Accessing usb through jusb

hello,
when i am trying to accessing the usb through the jusb package an exception comes.plz help me
the code is as follows
import usb.core.*;
import usb.windows.*;
import usb.core.*;
import java.io.*;
public class ListUSB
public static void main(String[] args)
try
// Bootstrap by getting the USB Host from the HostFactory.
Host host = HostFactory.getHost();
// Obtain a list of the USB buses available on the Host.
Bus[] bus = host.getBusses();
int total_bus = bus.length;
// Traverse through all the USB buses.
for (int i=0; i<total_bus; i++)
// Access the root hub on the USB bus and obtain the
// number of USB ports available on the root hub.
Device root = bus.getRootHub();
int total_port = root.getNumPorts();
// Traverse through all the USB ports available on the
// root hub. It should be mentioned that the numbering
// starts from 1, not 0.
for (int j=1; j<=total_port; j++)
// Obtain the Device connected to the port.
Device device = root.getChild(j);
if (device != null)
                              System.out.println(" USB Available");
// Obtain the current Configuration of the device and the number of
// Interfaces available under the current Configuration.
Configuration config = device.getConfiguration();
int total_interface = config.getNumInterfaces();
// Traverse through the Interfaces
for (int k=0; k<total_interface; k++)
// Access the currently Interface and obtain the number of
// endpoints available on the Interface.
Interface itf = config.getInterface(k, 0);
int total_ep = itf.getNumEndpoints();
// Traverse through all the endpoints.
for (int l=0; l<total_ep; l++)
// Access the endpoint, and obtain its I/O type.
Endpoint ep = itf.getEndpoint(l);
String io_type = ep.getType();
boolean input = ep.isInput();
//                                   String io_type="lk";
                                        System.out.println(input);
                                        System.out.println(io_type);
// If the endpoint is an input endpoint, obtain its
// InputStream and read in data.
if (input)
//InputStream in;
                                        //DataInputStream dis=new DataInputStream(ep.getInputStream());
                                        InputStream dis=ep.getInputStream();//HERE EXCEPTION COMES AS ILLEGAL ARGUMENT EXCEPTION
                              System.out.println(input);
                                        // in.read();
//in = ep.getInputStream();
// Read in data here
                                             byte b[] =new byte[100];
                                             dis. read(b);
                                             System.out.println("The Message is"+b);
                                             dis.close();
// If the Endpoint is and output Endpoint, obtain its
// OutputStream and write out data.
else
OutputStream out;
out = ep.getOutputStream();
// Write out data here.
out.close();
                         else
                              System.out.println("USB not Available");
} catch (Exception e)
e.printStackTrace();

