Announcement Announcement Module
No announcement yet.
xerces error when opening Spring Beans View Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • xerces error when opening Spring Beans View

    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.

  • #2
    More information required

    To track down your problem we need more information:
    1. Which Eclipse environment (plain Eclipse, Callisto, WSAD, RAD, ...)?
    2. Which JDK vendor and version (SUN, IBM)? Some JVM's are shipping with a broken XML parser.
    3. 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".



    • #3
      I don't find error in the error.log


      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.version=1.5.0_06 mode HotSpot(TM) Client VM Virtual Machine Specification
      java.vm.specification.vendor=Sun Microsystems Inc.
      java.vm.vendor=Sun Microsystems Inc.

      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.


      • #4
        Are you using any special XML feature (e.g. XML include) in your beans config file?

        Any chance to attach the offending XML file?



        • #5

          Sure, I send you the file.

          The thing is that is gives the same error with the Spring PetClinic XMLs ...




          • #6
            Originally posted by grishester View Post
            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?

            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".



            • #7
              INI file and Config details


              Thanks so much for your help, I send you the eclipse.ini and the config details.



              • #8
                Originally posted by grishester View Post
                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 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

                Last edited by Torsten Juergeleit; Oct 6th, 2006, 04:49 PM. Reason: Added link to changelog of the new Spring IDE release


                • #9
                  My error log


                  it still does not work, event with Sprind IDE 1.3.5, dear friend.
                  But here is the trace in the error.log:

                  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

                  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 mberPreservingDOMParser.<init>(LineNumberPreservin
                  at org.springframework.ide.eclipse.beans.core.interna l.parser.EventBeanDefinitionReader.getDomParser(Ev
                  at org.springframework.ide.eclipse.beans.core.interna l.parser.EventBeanDefinitionReader.loadBeanDefinit ions(
                  at org.springframework.ide.eclipse.beans.core.interna l.parser.EventBeanDefinitionRegistry.loadBeanDefin itions(
                  at org.springframework.ide.eclipse.beans.core.interna l.model.BeansConfig.readConfig( 1)
                  at org.springframework.ide.eclipse.beans.core.interna l.model.BeansConfig.getBeans(
                  at org.springframework.ide.eclipse.beans.ui.graph.edi tor.GraphEditorInput.createBeansMap(GraphEditorInp
                  at org.springframework.ide.eclipse.beans.ui.graph.edi tor.GraphEditorInput.<init>( 187)
                  at org.springframework.ide.eclipse.beans.ui.graph.edi tor.GraphEditorInputFactory.createElement(GraphEdi
                  at org.eclipse.ui.internal.EditorReference.getRestore dInput(
                  at org.eclipse.ui.internal.EditorReference.getEditorI nput(
                  at org.eclipse.ui.internal.EditorReference.createPart Helper(
                  at org.eclipse.ui.internal.EditorReference.createPart (
                  at org.eclipse.ui.internal.WorkbenchPartReference.get Part(
                  at org.eclipse.ui.internal.EditorAreaHelper.setVisibl eEditor(
                  at org.eclipse.ui.internal.EditorManager.setVisibleEd itor(
                  at org.eclipse.ui.internal.EditorManager$
                  at .java:37)
                  at a:843)
                  at org.eclipse.ui.internal.EditorManager.restoreState (
                  at org.eclipse.ui.internal.WorkbenchPage.restoreState (
                  at org.eclipse.ui.internal.WorkbenchWindow.restoreSta te(
                  at org.eclipse.ui.internal.Workbench.doRestoreState(W
                  at org.eclipse.ui.internal.Workbench.access$14(Workbe
                  at org.eclipse.ui.internal.Workbench$ .java:1681)
                  at org.eclipse.ui.internal.Workbench.runStartupWithPr ogress(
                  at org.eclipse.ui.internal.Workbench.restoreState(Wor
                  at org.eclipse.ui.internal.Workbench.access$12(Workbe
                  at org.eclipse.ui.internal.Workbench$ .java:1529)
                  at .java:37)
                  at org.eclipse.ui.internal.Workbench.restoreState(Wor
                  at org.eclipse.ui.internal.WorkbenchConfigurer.restor eState(
                  at org.eclipse.ui.application.WorkbenchAdvisor.openWi ndows(
                  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(
                  at org.eclipse.ui.PlatformUI.createAndRunWorkbench(Pl
                  at org.eclipse.core.internal.runtime.PlatformActivato r$
                  at org.eclipse.core.runtime.internal.adaptor.EclipseA ppLauncher.runApplication( 92)
                  at org.eclipse.core.runtime.internal.adaptor.EclipseA ppLauncher.start(
                  at n(
                  at n(
                  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
                  at org.eclipse.core.launcher.Main.basicRun( 280)
                  at org.eclipse.core.launcher.Main.main(

                  If you can help me ... thanks a lot !



                  • #10
                    Originally posted by grishester View Post
                    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 returns plenty of hits (there's a ticket 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).



                    • #11
                      Thanks !


                      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,