Reading data from socket problem

Hello;
I have implemented a multiplayer game with server java and client flash. I have a socket connection and I get(wait) an encripted data from server. However sometimes I can't get data from server. I know that server is sending the data but I can't see the data on the socket.
Sometimes I cannot get the data in one chunk but I have solved that problem(I hope).. Here is my code:
private function onSocketData(event:ProgressEvent = null) {
     try {
          var input:String = "";
           var  byteArray = new ByteArray();
          socket.readBytes(byteArray, 0, socket.bytesAvailable);
           input+= byteArray.toString();
          queueOrg.addToMsgQueue(input);
     } catch (error:Error) {
          trace("SocketConnector -> onSocketData : "+error);
Thanks...

And don't use ready() or available as a test for end of stream like that. That's not what it's for. (What is is for is a moot question.) Using it like that is a recipe for losing data.

Similar Messages

  • Error when reading data from socket

    Hi,
    I am getting the error 'NiRawReadError: An error occured when reading data from socket.' when using the ABAP API  'mo_core_service->invoke_matching'.
    And I get this error only when I pass ABAP_TRUE to the paramter 'iv_wait_for_invocation' .
    Can anybody help me in correcting this?

    Hi Narasa,
    The following error is already in discussion in the below forum.Plz consult the forum link you will find the error solution.
    Problem in ABAP API - NiRawReadError: error when reading data from socket
    Rgds
    Ankit

  • How to detect a -1 in while reading data from socket

    Hi
    Am faced with a problem in socket reading
    Whenever I try to read any data from a socket and I encounter a -1, I assume that the steam has reached End of File and close that connection. This logic was introduced overcome a problem of connection getting closed from the server and the client connection hanging in CLOSE_WAIT state.
    Now the problem if the server sends a -1 as part of the data, how do I differenciate between -1 to indicate the End of stream and -1 in the actual data
    thanks in advance
    jcool

    As dannyyates states, the possible return values for read() are a single byte (0..255) or an end of stream (-1), so you have 257 total possible values there. If the other side wrote a byte equal to -1 from its perspective, you would receive a 255 in Java (since both are represented 11111111 in binary - one is interpreted as signed and one is interpreted as unsigned). Your return value from read is between 0x00000000 and 0x000000FF (hex) since read() returns an int (32 bits) rather than a byte (8 bits) and EOF is returned as 0xFFFFFFFF.
    Honestly, though, you might just consider using the read(byte[]) method where appropriate. It is much more efficient for reads of more than one byte at a time; it reads a bunch of bytes into an array. Its return value is how many bytes it read, with -1 indicating EOF.

  • Reading data from socket into buffer

    Hi all,
    I'm reading packets of data from a socket, and i want to store it into a buffer array.
    I don't know the packet length, which means i can't really specify the buffer length.
    Is there anyway to get around this?
    Thanks,
    Hugh

    Have a look at BufferedOutputStreamHTH.
    Yu SONG

  • NIO Socket implementation - delay between select and get data from socket

    Hi all,
    I have implemented a internal CallAPI for RPC over a socket connection. It works fine but if there are more than five clients and some load I have the phenomena that the READ selector returns a SelectorKey but I did not get any data from the socket.
    My implementation is based on NIO has following components:
    + Accept-Thread
    Thread handles new clients.
    + Read-Thread
    Thread handles the data from the socket for the registered client. Each request is handled in an own Process-Thread. A Thread-Pool implementation is used for processing.
    + Process-Thread
    The Process-Thread reads the data from the socket and starts the processing of the logical request.
    In my tests I get the notification of data at the socket. The Process-Thread want to read the data for the socket, but no data are available. In some situations if have to read about 20 times and more to get the data. Between each read attempt I have inserted a sleep in the Process-Thread if no data was available. This have improved the problem, but it already exists. I tested the problem with several systems and jvm's but it seams that it is independent from the system.
    What can I to do improve the situation?
    I already include the read implementation from the grizzly-Framework. But it doesn't improve the situation.
    Socket - Init
         protected void openSocket( String host, int port ) throws IOException
              serverChannel = ServerSocketChannel.open();
              serverChannel.configureBlocking( false );
              serverSocket = serverChannel.socket();
              serverSocket.setReuseAddress( true );
              this.serverhost = host;
              this.serverport = port;
              this.srvAcceptSelector = Selector.open();
              this.srvReadSelector = Selector.open();
              InetSocketAddress isa = null;
              if ( serverhost != null )
                   isa = new InetSocketAddress( this.serverhost, this.serverport );
              else
                   isa = new InetSocketAddress( this.serverport );
              serverSocket.bind( isa, 50 );
              serverChannel.register( this.srvAcceptSelector, SelectionKey.OP_ACCEPT );
         }New Client � Init
         // New Client
         if ( key.isAcceptable())
              keyCountConnect++;
              ServerSocketChannel actChannel =
                   (ServerSocketChannel) key.channel();
              // Socket akteptieren
              SocketChannel actSocket = actChannel.accept();
              if ( actSocket != null )
                   actSocket.finishConnect();
                   actSocket.configureBlocking( false );
                   actSocket.socket().setTcpNoDelay( true );
                   this.registerSocketList.add( actSocket );
                   this.srvReadSelector.wakeup();
         }Read Data from Socket
        protected int readDatafromSocket( ByteArrayOutputStream socketdata )
             throws IOException
             int readedChars = 0;
            int count = -1;
            Selector readSelector = null;
            SelectionKey tmpKey = null;
            if ( sc.isOpen())
                  ByteBuffer inputbuffer = null;
                 try
                      inputbuffer = bufferpool.getBuffer();
                      while (( count = sc.read( inputbuffer )) > 0 )
                           readedChars += count;
                          inputbuffer.flip();
                           byte[] tmparray=new byte[inputbuffer.remaining()];
                           inputbuffer.get( tmparray );
                           socketdata.write( tmparray );
                          inputbuffer.clear();
                      if ( count < 0 )
                           this.closeSocket();
                           if( readedChars == 0 )
                                readedChars = -1;
                           if ( log.isDebug())
                                  log.debug( "Socket is closed! " );
                      else if ( readedChars == 0 )
                           if ( log.isDebug())
                                  log.debug( "Reread with TmpSelector" );
                           // Glassfish/Grizzly-Implementation
                         readSelector = SelectorFactory.getSelector();
                         if ( readSelector == null )
                              return 0;
                          count = 1;
                          tmpKey = this.sc.register( readSelector, SelectionKey.OP_READ );
                         tmpKey.interestOps(
                              tmpKey.interestOps() | SelectionKey.OP_READ );
                         int code = readSelector.select( 500 );
                         tmpKey.interestOps(
                             tmpKey.interestOps() & ( ~SelectionKey.OP_READ ));
                         if ( code == 0 )
                             return 0;
                             // Return on the main Selector and try again.
                           while (( count = sc.read( inputbuffer )) > 0 )
                                readedChars += count;
                               inputbuffer.flip();
                                byte[] tmparray=new byte[inputbuffer.remaining()];
                                inputbuffer.get( tmparray );
                                socketdata.write( tmparray );
                               inputbuffer.clear();
                           if ( count < 0 )
                                this.closeSocket();
                                if( readedChars == 0 )
                                     readedChars =-1;
                           else if ( count == 0 )
                                  // No data
                 finally
                      if ( inputbuffer != null )
                           bufferpool.releaseBuffer( inputbuffer );
                           inputbuffer = null;
                      // Glassfish-Implementierung
                    if ( tmpKey != null )
                        tmpKey.cancel();
                    if ( readSelector != null)
                        // Bug 6403933
                         try
                            readSelector.selectNow();
                         catch (IOException ex)
                        SelectorFactory.returnSelector( readSelector );
            return readedChars;
        }Thanks for your time.

    I've commented on that blog before. It is rubbish:
    - what does 'overloading the main Selector' actually mean? if anything?
    - 'Although this not clearly stated inside the NIO API documentation': The API documentation doesn't say anything about which Selector you should register channels with. Why would it? Register it with any Selector you like ...
    - 'the cost of maintaining multiple Selectors can reduce scalability instead of improving it' Exactly. So what is the point again?
    - 'wrapping a ByteBuffer inside a ByteBufferInputStream:' Code is rubbish and redundant. java.nio.channels.Channels has methods for this.
    There is no a priori advantage to using multiple Selectors and threads unless you have multiple CPUs. And even then not much, as non-blocking reads and writes don't consume significant amounts of CPU. It's the processing of the data once you've got it that takes the CPU, and that should be done in a separate thread.
    So I would re-evaluate your strategy. I suspect you're getting the channel registered with more than one Selector at a time. Implement it the simple way first then see if you really have a problem with 'overloading the main Selector' ...

  • Problem trying read data from Destination

    HI,
    I have confiigured ADS and when im testing dest im getting the error :error while silently connecting:org.w3c.www.protocol :connection refused.
    when i ckedth NWA logs i got the below trace file. please let me know how to solve this.
    Problem trying read data from Destination: dest:FP_ICF_DATA_K64//sap/bc/fp/form/layout/FP_FORM_SECURITY_TEST.XDP?fp-language=DE
    com.adobe.ads.destination.DestinationException: IO error detected while opening DEST connection: http://sapk64.essent.local:8062/sap/bc/fp/form/layout/FP_FORM_SECURITY_TEST.XDP?fp-language=DE
         at com.adobe.ads.destination.Destination.readUrlStream(Unknown Source)
         at com.adobe.ads.destination.Destination.readTemplate(Unknown Source)
         at com.adobe.ads.data.DestURLData.setData(Unknown Source)
         at com.adobe.ads.data.DestURLData.<init>(Unknown Source)
         at com.adobe.ads.data.PDFData.createFromURL(Unknown Source)
         at com.adobe.ads.data.PDFData.create(Unknown Source)
         at com.adobe.ads.request.Template.setPDFData(Unknown Source)
         at com.adobe.ads.request.Template.initialize(Unknown Source)
         at com.adobe.ads.request.Renderer.initializeTemplates(Unknown Source)
         at com.adobe.ads.request.Renderer.execute(Unknown Source)
         at com.adobe.BaseADSRequest.doWork(Unknown Source)
         at com.adobe.AdobeDocumentServicesWorker.processRender(Unknown Source)
         at com.adobe.AdobeDocumentServicesWorker.execute(Unknown Source)
         at com.adobe.AdobeDocumentServicesEJB.processRequest(Unknown Source)
         at com.adobe.AdobeDocumentServicesEJB.rpData(Unknown Source)
         at com.adobe.AdobeDocumentServicesLocalLocalObjectImpl0_0.rpData(AdobeDocumentServicesLocalLocalObjectImpl0_0.java:120)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:85)
         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:58)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:60)
         at java.lang.reflect.Method.invoke(Method.java:391)
         at com.sap.engine.services.webservices.runtime.EJBImplementationContainer.invokeMethod(EJBImplementationContainer.java:126)
         at com.sap.engine.services.webservices.runtime.RuntimeProcessor.process(RuntimeProcessor.java:157)
         at com.sap.engine.services.webservices.runtime.RuntimeProcessor.process(RuntimeProcessor.java:79)
         at com.sap.engine.services.webservices.runtime.servlet.ServletDispatcherImpl.doPost(ServletDispatcherImpl.java:92)
         at SoapServlet.doPost(SoapServlet.java:51)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.runServlet(HttpHandlerImpl.java:401)
         at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.handleRequest(HttpHandlerImpl.java:266)
         at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:387)
         at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:365)
         at com.sap.engine.services.httpserver.server.RequestAnalizer.invokeWebContainer(RequestAnalizer.java:944)
         at com.sap.engine.services.httpserver.server.RequestAnalizer.handle(RequestAnalizer.java:266)
         at com.sap.engine.services.httpserver.server.Client.handle(Client.java:95)
         at com.sap.engine.services.httpserver.server.Processor.request(Processor.java:175)
         at com.sap.engine.core.service630.context.cluster.session.ApplicationSessionMessageListener.process(ApplicationSessionMessageListener.java:33)
         at com.sap.engine.core.cluster.impl6.session.MessageRunner.run(MessageRunner.java:41)
         at com.sap.engine.core.thread.impl3.ActionObject.run(ActionObject.java:37)
         at java.security.AccessController.doPrivileged(AccessController.java:207)
         at com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:100)
         at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:170)
    Caused by: org.w3c.www.protocol.http.HttpException: java.net.ConnectException: Connection refused
    java.net.ConnectException: Connection refused
         at java.net.PlainSocketImpl.socketConnect(Native Method)
         at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:354)
         at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:219)
         at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:206)
         at java.net.Socket.connect(Socket.java:483)
         at java.net.Socket.connect(Socket.java:433)
         at java.net.Socket.<init>(Socket.java:340)
         at java.net.Socket.<init>(Socket.java:180)
         at org.w3c.www.protocol.http.f.a(Unknown Source)
         at org.w3c.www.protocol.http.f.markUsed(Unknown Source)
         at org.w3c.www.protocol.http.HttpBasicServer.getConnection(Unknown Source)
         at org.w3c.www.protocol.http.HttpBasicServer.runRequest(Unknown Source)
         at org.w3c.www.protocol.http.HttpManager.runRequest(Unknown Source)
         at org.w3c.www.protocol.http.HttpURLConnection.connect(Unknown Source)
         at org.w3c.www.protocol.http.HttpURLConnection.a(Unknown Source)
         at org.w3c.www.protocol.http.HttpURLConnection.getInputStream(Unknown Source)
         at com.adobe.ads.destination.Destination.readUrlStream(Unknown Source)
         at com.adobe.ads.destination.Destination.readTemplate(Unknown Source)
         at com.adobe.ads.data.DestURLData.setData(Unknown Source)
         at com.adobe.ads.data.DestURLData.<init>(Unknown Source)
         at com.adobe.ads.data.PDFData.createFromURL(Unknown Source)
         at com.adobe.ads.data.PDFData.create(Unknown Source)
         at com.adobe.ads.request.Template.setPDFData(Unknown Source)
         at com.adobe.ads.request.Template.initialize(Unknown Source)
         at com.adobe.ads.request.Renderer.initializeTemplates(Unknown Source)
         at com.adobe.ads.request.Renderer.execute(Unknown Source)
         at com.adobe.BaseADSRequest.doWork(Unknown Source)
         at com.adobe.AdobeDocumentServicesWorker.processRender(Unknown Source)
         at com.adobe.AdobeDocumentServicesWorker.execute(Unknown Source)
         at com.adobe.AdobeDocumentServicesEJB.processRequest(Unknown Source)
         at com.adobe.AdobeDocumentServicesEJB.rpData(Unknown Source)
         at com.adobe.AdobeDocumentServicesLocalLocalObjectImpl0_0.rpData(AdobeDocumentServicesLocalLocalObjectImpl0_0.java:120)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:85)
         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:58)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:60)
         at java.lang.reflect.Method.invoke(Method.java:391)
         at com.sap.engine.services.webservices.runtime.EJBImplementationContainer.invokeMethod(EJBImplementationContainer.java:126)
         at com.sap.engine.services.webservices.runtime.RuntimeProcessor.process(RuntimeProcessor.java:157)
         at com.sap.engine.services.webservices.runtime.RuntimeProcessor.process(RuntimeProcessor.java:79)
         at com.sap.engine.services.webservices.runtime.servlet.ServletDispatcherImpl.doPost(ServletDispatcherImpl.java:92)
         at SoapServlet.doPost(SoapServlet.java:51)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.runServlet(HttpHandlerImpl.java:401)
         at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.handleRequest(HttpHandlerImpl.java:266)
         at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:387)
         at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:365)
         at com.sap.engine.services.httpserver.server.RequestAnalizer.invokeWebContainer(RequestAnalizer.java:944)
         at com.sap.engine.services.httpserver.server.RequestAnalizer.handle(RequestAnalizer.java:266)
         at com.sap.engine.services.httpserver.server.Client.handle(Client.java:95)
         at com.sap.engine.services.httpserver.server.Processor.request(Processor.java:175)
         at com.sap.engine.core.service630.context.cluster.session.ApplicationSessionMessageListener.process(ApplicationSessionMessageListener.java:33)
         at com.sap.engine.core.cluster.impl6.session.MessageRunner.run(MessageRunner.java:41)
         at com.sap.engine.core.thread.impl3.ActionObject.run(ActionObject.java:37)
         at java.security.AccessController.doPrivileged(AccessController.java:207)
         at com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:100)
         at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:170)
    Error embedding request inputs in error log.
    Error embedding request inputs in error log.
    java.lang.NullPointerException
         at com.adobe.ads.request.Renderer.embedInputs(Unknown Source)
         at com.adobe.AdobeDocumentServicesWorker.processRenderLog(Unknown Source)
         at com.adobe.AdobeDocumentServicesWorker.processRender(Unknown Source)
         at com.adobe.AdobeDocumentServicesWorker.execute(Unknown Source)
         at com.adobe.AdobeDocumentServicesEJB.processRequest(Unknown Source)
         at com.adobe.AdobeDocumentServicesEJB.rpData(Unknown Source)
         at com.adobe.AdobeDocumentServicesLocalLocalObjectImpl0_0.rpData(AdobeDocumentServicesLocalLocalObjectImpl0_0.java:120)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:85)
         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:58)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:60)
         at java.lang.reflect.Method.invoke(Method.java:391)
         at com.sap.engine.services.webservices.runtime.EJBImplementationContainer.invokeMethod(EJBImplementationContainer.java:126)
         at com.sap.engine.services.webservices.runtime.RuntimeProcessor.process(RuntimeProcessor.java:157)
         at com.sap.engine.services.webservices.runtime.RuntimeProcessor.process(RuntimeProcessor.java:79)
         at com.sap.engine.services.webservices.runtime.servlet.ServletDispatcherImpl.doPost(ServletDispatcherImpl.java:92)
         at SoapServlet.doPost(SoapServlet.java:51)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.runServlet(HttpHandlerImpl.java:401)
         at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.handleRequest(HttpHandlerImpl.java:266)
         at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:387)
         at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:365)
         at com.sap.engine.services.httpserver.server.RequestAnalizer.invokeWebContainer(RequestAnalizer.java:944)
         at com.sap.engine.services.httpserver.server.RequestAnalizer.handle(RequestAnalizer.java:266)
         at com.sap.engine.services.httpserver.server.Client.handle(Client.java:95)
         at com.sap.engine.services.httpserver.server.Processor.request(Processor.java:175)
         at com.sap.engine.core.service630.context.cluster.session.ApplicationSessionMessageListener.process(ApplicationSessionMessageListener.java:33)
         at com.sap.engine.core.cluster.impl6.session.MessageRunner.run(MessageRunner.java:41)
         at com.sap.engine.core.thread.impl3.ActionObject.run(ActionObject.java:37)
         at java.security.AccessController.doPrivileged(AccessController.java:207)
         at com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:100)
         at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:170)
    No output was generated while rendering
    The render error log file has been written to /usr/sap/T50/SYS/global/AdobeDocumentServices/renderErrorLog/errorFiles/2008.08.05.113021ADS_AGENT.pdf.
    Please validate the input files or streams attached with it and try again
    Processing exception during a "Render" operation.
    Request start time: Tue Aug 05 11:30:21 CEST 2008
    com.adobe.ads.destination.DestinationException: IO error detected while opening DEST connection: http://sapk64.essent.local:8062/sap/bc/fp/form/layout/FP_FORM_SECURITY_TEST.XDP?fp-language=DE; [Error Log file "2008.08.05.113021ADS_AGENT.pdf" written to /usr/sap/T50/SYS/global/AdobeDocumentServices/renderErrorLog/errorFiles]
    Exception Stack Trace:
    com.adobe.ads.destination.DestinationException: IO error detected while opening DEST connection: http://sapk64.essent.local:8062/sap/bc/fp/form/layout/FP_FORM_SECURITY_TEST.XDP?fp-language=DE
         at com.adobe.ads.destination.Destination.readUrlStream(Unknown Source)
         at com.adobe.ads.destination.Destination.readTemplate(Unknown Source)
         at com.adobe.ads.data.DestURLData.setData(Unknown Source)
         at com.adobe.ads.data.DestURLData.<init>(Unknown Source)
         at com.adobe.ads.data.PDFData.createFromURL(Unknown Source)
         at com.adobe.ads.data.PDFData.create(Unknown Source)
         at com.adobe.ads.request.Template.setPDFData(Unknown Source)
         at com.adobe.ads.request.Template.initialize(Unknown Source)
         at com.adobe.ads.request.Renderer.initializeTemplates(Unknown Source)
         at com.adobe.ads.request.Renderer.execute(Unknown Source)
         at com.adobe.BaseADSRequest.doWork(Unknown Source)
         at com.adobe.AdobeDocumentServicesWorker.processRender(Unknown Source)
         at com.adobe.AdobeDocumentServicesWorker.execute(Unknown Source)
         at com.adobe.AdobeDocumentServicesEJB.processRequest(Unknown Source)
         at com.adobe.AdobeDocumentServicesEJB.rpData(Unknown Source)
         at com.adobe.AdobeDocumentServicesLocalLocalObjectImpl0_0.rpData(AdobeDocumentServicesLocalLocalObjectImpl0_0.java:120)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:85)
         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:58)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:60)
         at java.lang.reflect.Method.invoke(Method.java:391)
         at com.sap.engine.services.webservices.runtime.EJBImplementationContainer.invokeMethod(EJBImplementationContainer.java:126)
         at com.sap.engine.services.webservices.runtime.RuntimeProcessor.process(RuntimeProcessor.java:157)
         at com.sap.engine.services.webservices.runtime.RuntimeProcessor.process(RuntimeProcessor.java:79)
         at com.sap.engine.services.webservices.runtime.servlet.ServletDispatcherImpl.doPost(ServletDispatcherImpl.java:92)
         at SoapServlet.doPost(SoapServlet.java:51)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.runServlet(HttpHandlerImpl.java:401)
         at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.handleRequest(HttpHandlerImpl.java:266)
         at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:387)
         at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:365)
         at com.sap.engine.services.httpserver.server.RequestAnalizer.invokeWebContainer(RequestAnalizer.java:944)
         at com.sap.engine.services.httpserver.server.RequestAnalizer.handle(RequestAnalizer.java:266)
         at com.sap.engine.services.httpserver.server.Client.handle(Client.java:95)
         at com.sap.engine.services.httpserver.server.Processor.request(Processor.java:175)
         at com.sap.engine.core.service630.context.cluster.session.ApplicationSessionMessageListener.process(ApplicationSessionMessageListener.java:33)
         at com.sap.engine.core.cluster.impl6.session.MessageRunner.run(MessageRunner.java:41)
         at com.sap.engine.core.thread.impl3.ActionObject.run(ActionObject.java:37)
         at java.security.AccessController.doPrivileged(AccessController.java:207)
         at com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:100)
         at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:170)
    Caused by: org.w3c.www.protocol.http.HttpException: java.net.ConnectException: Connection refused
    java.net.ConnectException: Connection refused
         at java.net.PlainSocketImpl.socketConnect(Native Method)
         at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:354)
         at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:219)
         at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:206)
         at java.net.Socket.connect(Socket.java:483)
         at java.net.Socket.connect(Socket.java:433)
         at java.net.Socket.<init>(Socket.java:340)
         at java.net.Socket.<init>(Socket.java:180)
         at org.w3c.www.protocol.http.f.a(Unknown Source)
         at org.w3c.www.protocol.http.f.markUsed(Unknown Source)
         at org.w3c.www.protocol.http.HttpBasicServer.getConnection(Unknown Source)
         at org.w3c.www.protocol.http.HttpBasicServer.runRequest(Unknown Source)
         at org.w3c.www.protocol.http.HttpManager.runRequest(Unknown Source)
         at org.w3c.www.protocol.http.HttpURLConnection.connect(Unknown Source)
         at org.w3c.www.protocol.http.HttpURLConnection.a(Unknown Source)
         at org.w3c.www.protocol.http.HttpURLConnection.getInputStream(Unknown Source)
         at com.adobe.ads.destination.Destination.readUrlStream(Unknown Source)
         at com.adobe.ads.destination.Destination.readTemplate(Unknown Source)
         at com.adobe.ads.data.DestURLData.setData(Unknown Source)
         at com.adobe.ads.data.DestURLData.<init>(Unknown Source)
         at com.adobe.ads.data.PDFData.createFromURL(Unknown Source)
         at com.adobe.ads.data.PDFData.create(Unknown Source)
         at com.adobe.ads.request.Template.setPDFData(Unknown Source)
         at com.adobe.ads.request.Template.initialize(Unknown Source)
         at com.adobe.ads.request.Renderer.initializeTemplates(Unknown Source)
         at com.adobe.ads.request.Renderer.execute(Unknown Source)
         at com.adobe.BaseADSRequest.doWork(Unknown Source)
         at com.adobe.AdobeDocumentServicesWorker.processRender(Unknown Source)
         at com.adobe.AdobeDocumentServicesWorker.execute(Unknown Source)
         at com.adobe.AdobeDocumentServicesEJB.processRequest(Unknown Source)
         at com.adobe.AdobeDocumentServicesEJB.rpData(Unknown Source)
         at com.adobe.AdobeDocumentServicesLocalLocalObjectImpl0_0.rpData(AdobeDocumentServicesLocalLocalObjectImpl0_0.java:120)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:85)
         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:58)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:60)
         at java.lang.reflect.Method.invoke(Method.java:391)
         at com.sap.engine.services.webservices.runtime.EJBImplementationContainer.invokeMethod(EJBImplementationContainer.java:126)
         at com.sap.engine.services.webservices.runtime.RuntimeProcessor.process(RuntimeProcessor.java:157)
         at com.sap.engine.services.webservices.runtime.RuntimeProcessor.process(RuntimeProcessor.java:79)
         at com.sap.engine.services.webservices.runtime.servlet.ServletDispatcherImpl.doPost(ServletDispatcherImpl.java:92)
         at SoapServlet.doPost(SoapServlet.java:51)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.runServlet(HttpHandlerImpl.java:401)
         at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.handleRequest(HttpHandlerImpl.java:266)
         at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:387)
         at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:365)
         at com.sap.engine.services.httpserver.server.RequestAnalizer.invokeWebContainer(RequestAnalizer.java:944)
         at com.sap.engine.services.httpserver.server.RequestAnalizer.handle(RequestAnalizer.java:266)
         at com.sap.engine.services.httpserver.server.Client.handle(Client.java:95)
         at com.sap.engine.services.httpserver.server.Processor.request(Processor.java:175)
         at com.sap.engine.core.service630.context.cluster.session.ApplicationSessionMessageListener.process(ApplicationSessionMessageListener.java:33)
         at com.sap.engine.core.cluster.impl6.session.MessageRunner.run(MessageRunner.java:41)
         at com.sap.engine.core.thread.impl3.ActionObject.run(ActionObject.java:37)
         at java.security.AccessController.doPrivileged(AccessController.java:207)
         at com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:100)
         at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:170)

    hi,
    My problem is solved  now. We have opened backend system port connection from portal side.
    regards,
    Krishna

  • Problem reading data from two tables

    Hi experts,
    I'm developing a JDBC - IDOC scenario that needs to read data from two oracle tables. I have created a BPM that has a initial fork for the two channels and it works fine.
    The problem is that I need to read data from the first, two or both tables depending if there is data to read. If there is data in the two tables it works, but if only there is data in one of the two tables, I have read problems. I have tryed to set the 'neccesary branches' to 1 but this is a problem when I have data in both tables.
    Any idea?
    Best Regards,
    Alfredo Lagunar.

    Hi,
    have your fork step inside a block and then right-click your block to insert a deadline branch to your BPM process and specify the time after which your BPM process should be cancelled.....so if in that time, you get data from both tables, your BPM will work okay otherwise if that time is over, then your BPM process will be cancelled.
    Regards,
    Rajeev Gupta

  • Problem with reading data from screen and inserting in table

    hi ther,
    im new to abap-webdyn pro. can anyone suggest how to read data from screen and insert into table when press 'ADD' button.
    i done screen gui , table creation but problems with action. what the content of acton add.
    is ther any link that helps me or tut??
    thankx in advance!
    regards

    Hi,
    Create a context node for the screen fields for which you want to enter the values with cardinality 1.1.....
    Now in the layout of your view bind the screen input fields to that context node(attributes) to the value property of the input fields...
    Now in the action of ADD button....
    --> go the wizard and select the read node button and select the node which you have created it generates the auto code for you.....
    for example if the node is contains aone attribute like MATNR
    reading the node from wizard will generate the code as....
    DATA lo_nd_matnr TYPE REF TO if_wd_context_node.
      DATA lo_el_matnr TYPE REF TO if_wd_context_element.
      DATA ls_matnr TYPE wd_this->element_matnr.
      DATA lv_matnr TYPE wd_this->element_matnr-matnr.
    * navigate from <CONTEXT> to <MATNR> via lead selection
      lo_nd_matnr = wd_context->get_child_node( name = wd_this->wdctx_matnr ).
    * @TODO handle non existant child
    * IF lo_nd_matnr IS INITIAL.
    * ENDIF.
    * get element via lead selection
      lo_el_matnr = lo_nd_matnr->get_element( ).
    * @TODO handle not set lead selection
      IF lo_el_matnr IS INITIAL.
      ENDIF.
    * get single attribute
      lo_el_matnr->get_attribute(
        EXPORTING
          name =  `MATNR`
        IMPORTING
          value = lv_matnr ).
    here the variable lv_matnr will contain the entered value......
    now you can use this value for further process.
    Thanks,
    Shailaja Ainala.

  • Problem reading data from oracle database 11g using OleDbDataReader

    Hi everyone I work with Visual Studio 2010 and C# programming language. I have a problem reading data from the oracle database. I created a WPF application with my main Window Xaml and class files and 1 more class called DataFiles. The thing I want is to read some data from the database on my grid in my WPF window. Problem is even though it connects to the database the grid is always empty. It isn't the connection string as I tested it and it connects to the database the problem seems to be in showing the LASTNAME (PREZIME in my native tongue) on the grid which is what it's supposed to do.
    Here is the code:
    Data Files Code
    using System;
    using System.Collections.ObjectModel;
    using System.Data.SqlClient;
    using System.Data.OleDb;
    namespace SQLKonekcija
        public class clsEmployee
            public string Prezime { get; set; }
        public class DataAccess
            OleDbConnection oleCon;
            OleDbCommand oleComd;
            public DataAccess()
                string connectionString = "provider=ORAOLEDB.ORACLE; data source=ORCL; password=****; user id=****;";
                oleCon = new OleDbConnection(connectionString);
            public ObservableCollection<clsEmployee> GetAllEmployee()
                ObservableCollection<clsEmployee> EmpCol = new ObservableCollection<clsEmployee>();
                oleComd = new OleDbCommand();
                oleComd.Connection = oleCon;
                oleComd.CommandText = "Select PREZIME from UPOSLENICI";
                oleCon.Open();
                OleDbDataReader Reader = oleComd.ExecuteReader();
                Reader.Read();
                while (Reader.Read())
                    EmpCol.Add(new clsEmployee()
                        Prezime = Reader["PREZIME"].ToString()
                oleCon.Close();
                return EmpCol;
            }And here is my main window.cs code
    public partial class MainWindow : Window
            clsEmployee objEmpToAdd;
            DataAccess objDs;
            public MainWindow()
                InitializeComponent();
            private void Window_Loaded(object sender, RoutedEventArgs e)
                objDs = new DataAccess();
                dgEmp.ItemsSource = objDs.GetAllEmployee();And the XAML
    <Window x:Class="SQLKonekcija.MainWindow"
            xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
            xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
            Title="MainWindow" Height="350" Width="525" Loaded="Window_Loaded">
        <Grid>
            <DataGrid AutoGenerateColumns="False" Height="237"
                      HorizontalAlignment="Left" Margin="18,66,0,0" Name="dgEmp"
                      VerticalAlignment="Top" Width="466" ColumnWidth="*"
                       >
                <DataGrid.Columns>
                    <DataGridTextColumn Binding="{Binding PREZIME}" Header="Prezime"></DataGridTextColumn>
                </DataGrid.Columns>
            </DataGrid>
            <TextBlock Height="42" HorizontalAlignment="Left" Margin="18,15,0,0" Name="textBlock1" Text="TEST CONNECTION" VerticalAlignment="Top" Width="462" TextAlignment="Center" FontSize="28" FontWeight="ExtraBold" />
        </Grid>
    </Window>
    The guys on the MSDN forums told me I should ask the question here so sorry if it's not your field.
    Hope u guys can help, thanks.

    I tried it, commented out the reader.read and have the following connection string
    string connectionString = "provider=ORAOLEDB.ORACLE; data source=ORCL; password=****; user id=****; OLEDB.NET=True"
    Unfortunately the result is the same.
    Edited by: Dino2dy on Nov 24, 2011 12:53 AM

  • Problem while reading data from AL11

    Hi Experts,
    I am using OPEN DATASET
                          READ DATASET
                      CLOSE DATASET  to read data from the application sever. In application sever the file type is .CSV. So after reading data from application layer(AL11) to a text variable,  using statement ' SPLIT AT ','  ' all the values passing into correspoding internal table fields. And it getting updated successfully into DB also.
    In above scenario my question is, if aquantity figure with coma seperator( 95,000,000.000), then while SPLIT it's creating problem. Same case in .XLS file, it will be created # seperator in the application layer. if any field having # then it will create problem again.
    So can anybody suggest how can we over come the problem. Or is there any other way to read data properly from application layer(AL11)?
    Thanks and regards,
    Phani.

    to overcom this problem,
    normally we use tab as sparator
    so use CL_ABAP_CHAR_UTILITIES=>VERTICAL_TAB  to separate your fields!
    grx
    Andreas

  • Problem in reading data from Excel sheet to 2D string array (ActiveX & LabView).

    I am trying to read data from Excel sheet to 2D string array (ActiveX & LabView). Error -2147352571 is generated (type mismatch) if cell value is "#NULL!", "#N/A" etc. What should I do?

    Hello �
    Is the error happening when the cell value is #NULL or #NA only?
    Sometimes these errors occur because of an ActiveX object mismatch. The version of the ActiveX object might have changed or been updated since the VI was created. The VI tries to use an earlier, incompatible version of the ActiveX object.
    To solve the problem, you need to link automation refnum terminal to the correct ActiveX object. To do so, right-click an automation refnum terminal and choose Select ActiveX Class»Browse from the shortcut menu. From the Type Library pull-down menu, select the latest version of the library you want to use, such as Microsoft Excel Object Library. In the Objects list, select an ActiveX object, and click the OK button. Link ea
    ch automation refnum terminal in the VI and its subVIs until the run arrow is not broken. Also, you might have to replace some or all of the Invoke Nodes and Property Nodes for the ActiveX objects.
    Also, I came across this Knowledgebase. The error number is slightly different but it is always good to check it out and make sure it is not your case.
    Hope this helps.
    S Vences
    Applications Engineer
    National Instruments

  • Problem while reading data from Serial Port

    Hi All,
    I am facing some problem while reading data from Serial Port.
    As per the requirement I am writing the data on Serial Port and waiting for response of that data.
    Notification for data availabilty is checked with method public void serialEvent(SerialPortEvent event) of javax.comm.SerialPortEventListener.
    When we are writing data on the port one thread i.e. "main" thread is generated and when data availability event occures another thread "Win32SerialPort Notification thread" is generated. This creates problem for me as we can't control thread processing.
    So can anybody pls explain me how to overcome this problem?
    Regards,
    Neha

    My Problem is:-
    I am simoultaneouly wrting data on port & reading data from port.
    First I write data on port using outputStream.write() method. Now when target side sends me response back for the request on serial port DATA_AVAILABLE of SerialPortEventListner event occured,we are reading data from serial port.Now till the time we didn't get the response from target next command can't be written on the serial port. When we are writing data on port main thread is executed.Now my problem starts when DATA_AVAILABLE event occured.At this point another thread is created.Due to this my program writes data of next command without reading response of previous command.To solve this prob. I have used wait() & notify() methods as follows.But again due to this my pc hangs after execution of 2 commands. (PC hang in while loop in a code provided below.)
    From SOPs I could figure it out that after 2 commands we are not able to write data on serial port so DATA_AVAILABLE event doesn't occure n pro. goes in wait state.
    Can anybody help me to solve this issue.
    Neha.
    Code:
    public void serialEvent(SerialPortEvent event)
              switch (event.getEventType())
                   case SerialPortEvent.BI:
                   case SerialPortEvent.OE:
                   case SerialPortEvent.FE:
                   case SerialPortEvent.PE:
                   case SerialPortEvent.CD:
                   case SerialPortEvent.CTS:
                   case SerialPortEvent.DSR:
                   case SerialPortEvent.RI:
                   case SerialPortEvent.OUTPUT_BUFFER_EMPTY:
                                 break;
                   case SerialPortEvent.DATA_AVAILABLE:
                        try
                             dataThread = Thread.currentThread();
                             dataThread.setPriority(10);
                             dataAvailable = true;
                                                                                    byte[] tempArray=new byte[availableBytes];
                                        inputStream.read(tempArray);
                                                                       catch (IOException io)
                             SOP(io, "Error in serialEvent callback call for event DATA_AVAILABLE");
    public void  writetoPort(byte[] data) throws IOException
                             outputStream.write(data);
                              while(finalTimeOut >= actualTime)
                            if( ! dataAvailable)
                                    actualTime = System.currentTimeMillis();
                           else
              synchronized (mainThread)
                   mainThread = Thread.currentThread();
                   mainThread.wait();
    public  void sendDatatoUser(byte[] b) throws Exception, HWCCSystemFailure
              obj.returnData(b);
              synchronized(mainThread)
                   mainThread.notify();
                                                           

  • JavaConsole Error: Problem reading data from server

    HI All
    We are getting this error on java console on a page:
      Error: Problem reading data from Server - Java.Security.AccessControlException:access denied (java.util.PropertyPermission http.strictpostredirect Read)
    In this page we are not firing  a SQL Query of huge data.
    Any suggestions on this why it is happening?
    Thanks
    Manisha

    Manisha,
    I think JVM(Java Virtual Machine) is trying to access something at network level and it cant able to find it.Or any new patches of java is installed.
    Or may be due to IIS or Applet,Don't know exactly.
    You can find some answers in below links:
    http://java.sun.com/j2se/1.4.2/docs/api/java/security/AccessControlException.html
    http://www.webdeveloper.com/forum/archive/index.php/t-46358.html
    -Suresh

  • Problem in reading data from serial port continuously- application hangs after sometimes

    I need to read data from two COM port and order of data appearance from COM port is not fixed. 
    I have used small timeout and reading data in while loop continously . If my application is steady for sometime it gets hangs and afterwards it doesnt receive any data again. 
    Then I need to restart my application again to make it work.
    I am attaching VI. Let me know any issue.
    Kudos are always welcome if you got solution to some extent.
    I need my difficulties because they are necessary to enjoy my success.
    --Ranjeet
    Attachments:
    Scanning.vi ‏39 KB

    billko wrote:
    Ranjeet_Singh wrote:
    I need to read data from two COM port and order of data appearance from COM port is not fixed. 
    I have used small timeout and reading data in while loop continously . If my application is steady for sometime it gets hangs and afterwards it doesnt receive any data again. 
    Then I need to restart my application again to make it work.
    I am attaching VI. Let me know any issue.
    What do you mean, "not fixed?"  If there is no termination character, no start/stop character(s) or even a consistent data length, then how can you really be sure when the data starts and stops?
    I probably misunderstood you though.  Assuming the last case is not ture - there is a certain length to the data - then you should use the bytes at port, like in the otherwise disastrous serial port read example.  In this case, it's NOT disastrous.  You have to make sure that you read all the data that came through.  Right now you have no idea how much data you just read.  Also, if this is streaming data, you might want to break it out into a producer/consumer design pattern.
    Not fixed means order is not fixed, data from any com port can come anytime. lenght is fixed, one com port have 14 byte and other 8 byte fixed..
    Reading data is not an issue for me as it works nice but I have a query that why my application hangs after sometime and stops reading data from COM PORT.
    Kudos are always welcome if you got solution to some extent.
    I need my difficulties because they are necessary to enjoy my success.
    --Ranjeet

  • Problem while reading data  from USB with JSR80

    Hi
    Iam using Fedora 9 with 32 bit.
    Iam using JSR80 api to read the data from USB devices.
    I successfully set-up the code as per given on JSR80 site on my eclipsce ide.
    below is my code which iam using to read data from usb
    import com.ibm.jusb.*;
    import java.util.List;
    import javax.usb.*;
    import java.util.List;
    public class USBReader {
    public static  UsbInterface interf = null;
         public static void main(String[] args) {
              try
            {// Access the system USB services, and access to the root
             // hub. Then traverse through the root hub.
               System.out.println("Application started");
             UsbServices services = UsbHostManager.getUsbServices();
             UsbHub rootHub = services.getRootUsbHub();
             traverse(rootHub);
             testIO(rootHub);
            } catch (Exception e) {
                 System.out.println("The Exception occured"+e.getMessage());
          public static void traverse(UsbDevice device){
               System.out.println("Iam in traverse ");
               if (device.isUsbHub()){  
                    // This is a USB Hub, traverse through the hub.
                    System.out.println("The device is hub");
                    List attachedDevices = ((UsbHub) device).getAttachedUsbDevices();
                    System.out.println("The attached devices size:"+attachedDevices.size());
                    for (int i=0; i<attachedDevices.size(); i++){
                         traverse((UsbDevice) attachedDevices.get(i));
                    if(attachedDevices !=null){
                         for(int j=0;j<attachedDevices.size();j++){
                              System.out.println("The device is"+attachedDevices.get(j));
           else{
              // This is a USB function, not a hub.
              // Do something.
                System.out.println("The device is not hub");
          public static void testIO(UsbDevice device) throws UsbClaimException, UsbNotActiveException, UsbDisconnectedException, UsbException{
               System.out.println("Iam in testIO");
              try{
                 // Access to the active configuration of the USB device, obtain
                 // all the interfaces available in that configuration.
                 UsbConfiguration config = device.getActiveUsbConfiguration();
                 List totalInterfaces = config.getUsbInterfaces();
                 System.out.println("The Total interfaces: "+totalInterfaces.size());
                 // Traverse through all the interfaces, and access the endpoints
                 // available to that interface for I/O.
                 for (int i=0; i<totalInterfaces.size(); i++){
                    interf = (UsbInterface) totalInterfaces.get(i);
                    System.out.println("The interfaces are "+totalInterfaces.get(i));
                    String strinf=interf.getInterfaceString();
                    System.out.println("Claimed Status: "+interf.isClaimed());
                    System.out.println("Active status : "+interf.isActive());
                    System.out.println("Settings :"+interf.getNumSettings());
                    //interf.release();
                    interf.claim();
                    List totalEndpoints = interf.getUsbEndpoints();
                    for (int j=0; j<totalEndpoints.size(); j++){
                       // Access the particular endpoint, determine the direction
                       // of its data flow, and type of data transfer, and open the
                       // data pipe for I/O.
                       UsbEndpoint ep = (UsbEndpoint) totalEndpoints.get(i);
                       int direction = ep.getDirection();
                       int type = ep.getType();
                       UsbPipe pipe = ep.getUsbPipe();
                       pipe.open();
                       // Perform I/O through the USB pipe here.
                       pipe.close();
                    interf.release();
              } catch (Exception e) {
                   System.out.println("Exception in TestIO"+e.getMessage());
                   e.printStackTrace();
    }When i execute the above code i get the following exception
    Exception in TestIOCannot claim an interface on a virtual root hub.
    javax.usb.UsbException: Cannot claim an interface on a virtual root hub.
         at com.ibm.jusb.VirtualRootUsbHubImp$VirtualRootUsbInterfaceOsImp.claim(VirtualRootUsbHubImp.java:143)
         at com.ibm.jusb.os.DefaultUsbInterfaceOsImp.claim(DefaultUsbInterfaceOsImp.java:54)
         at com.ibm.jusb.UsbInterfaceImp.claim(UsbInterfaceImp.java:109)
         at com.ibm.jusb.UsbInterfaceImp.claim(UsbInterfaceImp.java:83)
         at USBReader.testIO(USBReader.java:60)
         at USBReader.main(USBReader.java:15)iam not getting the clue for it .

    Cannot claim an interface on a virtual root hubSo don't do that? I have no idea how to tell, but clearly you need to test a few more attributes before you claim. Or else just log the claim error and continue with the next interface.

Maybe you are looking for