Skip to main content



      Home
Home » Eclipse Projects » Eclipse Platform » java.beans.XMLDecoder parse error in Plugin
java.beans.XMLDecoder parse error in Plugin [message #272988] Wed, 29 September 2004 14:04 Go to next message
Eclipse UserFriend
I've got a strange situation whereby I am unable to parse a file generated
by java.beans.XMLEncoder using the XMLDecoder within a plugin environment.
It feels like some kind of class loading problem whereby the XMLDecoder
cannot locate the com.eyeris.common.fileserver.FileServerFile class but I
can't figure it out as the plugin declares the correct dependencies and I'm
able to instantiate a dummy class instance.

Here's the test that works as a stand-alone java project, invoking the same
code within the context of a plugin fails everytime. The file I'm reading
and the stack trace from the plugin invocation are included below:

public class decodertest {

public static void main(String args[]) {
ExceptionListener listener = new ExceptionListener() {

public void exceptionThrown(Exception e) {
e.printStackTrace();
}

};

// Create dummy instance to verify class loading
com.eyeris.common.fileserver.FileServerFile fsf = new
com.eyeris.common.fileserver.FileServerFile();

XMLDecoder d = null;
try {
d = new XMLDecoder(
new BufferedInputStream(
new FileInputStream("C:/temp/XMLDecoderIn.txt")), null,
listener);
} catch (FileNotFoundException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
Object result = d.readObject();
d.close();

}
}

The file I'm trying to read/parse:

<?xml version="1.0" encoding="UTF-8"?>
<java version="1.4.2_05" class="java.beans.XMLDecoder">
<object class="java.util.LinkedList">
<void method="add">
<object class="com.eyeris.common.fileserver.FileServerFile">
<void property="length">
<long>0</long>
</void>
<void property="name">
<string>condcomponent.cond</string>
</void>
<void property="url">
<string>epfs://localhost/condcomponent.cond</string>
</void>
</object>
</void>
</object>
</java>


Stack trace:

at org.eclipse.core.launcher.Main.main(Main.java:628)

java.lang.NullPointerException

at java.beans.Statement.invoke(Statement.java:454)

at java.beans.Expression.getValue(Expression.java:101)

at java.beans.ObjectHandler.getValue(XMLDecoder.java:241)

at java.beans.ObjectHandler.eval(XMLDecoder.java:262)

at java.beans.ObjectHandler.startElement(XMLDecoder.java:344)

at
org.xml.sax.helpers.XMLReaderAdapter.startElement(XMLReaderA dapter.java:333)

at org.apache.crimson.parser.Parser2.maybeElement(Parser2.java: 1674)

at org.apache.crimson.parser.Parser2.content(Parser2.java:1963)

at org.apache.crimson.parser.Parser2.maybeElement(Parser2.java: 1691)

at org.apache.crimson.parser.Parser2.content(Parser2.java:1963)

at org.apache.crimson.parser.Parser2.maybeElement(Parser2.java: 1691)

at org.apache.crimson.parser.Parser2.content(Parser2.java:1963)

at org.apache.crimson.parser.Parser2.maybeElement(Parser2.java: 1691)

at org.apache.crimson.parser.Parser2.content(Parser2.java:1963)

at org.apache.crimson.parser.Parser2.maybeElement(Parser2.java: 1691)

at org.apache.crimson.parser.Parser2.parseInternal(Parser2.java :667)

at org.apache.crimson.parser.Parser2.parse(Parser2.java:337)

at org.apache.crimson.parser.XMLReaderImpl.parse(XMLReaderImpl. java:448)

at org.xml.sax.helpers.XMLReaderAdapter.parse(XMLReaderAdapter. java:223)

at javax.xml.parsers.SAXParser.parse(SAXParser.java:314)

at javax.xml.parsers.SAXParser.parse(SAXParser.java:89)

at java.beans.XMLDecoder.<init>(XMLDecoder.java:88)

at
com.eyeris.eyeprofit.ui.repository.core.EPRepositoryCorePlug in.readFile(EPRe
positoryCorePlugin.java:103)

at
com.eyeris.eyeprofit.ui.repository.core.EPRepositoryCorePlug in.start(EPRepos
itoryCorePlugin.java:89)

at
org.eclipse.osgi.framework.internal.core.BundleContextImpl$1 .run(BundleConte
xtImpl.java:958)

at java.security.AccessController.doPrivileged(Native Method)

at
org.eclipse.osgi.framework.internal.core.BundleContextImpl.s tartActivator(Bu
ndleContextImpl.java:954)

at
org.eclipse.osgi.framework.internal.core.BundleContextImpl.s tart(BundleConte
xtImpl.java:937)

at
org.eclipse.osgi.framework.internal.core.BundleHost.startWor ker(BundleHost.j
ava:421)

at
org.eclipse.osgi.framework.internal.core.AbstractBundle.star t(AbstractBundle
..java:293)

at
org.eclipse.core.runtime.adaptor.EclipseClassLoader.findLoca lClass(EclipseCl
assLoader.java:110)

at
org.eclipse.osgi.framework.internal.core.BundleLoader.findLo calClass(BundleL
oader.java:371)

at
org.eclipse.osgi.framework.internal.core.BundleLoader.findCl ass(BundleLoader
..java:402)

at
org.eclipse.osgi.framework.adaptor.core.AbstractClassLoader. loadClass(Abstra
ctClassLoader.java:93)

at java.lang.ClassLoader.loadClass(ClassLoader.java:235)

at
org.eclipse.osgi.framework.internal.core.BundleLoader.loadCl ass(BundleLoader
..java:307)

at
org.eclipse.osgi.framework.internal.core.BundleHost.loadClas s(BundleHost.jav
a:336)

at
org.eclipse.osgi.framework.internal.core.AbstractBundle.load Class(AbstractBu
ndle.java:1313)

at
org.eclipse.core.internal.registry.ConfigurationElement.crea teExecutableExte
nsion(ConfigurationElement.java:131)

at
org.eclipse.core.internal.registry.ConfigurationElement.crea teExecutableExte
nsion(ConfigurationElement.java:124)

at
org.eclipse.core.internal.registry.ConfigurationElement.crea teExecutableExte
nsion(ConfigurationElement.java:113)

at org.eclipse.ui.internal.WorkbenchPlugin$1.run(WorkbenchPlugi n.java:196)

at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator .java:69)

at
org.eclipse.ui.internal.WorkbenchPlugin.createExtension(Work benchPlugin.java
:193)

at
org.eclipse.ui.internal.registry.ViewDescriptor.createView(V iewDescriptor.ja
va:76)

at org.eclipse.ui.internal.ViewFactory$1.run(ViewFactory.java:2 87)

at
org.eclipse.core.internal.runtime.InternalPlatform.run(Inter nalPlatform.java
:615)

at org.eclipse.core.runtime.Platform.run(Platform.java:747)

at org.eclipse.ui.internal.ViewFactory.busyRestoreView(ViewFact ory.java:259)

at org.eclipse.ui.internal.ViewFactory$2.run(ViewFactory.java:5 16)

at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator .java:69)

