• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

WSAD Relies on PARENT_FIRST classloading to support webservices

 
Ed Wallen
Ranch Hand
Posts: 34
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
FYI...........Using IBM's WSAD 5.1.1, when deploying and running a webservice that exposes a value object that is referenced from your web project (i.e. exists in a utility project or EJB project), the web project has to be running in a classloader mode of PARENT_FIRST. This is because WSAD will generate the source code of your value object and keep this generated copy in the web project. A linkage error will result similar to the one below:


[2/18/05 9:29:05:508 EST] 134a6e90 WebServicesSe E com.ibm.ws.webservices.engine.transport.http.WebServicesServlet WSWS3227E: Error: Exception:
[2/18/05 9:29:05:528 EST] 134a6e90 WebServicesSe E com.ibm.ws.webservices.engine.transport.http.WebServicesServlet TRAS0014I: The following exception was logged WebServicesFault
faultCode: Server.generalException
faultString: java.lang.LinkageError: LinkageError while defining class: MyValueObject
Could not be defined due to: Class MyValueObject violates loader constraints: parent and child already loaded different classes
This is often caused by having a class defined at multiple
locations within the classloader hierarchy. Other potential causes
include compiling against an older or newer version of the class
that has an incompatible method signature.
Dumping the current context classloader hierarchy:
==> indicates defining classloader
[0]
com.ibm.ws.classloader.CompoundClassLoader@5655ae95
Local ClassPath: C:\ccview\working\webservice\WebServiceTestWeb\WebContent\WEB-INF\classes;C:\ccview\working\webservice\WebServiceTestWeb\WebContent;
Delegation Mode: PARENT_LAST
==>[1] com.ibm.ws.classloader.JarClassLoader@1447161493 Local Classpath: C:\ccview\working\webservice\WebServiceTestCore\classes; Delegation mode: PARENT_FIRST
[2] com.ibm.ws.classloader.ExtJarClassLoader@827125396 Local ClassPath: C:\Program Files\IBM\WebSphere Studio\Application Developer\v5.1\runtimes\base_v5\lib\app; Delegation Mode: PARENT_LAST
[3] com.ibm.ws.classloader.ProtectionClassLoader@b8e2e94
[4] com.ibm.ws.bootstrap.ExtClassLoader@4f6bee9c
[5] sun.misc.Launcher$AppClassLoader@4c9cee9c
[6] sun.misc.Launcher$ExtClassLoader@4c99ae9c
---Original exception---
java.lang.LinkageError: Class MyValueObject violates loader constraints: parent and child already loaded different classes
at java.lang.ClassLoader.defineClass0(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java(Compiled Code))
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java(Compiled Code))
at com.ibm.ws.classloader.CompoundClassLoader._defineClass(CompoundClassLoader.java:446)
at com.ibm.ws.classloader.CompoundClassLoader.findClass(CompoundClassLoader.java:396)
at com.ibm.ws.classloader.CompoundClassLoader.loadClass(CompoundClassLoader.java:300)
at java.lang.ClassLoader.loadClass(ClassLoader.java(Compiled Code))
 
Balaji Loganathan
author and deputy
Bartender
Posts: 3150
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to Javaranch Ed
We have one little and simple policy here...that is "the display name", could you please change your display name according to this name policy.
Thanks.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic