Odette-j Error

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • louis08
    New Member
    • Feb 2008
    • 6

    Odette-j Error

    When i connect to the server i get a BufferOverflowE xception,
    HELP!!!!

    This is where the error is thrown.
    Code:
       
          final Transport transport = new TCPTransport(client);
       
           
       
          final Session session = Session.getInstance(new Properties(), TransferMode.BOTH);
      
           
       
          final StringBuffer userBoxId = new StringBuffer();
      
           
       
          session.setReceivingSupport(new ListeningSupport("C:/oftp/"));
       
           
       
          session.acceptConnection(transport);
      
          /*Error happens here at next line*/
      
          OdetteFTPEntity oftp = session.acceptConnection(transport);

    this is the function that is called: acceptConnectio n()


    Code:
       
          public OdetteFTPEntity acceptConnection(Transport transport)
                               throws OdetteFTPException {
              
       
                        /* incoming network connection */ 
       
                        if ((state == null) || (state instanceof IdleState)) {
       
           
       
                            boolean stb = PreferencesUtil.getBoolean(properties, "odette.stb");
       
                            int sdeb = PreferencesUtil.getInt(properties, "odette.buffer-size");
       
                            service = Service.getInstance(transport, sdeb, stb);
                              setProperty("odette.called-address", transport.getLocalAddress());
      
                            setProperty("odette.calling-address",transport.getRemoteAddress());
      
                   
      
                           /* start session phase */
      
                              changeState(ListenerState.class);
      
                              /*Error happens here at next line*/
      
                              state.startSession();
      
                                   
      
                          } else {
    
           
    
                            NotInIdleStateError();
    
                        }
    
                        return state;
    
                    }

    I traced it into this interface called OdetteFTPEntity

    Code:
          public interface OdetteFTPEntity {
    
              public Session getContext();
    
          /*Error happens here in startSession Function*/
    
              public void startSession() throws OdetteFTPException;
    
              public void startFile(VirtualFile file, String destination,
                     String originator, String userData, String reserved)
    
                      throws OdetteFTPException;
    
              public void dataRegime() throws OdetteFTPException;
    
              public void closeFile(int recordCount, long unitCount)
    
                      throws OdetteFTPException;
    
              public void changeDirection() throws OdetteFTPException;
    
              public void endToEndResponse(String datasetName, Date fileDateTime,
    
                      String destination, String originator, String userData,
    
                      String reserved) throws OdetteFTPException; 
    
              public void release() throws OdetteFTPException;
    
           
              public void abort(EndSessionReason error) throws OdetteFTPException;
          
    
              public boolean isConnected() throws OdetteFTPException;
    
           
    
          }
    This is the error stack trace



    java.nio.Buffer OverflowExcepti on

    at java.nio.Direct ByteBuffer.put( DirectByteBuffe r.jav a:279)

    at org.fossilec.od ettej.service.S treamTransmissi onSer vice.receiveStr eamTransmission Buffer(StreamTr ansmi ssionService.ja va:87)

    at org.fossilec.od ettej.service.S treamTransmissi onSer vice.receive(St reamTransmissio nService.java:6 4)

    at org.fossilec.od ettej.AbstractS tate.receive(Ab strac tState.java:85)

    at org.fossilec.od ettej.ListenerS tate.negotiateS tartS ession(Listener State.java:548)

    at org.fossilec.od ettej.ListenerS tate.startSessi on(Li stenerState.jav a:114)

    at org.fossilec.od ettej.Session.a cceptConnection (Sess ion.java:266)

    at examples.odette j.OdetteServer. startSession(Od etteS erver.java:140)

    at examples.odette j.OdetteServer. handleConnectio ns(Od etteServer.java :114)

    at examples.odette j.OdetteServer. run(OdetteServe r.jav a:54)

    at javaapplication 1.Main.<init>(M ain.java:27)

    at javaapplication 1.Main.main(Mai n.java:37)

    java.lang.Illeg alStateExceptio n: Not in Idle state

    at org.fossilec.od ettej.Session.N otInIdleStateEr ror(S ession.java:310 )

    at org.fossilec.od ettej.Session.a cceptConnection (Sess ion.java:272)

    at examples.odette j.OdetteServer$ 2.run(OdetteSer ver.j ava:164)

    at java.lang.Threa d.run(Thread.ja va:595)



    Regards,
    Louis.
Working...