[jbosstools-issues] [JBoss JIRA] Issue Comment Edited: (JBIDE-9287) NullPointerException in org.jboss.tools.cdi.seam.config.core.xml.SAXParser

Viacheslav Kabanovich (JIRA) jira-events at lists.jboss.org
Thu Jun 30 20:48:23 EDT 2011


    [ https://issues.jboss.org/browse/JBIDE-9287?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12612126#comment-12612126 ] 

Viacheslav Kabanovich edited comment on JBIDE-9287 at 6/30/11 8:47 PM:
-----------------------------------------------------------------------

We use XMLReaderFactory.createXMLReader() to create parser instance and expect that it will find it in classpath. However, Eclipse has many class loaders and org.xml.sax.helpers.NewInstance (of which class loader is taken for loading parser instance) can be loaded by a class loader that does not have a parser implementation. We have not provided explicit dependency on a plugin that has it. If our SAXParser is invoked through plugin which has no parser implementation in all its dependency tree, then XMLReaderFactory.createXMLReader() will fail. It seems that the probability of it is very low, so that we have to decide if we should create that explicit dependency (by the way, our test plugins have it); or just log message if failure happens. I do not remember why we avoided that explicit dependency, may it have some side effects?

      was (Author: scabanovich):
    We use XMLReaderFactory.createXMLReader() to create XMLReader instance and expect that it will find it in classpath. However, Eclipse has many class loaders and org.xml.sax.helpers.NewInstance class be loaded by a class loader that does not have a parser implementation. We have not provided explicit dependency on a plugin that has it. If our SAXParser is invoked through plugin which has no parser implementation in all dependency its tree, then XMLReaderFactory.createXMLReader() will fail. It seems that the probability of it is very low, so that we have to decide if we should create that explicit dependency (by the way, our test plugins have it); or just log message if failure happens.
  
> NullPointerException in org.jboss.tools.cdi.seam.config.core.xml.SAXParser
> --------------------------------------------------------------------------
>
>                 Key: JBIDE-9287
>                 URL: https://issues.jboss.org/browse/JBIDE-9287
>             Project: Tools (JBoss Tools)
>          Issue Type: Bug
>          Components: cdi (jsr-299)
>    Affects Versions: 3.3.0.M2
>            Reporter: Viacheslav Kabanovich
>            Assignee: Viacheslav Kabanovich
>             Fix For: 3.3.0.M3
>
>
> java.lang.NullPointerException
> 	at
> org.jboss.tools.cdi.seam.config.core.xml.SAXParser.parse(SAXParser.java:66)
> 	at
> org.jboss.tools.cdi.seam.config.core.scanner.SeamDefinitionBuilder.createDefinition(SeamDefinitionBuilder.java:71)
> 	at
> org.jboss.tools.cdi.seam.config.core.CDISeamConfigExtension.buildDefinitions(CDISeamConfigExtension.java:118)
> 	at org.jboss.tools.cdi.core.CDICoreBuilder.build(CDICoreBuilder.java:201)
> 	at
> org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:728)
> 	at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
> 	at
> org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:199)
> 	at
> org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:239)
> 	at
> org.eclipse.core.internal.events.BuildManager$1.run(BuildManager.java:292)
> 	at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
> 	at
> org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:295)
> 	at
> org.eclipse.core.internal.events.BuildManager.basicBuildLoop(BuildManager.java:351)
> 	at
> org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:374)
> 	at
> org.eclipse.core.internal.events.AutoBuildJob.doBuild(AutoBuildJob.java:143)
> 	at org.eclipse.core.internal.events.AutoBuildJob.run(AutoBuildJob.java:241)
> 	at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the jbosstools-issues mailing list