Results 1 to 7 of 7
Like Tree1Likes
  • 1 Post By DarrylBurke

Thread: Need help with JavaPOS/UnifiedPOS

  1. #1
    ozzyman's Avatar
    ozzyman is offline Senior Member
    Join Date
    Mar 2011
    Location
    London, UK
    Posts
    797
    Blog Entries
    2
    Rep Power
    4

    Default Need help with JavaPOS/UnifiedPOS

    Hi, does anyone have any experience with JavaPOS?

    The trouble is I can't find any tutorial on 'setting it up' and so I can't find out how to add it to my eclipse/netbeans project... and I can't compile the example code that was supplied with my thermal printer.

    I have a Star TSP100ii receipt printer and a Cash Drawer that plugs into the back of the printer via RJ11 port. I've connected it up, installed the futurePRNT software and tested printing and kicking the cash drawer with the config utility... that all worked fine.

    I checked the program folder, it has some JavaPOS samples which I'm supposed to be able to use in my project, however trying to compile that Java file gave some error... these were the instructions given in the sample file (to control the Cash Drawer):
    Java Code:
    // usage instructions - Windows
    // 1. compile from command line - javac -classpath jpos113-controls.jar;jcl.jar StarCashDrawerTest.java
    // 2. execute from command line - java -classpath .;starjavapos.jar;stario.jar;jpos113-controls.jar;jcl.jar;xercesimpl.jar;xml-apis.jar StarCashDrawerTest
    Step 1 (compilation) was successful however step 2 gave this error:
    Java Code:
    jpos.JposException: Service does not exist in loaded JCL registry
    at jpos.loader.simple.SimpleServiceManager.createConnection(Unknown Source)
    at jpos.loader.JposServiceLoader.findService(Unknown Source)
    at StarCashDrawerTest.runTest(StarCashDrawerTest.java:55)
    at StarCashDrawerTest.main(StarCashDrawerTest.java:107)
    StarCashDrawerTest finished.
    This is the line 55:
    Java Code:
    	// open the cashDrawer object according to the entry names defined in jpos.xml
    	cashDrawer.open("default");
    There is a note about this code saying that "default" should be changed:
    Java Code:
    // NOTE: CHANGE THE CASH DRAWER NAME IN THE cashDrawer.open STATEMENT BELOW TO MATCH YOUR CONFIGURED DEVICE NAME
    However, there is no information telling how to find out the 'configured device name'...

    This is line 107:
    Java Code:
    	new StarCashDrawerTest().runTest(args);
    I have opened the JavaPOS docs (its now called UnifiedPOS) but its not very good... just a PDF file explaining each method available.

    Does anyone know how to fix this? & how to add JavaPOS to my project in NetBeans/Eclipse?

    thanks

  2. #2
    ozzyman's Avatar
    ozzyman is offline Senior Member
    Join Date
    Mar 2011
    Location
    London, UK
    Posts
    797
    Blog Entries
    2
    Rep Power
    4

    Default Re: Need help with JavaPOS/UnifiedPOS

    I didn't realise I was supposed to generate the "jpos.xml" file using the Config Utility that came from the printer vendor...

    For Star you open "Configuration Utility", Select Star Line Mode, Click JavaPOS on the left side, press Create JPOS XML Registry File, Click Add New to add your printer and cash drawer - the name comes up automatically if it's connected --press OK, press Apply and the jpos.xml file will be automatically updated, throw that jpos.xml file into your project with the jar files. Also update the CashDrawer.open("default") to the names written in the jpos.xml file... it will say LogicalName="the_name".

  3. #3
    DarrylBurke's Avatar
    DarrylBurke is offline Member
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,240
    Rep Power
    19

    Default Re: Need help with JavaPOS/UnifiedPOS

    Thank you for sharing the solution. The problem isn't new ;)

    db
    ozzyman likes this.
    If you're forever cleaning cobwebs, it's time to get rid of the spiders.

  4. #4
    phanisrinivas is offline Member
    Join Date
    Aug 2012
    Posts
    7
    Rep Power
    0

    Default Re: Need help with JavaPOS/UnifiedPOS

    Hi
    Just Check out the logical Name of the printer with cash drawer in jpos.xml or in config.xml(it is existed in TPGPOS printer factory classes).I don't have knowledge on how to operate the star receipt printer.I worked on TPG pos printer.Using config.xml file only you have to communicate with the printer as well as cash drawer.

    your open cash drawer code is like this:
    cashDrawer.open("logical name of the printer"); //which is defined in config.xml or jpos.xml

    For this we need to interact with printer factory classes.

    Thanks

    phani.

  5. #5
    jadsonjs is offline Member
    Join Date
    Apr 2013
    Posts
    2
    Rep Power
    0

    Default Re: Need help with JavaPOS/UnifiedPOS

    I created the JPOS XML registry file.
    But it still have the same error when I try to execute the print hello world example that came into CD-ROM of the printer.

    "jpos.JposException: Service does not exist in loaded JCL registry"

    Where you threw the jpos.xml in yout project ? what jars file you put into your project ?
    You buy the printer and it doesn't come with the instructions how setup your project. This is ridiculous.

    With the Epson TM-T20 the application to make the registre is C:\Program Files (x86)\EPSON\JavaPOS\SetupPOS\SetupPOS.exe
    It have create the jpos.xml file at same directory.

    I have put the jpos111.jar and xercesImpl.jar in my project. But how the application knows how to load this jpos.xml file ?

    Please, somebody help me.

  6. #6
    jadsonjs is offline Member
    Join Date
    Apr 2013
    Posts
    2
    Rep Power
    0

    Default Re: Need help with JavaPOS/UnifiedPOS

    I tried almost every thing.
    Load the jpos.xml with System.setProperty("jpos.config.populatorFile", path_to_jpos_xml); OK
    but appeared some other problems, like: "don't find the ????.dll file", so I put the EPSON/JavaPOS/../lib to the java.library.path (ok)
    but appeared another problem, I put all .jar file of EPSON on my class path. (ok)
    but appeared another problem..... and so on.

    It is really very difficult use JPos.

    So i have found the Epson Virtual Port Drive application. Thats emulate a USB por with the COM port.

    All my problem are solved. I used RXTXcoom.jar and rxtxSerial.dll to print and gave up this JPOS. :/

    thanks..

  7. #7
    hsiehlc is offline Member
    Join Date
    Jun 2013
    Posts
    1
    Rep Power
    0

    Default Re: Need help with JavaPOS/UnifiedPOS

    Hi, I have a similar problem testing on POSTest + Star TSP100 + Ubuntu...
    I download POSTest and run it successfully with the test GUI up.
    I installed STAR TSP100 on my Ubuntu, and got printer to print out a test print out.
    I also download all JavaPOS folder from STAR installation CD (so I got all the jcl.jar, jpos110.jar, jpos113-controls.jar, stario.jar, starjavapos.jar from that and put them to my POSTest directory with other jpos110.jar, jpos.xml... from POSTest)
    I modified jpos.xml to as follows:

    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE JposEntries PUBLIC "-//JavaPOS//DTD//EN"
    "jpos/res/jcl.dtd">
    <JposEntries>
    <!--Saved by JavaPOS jpos.config/loader (JCL) version 2.1.0-RC3 on 10/26/04 8:17 AM-->
    <JposEntry logicalName="VirtualLineDisplay">
    <creation factoryClass="com.xyz.jpos.XyzJposServiceInstanceF actory" serviceClass="com.xyz.jpos.LineDisplayService"/>
    <vendor name="Xyz, Corp." url="http://www.javapos.com"/>
    <jpos category="LineDisplay" version="1.5"/>
    <product description="Example virtual LineDisplay JavaPOS Service from virtual Xyz Corporation" name="Xyz Virtual LineDisplay Service for JavaPOS(TM) Standard" url="http://www.javapos.com"/>

    <!--Other non JavaPOS required property (mostly vendor properties and bus specific properties i.e. RS232 )-->
    </JposEntry>

    <JposEntries>
    <JposEntry logicalName="defaultPOSPrinter">
    <creation factoryClass="com.starmicronics.starjavapos.Servic eInstanceFactory" serviceClass="com.starmicronics.starjavapos.POSPri nterService"/>
    <vendor name="Star Micronics" url="www.star-m.jp/eng/index.htm"/>
    <jpos category="POSPrinter" version="1.13"/>
    <product description="Thermal receipt printer" name="TSP100" url="www.futureprnt.com"/>
    <prop name="model" type="String" value="TSP100"/>
    <prop name="portName" type="String" value="usbprn:TSP100"/>
    <prop name="portSettings" type="String" value=""/>
    <prop name="ioTimeoutMillis" type="Integer" value="5000"/>
    <prop name="doCheckedBlockPrinting" type="Boolean" value="true"/>
    </JposEntry>

    <JposEntry logicalName="defaultCashDrawer">
    <creation factoryClass="com.starmicronics.starjavapos.Servic eInstanceFactory" serviceClass="com.starmicronics.starjavapos.CashDr awerService"/>
    <vendor name="Star Micronics" url="www.star-m.jp/eng/index.htm"/>
    <jpos category="CashDrawer" version="1.13"/>
    <product description="Printer controlled cash drawer" name="Star Micronics cash drawer controller" url="www.futureprnt.com"/>
    <prop name="portName" type="String" value="usbprn:TSP100"/>
    <prop name="portSettings" type="String" value=""/>
    <prop name="controlPrimaryDrawer" type="Boolean" value="true"/>
    <prop name="firePulseWidth" type="Long" value="200"/>
    <prop name="sleepPulseWidth" type="Long" value="200"/>
    <prop name="capStatus" type="Boolean" value="true"/>
    <prop name="signalLevelHighWhenDrawerOpen" type="Boolean" value="true"/>
    </JposEntry>
    </JposEntries>

    and I run POSTest again, but just can't get the defaultPOSPrinter to open, when I click on the open button on the POSTest GUI interface, it says:
    Failed to open defaultPOSPrinter
    Exception: Sevice does not exist in loaded JCL registry
    Appreciated if anyone can shed some light...

Similar Threads

  1. JavaPOS Applet
    By leequarella in forum Java Applets
    Replies: 1
    Last Post: 02-19-2012, 05:11 PM
  2. How to use JavaPos
    By Daniel in forum Advanced Java
    Replies: 2
    Last Post: 07-01-2007, 09:26 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •