Topic
  • 7 replies
  • Latest Post - ‏2013-06-20T18:31:55Z by bondsadh
rimiGrover
rimiGrover
1 Post

Pinned topic Generating JAXB classes from XSD- class not found exception

‏2011-05-16T20:55:10Z |
When trying to generate JAXB classes from schema, the following exception is recieved:
Exception in thread "main" java.lang.ClassNotFoundException: com.sun.tools.internal.xjc.Driver
at com.sun.tools.xjc.ParallelWorldClassLoader.findClass(ParallelWorldClassLoader.java:76)
at java.lang.ClassLoader.loadClass(ClassLoader.java:643)
at java.lang.ClassLoader.loadClass(ClassLoader.java:609)
at com.sun.tools.xjc.XJCFacade.main(XJCFacade.java:43)

It seems like the eclipse project has documented this as #Bug 313607 (https://bugs.eclipse.org/bugs/show_bug.cgi?id=313607) which is resolved, which patch will this be available in.
Updated on 2012-09-07T14:18:01Z at 2012-09-07T14:18:01Z by TroyBishop
  • Keith Chong
    Keith Chong
    19 Posts

    Re: Generating JAXB classes from XSD- class not found exception

    ‏2011-05-19T19:45:42Z  
    A few questions:

    What version of Rational Application Developer (or other) are you using?
    Are you following the same steps as described in the bugzilla? Or something else?
    Are you seeing this exception every time you generate JAXB classes?
  • SystemAdmin
    SystemAdmin
    14225 Posts

    Re: Generating JAXB classes from XSD- class not found exception

    ‏2011-07-11T17:53:25Z  
    A few questions:

    What version of Rational Application Developer (or other) are you using?
    Are you following the same steps as described in the bugzilla? Or something else?
    Are you seeing this exception every time you generate JAXB classes?
    I am seeing same message, running RAD 8 with Websphere v7.0 server runtime. Any help available?

    Here's what I did:
    Create new Java project
    Add Websphere v7.0 server runtime to class path
    Add JRE System Library (JavaSE-1.6)
    Add new package to hold generated source
    Add new "ref" folder to hold xsd file, not in Java src structure
    Import xsd to "ref" folder from file system
    Right-Click on xsd, choose Generate...JAXB Classes, choose package
    Click Finish button

    Observe same error as original post.

    When will fix be available? Is there a jar file we need to include on the classpath? I'm stumped.
  • SystemAdmin
    SystemAdmin
    14225 Posts

    Re: Generating JAXB classes from XSD- class not found exception

    ‏2012-02-23T14:28:59Z  
    I am seeing same message, running RAD 8 with Websphere v7.0 server runtime. Any help available?

    Here's what I did:
    Create new Java project
    Add Websphere v7.0 server runtime to class path
    Add JRE System Library (JavaSE-1.6)
    Add new package to hold generated source
    Add new "ref" folder to hold xsd file, not in Java src structure
    Import xsd to "ref" folder from file system
    Right-Click on xsd, choose Generate...JAXB Classes, choose package
    Click Finish button

    Observe same error as original post.

    When will fix be available? Is there a jar file we need to include on the classpath? I'm stumped.
    Still having the same problem on

    IBM Rational® Application Developer for WebSphere® Software
    Version: 8.0.4 iFix1
    Build ID: RADO804iFix1-I20120127_2338

    by trying to generate JAXB classes from a .xsd file in a java project that has:
    
    <classpath> <classpathentry kind=
    "src" path=
    "src"/> <classpathentry kind=
    "con" path=
    "org.eclipse.jst.j2ee.internal.module.container"/> <classpathentry kind=
    "con" path=
    "org.eclipse.jst.server.core.container/com.ibm.ws.ast.st.runtime.runtimeTarget.v70/was.base.v7"> <attributes> <attribute name=
    "owner.project.facets" value=
    "jst.utility"/> </attributes> </classpathentry> <classpathentry kind=
    "con" path=
    "org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/WebSphere Application Server v7.0 JRE"> <attributes> <attribute name=
    "owner.project.facets" value=
    "java"/> </attributes> </classpathentry> <classpathentry kind=
    "output" path=
    "bin"/> </classpath>
    

    @IBM: Any fixes planned ?

    @Anyone: Any workarounds ?

    Thanks.
  • Sunith_Narayan
    Sunith_Narayan
    1 Post

    Re: Generating JAXB classes from XSD- class not found exception

    ‏2012-04-18T07:10:23Z  
    Hi,

    I am using RAD 8.0.4 and am facing the same issue mentioned here

    Exception in thread "main" java.lang.ClassNotFoundException: com.sun.tools.internal.xjc.Driver
    at com.sun.tools.xjc.ParallelWorldClassLoader.findClass(ParallelWorldClassLoader.java:76)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:643)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:609)
    at com.sun.tools.xjc.XJCFacade.main(XJCFacade.java:43)

    Does anyone know whether there is a workaround (maybe update some of the packages..)? Am new to RAD and am stuck with this issue. Any help is appreciated
  • MRKB
    MRKB
    3 Posts

    Re: Generating JAXB classes from XSD- class not found exception

    ‏2012-09-07T12:04:27Z  
    Hi,

    I am using RAD 8.0.4 and am facing the same issue mentioned here

    Exception in thread "main" java.lang.ClassNotFoundException: com.sun.tools.internal.xjc.Driver
    at com.sun.tools.xjc.ParallelWorldClassLoader.findClass(ParallelWorldClassLoader.java:76)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:643)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:609)
    at com.sun.tools.xjc.XJCFacade.main(XJCFacade.java:43)

    Does anyone know whether there is a workaround (maybe update some of the packages..)? Am new to RAD and am stuck with this issue. Any help is appreciated
    Any Solution so far for this ?
    I too have this issue.

    RAD 8 is not at all productive, too many issues like this

    Exception in thread "main" java.lang.NoClassDefFoundError: com.sun.tools.xjc.XJCFacade
    Caused by: java.lang.ClassNotFoundException: com.sun.tools.xjc.XJCFacade
    at java.net.URLClassLoader.findClass(URLClassLoader.java:423)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:660)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:346)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:626)
  • TroyBishop
    TroyBishop
    104 Posts

    Re: Generating JAXB classes from XSD- class not found exception

    ‏2012-09-07T14:18:01Z  
    Hello,

    Have a look at APAR PM69118 which states:

    
    ... The 
    'Generate > JAXB classes' wizard belongs to base Eclipse and requires additional libraries to be configured in the runtime to complete successfully.  A warning normally appears alerting you to this.  But 
    
    if you have the JPA 2.0 feature pack installed on your WebSphere Application Server 7.0 then the warning does not appear.   Local fix: The workaround is to use the RAD wizard to generate your JAXB classes when right clicking on your schema file.  This wizard is 
    'Generate > Java'.  Then select the 
    'Schema to JAXB Java classes
    ' option.
    


    -Troy
  • bondsadh
    bondsadh
    1 Post

    Re: Generating JAXB classes from XSD- class not found exception

    ‏2013-06-20T18:31:55Z  

    Hello,

       I had the same problem and resolved as follows...

       1. project facet of the project properties.

           1. runtimes tab -> selected Websphere Application Server 7.0

            2. Java Version 1.6(can change to higher if required for ur project)

            3. Enable -> Webspher Web(Co-existence) 7.0

             4. Enable -> Websphere Web(Extended)  7.0

    2. right click on xsd file Generate > Jaxb classes  worked like a charm

       

    Thanks

    Sadhana