View Full Version : xerces error when opening Spring Beans View
grishester
Oct 5th, 2006, 01:29 PM
Hi everybody,
I am new to Spring Framework and I thought that working with Eclipse and Spring-IDE would be the best way to understand Spring MVC.
I have downloaded the last version of Spring IDE (version 1.3.4) directly from the Spring IDE Update Site. Until here, no problem :)
I made a Dynamic Web project with a servlet named springservlet so I defined my Spring Servlet Config file, springservlet-servlet.xml in my WEB-INF directory. I then added the Spring Nature to my project and set my springservlet-servlet.xml as a Spring Beans configuration file.
The problem is that, when I open the Spring Beans View (Window/Show View/Other/Spring/Spring Beans) and that I try to see the beans, my IDE generates an error:
org.apache.xerces.parsers.XIncludeAwareParserConfi guration :(
I send you the screenshot of the problem.
Anyone can help me to solve it?
Thanks very much.
Torsten Juergeleit
Oct 5th, 2006, 02:48 PM
To track down your problem we need more information:
Which Eclipse environment (plain Eclipse, Callisto, WSAD, RAD, ...)?
Which JDK vendor and version (SUN, IBM)? Some JVM's are shipping with a broken XML parser.
What errors are listed in Eclipse's error log?
Information 1 and 2 are available via "Help > About > Configuration Details".
Information 3 is available via "Window > Show View > Other... > PDE Runtime > Error Log".
Torsten
grishester
Oct 5th, 2006, 03:53 PM
Hi,
thanks very much for your answer.
Here are the answers to your questions:
1. Plain Eclipse,
Eclipse SDK
Version: 3.2.1
Build id: M20060921-0945
2. SDK : Sun 1.5
java.vendor=Sun Microsystems Inc.
java.vendor.url=http://java.sun.com/
java.version=1.5.0_06
java.vm.info=mixed mode
java.vm.name=Java HotSpot(TM) Client VM
java.vm.specification.name=Java Virtual Machine Specification
java.vm.specification.vendor=Sun Microsystems Inc.
java.vm.specification.version=1.0
java.vm.vendor=Sun Microsystems Inc.
java.vm.version=1.5.0_06-b05
3. In the Error Log, nothing is said about this org.apache.xerces.parsers.XIncludeAwareParserConfi guration. In the .log there appears no error.
The error only appears in the Spring Beans View and nothing else appears (no validation errors ...)
Thank you for telling me anything you need.
Torsten Juergeleit
Oct 5th, 2006, 04:05 PM
Are you using any special XML feature (e.g. XML include) in your beans config file?
Any chance to attach the offending XML file?
Torsten
grishester
Oct 5th, 2006, 04:15 PM
Sure, I send you the file.
The thing is that is gives the same error with the Spring PetClinic XMLs ...
Thanks,
Julien
Torsten Juergeleit
Oct 5th, 2006, 05:21 PM
The thing is that is gives the same error with the Spring PetClinic XMLs ...
This would be my next question :)
Ok, then there seems to be an issue with your JDK or Eclipse configuration regarding the Xerces XML parser internally used by Spring IDE. With Spring IDE the Xerces jar files are shipped in the "org.springframework.ide.eclipse.core" plugin.
Do you have an older version of Xerces in the JVM's extension directory like this guy (http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6337684)?
Or do you use the JVM's endorsed mechanism (e.g. via the system property "-Djava.endorsed.dirs=<path-to-your-xerces-jars-folder>") to bring your own version of Xerces? You should check your Eclipse start parameters e.g. for stuff like "eclipse.exe -vmargs -Djava.endorsed.dirs=<path-to-your-xerces-jars-folder>".
Please attach the complete output of "Help > About > Configuration Details".
Torsten
grishester
Oct 5th, 2006, 05:30 PM
Hi,
Thanks so much for your help, I send you the eclipse.ini and the config details.
Julien
Torsten Juergeleit
Oct 6th, 2006, 04:47 PM
I send you the eclipse.ini and the config details.
I didn't found anything suspicious in these file.
But meanwhile Spring IDE 1.3.5 (http://springide.org/project/wiki/ChangeLog) was released. Here the embedded Xerces XML parser was updated to version 2.8.1. Maybe this version doesn't interfer with the "other" version found on your classpath anymore.
Additionally any exception catched during initialization of the Xerces DOMParser instance is written to Eclipse's error log (Window > Show View > Other... > PDE Runtime > Error Log). Maybe this will give us new information regarding your Xerces issues.
So give it a try :)
Torsten
grishester
Oct 6th, 2006, 05:30 PM
Hi,
it still does not work, event with Sprind IDE 1.3.5, dear friend.
But here is the trace in the error.log:
eclipse.buildId=M20060921-0945
java.version=1.5.0_06
java.vendor=Sun Microsystems Inc.
BootLoader constants: OS=win32, ARCH=x86, WS=win32, NL=es_MX
Command-line arguments: -os win32 -ws win32 -arch x86
Error
Fri Oct 06 17:23:37 CDT 2006
Internal Error
org.springframework.ide.eclipse.beans.core.BeanDef initionException: org.apache.xerces.parsers.XIncludeAwareParserConfi guration
java.lang.ClassCastException: org.apache.xerces.parsers.XIncludeAwareParserConfi guration
at org.apache.xerces.parsers.DOMParser.<init>(Unknown Source)
at org.apache.xerces.parsers.DOMParser.<init>(Unknown Source)
at org.springframework.ide.eclipse.core.io.xml.LineNu mberPreservingDOMParser.<init>(LineNumberPreservingDOMParser.java:46)
at org.springframework.ide.eclipse.beans.core.interna l.parser.EventBeanDefinitionReader.getDomParser(Ev entBeanDefinitionReader.java:204)
at org.springframework.ide.eclipse.beans.core.interna l.parser.EventBeanDefinitionReader.loadBeanDefinit ions(EventBeanDefinitionReader.java:117)
at org.springframework.ide.eclipse.beans.core.interna l.parser.EventBeanDefinitionRegistry.loadBeanDefin itions(EventBeanDefinitionRegistry.java:51)
at org.springframework.ide.eclipse.beans.core.interna l.model.BeansConfig.readConfig(BeansConfig.java:35 1)
at org.springframework.ide.eclipse.beans.core.interna l.model.BeansConfig.getBeans(BeansConfig.java:203)
at org.springframework.ide.eclipse.beans.ui.graph.edi tor.GraphEditorInput.createBeansMap(GraphEditorInp ut.java:197)
at org.springframework.ide.eclipse.beans.ui.graph.edi tor.GraphEditorInput.<init>(GraphEditorInput.java:187)
at org.springframework.ide.eclipse.beans.ui.graph.edi tor.GraphEditorInputFactory.createElement(GraphEdi torInputFactory.java:48)
at org.eclipse.ui.internal.EditorReference.getRestore dInput(EditorReference.java:310)
at org.eclipse.ui.internal.EditorReference.getEditorI nput(EditorReference.java:273)
at org.eclipse.ui.internal.EditorReference.createPart Helper(EditorReference.java:534)
at org.eclipse.ui.internal.EditorReference.createPart (EditorReference.java:372)
at org.eclipse.ui.internal.WorkbenchPartReference.get Part(WorkbenchPartReference.java:566)
at org.eclipse.ui.internal.EditorAreaHelper.setVisibl eEditor(EditorAreaHelper.java:263)
at org.eclipse.ui.internal.EditorManager.setVisibleEd itor(EditorManager.java:1446)
at org.eclipse.ui.internal.EditorManager$5.run(Editor Manager.java:1006)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner .java:37)
at org.eclipse.core.runtime.Platform.run(Platform.jav a:843)
at org.eclipse.ui.internal.EditorManager.restoreState (EditorManager.java:1001)
at org.eclipse.ui.internal.WorkbenchPage.restoreState (WorkbenchPage.java:2843)
at org.eclipse.ui.internal.WorkbenchWindow.restoreSta te(WorkbenchWindow.java:1936)
at org.eclipse.ui.internal.Workbench.doRestoreState(W orkbench.java:2857)
at org.eclipse.ui.internal.Workbench.access$14(Workbe nch.java:2805)
at org.eclipse.ui.internal.Workbench$19.run(Workbench .java:1681)
at org.eclipse.ui.internal.Workbench.runStartupWithPr ogress(Workbench.java:1421)
at org.eclipse.ui.internal.Workbench.restoreState(Wor kbench.java:1679)
at org.eclipse.ui.internal.Workbench.access$12(Workbe nch.java:1650)
at org.eclipse.ui.internal.Workbench$17.run(Workbench .java:1529)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner .java:37)
at org.eclipse.ui.internal.Workbench.restoreState(Wor kbench.java:1473)
at org.eclipse.ui.internal.WorkbenchConfigurer.restor eState(WorkbenchConfigurer.java:183)
at org.eclipse.ui.application.WorkbenchAdvisor.openWi ndows(WorkbenchAdvisor.java:702)
at org.eclipse.ui.internal.Workbench.init(Workbench.j ava:1085)
at org.eclipse.ui.internal.Workbench.runUI(Workbench. java:1847)
at org.eclipse.ui.internal.Workbench.createAndRunWork bench(Workbench.java:419)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(Pl atformUI.java:149)
at org.eclipse.ui.internal.ide.IDEApplication.run(IDE Application.java:95)
at org.eclipse.core.internal.runtime.PlatformActivato r$1.run(PlatformActivator.java:78)
at org.eclipse.core.runtime.internal.adaptor.EclipseA ppLauncher.runApplication(EclipseAppLauncher.java: 92)
at org.eclipse.core.runtime.internal.adaptor.EclipseA ppLauncher.start(EclipseAppLauncher.java:68)
at org.eclipse.core.runtime.adaptor.EclipseStarter.ru n(EclipseStarter.java:400)
at org.eclipse.core.runtime.adaptor.EclipseStarter.ru n(EclipseStarter.java:177)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Nativ e Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknow n Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Un known Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.eclipse.core.launcher.Main.invokeFramework(Mai n.java:336)
at org.eclipse.core.launcher.Main.basicRun(Main.java: 280)
at org.eclipse.core.launcher.Main.run(Main.java:977)
at org.eclipse.core.launcher.Main.main(Main.java:952)
If you can help me ... thanks a lot !
Julien
Torsten Juergeleit
Oct 6th, 2006, 07:37 PM
java.lang.ClassCastException: org.apache.xerces.parsers.XIncludeAwareParserConfi guration
This means in your Eclipse environment is definitely somewhere (on the classpath) a different version of Xerces which interfers with the one shipped with Spring IDE. It seems that Xerces uses internally a different classloader (not the Eclipse plugin's ones) to load additional classes, maybe something like
Thread.currentThread().getContextClassLoader().loa dClass(className).newInstance()
This way classes from a different version of Xerces are loaded which results into this ClassCastException. Googl'ing for +Eclipse +ClassCastException +org.apache.xerces.parsers (http://www.google.com/search?num=100&hl=en&lr=&newwindow=1&client=safari&rls=en&q=%2BEclipse+%2BClassCastException+%2Borg.apache.x erces.parsers&btnG=Search) returns plenty of hits (there's a ticket (http://springide.org/project/ticket/176) in Spring IDE bug tracker as well :().
It seems that you have to find the offending version of Xerces.
Maybe you can check with a "clean" version of a JRE (no Xerces stuff in "jre/lib/ext/" or "jre/lib/endorsed") and a "clean" version of Eclipse 3.2 (no other plugin other than Spring IDE).
Torsten
grishester
Oct 7th, 2006, 02:35 PM
Hi,
thank you. I didn't know about the lib/ext, I just knew about the endorsed directory. I deleted the xercesImpl.jar that I had in my JRE's lib/ext and it worked.
Thank you very much,
Julien.
Powered by vBulletin® Version 4.2.1 Copyright © 2013 vBulletin Solutions, Inc. All rights reserved.