Help me to config usb4java!

2,865 views
Skip to first unread message

Trọng Đạt Trần

unread,
Aug 30, 2013, 10:21:10 PM8/30/13
to usb4...@googlegroups.com
I can't understand "To tell the USB Host Manager of javax.usb to use the usb4java implementation you have to put the following property into the javax.usb.properties file which must be located in the root of your classpath:
javax.usb.services = de.ailis.usb4java.Services
usb4java can be configured by adding more properties to this file as described in the following sections. All these properties only affect the high-level javax.usb API ofusb4java. The low-level API just wraps the native libusb library so no configuration is available (or needed) for it."

How to config? Help me!!!!!!!!!!!

Alex Gardiner

unread,
Sep 26, 2013, 11:14:10 AM9/26/13
to usb4...@googlegroups.com
Hi - I have the same problem.  I am trying to implement a JavaFX test program using Dump Device Tree.  I am using Netbeans.  I have the javax.usb.properties file in the Source package and after building it is in the Class folder with the generated classes but still gives the Properties file not found error when the "UsbServices line is called.

Where exactly should the properties file be or should there be a reference to it within my program?

Alex

Alex Gardiner

unread,
Oct 2, 2013, 10:34:33 AM10/2/13
to usb4...@googlegroups.com
I have got a test JavaFX system working by placing the properties file in the src folder. I have got the DumpDeviceTree and DumpDevice programs to work but not the Device names. I'll start a new post on that.

Alex

Leonardo sarraff

unread,
Oct 24, 2013, 5:15:55 PM10/24/13
to usb4...@googlegroups.com
Alex Gardiner i got the same problem that you got. I wanna know where i can find this file (javax.usb.properties)? Other doubt, if i  place it in the src directory of my project, the Exception: Properties file javax.usb.properties not found. will be fixed? I'm using netbeans IDE 7.3.
Thanks!!!


rstoeck

unread,
Oct 25, 2013, 1:45:58 AM10/25/13
to usb4...@googlegroups.com
Do these three steps:
  1. Create the file "javax.usb.properties"
  2. Type this one line into it:  javax.usb.services = de.ailis.usb4java.Services
  3. Make sure this file is on your classpath when you run your Java program

Alex Gardiner

unread,
Oct 25, 2013, 6:55:56 AM10/25/13
to usb4...@googlegroups.com
As rstoeck wrote, create the property file with the contents specified.  Having got the file, put it in your project folder, not the scr folder, ie it is at the same level as the scr folder and alongside the build.xml folder..  I wrote a simple javafx program to test the examples.  Got 2 of them to work but not the third - see a different post.  This could be because I am using libusb-win32 not libusbx.  If you e-mail me, I will send you the sourse code I wrote.   Let us know if you get it to work.

Alex

Leonardo sarraff

unread,
Oct 25, 2013, 10:37:26 AM10/25/13
to usb4...@googlegroups.com
Good morning Alex, i did what you said, i created the javax.usb.properties and place it in the project folder., but a got this output below. I'm seding you my code. Thanks for your attention!!!

Device 007/001
Parent 007/000
Speed: Unknown
Unable to open devivce: LIBUSB_ERROR_NOT_SUPPORTED. Continuing without device hanlde.
Device Descriptor:
  bLength                 18
  bDescriptorType          1
  bcdUSB                0.00
  bDeviceClass             0 Per interface
  bDeviceSubClass          0
Unable to read config descriptor -5
  bDeviceProtocol          0
  bMaxPacketSize0          0
  idVendor            0x8086
  idProduct           0x3b3e
  bcdDevice             0.00
  iManufacturer            0
  iProduct                 0
  iSerial                  0
  bNumConfigurations       1#
# A fatal error has been detected by the Java Runtime Environment:
#
#  EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x70884ba7, pid=3672, tid=512
#
# JRE version: Java(TM) SE Runtime Environment (7.0_45-b18) (build 1.7.0_45-b18)
# Java VM: Java HotSpot(TM) Client VM (24.45-b08 mixed mode, sharing windows-x86 )
# Problematic frame:
# C  [libusb4java.dll+0x4ba7]
#
# Failed to write core dump. Minidumps are not enabled by default on client versions of Windows
#
# An error report file with more information is saved as:
# C:\Users\matakura\Documents\NetBeansProjects\USBApplication\hs_err_pid3672.log
#
# If you would like to submit a bug report, please visit:
#   http://bugreport.sun.com/bugreport/crash.jsp
# The crash happened outside the Java Virtual Machine in native code.
# See problematic frame for where to report the bug.
#
Java Result: 1



USB_Test_Usb4Java.java

Alex Gardiner

unread,
Oct 25, 2013, 11:32:28 AM10/25/13
to usb4...@googlegroups.com
Hi

You need someone with more experience than me to answer this.  Like you, I am new to this software.

The Netbeans project I used to test the system can be downloaded from

https://drive.google.com/folderview?id=0B0pRLiz1BiPwTHA3bTRzZ1luQW8&usp=sharing

When clicked, the top 2 buttons give the information expected but not the 3rd. I may get some time to work on it in a few weeks

Alex

Leonardo sarraff

unread,
Nov 1, 2013, 4:32:55 PM11/1/13
to usb4...@googlegroups.com
Thank you Alex for your help!!!

Vinh Tran

unread,
Jan 9, 2014, 12:27:31 AM1/9/14
to usb4...@googlegroups.com
You need to install WinUSB driver to replace native device driver.
Use Zadig to install it.
I got the same error on windows and fixed after installed WinUSB driver
 

Vinh Tran

unread,
Jan 9, 2014, 12:29:17 AM1/9/14
to usb4...@googlegroups.com
Create javax.usb.properties file in src folder, and put above line in it.
Check in UsbHostManager source code, you can see the logic behind that

Klaus Reimer

unread,
Mar 2, 2014, 6:13:42 PM3/2/14
to usb4...@googlegroups.com
On 25.10.2013 16:37, Leonardo sarraff wrote:
> Good morning Alex, i did what you said, i created the javax.usb.properties
> and place it in the project folder., but a got this output below. I'm
> seding you my code. Thanks for your attention!!!
> ...
> # A fatal error has been detected by the Java Runtime Environment:
> # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x70884ba7, pid=3672,
> tid=512

libusb has some issues on Windows when communicating with devices which
are not explicitly using a libusb compatible driver. For these devices
you may get false and useless descriptor data and in some situations it
may even crash as in your case.

For Windows I recommend scanning for the exact device you want to
communicate with (And for which you have created and installed a libusb
driver) and then only play around with this device.

The upcoming version 1.2.0 of usb4java will use the latest libusb 1.0.18
which hopefully works better on Windows. But even with this version you
might experience trouble with this DumpDevices example on Windows.

--
Klaus Reimer <http://www.ailis.de/~k/>
[2FC4 CCA0 C03B 1E5F 1ACC 94D6 6461 426C E734 75A1]

signature.asc

Glaur Sian

unread,
Jun 20, 2014, 9:00:09 AM6/20/14
to usb4...@googlegroups.com
hi, can you help me to read and write data in hex from an fingerprint reader on usb? i need only to receive data in hex from the usb witch it is sending when i swipe the finger in the sensor.

thanks...feel free to send me an email. If you send me an netbeans zip archivated project or eclipse will be a wonderfull thing :))
Reply all
Reply to author
Forward
0 new messages