I am trying to use JBossCache within an Eclipse plugin. The cache is 
instantiating just fine, but as soon as I try to put an object in the cache, I 
get an NPE with the following stack trace.

org.jboss.util.NestedRuntimeException: - nested throwable: 
(java.lang.NullPointerException)
        at org.jboss.cache.TreeCache.invokeMethod(TreeCache.java:3083)
        at org.jboss.cache.TreeCache.put(TreeCache.java:1758)
        at org.jboss.cache.TreeCache.put(TreeCache.java:1741)
        at 
com.amaranth.unit.factory.SimpleUnitFactory.init(SimpleUnitFactory.java:58)
        at 
com.amaranth.unit.factory.SimpleUnitFactory.(SimpleUnitFactory.java:46)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown 
Source)
        at java.lang.reflect.Constructor.newInstance(Unknown Source)
        at java.lang.Class.newInstance0(Unknown Source)
        at java.lang.Class.newInstance(Unknown Source)
        at 
org.apache.commons.discovery.tools.ClassUtils.newInstance(ClassUtils.java:157)
        at 
org.apache.commons.discovery.tools.SPInterface.newInstance(SPInterface.java:197)
        at 
org.apache.commons.discovery.tools.DiscoverClass.newInstance(DiscoverClass.java:579)
        at 
org.apache.commons.discovery.tools.DiscoverSingleton.find(DiscoverSingleton.java:418)
        at 
org.apache.commons.discovery.tools.DiscoverSingleton.find(DiscoverSingleton.java:272)
        at com.amaranth.quantity.DefaultQuantity.(DefaultQuantity.java:59)
        at 
com.amaranth.commodity.factory.SimpleCommodityFactory.init(SimpleCommodityFactory.java:53)
        at 
com.amaranth.commodity.factory.SimpleCommodityFactory.(SimpleCommodityFactory.java:44)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown 
Source)
        at java.lang.reflect.Constructor.newInstance(Unknown Source)
        at java.lang.Class.newInstance0(Unknown Source)
        at java.lang.Class.newInstance(Unknown Source)
        at 
org.apache.commons.discovery.tools.ClassUtils.newInstance(ClassUtils.java:157)
        at 
org.apache.commons.discovery.tools.SPInterface.newInstance(SPInterface.java:197)
        at 
org.apache.commons.discovery.tools.DiscoverClass.newInstance(DiscoverClass.java:579)
        at 
org.apache.commons.discovery.tools.DiscoverSingleton.find(DiscoverSingleton.java:418)
        at 
org.apache.commons.discovery.tools.DiscoverSingleton.find(DiscoverSingleton.java:272)
        at 
com.amaranth.energy.workbench.rcp.CommodityView$ViewContentProvider.getElements(CommodityView.java:45)
        at 
org.eclipse.jface.viewers.StructuredViewer.getRawChildren(StructuredViewer.java:766)
        at 
org.eclipse.jface.viewers.AbstractTreeViewer.getRawChildren(AbstractTreeViewer.java:747)
        at 
org.eclipse.jface.viewers.StructuredViewer.getFilteredChildren(StructuredViewer.java:708)
        at 
org.eclipse.jface.viewers.StructuredViewer.getSortedChildren(StructuredViewer.java:823)
        at 
org.eclipse.jface.viewers.AbstractTreeViewer$1.run(AbstractTreeViewer.java:381)
        at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:69)
        at 
org.eclipse.jface.viewers.AbstractTreeViewer.createChildren(AbstractTreeViewer.java:363)
        at 
org.eclipse.jface.viewers.AbstractTreeViewer$5.run(AbstractTreeViewer.java:834)
        at 
org.eclipse.jface.viewers.StructuredViewer.preservingSelection(StructuredViewer.java:1109)
        at 
org.eclipse.jface.viewers.AbstractTreeViewer.inputChanged(AbstractTreeViewer.java:824)
        at 
org.eclipse.jface.viewers.ContentViewer.setInput(ContentViewer.java:248)
        at 
org.eclipse.jface.viewers.StructuredViewer.setInput(StructuredViewer.java:1323)
        at 
com.amaranth.energy.workbench.rcp.CommodityView.createPartControl(CommodityView.java:98)
        at org.eclipse.ui.internal.PartPane$2.run(PartPane.java:148)
        at 
org.eclipse.core.internal.runtime.InternalPlatform.run(InternalPlatform.java:1015)
        at org.eclipse.core.runtime.Platform.run(Platform.java:757)
        at 
org.eclipse.ui.internal.PartPane.doCreateChildControl(PartPane.java:144)
        at 
org.eclipse.ui.internal.ViewPane.doCreateChildControl(ViewPane.java:135)
        at 
