Clicky

I have the following problem.

I made a WebService Client in Netbeans, as far as i have tested it inside netbeans all works right

the problem is when i try to deploy with the jar file, it send me the following exception

Exception in thread "main" java.lang.NoClassDefFoundError: com/sun/xml/ws/api/SA
AJFactory
        at java.lang.ClassLoader.defineClass1(Native Method)
        at java.lang.ClassLoader.defineClass(ClassLoader.java:621)
        at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:12
4)
        at java.net.URLClassLoader.defineClass(URLClassLoader.java:260)
        at java.net.URLClassLoader.access$000(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:307)
        at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:252)
        at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)
        at weblogic.wsee.jaxws.WLSContainer.<clinit>(WLSContainer.java:136)
        at weblogic.wsee.jaxws.spi.WLSProvider.<clinit>(WLSProvider.java:67)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)

        at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstruct
orAccessorImpl.java:39)
        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingC
onstructorAccessorImpl.java:27)
        at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
        at java.lang.Class.newInstance0(Class.java:355)
        at java.lang.Class.newInstance(Class.java:308)
        at javax.xml.ws.spi.FactoryFinder.newInstance(FactoryFinder.java:31)
        at javax.xml.ws.spi.FactoryFinder.find(FactoryFinder.java:90)
        at javax.xml.ws.spi.Provider.provider(Provider.java:83)
        at javax.xml.ws.Service.<init>(Service.java:56)
        at com.ixe.obtenerdocumentosimpresion.webservice.Core.<init>(Core.java:5
7)
        at com.ixe.obtenerdocumentosimpresion.webservice.LlamadaServicioWeb.<ini
t>(LlamadaServicioWeb.java:58)
        at com.ixe.obtenerdocumentosimpresion.entrada.Programa.main(Programa.jav
a:58)
Caused by: java.lang.ClassNotFoundException: com.sun.xml.ws.api.SAAJFactory
        at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
        at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:252)
        at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)
        ... 27 more

i have seached for a reference like that in the libraries, but so far i havent found any, can you help please

asked 03/22/2010 04:34

Gerrard85's gravatar image

Gerrard85 ♦♦


4 Answers:
where are u trying to deploy with the jar file? is it a web application or a normal java application.

By default java 6 has saaj in the lib. so only I am asking the above question, just make sure you are running the app on java 6
link
shivaspk's gravatar image

shivaspk

Im trying to deploy it as a normal java application. The application connects to a JNDI in weblogic to obtain the data and then calls the webservice for processing.

As a related note, i recently found that if i remove the weblogic.jar from the classpath the call to the web service works fine. But when i try to use the wlclient.jar in substitution of weblogic.jar sends the following exception

Exception in thread "main" java.lang.ClassCastException: java.lang.Object cannot be cast to java.io.Serializable
        at weblogic.iiop.IIOPOutputStream.writeAny(IIOPOutputStream.java:1588)
        at weblogic.iiop.IIOPOutputStream.writeObject(IIOPOutputStream.java:2231)
        at weblogic.utils.io.ObjectStreamClass.writeFields(ObjectStreamClass.java:413)
        at weblogic.corba.utils.ValueHandlerImpl.writeValueData(ValueHandlerImpl.java:235)
        at weblogic.corba.utils.ValueHandlerImpl.writeValueData(ValueHandlerImpl.java:225)
        at weblogic.corba.utils.ValueHandlerImpl.writeValue(ValueHandlerImpl.java:182)
        at weblogic.iiop.IIOPOutputStream.write_value(IIOPOutputStream.java:1963)
        at weblogic.iiop.IIOPOutputStream.write_value(IIOPOutputStream.java:2001)
        at weblogic.iiop.IIOPOutputStream.writeObject(IIOPOutputStream.java:2266)
        at weblogic.jdbc.common.internal.RmiDataSource_WLSkel.invoke(Unknown Source)
        at weblogic.rmi.internal.BasicServerRef.invoke(BasicServerRef.java:589)
        at weblogic.rmi.cluster.ClusterableServerRef.invoke(ClusterableServerRef.java:230)
        at weblogic.rmi.internal.BasicServerRef$1.run(BasicServerRef.java:477)
        at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:363)
        at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:147)
        at weblogic.rmi.internal.BasicServerRef.handleRequest(BasicServerRef.java:473)
        at weblogic.rmi.internal.wls.WLSExecuteRequest.run(WLSExecuteRequest.java:118)
        at weblogic.work.ExecuteThread.execute(ExecuteThread.java:201)
        at weblogic.work.ExecuteThread.run(ExecuteThread.java:173)

and in the log of weblogic appears the following exception

Exception in thread "main" java.lang.ClassCastException: java.lang.Object cannot be cast to java.io.Serializable
        at weblogic.iiop.IIOPOutputStream.writeAny(IIOPOutputStream.java:1588)
        at weblogic.iiop.IIOPOutputStream.writeObject(IIOPOutputStream.java:2231)
        at weblogic.utils.io.ObjectStreamClass.writeFields(ObjectStreamClass.java:413)
        at weblogic.corba.utils.ValueHandlerImpl.writeValueData(ValueHandlerImpl.java:235)
        at weblogic.corba.utils.ValueHandlerImpl.writeValueData(ValueHandlerImpl.java:225)
        at weblogic.corba.utils.ValueHandlerImpl.writeValue(ValueHandlerImpl.java:182)
        at weblogic.iiop.IIOPOutputStream.write_value(IIOPOutputStream.java:1963)
        at weblogic.iiop.IIOPOutputStream.write_value(IIOPOutputStream.java:2001)
        at weblogic.iiop.IIOPOutputStream.writeObject(IIOPOutputStream.java:2266)
        at weblogic.jdbc.common.internal.RmiDataSource_WLSkel.invoke(Unknown Source)
        at weblogic.rmi.internal.BasicServerRef.invoke(BasicServerRef.java:589)
        at weblogic.rmi.cluster.ClusterableServerRef.invoke(ClusterableServerRef.java:230)
        at weblogic.rmi.internal.BasicServerRef$1.run(BasicServerRef.java:477)
        at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:363)
        at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:147)
        at weblogic.rmi.internal.BasicServerRef.handleRequest(BasicServerRef.java:473)
        at weblogic.rmi.internal.wls.WLSExecuteRequest.run(WLSExecuteRequest.java:118)
        at weblogic.work.ExecuteThread.execute(ExecuteThread.java:201)
        at weblogic.work.ExecuteThread.run(ExecuteThread.java:173)

yes, i have already checked that the weblogic.jar and wlclient.jar are obtained from the installation of weblogic
link
Gerrard85's gravatar image

Gerrard85

The problem is with the Class loading, Web logic has a default implementation of SAAJ and those jars load first, long back when I tried using eclipse I had a similar problem fixed it bu tweaking pre_classpath element in one of the configuration batch files.
link
shivaspk's gravatar image

shivaspk

This question has been classified as abandoned and is closed as part of the Cleanup Program. See the recommendation for more details.
link
mwvisa1's gravatar image

mwvisa1

Your answer
[hide preview]

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Tags:

×141
×11
×5
×2
×1

Asked: 03/22/2010 04:34

Seen: 1042 times

Last updated: 10/06/2011 09:20