at org.eclipse.ui.internal.ViewFactory.restoreView(ViewFactory. java:514)

at
org.eclipse.ui.internal.ViewFactory$ViewReference.getPart(Vi ewFactory.java:1
02)

at
org.eclipse.ui.internal.ViewFactory$ViewReference.getView(Vi ewFactory.java:1
66)

at
org.eclipse.ui.internal.WorkbenchPage.restoreState(Workbench Page.java:2507)

at
org.eclipse.ui.internal.WorkbenchWindow.restoreState(Workben chWindow.java:13
72)

at org.eclipse.ui.internal.Workbench.restoreState(Workbench.jav a:1224)

at org.eclipse.ui.internal.Workbench.access$10(Workbench.java:1 185)

at org.eclipse.ui.internal.Workbench$13.run(Workbench.java:1096 )

at
org.eclipse.core.internal.runtime.InternalPlatform.run(Inter nalPlatform.java
:615)

at org.eclipse.core.runtime.Platform.run(Platform.java:747)

at org.eclipse.ui.internal.Workbench.restoreState(Workbench.jav a:1029)

at
org.eclipse.ui.internal.WorkbenchConfigurer.restoreState(Wor kbenchConfigurer
..java:167)

at
org.eclipse.ui.application.WorkbenchAdvisor.openWindows(Work benchAdvisor.jav
a:652)