I had download the JUSB-API from www.Bubensoft.de , i manage to install the driver but when i compile and run the above java code
import com.rb.usb.*;
public class Test implements PipeListener{
private static JDevice jDevice;
boolean terminate = false;
private static Pipe event;
private static ConfigurationDescriptor configNumber ;
public static void Test() {
int host=JUSB.scanHostControllers();
System.err.println(host);
// System.err.println(JUSB.getJDevices());
// System.err.println(JUSB.findDevice("vid_05e0&pid_1200"));
jDevice= (JDevice) JUSB.findDevice("vid_05e0&pid_1200");
//jDevice.traceDriverOn();
//JUSB.open(jDevice.getDevicePath());
// System.err.println(configNumber.getConfigurationValue());
jDevice.close();
jDevice.open();
JUSB.open(jDevice.getHardwareId());
System.err.println(jDevice.isJDevice());
System.err.println(jDevice.getHandle());
System.err.println(jDevice.isConfigured());
System.err.println(jDevice.getPipe(0));
public void pipeEvent(PipeEvent event) {
          switch (event.getId()) {
               case PipeEvent.DESTROYED:
                    terminate=true;
                    break;
               case PipeEvent.RECEIVED:
                    System.out.println("" + event.getData().length + " Bytes empfangen");
                    break;
               case PipeEvent.SEND:
                    System.out.println("" + event.getData().length + " Bytes gesendet");
                    break;
               default:
                    break;
public static void main (String[]args)
Test();
System.exit(0);
i get this output
*3*
true
-1
false
null
can any one tell me why the jDevice is not open?

Similar Messages

  • Can only access emails through OWA after migration from exchange 2007 to 2013

    can only access emails through OWA after migration from exchange 2007 to 2013, in other words unable to access mails through outlook or from other Applications services.
    needed RCA ... plz help..

    Hi,
    From your description, you can send and receive messages only when you use OWA after migration from Exchange 2007 to Exchange 2013. If I have misunderstood your concern, please let me know.
    In your case, I recommend you create a new test mailbox in your Exchange 2013 and check if you can send and receive messages on Outlook. If yes, it is recommended to create a new profile to solve this issue.
    Hope this can be helpful to you.
    Best regards,
    Amy Wang
    TechNet Community Support

  • I have had a reinstall nightmare getting my loops back they are in the apple library, I can access them through the media browser but I only have a few available through the loop browser, how do I get them all back there again? please help

    I have had a reinstall nightmare getting my loops back they are in the apple library, I can access them through the media browser but I only have a few available through the loop browser, how do I get them all back there again? please help

    "Where do I find my hundreds of dollars of downloads I have done since 2005?"
    They will only be where you put them  If you are doing the very basics, then they will be on your computer and they will be in your backup copy of your computer.
    The itunes store is not global at all, never has been. You cannot redownload your content from another country.  You can only use the countrys itunes store for the country that you are physically located.

  • Since updating my iPhone 4 to ios6 I can no longer access itunes through the itunes app.  I just get a blank white screen.  Is there a fix for this yet?

    Since upgrading my iPhone 4 to the new ios6 software I can no longer access itunes through the itunes app.  I there a fix for this yet?

    Scalesy05 wrote:
    I there a fix for this yet?
    Why would there be a fix?  YOU are having the problem.  I'm not, no one I know is having the problem.  No fix is needed.
    Basic troubleshooting steps clearly outlined in the User Guide are restart, reset, restore from backup, restore as new.  Have you been through any, if not all of these troubleshooting steps yet?

  • Unable to access Database through DBAdapater

    Hi All,
    I am using Dbadapter in my SOA Composite application and trying to access that through invoke activity.
    I am getting errors in both Jdeveloper and in SOA infra environment (http://localhost:8001/soa-infra).I am unable to proceed with my work.
    1) Error in Jdeveloper:
    When I click on Dbadapter and it is giving below error stacktrace:
    java.lang.NullPointerException
         at oracle.tip.adapter.db.ox.AttributeHolder.toString(AttributeHolder.java:82)
         at java.lang.String.valueOf(String.java:2826)
         at
    org.eclipse.persistence.exceptions.DescriptorException.illegalArgumentWhileSettingValueThruMethodAcc
    essor(DescriptorException.java:691)
         at
    org.eclipse.persistence.internal.descriptors.MethodAttributeAccessor.setAttributeValueInObject(Metho
    dAttributeAccessor.java:248)
         at
    org.eclipse.persistence.internal.descriptors.MethodAttributeAccessor.setAttributeValueInObject(Metho
    dAttributeAccessor.java:201)
         at
    org.eclipse.persistence.oxm.mappings.XMLDirectMapping.setAttributeValueInObject(XMLDirectMapping.jav
    a:386)
         at
    org.eclipse.persistence.mappings.DatabaseMapping.readFromRowIntoObject(DatabaseMapping.java:1284)
         at
    org.eclipse.persistence.internal.descriptors.ObjectBuilder.buildAttributesIntoObject(ObjectBuilder.j
    ava:342)
         at
    org.eclipse.persistence.internal.oxm.XMLObjectBuilder.buildAttributesIntoObject(XMLObjectBuilder.jav
    a:376)
         at
    org.eclipse.persistence.internal.oxm.XMLObjectBuilder.buildObject(XMLObjectBuilder.java:286)
         at
    org.eclipse.persistence.oxm.mappings.XMLCompositeObjectMapping.buildCompositeObject(XMLCompositeObje
    ctMapping.java:435)
         at
    org.eclipse.persistence.oxm.mappings.XMLCompositeObjectMapping.valueFromRow(XMLCompositeObjectMappin
    g.java:540)
         at
    org.eclipse.persistence.oxm.mappings.XMLCompositeObjectMapping.readFromRowIntoObject(XMLCompositeObj
    ectMapping.java:464)
         at
    org.eclipse.persistence.internal.descriptors.ObjectBuilder.buildAttributesIntoObject(ObjectBuilder.j
    ava:342)
         at
    org.eclipse.persistence.internal.oxm.XMLObjectBuilder.buildAttributesIntoObject(XMLObjectBuilder.jav
    a:376)
         at
    org.eclipse.persistence.internal.oxm.XMLObjectBuilder.buildObject(XMLObjectBuilder.java:286)
         at
    org.eclipse.persistence.internal.oxm.record.DOMUnmarshaller.xmlToObject(DOMUnmarshaller.java:427)
         at
    org.eclipse.persistence.internal.oxm.record.DOMUnmarshaller.xmlToObject(DOMUnmarshaller.java:354)
         at
    org.eclipse.persistence.internal.oxm.record.DOMUnmarshaller.unmarshal(DOMUnmarshaller.java:208)
         at org.eclipse.persistence.oxm.XMLUnmarshaller.unmarshal(XMLUnmarshaller.java:476)
         at
    org.eclipse.persistence.sessions.factories.XMLProjectReader.readObjectPersistenceRuntimeFormat(XMLPr
    ojectReader.java:287)
         at
    org.eclipse.persistence.sessions.factories.XMLProjectReader.read(XMLProjectReader.java:180)
         at
    org.eclipse.persistence.sessions.factories.XMLProjectReader.read(XMLProjectReader.java:236)
         at
    oracle.tip.tools.ide.adapters.designtime.adapter.xr.XRAdapterUtil.readTopLinkProjectFiles(XRAdapterU
    til.java:492)
         at
    oracle.tip.tools.ide.adapters.designtime.adapter.xr.XRAdapterSelectTablesPage.<init>(XRAdapterSelect
    TablesPage.java:122)
         at
    oracle.tip.tools.ide.adapters.designtime.adapter.xr.XRAdapterOperationPage$ReAddPagesRunnable.run(XR
    AdapterOperationPage.java:844)
         at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
         at java.awt.EventQueue.dispatchEvent(EventQueue.java:597)
         at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269)
         at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184)
         at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:178)
         at java.awt.Dialog$1.run(Dialog.java:1046)
         at java.awt.Dialog$3.run(Dialog.java:1098)
         at java.security.AccessController.doPrivileged(Native Method)
         at java.awt.Dialog.show(Dialog.java:1096)
         at java.awt.Component.show(Component.java:1563)
         at java.awt.Component.setVisible(Component.java:1515)
         at java.awt.Window.setVisible(Window.java:842)
         at java.awt.Dialog.setVisible(Dialog.java:986)
         at oracle.bali.ewt.wizard.WizardDialog.runDialog(WizardDialog.java:382)
         at oracle.bali.ewt.wizard.WizardDialog.runDialog(WizardDialog.java:298)
         at
    oracle.tip.tools.ide.adapters.designtime.adapter.techAdapterWizard.display(techAdapterWizard.java:36
    2) Error with testing in soa-infra environment :
    <env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/"><env:Header/><env:Body><env:Fault><faultcode>env:Server</faultcode><faultstring>Exception occured when binding was invoked.
    Exception occured during invocation of JCA binding: "JCA Binding execute of Reference operation 'insert' failed due to: Could not create/access the TopLink Session.
    This session is used to connect to the datastore.
    Caused by java.lang.NullPointerException.
    You may need to configure the connection settings in the deployment descriptor (i.e. DbAdapter.rar#META-INF/weblogic-ra.xml) and restart the server. This exception is considered not retriable, likely due to a modelling mistake.
    The invoked JCA adapter raised a resource exception.
    Please examine the above error message carefully to determine a resolution.
    </faultstring><faultactor/><detail><exception>null</exception></detail></env:Fault></env:Body></env:Envelope>
    I am giving proper values for JNDI name in weblogic-ra.xml.
    What I observed is We have a connectionfacatory configuration in ra.xml which is "oracle.tip.adapter.db.ManagaedConnectionfactory".
    Is there any link with this connectionfactory to the errors that I am getting.
    Please guide me on this.
    Thanks in advance

    Have you updated the "Outbound Connection Pools-" under your soa server ?
    http://docs.oracle.com/cd/E23943_01/web.1111/e13732/connect.htm
    *7) Give points - it is good etiquette to reward an answerer points (5 - helpful; 10 - correct) for their post if they answer your question.*
    Thanks,
    Vijay

