This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
I only have a Java source file open, but I get this message when NetBeans (050629) regains focus. I have been getting this message for about a week (I am using nightly builds of NB). I am running: java version "1.5.0_03" Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_03-b07) Java HotSpot(TM) 64-Bit Server VM (build 1.5.0_03-b07, mixed mode) Is there a compelling reason not to use JAXP API instead of Xerces? ---------------- java.lang.ClassCastException: org.apache.xerces.parsers.XML11Configuration at org.apache.xerces.parsers.DOMParser.<init>(Unknown Source) at org.apache.xerces.parsers.DOMParser.<init>(Unknown Source) at org.netbeans.modules.j2ee.dd.api.ejb.DDProvider.parseDD(DDProvider.java:288) at org.netbeans.modules.j2ee.dd.api.ejb.DDProvider.parseDD(DDProvider.java:282) at org.netbeans.modules.j2ee.dd.api.ejb.DDProvider.parseDD(DDProvider.java:277) at org.netbeans.modules.j2ee.dd.api.ejb.DDProvider.getDDRoot(DDProvider.java:125) at org.netbeans.modules.j2ee.ejbjarproject.ui.logicalview.ejb.shared.EjbMethodController.createFromClass(EjbMethodController.java:70) at org.netbeans.modules.j2ee.ejbjarproject.ui.logicalview.ejb.shared.EjbMethodController.create(EjbMethodController.java:49) at org.netbeans.modules.j2ee.ejbjarproject.ui.logicalview.ejb.session.BeanClassFactory.createMethodNode(BeanClassFactory.java:42) at org.netbeans.modules.java.ui.nodes.FilterSourceNodeFactory.createMethodNode(FilterSourceNodeFactory.java:33) at org.netbeans.modules.javadoc.comments.JavaDocPropertySupportFactory.createMethodNode(JavaDocPropertySupportFactory.java:42) at org.netbeans.modules.java.ui.nodes.FilterSourceNodeFactory.createMethodNode(FilterSourceNodeFactory.java:33) at org.netbeans.modules.refactoring.ui.RefactoringFilterFactory.createMethodNode(RefactoringFilterFactory.java:54) at org.netbeans.modules.java.ui.nodes.BridgeSource2Element.createMethodNode(BridgeSource2Element.java:38) at org.netbeans.modules.java.ui.nodes.BridgeElement2Source.createMethodNode(BridgeElement2Source.java:38) at org.netbeans.modules.java.JavaEditor$JavaEditorComponent.createNode(JavaEditor.java:1264) at org.netbeans.modules.java.JavaEditor$JavaEditorComponent.access$800(JavaEditor.java:1164) at org.netbeans.modules.java.JavaEditor$JavaEditorComponent$1$1.run(JavaEditor.java:1216) at org.openide.util.Mutex.readAccess(Mutex.java:195) at org.netbeans.modules.java.JavaEditor$JavaEditorComponent$1.run(JavaEditor.java:1214) at org.openide.util.Task.run(Task.java:207) at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:419) [catch] at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:794)
Created attachment 22956 [details] DDProvider uses JAXP instead of Xerces
I whipped together the attached patch to use JAXP instead of Xerces. I'm going to use my modified version for a couple of days and see if the problem disappears or if it introduces new problems. I saw the comment in the code re: validation and JAXP, but was not able to understand the author's disagreement with JAXP's validation mechanism.
We use Xerces explicitly because we use its schema validation and we want to prevent change of parser by setting system property "javax.xml.parsers.SAXParserFactory". I guess your problem is not caused by explicit call of Xerces in our code but rather by some problem in your configuration. It looks like conflict between different versions of the same classes in libraries. Please install NetBeans in a new directory and check whether the problem lingers.
I always install a fresh copy of NetBeans because I am using nightlies that are built from my local CVS refresh. The only thing that lingers is my $HOME/.netbeans/dev directory because it has my color settings and mevenide nbms installed. It would be "challenging" to recreate this problem using a clean userdir since the project in question is managed by Maven, not Ant. Anyway, as I stated, I switched DDProvider over to JAXP and the CCE went away. I am not familiar enough with the inner workings of NB to be able to assert any more testing than that. Thanks for looking into this.
Did you run always clean before build? Your patch probably solves your problem but still you can download daily build from http://www.netbeans.info/downloads/download.php?a=n&p=1 and install it in a new directory to get correct configuration and perhaps compare it with your current configuration to detect source of the exception.
Cannot reproduce the issue. It was probably caused by some mistake in configuration.
I may have more insight. It could be mevenide (http://mevenide.codehaus.org/) interacting poorly with the DDProvider. That is 100% theory, I have no supporting evidence, but that is the one glaring divergence of my configuration from a "naked" NB HEAD build. I had to hack upon their Info/info.xml in mevenide-netbeans-grammar-0.6.1 to correct the xml.core/2 dependency, which I can share with anyone if there is interest. I don't want to reopen this unless there is interest from the NB side of things in tracking it down.