at org.eclipse.ui.internal.Workbench.init(Workbench.java:819)

at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:1325)

at
org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Work bench.java:254)

at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.j ava:141)

at
com.eyeris.eyeprofit.modelconfig.ui.ModelConfigApplication.r un(ModelConfigAp
plication.java:35)

at
org.eclipse.core.internal.runtime.PlatformActivator$1.run(Pl atformActivator.
java:335)

at
org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:273)

at
org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:129)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAcce ssorImpl.java:39
)

at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMe thodAccessorImpl
..java:25)

at java.lang.reflect.Method.invoke(Method.java:324)

at org.eclipse.core.launcher.Main.basicRun(Main.java:183)

at org.eclipse.core.launcher.Main.run(Main.java:644)

at org.eclipse.core.launcher.Main.main(Main.java:628)
Re: java.beans.XMLDecoder parse error in Plugin [message #272994 is a reply to message #272988] Wed, 29 September 2004 14:36 Go to previous message
Eclipse UserFriend
Looks like I found the bug associated with this issue so disregard this
message. For reference, it is:

https://bugs.eclipse.org/bugs/show_bug.cgi?id=30588

"Paul Wuethrich" <paul.wuethrich@eye-ris.com> wrote in message
news:cjet5p$2qe$1@eclipse.org...
> I've got a strange situation whereby I am unable to parse a file generated
> by java.beans.XMLEncoder using the XMLDecoder within a plugin environment.
> It feels like some kind of class loading problem whereby the XMLDecoder
> cannot locate the com.eyeris.common.fileserver.FileServerFile class but I
> can't figure it out as the plugin declares the correct dependencies and
I'm
> able to instantiate a dummy class instance.
>
> Here's the test that works as a stand-alone java project, invoking the
same
> code within the context of a plugin fails everytime. The file I'm reading
> and the stack trace from the plugin invocation are included below:
>
> public class decodertest {
>
> public static void main(String args[]) {
> ExceptionListener listener = new ExceptionListener() {
>
> public void exceptionThrown(Exception e) {
> e.printStackTrace();
> }
>
> };
>
> // Create dummy instance to verify class loading
> com.eyeris.common.fileserver.FileServerFile fsf = new
> com.eyeris.common.fileserver.FileServerFile();
>
> XMLDecoder d = null;
> try {
> d = new XMLDecoder(
> new BufferedInputStream(
> new FileInputStream("C:/temp/XMLDecoderIn.txt")), null,
> listener);
> } catch (FileNotFoundException e) {
> // TODO Auto-generated catch block
> e.printStackTrace();
> }
> Object result = d.readObject();
> d.close();
>
> }
> }
>
> The file I'm trying to read/parse:
>
> <?xml version="1.0" encoding="UTF-8"?>
> <java version="1.4.2_05" class="java.beans.XMLDecoder">
> <object class="java.util.LinkedList">
> <void method="add">
> <object class="com.eyeris.common.fileserver.FileServerFile">
> <void property="length">
> <long>0</long>
> </void>
> <void property="name">
> <string>condcomponent.cond</string>
> </void>
> <void property="url">
> <string>epfs://localhost/condcomponent.cond</string>
> </void>
> </object>
> </void>
> </object>
> </java>
>
>
> Stack trace:
>
> at org.eclipse.core.launcher.Main.main(Main.java:628)
>
> java.lang.NullPointerException
>
> at java.beans.Statement.invoke(Statement.java:454)
>
> at java.beans.Expression.getValue(Expression.java:101)
>
> at java.beans.ObjectHandler.getValue(XMLDecoder.java:241)
>
> at java.beans.ObjectHandler.eval(XMLDecoder.java:262)
>
> at java.beans.ObjectHandler.startElement(XMLDecoder.java:344)
>
> at
>
org.xml.sax.helpers.XMLReaderAdapter.startElement(XMLReaderA dapter.java:333)
>
> at org.apache.crimson.parser.Parser2.maybeElement(Parser2.java: 1674)
>
> at org.apache.crimson.parser.Parser2.content(Parser2.java:1963)
>
> at org.apache.crimson.parser.Parser2.maybeElement(Parser2.java: 1691)
>
> at org.apache.crimson.parser.Parser2.content(Parser2.java:1963)
>
> at org.apache.crimson.parser.Parser2.maybeElement(Parser2.java: 1691)
>
> at org.apache.crimson.parser.Parser2.content(Parser2.java:1963)
>
> at org.apache.crimson.parser.Parser2.maybeElement(Parser2.java: 1691)
>
> at org.apache.crimson.parser.Parser2.content(Parser2.java:1963)
>
> at org.apache.crimson.parser.Parser2.maybeElement(Parser2.java: 1691)
>
> at org.apache.crimson.parser.Parser2.parseInternal(Parser2.java :667)
>
> at org.apache.crimson.parser.Parser2.parse(Parser2.java:337)
>
> at org.apache.crimson.parser.XMLReaderImpl.parse(XMLReaderImpl. java:448)
>
> at org.xml.sax.helpers.XMLReaderAdapter.parse(XMLReaderAdapter. java:223)
>
> at javax.xml.parsers.SAXParser.parse(SAXParser.java:314)
>
> at javax.xml.parsers.SAXParser.parse(SAXParser.java:89)
>
> at java.beans.XMLDecoder.<init>(XMLDecoder.java:88)
>
> at
>
com.eyeris.eyeprofit.ui.repository.core.EPRepositoryCorePlug in.readFile(EPRe
> positoryCorePlugin.java:103)
>
> at
>
com.eyeris.eyeprofit.ui.repository.core.EPRepositoryCorePlug in.start(EPRepos
> itoryCorePlugin.java:89)
>
> at
>
org.eclipse.osgi.framework.internal.core.BundleContextImpl$1 .run(BundleConte
> xtImpl.java:958)
>
> at java.security.AccessController.doPrivileged(Native Method)
>
> at
>
org.eclipse.osgi.framework.internal.core.BundleContextImpl.s tartActivator(Bu
> ndleContextImpl.java:954)
>
> at
>
org.eclipse.osgi.framework.internal.core.BundleContextImpl.s tart(BundleConte
> xtImpl.java:937)
>
> at
>
org.eclipse.osgi.framework.internal.core.BundleHost.startWor ker(BundleHost.j
> ava:421)
>
> at
>
org.eclipse.osgi.framework.internal.core.AbstractBundle.star t(AbstractBundle
> .java:293)
>
> at
>
org.eclipse.core.runtime.adaptor.EclipseClassLoader.findLoca lClass(EclipseCl
> assLoader.java:110)
>
> at
>
org.eclipse.osgi.framework.internal.core.BundleLoader.findLo calClass(BundleL
> oader.java:371)
>
> at
>
org.eclipse.osgi.framework.internal.core.BundleLoader.findCl ass(BundleLoader
> .java:402)
>
> at
>
org.eclipse.osgi.framework.adaptor.core.AbstractClassLoader. loadClass(Abstra
> ctClassLoader.java:93)
>
> at java.lang.ClassLoader.loadClass(ClassLoader.java:235)
>
> at
>
org.eclipse.osgi.framework.internal.core.BundleLoader.loadCl ass(BundleLoader
> .java:307)
>
> at
>
org.eclipse.osgi.framework.internal.core.BundleHost.loadClas s(BundleHost.jav
> a:336)
>
> at
>
org.eclipse.osgi.framework.internal.core.AbstractBundle.load Class(AbstractBu
> ndle.java:1313)
>
> at
>
org.eclipse.core.internal.registry.ConfigurationElement.crea teExecutableExte
> nsion(ConfigurationElement.java:131)
>
> at
>
org.eclipse.core.internal.registry.ConfigurationElement.crea teExecutableExte
> nsion(ConfigurationElement.java:124)
>
> at
>
org.eclipse.core.internal.registry.ConfigurationElement.crea teExecutableExte
> nsion(ConfigurationElement.java:113)
>
> at org.eclipse.ui.internal.WorkbenchPlugin$1.run(WorkbenchPlugi n.java:196)
>
> at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator .java:69)
>
> at
>
org.eclipse.ui.internal.WorkbenchPlugin.createExtension(Work benchPlugin.java
> :193)
>
> at
>
org.eclipse.ui.internal.registry.ViewDescriptor.createView(V iewDescriptor.ja
> va:76)
>
> at org.eclipse.ui.internal.ViewFactory$1.run(ViewFactory.java:2 87)
>
> at
>
org.eclipse.core.internal.runtime.InternalPlatform.run(Inter nalPlatform.java
> :615)
>
> at org.eclipse.core.runtime.Platform.run(Platform.java:747)
>
> at
org.eclipse.ui.internal.ViewFactory.busyRestoreView(ViewFact ory.java:259)
>
> at org.eclipse.ui.internal.ViewFactory$2.run(ViewFactory.java:5 16)
>
> at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator .java:69)
>
> at org.eclipse.ui.internal.ViewFactory.restoreView(ViewFactory. java:514)
>
> at
>
org.eclipse.ui.internal.ViewFactory$ViewReference.getPart(Vi ewFactory.java:1
> 02)
>
> at
>
org.eclipse.ui.internal.ViewFactory$ViewReference.getView(Vi ewFactory.java:1
> 66)
>
> at
>
org.eclipse.ui.internal.WorkbenchPage.restoreState(Workbench Page.java:2507)
>
> at
>
org.eclipse.ui.internal.WorkbenchWindow.restoreState(Workben chWindow.java:13
> 72)
>
> at org.eclipse.ui.internal.Workbench.restoreState(Workbench.jav a:1224)
>
> at org.eclipse.ui.internal.Workbench.access$10(Workbench.java:1 185)
>
> at org.eclipse.ui.internal.Workbench$13.run(Workbench.java:1096 )
>
> at
>
org.eclipse.core.internal.runtime.InternalPlatform.run(Inter nalPlatform.java
> :615)
>
> at org.eclipse.core.runtime.Platform.run(Platform.java:747)
>
> at org.eclipse.ui.internal.Workbench.restoreState(Workbench.jav a:1029)
>
> at
>
org.eclipse.ui.internal.WorkbenchConfigurer.restoreState(Wor kbenchConfigurer
> .java:167)
>
> at
>
org.eclipse.ui.application.WorkbenchAdvisor.openWindows(Work benchAdvisor.jav
> a:652)
>
> at org.eclipse.ui.internal.Workbench.init(Workbench.java:819)
>
> at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:1325)
>
> at
>
org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Work bench.java:254)
>
> at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.j ava:141)
>
> at
>
com.eyeris.eyeprofit.modelconfig.ui.ModelConfigApplication.r un(ModelConfigAp
> plication.java:35)
>
> at
>
org.eclipse.core.internal.runtime.PlatformActivator$1.run(Pl atformActivator.
> java:335)
>
> at
>
org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:273)
>
> at
>
org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:129)
>
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>
> at
>
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAcce ssorImpl.java:39
> )
>
> at
>
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMe thodAccessorImpl
> .java:25)
>
> at java.lang.reflect.Method.invoke(Method.java:324)
>
> at org.eclipse.core.launcher.Main.basicRun(Main.java:183)
>
> at org.eclipse.core.launcher.Main.run(Main.java:644)
>
> at org.eclipse.core.launcher.Main.main(Main.java:628)
>
>
Previous Topic:extracting java metadata
Next Topic:the addressbook swt sample
Goto Forum:
  


Current Time: Sun Jul 13 20:24:02 EDT 2025

Powered by FUDForum. Page generated in 0.28728 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top