  • Unable to access Workspace through Apache web server

    Hi,
    I have configured Hyperion 9.3.1. products in windows.
    I am getting the following error message when trying to access Workspace through Apache web server(port 19000). But, able to access through Weblogic Application server(port 45000).
    please assist me in resolving this issue.
    Internal Server Error
    The server encountered an internal error or misconfiguration and was unable to complete your request.
    Please contact the server administrator, [email protected] and inform them of the time the error occurred, and anything you might have done that may have caused the error.
    More information about this error may be available in the server error log.
    Apache/2.0.63 (Win32) mod_jk/1.2.8 Server at nasbydapp04 Port 19000
    Thanks,
    Siva

    I re-configured the BIPlus components and even now, i am unable to access workspace through Apache web server.
    But now, i am getting a different error
    Error:
    HTTP 404 - File not found
    Internet Explorer
    Can anyone help me in resolving this issue.
    I have updated httpd.conf and HYSL-Weblogic.conf file in Apache server.

  • Error while accessing data from MS Access DB through Window AD architec

    Dear Members,
    Iam having a BO 3.0 installation on a standalone PC with the basic tomcat and mysql setup... As a test environment, Now while designing universes i can easily connect to Oracle EBS structure also SQL server DB ... the problem is when iam linking to a MS Access DB through a network drive (its all ok in the designer) but while in Webi while runnning the query, it throws an error of (WIS 10901 .... database error DSN not specified)
    I have configured ODBC properly also given appropriate rights for the users and strangely the same universe is running well with my thick client desktop and webi rich client
    (so iam sure its not a odbc issue)
    Looking forward for any comments on this problem

