tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Martin Gainty" <>
Subject Re: java.lang.LinkageError: Class soap/xsd/CompanyInfo violates loader constraints
Date Mon, 24 Jul 2006 13:21:00 GMT
Good Morning Luis-

I fed your WSDL into validator located here
so ..the good news is that the definition for companyInfo looks valid

ClassLoader delegation-
Straight from the doc at

"Servlet specification recommends that the Web Classloader look in the local class loader
before delegating to its parent. To make the Web Classloader follow the delegation model in
the Servlet specification, set delegate="false" in the class-loader element of the sun-web.xml
file. It's safe to do this only for a web module that does not interact with any other modules."
"The default value is delegate="true", which causes the Web Classloader to delegate in the
same manner as the other classloaders. Use delegate="true" for a web application that accesses
EJB components or that acts as a web service client or endpoint. For details about sun-web.xml,
see The sun-web.xml File."

from the doc if your webapp is standalone set delegate = false
If it's accessing EJB components or is a webservice client and or endpoint delegate = true
I defer to the sun application server site for accuracy on configuration and installation

I *assume* you are attempting to build and configure your own mod_jk worker?
This is system related stuff which assumes you are backing up your current installation beforehand
and using Platform specific utilities (cl/gcc/iSeries) to essentially make your platform-specific
The important point here is to use the platform specific install/configuration/compile scripts
which are blesses by the platform's vendor-


This email message and any files transmitted with it contain confidential
information intended only for the person(s) to whom this email message is
addressed.  If you have received this email message in error, please notify
the sender immediately by telephone or email and destroy the original
message without making a copy.  Thank you.

  ----- Original Message ----- 
  From: Luis Rivera 
  To: Raju Balugu 
  Cc: Tomcat Users List 
  Sent: Monday, July 24, 2006 5:18 AM
  Subject: Re: java.lang.LinkageError: Class soap/xsd/CompanyInfo violates loader constraints

        Dear Raju and Martin,

  First of all, thanks a lot for the replies. I do appreciate it. I am including the WSDL
so you can take a look if you have a chance. I will post it over the axis lists very soon.

  1) I don't think it is the WSDL, because as you could appreciate in the WSDL, it is defined.
Also, if I have all the application inside webapps/axis/WEB-INF/classes, it works! But as
soon as I take the class that load the JNI DLL to the common/classes or shared/classes directories,
then I run into the trouble with the class loaders. First I noticed that the errors were due
to classes I did not copy to the common directory (CompanyInfo), so I did and the error changed
to what LinkageError. 

  2) Regarding the class loading model. I understand why it is recommended, but is it possible
to change it? The reason I ask is because I found on the web an email from a guy with the
same exception, but using  J2EE and he said that by setting the delegation to true in the
sun-web.xml file, the problem was solved!!!

  3) Could you let me know which libraries are you talking about? The bootstrap.jar file under
the TOMCAT_HOME/bin directory?


  I am using the common/classes, after migrating from the shared/classes directory, thinking
that might solve the problem, but no luck. Both of those directories are defined for the common
and shared loader respectively in the directory. Let me just try to illustrate
what I am trying to do: Entry point, file generated by WSDL2Java (inside webapps/axis/WEB-INF/classes)

       void getCompany(CompanyInfoHolder company, StringHolder result) 
             crl.nada(company, result);
       } jni wrapper that will load the crl.DLL library (inside common/classes)

       void nada(CompanyInfoHolder company, StringHolder result) 
            company.value = new soap.xsd.CompanyInfo(); // The problem comes here !!!

  This exact same code, works if all is located under webapps/axis/WEB-INF/classes, but as
the TOMCAT documentation lets me know, I have to take the to the shared or
common directory to prevent TOMCAT from trying to load my DLL more than once.

     Thanks again and in advance for any pointer you all can give me,
     --Luis R.

  On 7/23/06, Raju Balugu <> wrote:
    Hi ,

    How you are loading the outside(which are not there in classpath) jars and classes in
