| Summary: | [Help] problem loading xerces parser under tomcat/help in rcp | ||||||
|---|---|---|---|---|---|---|---|
| Product: | [Eclipse Project] Platform | Reporter: | Francis Upton IV <francisu> | ||||
| Component: | User Assistance | Assignee: | Curtis d'Entremont <curtispd> | ||||
| Status: | RESOLVED WORKSFORME | QA Contact: | |||||
| Severity: | major | ||||||
| Priority: | P3 | CC: | eclipse, hugo.a.garcia, jstuckey, tjwatson | ||||
| Version: | 3.1.1 | ||||||
| Target Milestone: | 3.2 M6 | ||||||
| Hardware: | PC | ||||||
| OS: | Linux | ||||||
| Whiteboard: | |||||||
| Attachments: |
|
||||||
Oh, here is some additional information, looks like the 'cat can't find the Xerces parser, which is causing the WorkingSetManager to fail to load. I have the Xerces parser in a plugin (which contains only Jars). This plugin is in the product/run configuration (and I can successfully use the xerces parser in other places in my app). I stepped through the class loading of Tomcat when it tries to load the parser, and it seems only to look in the classloader associated with the Tomcat bundle. When my app tries to load the xerces parser classes from other places, it loads correctly as the thread contextclassloader is pointing to an Eclipse classloader that is pointing directly to the bundle that has all of my required Jars (including the Xerces parser). How can I get the tomcat plugin to look in my other plugins to find the required Jar files? ApplicationDispatcher[/help] Servlet.service() for servlet org.eclipse.help.internal.webapp.jsp.advanced.searchScoped_jsp threw exception javax.servlet.ServletException: Provider org.apache.xerces.jaxp.DocumentBuilderFactoryImpl not found at org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:536) at org.eclipse.help.internal.webapp.jsp.advanced.searchScoped_jsp._jspService(searchScoped_jsp.java:188) at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:137) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:684) at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:432) at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:356) at org.eclipse.help.internal.webapp.jsp.advanced.search_jsp._jspService(search_jsp.java:57) at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:137) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:256) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643) at org.apache.catalina.valves.CertificatesValve.invoke(CertificatesValve.java:246) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995) at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2422) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643) at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:171) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641) at org.eclipse.tomcat.internal.EclipseErrorReportValve.invoke(EclipseErrorReportValve.java:153) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995) at org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:199) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:828) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:700) at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:584) at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:683) at java.lang.Thread.run(Thread.java:534) ----- Root Cause ----- javax.xml.parsers.FactoryConfigurationError: Provider org.apache.xerces.jaxp.DocumentBuilderFactoryImpl not found at javax.xml.parsers.DocumentBuilderFactory.newInstance(DocumentBuilderFactory.java:99) at org.eclipse.help.internal.workingset.WorkingSetManager.<clinit>(WorkingSetManager.java:44) at org.eclipse.help.internal.base.BaseHelpSystem.getWorkingSetManager(BaseHelpSystem.java:107) at org.eclipse.help.internal.webapp.servlet.WebappWorkingSetManager.<init>(WebappWorkingSetManager.java:42) at org.eclipse.help.internal.webapp.data.SearchData.<init>(SearchData.java:59) at org.eclipse.help.internal.webapp.jsp.advanced.searchScoped_jsp._jspService(searchScoped_jsp.java:65) at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:137) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:684) at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:432) at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:356) at org.eclipse.help.internal.webapp.jsp.advanced.search_jsp._jspService(search_jsp.java:57) at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:137) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:256) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643) at org.apache.catalina.valves.CertificatesValve.invoke(CertificatesValve.java:246) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995) at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2422) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643) at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:171) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641) at org.eclipse.tomcat.internal.EclipseErrorReportValve.invoke(EclipseErrorReportValve.java:153) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995) at org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:199) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:828) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:700) at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:584) at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:683) at java.lang.Thread.run(Thread.java:534) I have a solution to the problem, which is to update the org.eclipse.tomcat plugin manifest.mf file adding the following line: Eclipse-BuddyPolicy: global This allows the plugin to find the parser if it's anywhere. Has anyone looked at this? Since the fix is so simple, it would be nice to get it into a release. Thanks, Francis Just to better understand the problem - is it that your JRE doesn't provide an XML parser implementation, and that you instead provide it via another plugin that the tomcat plugin does not depend on? Because I'm using the Xerces parser in other places in my process, the help plugin wants to use it as well. However, it can't find it. I do provide the Xerces parser in one of my plugins. This will allow it to find the parser whereever it is. Thanks for scheduling this! Fix applied. The fix for this has brought forth another bug, the opposite problem. If you have a commons logging jar tomcat will find that one instead of its own (which appears to be incompatible). The fix is causing more problems than it is fixing, and also I've just learned that using the global buddy policy is highly discouraged. For these reasons I am rolling back. Francis, can you find an alternative solution ? How is the xerces parser configured to be the global one used by everyone? Are you setting some system property that tells JAXP to use xerces e.g.
javax.xml.parsers.DocumentBuilderFactory =
org.apache.xerces.jaxp.DocumentBuilderFactoryImpl
I'm not sure why this is only causing problems for help. I would expect the extension registry implementation to have similar issues when getting a parser.
wow, you're TJ Watson?
This is what I do:
System.setProperty("javax.xml.parsers.DocumentBuilderFactory",
"org.apache.xerces.jaxp.DocumentBuilderFactoryImpl");
System.setProperty("javax.xml.parsers.SAXParserFactory",
"org.apache.xerces.jaxp.SAXParserFactoryImpl");
I don't have any other problems; it seems to parse the configuration files just fine. Is there another way I should be setting things up so that I can use the Xerces parser when I parse XML and have eclipse work properly?
Created attachment 35719 [details]
example bundle
I am a TJ Watson, but not THE TJ Watson ;-)
I would suggest you use a
/META-INF/services/javax.xml.parsers.SAXParserFactory or
/META-INF/services/javax.xml.parsers.DocumentBuilderFactory.
file in your bundle with the xerces parser to configure xerces for your bundle. The only requirement is that this file available on your Bundle-Classpath. Attached is a simple example.
Just a wild guess but will using the tomcat 5.x series instead of the 4.x series remove the diferrences in the logging libs? (In reply to comment #11) > Just a wild guess but will using the tomcat 5.x series instead of the 4.x > series remove the diferrences in the logging libs? Probably, but the logging lib problem should have gone away after we rolled back the proposed fix to this one. It was causing Tomcat to use the logging from another plugin, but that logging was incompatible and it was failing to start. (In reply to comment #12) > Probably, but the logging lib problem should have gone away after we rolled > back the proposed fix to this one. I confirmed that the problem went away in the latest integration build I20060315-1200 -H Francis, did Tom's suggestion solve your problem? Yes, it certainly did, sorry I did not get a chance to try it sooner. Thanks Tom. You can close this one. Thanks. Closing. |
This is running an RCP application and trying to use help. I include the plugins required by help (ant, lucene, tomcat, and the 5 helps), in my product definition as well as in the run configuration. I get this error when starting up help (which also says at the top of the help browser "There was an error in your action"). It is failing on this line in BaseHelpSystem.java: public static synchronized WorkingSetManager getWorkingSetManager() { if (getInstance().workingSetManager == null) { >>>> getInstance().workingSetManager = new WorkingSetManager(); } return getInstance().workingSetManager; } Looks like it is having trouble creating the WorkingSetManager. Note this occurs with my eclipse application both on Windows and Linux. I start up help like this: window.getWorkbench().getHelpSystem().displayHelpResource("/com.oaklandsw.transform.doc/help/index.html"); There is nothing in the jre/lib/ext directory (that was not installed with the JRE, which is 1.4.2_09). Here is the error: StandardWrapperValve[org.eclipse.help.internal.webapp.jsp.advanced.searchView_jsp]: Servlet.service() for servlet org.eclipse.help.internal.webapp.jsp.advanced.searchView_jsp threw exception javax.servlet.ServletException at org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:536) at org.eclipse.help.internal.webapp.jsp.advanced.searchView_jsp._jspService(searchView_jsp.java:225) at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:137) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:256) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643) at org.apache.catalina.valves.CertificatesValve.invoke(CertificatesValve.java:246) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995) at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2422) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643) at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:171) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641) at org.eclipse.tomcat.internal.EclipseErrorReportValve.invoke(EclipseErrorReportValve.java:153) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995) at org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:199) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:828) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:700) at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:584) at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:683) at java.lang.Thread.run(Thread.java:534) ----- Root Cause ----- java.lang.NoClassDefFoundError at org.eclipse.help.internal.base.BaseHelpSystem.getWorkingSetManager(BaseHelpSystem.java:107) at org.eclipse.help.internal.webapp.servlet.WebappWorkingSetManager.<init>(WebappWorkingSetManager.java:42) at org.eclipse.help.internal.webapp.data.SearchData.<init>(SearchData.java:59) at org.eclipse.help.internal.webapp.jsp.advanced.searchView_jsp._jspService(searchView_jsp.java:66) at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:137) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:256) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643) at org.apache.catalina.valves.CertificatesValve.invoke(CertificatesValve.java:246) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995) at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2422) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643) at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:171) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641) at org.eclipse.tomcat.internal.EclipseErrorReportValve.invoke(EclipseErrorReportValve.java:153) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995) at org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:199) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:828) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:700) at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:584) at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:683) at java.lang.Thread.run(Thread.java:534)