tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Luis Rivera" <luiggii...@gmail.com>
Subject Re: java.lang.LinkageError: Class soap/xsd/CompanyInfo violates loader constraints
Date Mon, 24 Jul 2006 09:18:48 GMT
      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.

Martin:
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?

Raju:

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
catalina.properties directory. Let me just try to illustrate what I am
trying to do:

CRLImpl.java: Entry point, file generated by WSDL2Java (inside
webapps/axis/WEB-INF/classes)

     void getCompany(CompanyInfoHolder company, StringHolder result)
     {
           crl.nada(company, result);
     }

jniCRLimpl.java: 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 jniCRLimpl.java 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 <raju.balugu@gmail.com> 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
> catalina.properties(/conf).It may solve ur problem?please let me know
> server configuration too.
>
> Regards
> Raju
>
>
> On 7/24/06, Luis Rivera <luiggiilca@gmail.com> 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
> > solved.
> >
> >   Thanks in advance,
> >   --Luis R.
> >
> > On 7/23/06, Martin Gainty <mgainty@hotmail.com > wrote:
> > >
> > > Luis please post this email and your WSDL to axis-user@ws.apache.org
> > > 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" < luiggiilca@gmail.com>
> > > To: <users@tomcat.apache.org>
> > > Sent: Sunday, July 23, 2006 8:03 AM
> > > Subject: java.lang.LinkageError : Class soap/xsd/CompanyInfo violates
> > > loader constraints
> > >
> > >
> > > >   HELP PLEASE, PLEASE PLEASE,
> > > >
> > > >   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(
> > > > NativeMethodAccessorImpl.java:39)^M
> > > >        at sun.reflect.DelegatingMethodAccessorImpl.invoke (
> > > > DelegatingMethodAccessorImpl.java:25)^M
> > > >        at java.lang.reflect.Method.invoke(Method.java:585)^M
> > > >        at org.apache.axis.providers.java.RPCProvider.invokeMethod (
> > > > RPCProvider.java:397)^M
> > > >        at org.apache.axis.providers.java.RPCProvider.processMessage(
> > > > RPCProvider.java:186)^M
> > > >        at org.apache.axis.providers.java.JavaProvider.invoke(
> > > > JavaProvider.java:323)^M
> > > >        at org.apache.axis.strategies.InvocationStrategy.visit(
> > > > InvocationStrategy.java:32)^M
> > > >        at org.apache.axis.SimpleChain.doVisiting(SimpleChain.java:118)^M
> > > >        at org.apache.axis.SimpleChain.invoke(SimpleChain.java :83)^M
> > > >        at org.apache.axis.handlers.soap.SOAPService.invoke(
> > > SOAPService.java
> > > > :454)^M
> > > >        at org.apache.axis.server.AxisServer.invoke(AxisServer.java
> > > :281)^M
> > > >        at org.apache.axis.transport.http.AxisServlet.doPost (
> > > > AxisServlet.java:699)^M
> > > >        at javax.servlet.http.HttpServlet.service (HttpServlet.java
> > :709)^M
> > > >        at org.apache.axis.transport.http.AxisServletBase.service(
> > > > AxisServletBase.java:327)^M
> > > >        at javax.servlet.http.HttpServlet.service (HttpServlet.java
> > > :802)^M
> > > >        at
> > > org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(
> > > > ApplicationFilterChain.java:252)^M
> > > >        at org.apache.catalina.core.ApplicationFilterChain.doFilter (
> > > > ApplicationFilterChain.java :173)^M
> > > >        at org.apache.catalina.core.StandardWrapperValve.invoke(
> > > > StandardWrapperValve.java:213)^M
> > > >        at org.apache.catalina.core.StandardContextValve.invoke (
> > > > StandardContextValve.java:178)^M
> > > >        at org.apache.catalina.core.StandardHostValve.invoke(
> > > > StandardHostValve.java:126)^M
> > > >        at org.apache.catalina.valves.ErrorReportValve.invoke (
> > > > ErrorReportValve.java:105)^M
> > > >        at org.apache.catalina.core.StandardEngineValve.invoke (
> > > > StandardEngineValve.java:107)^M
> > > >        at org.apache.catalina.connector.CoyoteAdapter.service (
> > > > CoyoteAdapter.java:148)^M
> > > >        at org.apache.coyote.http11.Http11Processor.process(
> > > > Http11Processor.java:869)^M
> > > >        at
> > > >
> > >
> > org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection
> > > > (Http11BaseProtocol.java:664)^M
> > > >        at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(
> > > > PoolTcpEndpoint.java:527)^M
> > > >        at
> > org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt (
> > > > LeaderFollowerWorkerThread.java:80)^M
> > > >        at
> > org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(
> > > > ThreadPool.java:684)^M
> > > >        at java.lang.Thread.run (Thread.java :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 (ClassLoader.java:620)^M
> > > >        at java.security.SecureClassLoader.defineClass(
> > > > SecureClassLoader.java:124)^M
> > > >        at java.net.URLClassLoader.defineClass (URLClassLoader.java
> > :260)^M
> > > >        at java.net.URLClassLoader.access$100 (URLClassLoader.java
> > :56)^M
> > > >        at java.net.URLClassLoader$1.run(URLClassLoader.java:195)^M
> > > >        at java.security.AccessController.doPrivileged (Native
> > Method)^M
> > > >        at java.net.URLClassLoader.findClass ( URLClassLoader.java
> > :188)^M
> > > >        at java.lang.ClassLoader.loadClass(ClassLoader.java:306)^M
> > > >        at java.lang.ClassLoader.loadClass (ClassLoader.java:251)^M
> > > >        at java.lang.ClassLoader.loadClassInternal ( ClassLoader.java
> > > :319)^M
> > > >        at vsa.jniCRLimpl.nada(jniCRLimpl.java:100)^M
> > > >        at soap.wsdl.CRLImpl.getCompany (CRLImpl.java:94)^M
> > > >        at soap.wsdl.CRLSkeleton.getCompany(Unknown Source)^M
> > > >        ... 30 more^M
> > > >
> > > > Thanks in advance,
> > > > --Luis R.
> > > >
> >
> >
>

Mime
View raw message