tomcat? try to load the outside jar and class files from the
may solve ur problem?please let me know server configuration too. 


    On 7/24/06, Luis Rivera <> wrote: 
        Dear Martin Gainty,

      I have posted this issue on the axis (devs and users) lists, without any 
      luck. I really thought it was because it was a tomcat issue, so I am posting 
      it here. The only thing I have not posted is my WSDL, which I will do, in
      both places. But in case I still have your attention, please let me know if
      you or somebody who reads this know the answer to these questions? 

      Q1) Does this mean this is an axis isseu?

      Q2) Is there a way to change the class loading policy in Tomcat? (I know
      that delegation works under the servel model)

      Q3) Is it true that in Tomcat I need to place the classes that load JNI 
      libraries outside of the webapps directory? If not, then my problem is

        Thanks in advance,
        --Luis R.

      On 7/23/06, Martin Gainty < > wrote:
      > Luis please post this email and your WSDL to
      > Martin --
      > ********************************************************************* 
      > This email message and any files transmitted with it contain confidential
      > information intended only for the person(s) to whom this email message is
      > addressed.  If you have received this email message in error, please 
      > notify
      > the sender immediately by telephone or email and destroy the original
      > message without making a copy.  Thank you.
      > ----- Original Message -----
      > From: "Luis Rivera" <>
      > To: <>
      > Sent: Sunday, July 23, 2006 8:03 AM
      > Subject: java.lang.LinkageError : Class soap/xsd/CompanyInfo violates
      > loader constraints
      > >
      > >   Any tomcat Guru knows what can cause this exception? I need to have
      > some
      > > classes either in shared or common, outside of the webapps directory.
      > This
      > > is causing my a great headache, and only by activating the loggin in the
      > > webapps directory I saw the trace you will see below. I solved all the 
      > > problems of the classloaders not finding the classes, but I don't know
      > how
      > > to solve this one.
      > >
      > > I read in another website that the problem might be the classloading 
      > > delegation, but I don't think Tomcat has a way to change the
      > classloading
      > > delegation model. Besides, I don't believe that would solve it, because
      > I
      > > don't think the problem is that it is not finding the classes, but 
      > something
      > > else ... what constraints and where are they set? I am not using a
      > Security
      > > Manager, so it is not about permissions in the catalina.policy file.
      > >
      > > Here is the full stack trace 
      > >
      > > 27782 [http-8095-Processor25] DEBUG org.apache.axis.enterprise  -
      > Mapping
      > > Exception to AxisFault^M
      > > java.lang.reflect.InvocationTargetException^M
      > >        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)^M
      > >        at sun.reflect.NativeMethodAccessorImpl.invoke(
      > >^M
      > >        at sun.reflect.DelegatingMethodAccessorImpl.invoke (
      > >^M
      > >        at java.lang.reflect.Method.invoke(^M
      > >        at (
      > >^M
      > >        at
      > >^M
      > >        at
      > >^M
      > >        at org.apache.axis.strategies.InvocationStrategy.visit(
      > >^M
      > >        at org.apache.axis.SimpleChain.doVisiting( :118)^M
      > >        at org.apache.axis.SimpleChain.invoke( :83)^M
      > >        at org.apache.axis.handlers.soap.SOAPService.invoke(
      > > :454)^M
      > >        at org.apache.axis.server.AxisServer.invoke(
      > :281)^M
      > >        at org.apache.axis.transport.http.AxisServlet.doPost (
      > >^M
      > >        at javax.servlet.http.HttpServlet.service (^M
      > >        at org.apache.axis.transport.http.AxisServletBase.service(
      > >^M
      > >        at javax.servlet.http.HttpServlet.service ( 
      > :802)^M
      > >        at
      > org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(
      > >^M
      > >        at org.apache.catalina.core.ApplicationFilterChain.doFilter (
      > > :173)^M
      > >        at org.apache.catalina.core.StandardWrapperValve.invoke(
      > >^M
      > >        at org.apache.catalina.core.StandardContextValve.invoke (
      > >^M
      > >        at org.apache.catalina.core.StandardHostValve.invoke(
      > >^M
      > >        at org.apache.catalina.valves.ErrorReportValve.invoke (
      > >^M
      > >        at org.apache.catalina.core.StandardEngineValve.invoke (
      > >^M
      > >        at org.apache.catalina.connector.CoyoteAdapter.service (
      > >^M
      > >        at org.apache.coyote.http11.Http11Processor.process(
      > >^M
      > >        at
      > >
      > org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection

      > > (^M
      > >        at
      > >^M
      > >        at (
      > >^M
      > >        at org.apache.tomcat.util.threads.ThreadPool$
      > >^M
      > >        at ( :595)^M
      > > Caused by: java.lang.LinkageError: Class soap/xsd/CompanyInfo violates
      > > loader constraints^M
      > >        at java.lang.ClassLoader.defineClass1(Native Method)^M
      > >        at java.lang.ClassLoader.defineClass (^M
      > >        at
      > >^M
      > >        at (^M
      > >        at$100 (^M
      > >        at$^M
      > >        at (Native Method)^M
      > >        at (^M
      > >        at java.lang.ClassLoader.loadClass(^M
      > >        at java.lang.ClassLoader.loadClass (^M
      > >        at java.lang.ClassLoader.loadClassInternal (
      > :319)^M
      > >        at vsa.jniCRLimpl.nada(^M
      > >        at soap.wsdl.CRLImpl.getCompany (^M
      > >        at soap.wsdl.CRLSkeleton.getCompany(Unknown Source)^M
      > >        ... 30 more^M
      > >
      > > Thanks in advance,
      > > --Luis R.
      > >


  To start a new topic, e-mail:
  To unsubscribe, e-mail:
  For additional commands, e-mail:
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message