cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alexander Klimetschek <alexander.klimetsc...@mindquarry.com>
Subject Problem with JAXP and shielding (was Re: Shielded class loading between blocks)
Date Wed, 22 Nov 2006 10:08:34 GMT
Alexander Klimetschek schrieb:
> IMHO this might happen any time again and having the flexibility of 
> classloading in Java is perfect for solving those problems. I have 
> implemented that shielded groups stuff in the old 
> BootstrapClassLoaderManager, right now, I am writing on a 
> ShieldingBlockServlet as a proof of concept and to be up-to-date with 
> the cocoon trunk.

The new ShieldingBlockServlet works except for one annoying thing: when 
serving JSPs I get this exception:

java.lang.ClassCastException: 
org.apache.xerces.jaxp.DocumentBuilderFactoryImpl

(see full stacktrace below at the end of the mail).

This actually worked before when I used the shielding classloading stuff 
from cocoon-bootstrap, i.e. exactly the same shielded classloading code 
as used for the shielding of cocoon, only with an additional lib/ 
directory inside the block.

Now I have a ShieldingBlockServlet which is like the current 
o.a.c.maven.deployer.servlet.ShieldingServlet and it uses the 
o.a.c.classloader.DefaultClassLoader, which is setup only with lib and 
classes directory from the block (well, this might be different to the 
previous case, where also the standard WEB-INF/lib etc. were set, but 
IIRC they couldn't be found anyway, since they were looked up from the 
BlockContext).

The classloader hierarchy also seems to be ok, my DefaultClassLoader has 
the o.a.c.maven.deployer.servlet.ShieldedClassLoader as parent and that 
one has the WebappClassLoader as its parent.

With a look at Carsten ;-), what could be wrong?


Alex


The full stacktrace:

java.lang.ClassCastException: 
org.apache.xerces.jaxp.DocumentBuilderFactoryImpl
	at 
javax.xml.parsers.DocumentBuilderFactory.newInstance(DocumentBuilderFactory.java:98)
	at 
org.apache.jasper.xmlparser.ParserUtils.parseXMLDocument(ParserUtils.java:188)
	at 
org.apache.jasper.compiler.JspConfig.processWebDotXml(JspConfig.java:110)
	at org.apache.jasper.compiler.JspConfig.init(JspConfig.java:282)
	at org.apache.jasper.compiler.JspConfig.findJspProperty(JspConfig.java:347)
	at org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:220)
	at org.apache.jasper.compiler.Compiler.compile(Compiler.java:620)
	at org.apache.jasper.compiler.Compiler.compile(Compiler.java:602)
	at 
org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:618)
	at 
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:329)
	at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:440)
	at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:335)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
	at 
org.apache.cocoon.components.jsp.JSPEngineImpl.executeJSP(JSPEngineImpl.java:74)
	at org.apache.cocoon.reading.JSPReader.generate(JSPReader.java:115)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:585)
	at 
org.apache.cocoon.core.container.spring.avalon.PoolableFactoryBean$ProxyHandler.invoke(PoolableFactoryBean.java:349)
	at $Proxy5.generate(Unknown Source)
	at 
org.apache.cocoon.components.pipeline.AbstractProcessingPipeline.processReader(AbstractProcessingPipeline.java:649)
	at 
org.apache.cocoon.components.pipeline.AbstractProcessingPipeline.process(AbstractProcessingPipeline.java:429)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:585)
	at 
org.apache.cocoon.core.container.spring.avalon.PoolableFactoryBean$ProxyHandler.invoke(PoolableFactoryBean.java:349)
	at $Proxy4.process(Unknown Source)
	at 
org.apache.cocoon.components.treeprocessor.sitemap.ReadNode.invoke(ReadNode.java:94)
	at 
org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes(AbstractParentProcessingNode.java:55)
	at 
org.apache.cocoon.components.treeprocessor.sitemap.MatchNode.invoke(MatchNode.java:87)
	at 
org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes(AbstractParentProcessingNode.java:77)
	at 
org.apache.cocoon.components.treeprocessor.sitemap.PipelineNode.invoke(PipelineNode.java:152)
	at 
org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes(AbstractParentProcessingNode.java:77)
	at 
org.apache.cocoon.components.treeprocessor.sitemap.PipelinesNode.invoke(PipelinesNode.java:93)
	at 
org.apache.cocoon.components.treeprocessor.ConcreteTreeProcessor.process(ConcreteTreeProcessor.java:239)
	at 
org.apache.cocoon.components.treeprocessor.ConcreteTreeProcessor.process(ConcreteTreeProcessor.java:170)
	at 
org.apache.cocoon.components.treeprocessor.TreeProcessor.process(TreeProcessor.java:232)
	at 
org.apache.cocoon.servlet.RequestProcessor.process(RequestProcessor.java:397)
	at 
org.apache.cocoon.servlet.RequestProcessor.service(RequestProcessor.java:162)
	at org.apache.cocoon.sitemap.SitemapServlet.service(SitemapServlet.java:61)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
	at 
org.apache.cocoon.blocks.BlockContext$PathDispatcher.forward(BlockContext.java:529)
	at 
org.apache.cocoon.blocks.BlockContext$PathDispatcher.forward(BlockContext.java:511)
	at 
org.apache.cocoon.blocks.ShieldingBlockServlet.service(ShieldingBlockServlet.java:136)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
	at 
org.apache.cocoon.blocks.DispatcherServlet.service(DispatcherServlet.java:127)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
	at 
org.apache.cocoon.maven.deployer.servlet.ShieldingServlet.service(ShieldingServlet.java:95)
	at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:445)
	at 
org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1050)
	at 
com.mindquarry.webapp.servlet.AuthenticationFilter.doFilter(AuthenticationFilter.java:216)
	at 
org.apache.cocoon.maven.deployer.servlet.ShieldingServletFilter.doFilter(ShieldingServletFilter.java:50)
	at 
org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1041)
	at 
org.apache.cocoon.servlet.multipart.MultipartFilter.doFilter(MultipartFilter.java:104)
	at 
org.apache.cocoon.maven.deployer.servlet.ShieldingServletFilter.doFilter(ShieldingServletFilter.java:50)
	at 
org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1041)
	at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:354)
	at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:226)
	at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:627)
	at 
org.mortbay.jetty.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:149)
	at 
org.mortbay.jetty.handler.HandlerCollection.handle(HandlerCollection.java:123)
	at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:141)
	at org.mortbay.jetty.Server.handle(Server.java:269)
	at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:430)
	at 
org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:687)
	at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:492)
	at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:199)
	at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:339)
	at 
org.mortbay.jetty.nio.HttpChannelEndPoint.run(HttpChannelEndPoint.java:270)
	at 
org.mortbay.thread.BoundedThreadPool$PoolThread.run(BoundedThreadPool.java:475)



-- 
Alexander Klimetschek
http://www.mindquarry.com


Mime
View raw message