org.eclipse.ui.internal.PartPane.createChildControl(PartPane.java:349)
        at org.eclipse.ui.internal.ViewFactory$1.run(ViewFactory.java:405)
        at 
org.eclipse.core.internal.runtime.InternalPlatform.run(InternalPlatform.java:1015)
        at org.eclipse.core.runtime.Platform.run(Platform.java:757)
        at 
org.eclipse.ui.internal.ViewFactory.busyRestoreView(ViewFactory.java:289)
        at org.eclipse.ui.internal.ViewFactory$2.run(ViewFactory.java:589)
        at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:69)
        at org.eclipse.ui.internal.ViewFactory.restoreView(ViewFactory.java:586)
        at 
org.eclipse.ui.internal.ViewFactory$ViewReference.getPart(ViewFactory.java:108)
        at org.eclipse.ui.internal.PartPane.setVisible(PartPane.java:329)
        at org.eclipse.ui.internal.ViewPane.setVisible(ViewPane.java:607)
        at 
org.eclipse.ui.internal.presentations.PresentablePart.setVisible(PresentablePart.java:126)
        at 
org.eclipse.ui.internal.presentations.newapi.PresentablePartFolder.select(PresentablePartFolder.java:266)
        at 
org.eclipse.ui.internal.presentations.newapi.LeftToRightTabOrder.select(LeftToRightTabOrder.java:65)
        at 
org.eclipse.ui.internal.presentations.newapi.TabbedStackPresentation.selectPart(TabbedStackPresentation.java:381)
        at 
org.eclipse.ui.internal.PartStack.refreshPresentationSelection(PartStack.java:1051)
        at org.eclipse.ui.internal.PartStack.setSelection(PartStack.java:1009)
        at org.eclipse.ui.internal.PartStack.showPart(PartStack.java:1200)
        at org.eclipse.ui.internal.PartStack.createControl(PartStack.java:521)
        at org.eclipse.ui.internal.PartStack.createControl(PartStack.java:473)
        at 
org.eclipse.ui.internal.PartSashContainer.createControl(PartSashContainer.java:485)
        at 
org.eclipse.ui.internal.PerspectiveHelper.activate(PerspectiveHelper.java:230)
        at org.eclipse.ui.internal.Perspective.onActivate(Perspective.java:777)
        at 
org.eclipse.ui.internal.WorkbenchPage.onActivate(WorkbenchPage.java:2133)
        at 
org.eclipse.ui.internal.WorkbenchWindow$4.run(WorkbenchWindow.java:2235)
        at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:69)
        at 
org.eclipse.ui.internal.WorkbenchWindow.setActivePage(WorkbenchWindow.java:2221)
        at 
org.eclipse.ui.internal.WorkbenchWindow.busyOpenPage(WorkbenchWindow.java:572)
        at 
org.eclipse.ui.internal.Workbench.busyOpenWorkbenchWindow(Workbench.java:587)
        at 
org.eclipse.ui.internal.Workbench.openFirstTimeWindow(Workbench.java:1209)
        at 
org.eclipse.ui.internal.WorkbenchConfigurer.openFirstTimeWindow(WorkbenchConfigurer.java:178)
        at 
org.eclipse.ui.application.WorkbenchAdvisor.openWindows(WorkbenchAdvisor.java:717)
        at org.eclipse.ui.internal.Workbench.init(Workbench.java:918)
        at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:1554)
        at 
org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:293)
        at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:144)
        at 
com.amaranth.energy.workbench.rcp.WorkbenchApplication.run(WorkbenchApplication.java:21)
        at 
org.eclipse.core.internal.runtime.PlatformActivator$1.run(PlatformActivator.java:228)
        at 
org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:333)
        at 
org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:150)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
        at java.lang.reflect.Method.invoke(Unknown Source)
        at org.eclipse.core.launcher.Main.invokeFramework(Main.java:268)
        at org.eclipse.core.launcher.Main.basicRun(Main.java:260)
        at org.eclipse.core.launcher.Main.run(Main.java:887)
        at org.eclipse.core.launcher.Main.main(Main.java:871)
Caused by: java.lang.NullPointerException
        at org.jboss.cache.TreeCache.invokeMethod(TreeCache.java:3078)
        ... 96 more

When I run the component that uses the cache outside of Eclipse I have no 
problems. I am guessing it has to do with Eclipse's classloading mechanism. 
However,  the source for JBossCache does not accompany the download and I don't 
see a tag in CVS for JBossCache 1.2, the version I am using. So, I can't even 
tell what the content of the line is that is causing the NPE.

Any help/direction in this matter would be appreciated.

Thanks,
Karl


View the original post : 
http://www.jboss.org/index.html?module=bb&op=viewtopic&p=3869187#3869187

Reply to the post : 
http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=3869187


-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
JBoss-Development mailing list
JBoss-Development@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jboss-development

Reply via email to