axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dave Dunkin <Dav...@Attachmate.com>
Subject RE: classloader problems
Date Thu, 07 Feb 2002 19:53:38 GMT
Yes, the class is available in the WEB-INF/classes directory, not in the
system classpath.

Dave

-----Original Message-----
From: Sedukhin, Igor [mailto:Igor.Sedukhin@ca.com]
Sent: Thursday, February 07, 2002 7:00 AM
To: axis-dev@xml.apache.org
Subject: RE: classloader problems


Dave,

Are you sure the class it is trying to load (for a _RecordType type
specified in WSDL) is available for a deployed Axis web app? That is, is it
in WEB-INF/classes or in WEB-INF/lib?

Axis is inheriting the servlet classloader provided by the container. That's
the guy that cannot load the class. It won't rely on the system CLASSPATH
for security reasons. You'd have to provide it under a web app. The other
approach is to define your classloader and jump arround Axis with it :).
-- Igor Sedukhin .. (Igor.Sedukhin@ca.com) 
-- (631) 342-4325 .. 1 CA Plaza, Islandia, NY 11788 
-----Original Message-----
From: Dave Dunkin [mailto:DaveDu@Attachmate.com] 
Sent: Wednesday, February 06, 2002 7:07 PM
To: Axis-Dev (E-mail)
Subject: classloader problems


I'm having a problem with axis throwing a ClassNotFoundException when I try
to access a deployed service. It chokes on [Lservice1._RecordType; (see the
attached wsdl). I traced it down to the getLanguageSpecificType method in
WSDDTypeMapping.
    public Class getLanguageSpecificType() 
        throws ClassNotFoundException 
    { 
        if (typeQName != null) { 
            if
(!WSDDConstants.WSDD_JAVA.equals(typeQName.getNamespaceURI())) { 
                throw new ClassNotFoundException(JavaUtils. 
                             getMessage("badTypeNamespace00", 
                                        typeQName.getNamespaceURI(), 
                                        WSDDConstants.WSDD_JAVA)); 
            } 
            String loadName =
JavaUtils.getLoadableClassName(typeQName.getLocalPart()); 
            ClassLoader cl = Thread.currentThread().getContextClassLoader();

            return cl.loadClass(loadName); 
        } 
        
        throw new
ClassNotFoundException(JavaUtils.getMessage("noTypeQName00")); 
    } 
Now if I replace these two lines: 
            ClassLoader cl = Thread.currentThread().getContextClassLoader();

            return cl.loadClass(loadName); 
with this: 
            return Class.forName(loadName); 
everything works. Why is the contex ClassLoader used instead of the default
ClassLoader? 
Here's the full stack trace: 
java.lang.ClassNotFoundException: [Lservice1._RecordType; 
        at
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.jav
a:1307) 
        at
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.jav
a:1156) 
        at
org.apache.axis.deployment.wsdd.WSDDTypeMapping.getLanguageSpecificType(WSDD
TypeMapping.java:230) 
        at
org.apache.axis.deployment.wsdd.WSDDService.deployTypeMapping(WSDDService.ja
va:304) 
        at
org.apache.axis.deployment.wsdd.WSDDService.makeNewInstance(WSDDService.java
:251) 
        at
org.apache.axis.deployment.wsdd.WSDDDeployableItem.getInstance(WSDDDeployabl
eItem.java:294) 
        at
org.apache.axis.deployment.wsdd.WSDDDeployment.getService(WSDDDeployment.jav
a:430) 
        at
org.apache.axis.configuration.FileProvider.getService(FileProvider.java:208)

        at org.apache.axis.AxisEngine.getService(AxisEngine.java:240) 
        at
org.apache.axis.MessageContext.setTargetService(MessageContext.java:414) 
        at org.apache.axis.handlers.http.URLMapper.invoke(URLMapper.java:86)

        at
org.apache.axis.handlers.http.URLMapper.generateWSDL(URLMapper.java:94) 
        at
org.apache.axis.strategies.WSDLGenStrategy.visit(WSDLGenStrategy.java:72) 
        at org.apache.axis.SimpleChain.doVisiting(SimpleChain.java:151) 
        at org.apache.axis.SimpleChain.generateWSDL(SimpleChain.java:137) 
        at
org.apache.axis.server.AxisServer.generateWSDL(AxisServer.java:404) 
        at
org.apache.axis.transport.http.AxisServlet.doGet(AxisServlet.java:287) 
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:740) 
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) 
        at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Application
FilterChain.java:247) 
        at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterCh
ain.java:193) 
        at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.ja
va:243) 
        at
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5
66) 
        at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472) 
        at
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943) 
        at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.ja
va:201) 
        at
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5
66) 
        at
org.apache.catalina.valves.CertificatesValve.invoke(CertificatesValve.java:2
46) 
        at
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5
64) 
        at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472) 
        at
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943) 
        at
org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2344) 
        at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:164
) 
        at
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5
66) 
        at
org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.
java:170) 
        at
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5
64) 
        at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:170
) 
        at
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5
64) 
        at
org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:462) 
        at
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5
64) 
        at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472) 
        at
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943) 
        at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java
:163) 
        at
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5
66) 
        at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472) 
        at
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943) 
        at
org.apache.catalina.connector.http.HttpProcessor.process(HttpProcessor.java:
1011) 
        at
org.apache.catalina.connector.http.HttpProcessor.run(HttpProcessor.java:1106
) 
        at java.lang.Thread.run(Thread.java:496) 
Dave Dunkin 

Mime
View raw message