    possibly the account running the webi report server doesn't have access to the drive. Is it local system? Try using the same account you are logged into the webi rich client as, but you will most likely need to grant that account local admin on the server so it can run the service.
    Regards,
    Tim

  • How to find users machine / IP who is accessing forms through Oracle AS

    Dear Gurus
    We need to know the users machine / IP who are accessing forms through Oracle 9i Application Server, how can we find that?
    thanks in advance
    regards
    Mehmood

    Mehmood,
    Set serverURL=/forms90/f90servlet/session in the Forms Web configuration default section or add it to the URL to start tracing host name and ip-addresses from clients. The output appears in the servlet log file application.log. sessionperf , perf and debug are the other options instead of session.
    regards,
    Bernhard Jongejan
    http://bernhardjongejan.spaces.live.com

  • HT1212 my iphone screen is broken and i need to access it through itunes but my phone is locked. it cannot be unlocked on the screen but is there any way i can do it on itunes?

    my iphone screen is broken and i need to access it through itunes but my phone is locked. it cannot be unlocked on the screen but is there any way i can do it on itunes so i can access it?

    Depends, if you've synced with this iTunes, while that passcode was enabled, you won't be prompted to enter the passcode when connecting your phone. If you have not synced, while that passcode was enabled, you will. So, if you fall in the later, there is no way to do what you want.

  • The screen on my iPhone is frozen and I can access apps through Siri. The touch screen works within the apps but not in the home screen. What do I do?

    the screen on my iPhone is frozen and I can access apps through Siri. The touch screen works within the apps but not in the home screen. What do I do?

    Have you tried a reset which is similar to a computer restart and is done by pressing and holding the home button and the sleep/wake or on/off button simultaneously until you see the Apple logo and then release?

  • My iphoto9 has not been able to open for over 10 days!!  I can't load my Christmas pics, etc.  I know the pics are still there because I can access them through a round about way.  Can anyone help me to OPEN iPHOTO!?

    My iphoto9 has not been able to open for over 10 days!!  I can't load my Christmas pics, etc.  I know the pics are still there because I can access them through a round about way.  Can anyone help me to OPEN iPHOTO!?

