facebook

JAX-RPC and creation of JAR file

  1. MyEclipse Archived
  2.  > 
  3. Web Services
Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #302716 Reply

    Jag
    Member

    Hi
    I have a webservice, which uses Java version 1.5.0_11. I am using MyEclipse Blue which runs perfectly fine. I am trying to export as Runnable JAR and I am unable to run. The PC is installed with Java version 1.6.0_14.

    I tried 2 procedure, no luck.

    Procedure 1
    If I export them, I am able to create a jar file with my classes and as well sqlserver JDBC driver class.
    Exported the classes to BLBDaily.jar and ran the following cmd

    The following is what I receive
    C:\Temp\DOWNLO~2\BL~1\BLDaily>java -version
    java version “1.6.0_14”
    Java(TM) SE Runtime Environment (build 1.6.0_14-b08)
    Java HotSpot(TM) Client VM (build 14.0-b16, mixed mode, sharing)

    C:\Temp\DOWNLO~2\BL~1\BLDaily>java -jar BLBDaily.jar
    start Time Sun Sep 27 21:01:31 EDT 2009
    Exception in thread “main” java.lang.NoClassDefFoundError: javax/xml/rpc/Service

    Procedure 2
    I tried unzipping all the JAR
    (C:\Program Files\Java\jdk1.5.0_11\jre\lib\ext\webservices-rt.jar;
    C:\Program Files\Java\jdk1.5.0_11\jre\lib\ext\webservices-api.jar;
    C:\Program Files\Genuitec\Common\plugins\com.genuitec.eclipse.j2eedt.core_7.5.0.zmyeclipse75020090612\data\libraryset\EE_5\javaee.jar) into a work folder
    unzipping all the BLBDaily.jar
    creating new set of JAR from all classes (which were unzipped) and I receive the following
    cannot be cast to com.sun.xml.messaging.saaj.soap.MessageImpl
    when I run the jar (appears 1.6 vs 1.5 issue on procedure 2)

    The issue appears to be very fundamental one, CLASSPATH. Could someone suggest the process, where I could successfully pack them and eventually execute them.

    Other than usually Java runtime library, I am using SQL server 2005 JDBC driver, which needs to added or referd in the classpath.

    I appreciate the help.

    Thanks

    #302742 Reply

    Brian Fernandes
    Moderator

    asi,

    I’d like to clarify, do you have a webservice or a webservice client?

    If you have a web service as you stated, then it will not be possible to run it as a standalone application – you do need to deploy it to a server and access the service through the server.

    Could you please clarify?

    #302743 Reply

    Jag
    Member

    Thanks for the reply. It is webservice client. I works fine with NO issue in MyEclipse Blue IDE. And I using the following jars in my classpath
    C:\Program Files\Microsoft SQL Server 2005 Driver for JDBC\sqljdbc_1.2\enu\sqljdbc.jar;
    C:\Program Files\Java\jdk1.5.0_11\jre\lib\ext\webservices-rt.jar;
    C:\Program Files\Java\jdk1.5.0_11\jre\lib\ext\webservices-api.jar;
    C:\Program Files\Genuitec\Common\plugins\com.genuitec.eclipse.j2eedt.core_7.5.0.zmyeclipse75020090612\data\libraryset\EE_5\javaee.jar

    The following is what in my runPrj.bat
    PATH=C:\Program Files\java\jdk1.5.0_11\bin;
    java -classpath “C:\Program Files\Microsoft SQL Server 2005 Driver for JDBC\sqljdbc_1.2\enu\sqljdbc.jar”;
    “C:\Program Files\Java\jdk1.5.0_11\jre\lib\ext\webservices-rt.jar”;
    “C:\Program Files\Java\jdk1.5.0_11\jre\lib\ext\webservices-api.jar”;
    “C:\Program Files\Genuitec\Common\plugins\com.genuitec.eclipse.j2eedt.core_7.5.0.zmyeclipse75020090612\data\libraryset\EE_5\javaee.jar
    ” -jar BLBDaily.jar

    Not sure, how come it is NOT seeing javax/xml/rpc/service

    The following is the msg
    Exception in thread “main” java.lang.NoClassDefFoundError: javax/xml/rpc/Service

    Let me know.

    Thanks

    #302746 Reply

    Jag
    Member

    Brian
    Do you think, this is javaee.jar issue. Because I tried the same project in Netbeans and I am unable to even run the app inside the Netbeans IDE, atleast it runs in MyEclipseBlue . Let me know, what you think. I get the following msg.

    run:
    Exception in thread “main” java.lang.NoClassDefFoundError: javax/xml/rpc/Service
    start Time Mon Sep 28 22:12:39 EDT 2009
    at java.lang.ClassLoader.findBootstrapClass(Native Method)
    at java.lang.ClassLoader.findBootstrapClass0(ClassLoader.java:891)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:301)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:299)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:268)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
    at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
    at java.lang.ClassLoader.defineClass1(Native Method)
    at java.lang.ClassLoader.defineClass(ClassLoader.java:620)
    at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124)
    at java.net.URLClassLoader.defineClass(URLClassLoader.java:260)
    at java.net.URLClassLoader.access$100(URLClassLoader.java:56)
    at java.net.URLClassLoader$1.run(URLClassLoader.java:195)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:268)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
    at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
    at com.asi.WSClient.wsClientmain(WSClient.java:245)
    at com.asi.ASIMain.main(ASIMain.java:14)
    Java Result: 1
    BUILD SUCCESSFUL (total time: 2 seconds)

    #302757 Reply

    Brian Fernandes
    Moderator

    asi,

    That class is part of the javaee.jar, however, it may also be present in webservices-rt/api.jar and there could be some sort of conflict.

    Suggestions:
    1) if you’re running an app in MyEclipse Blue, an IBM JRE may be used (you can just check the JRE tab of the launch configuration to be sure).

    2) How did you get webservices-rt/api.jar in the ext folder? Did you put them there yourself? AFAIK the JDK will not come with these folders. I would suggest removing them from your classpath (they would probably be on the cp anyway because they are in the ext folder) or move them from the ext folder elsewhere, try adding them to the CP from a non-jdk folder.

    3) If this is a JAX-RPC webservice, you may not need webservices-rt/api.jar on the CP at all, try removing them.

    Please let us know how it goes.

    #302800 Reply

    Jag
    Member

    Brian
    Thanks for the prompt reply. There is definitively some conflict.
    1. The JRE for the project selected is jre1.5.0_11
    2. I did manually added to the ext folder (sort of desperation)
    3. Tried that no issue.

    Since the stubs claims (keep in mind, I could not even generate the stubs, reqstd from the client), it has been generated using JAX-RPC (Standard Implementation) 1.1.2_01 bld R40), I attempted the following

    Download JWSDP 1.4 and as well as JWSDP 1.5. No luck, I could NOT run the app inside the IDE either, but when I add the Java EE 5.0 library sets (javaee.jar) from C:\Program Files\Genuitec\Common\plugins\com.genuitec.eclipse.j2eedt.core_7.5.0.zmyeclipse75020090612\data\libraryset\EE_5\javaee.jar. I am able to RUN the client app inside the MyEclipse and NOT in NetBeans.

    I plan to attempt couple more things, I will keep you posted. In the meanwhile, I thought my updates would might turn on some lightbulbs on your side !!.

    I appreciate your help and this forum is an excellent source of knowledge, keep up the good work.

    Thanks
    Jag

Viewing 6 posts - 1 through 6 (of 6 total)
Reply To: JAX-RPC and creation of JAR file

You must be logged in to post in the forum log in