    To re-install iPhoto
    1. Put the iPhoto.app in the trash (Drag it from your Applications Folder to the trash)
    2a: On 10.5:  Go to HD/Library/Receipts and remove any pkg file there with iPhoto in the name.
    2b: On 10.6: Those receipts may be found as follows:  In the Finder use the Go menu and select Go To Folder. In the resulting window type
    /var/db/receipts/
    2c: on 10.7 they're at
    /private/var/db/receipts
    A Finder Window will open at that location and you can remove the iPhoto pkg files.
    3. Re-install.
    If you purchased an iLife Disk, then iPhoto is on it.
    If iPhoto was installed on your Mac when you go it then it’s on the System Restore disks that came with your Mac. Insert the first one and opt to ‘Install Bundled Applications Only.
    If you purchased it on the App Store or have a Recent Mac you can find it in your Purchases List.

  • Enable to select a check box in ALV while accessing it through portal

    Hi All,
    Currently I have given a link on portal to run a transaction code. The output of the program is ALV report, where user any select the check boxes.
    Now when I try to select a check box, it is not getting selected. I click on the checkbox, the tick appear and then the screen refreshes itself and the tick goes off. This is happening only when accessing it through portal. If i run the program in R/3 directly, I am able to select the check box.
    Please advice on this.
    Thanks
    Namit

    Reported to SAP for the same.

  • I installed plugins Vertus Fluid Mask and Imagenomic Portraiture but I do not see it under the filters tab like I do in CS3.  How do I access it through Photoshop CC.

    I installed plugins Vertus Fluid Mask and Imagenomic Portraiture but I do not see it under the filters tab like I do in CS3.  How do I access it through Photoshop CC?

    Good day!
    Have you installed the Photoshop-version-appropriate versions of the plug-ins?
    Regards,
    Pfaffenbichler

  • Why can't I access Scrabble through Facebook on my IPOD Touch?

    Why can't I access Scrabble through Facebook on my IPOD Touch?

    See the other actions of:
    iOS: Troubleshooting applications purchased from the App Store
    Contact the developer/go to their support site if only one app.
    Restore from backup. See:
    iOS: How to back up              
    Restore to factory settings/new iPod

  • HT201317 New phone: lost old phone in a fire. How can I access my photos on iCloud from my old phone? In settings I see the storage for BOTH phones. They are separate but same account. Can I access iCloud through PC or is the info now useless since phone

    New phone: lost old phone in a fire. How can I access my photos on iCloud from my old phone? In settings I see the storage for BOTH phones. They are separate but same account. Can I access iCloud through PC or is the info now useless since phone is gone?

    What a crappy design. This is where Android is so much better. It seems to me like you have no control over your iPhone. It does whatever Apple has designed it to do without asking you first. On Android you can actually go in see all folders, document files, photo files etc and you have so much more control of everything. Apple s..cks!

Maybe you are looking for

  • Proforma Invoice in Stock transfer Intra company

    Hi Gurus, I am trying to make Proforma Invoice in STO Intra company. But it is giving the errror "Not relevant for billing". Actually i want to create a excise Invoice from this Pro forma Invoice. I have also maintained NLN item category in Copy cont

  • How to configure a JMS Queue

    Hi, I have an EAR file thai includes an EJB 3.0 module with a MDB. I use a Queue. This is my code, @Resource(mappedName = "jms/NotificationQueue") private Queue notificationQueue; @Resource(mappedName = "jms/NotificationQueueFactory") private Connect

  • Help - Creative WebCam Audio Control disabled

    Hi, Just set up my Creative Live Vouce webcam for Skype use and everything is going well but when I select the WebCam Audio Control to play with the different settings it appears to be disabled. No option is highlighted and I can't select any of the

  • "Command I" shortcut in Preview - designated for show/hide toolbar AND show inspector?

    In the Mac Preview App, I tried using the the 'command I' shortcut to show/ hide the toolbar, but it brings up the inspector instead. Is the shortcut is designated for both these functions?

  • PhoneGap Build:Cannot Connect to Server Dreamweaver CS6

    Hey guys, I was wondering if someone could fix this problem, Im having, i have Dreamweaver cs6 on a mac, And im trying to login to phonegap build in dreamweaver, but everytime i try, it tells me that it cannot connect to the servers, plz try again la