Hi,
I’m developing a URCap which insert nodes to the program tree. I have written the Contribution and it worked fine, but when I started adding more and more to thee View URSim crashed with the following error:
{thread: Thread-2 , loggerClass: com.ur.polyscope.controllerinterface.internal.ControllerSocket}
08:42:50.923 ERROR - Crashed while loading {thread: Thread-2 , loggerClass: gui.main.URGUI}
com.google.inject.ProvisionException: Unable to provision, see the following errors:
- Error injecting constructor, java.lang.NullPointerException
at com.ur.program.edit.infrastructure.AddNodeStructureView.(AddNodeStructureView.java:72)
at com.ur.program.edit.infrastructure.AddNodeStructureView.class(AddNodeStructureView.java:51)
while locating com.ur.program.edit.infrastructure.AddNodeStructureView
for the 1st parameter of com.ur.program.edit.infrastructure.G5LeftReplacement.(G5LeftReplacement.java:28)
while locating com.ur.program.edit.infrastructure.G5LeftReplacement
for the 1st parameter of com.ur.program.edit.infrastructure.G5LeftToggle.(G5LeftToggle.java:25)
while locating com.ur.program.edit.infrastructure.G5LeftToggle
for the 2nd parameter of com.ur.program.edit.infrastructure.G5SidePanels.(G5SidePanels.java:26)
while locating com.ur.program.edit.infrastructure.G5SidePanels
while locating gui.tree.SidePlaceholders
for the 3rd parameter of gui.polyscope.program.ProgramPanel.(ProgramPanel.java:115)
at gui.polyscope.program.ProgramPanel.class(ProgramPanel.java:68)
while locating gui.polyscope.program.ProgramPanel
at gui.polyscope.ProgramTab.(ProgramTab.java:38)
at gui.polyscope.ProgramTab.class(ProgramTab.java:25)
while locating gui.polyscope.ProgramTab
at gui.main.MainPanel.(MainPanel.java:23)
at gui.main.MainPanel.class(MainPanel.java:23)
while locating gui.main.MainPanel
for the 1st parameter of gui.main.ExtensibleMainPanel.(ExtensibleMainPanel.java:16)
at gui.main.ExtensibleMainPanel.class(ExtensibleMainPanel.java:16)
while locating gui.main.ExtensibleMainPanel
at gui.main.URGUI.(URGUI.java:108)
at gui.main.URGUI.class(URGUI.java:96)
while locating gui.main.URGUI
There are many more rows of errors, but I hope somebody can figure out the problem from this. Even after leaving the View completely empty (only the buildUI() method is present), the problem is still here.
Thanks,
Viktor
Did you check line 72 of your AddNodeStructureView.java? It looks like there is a null pointer somewhere in your code. Just trace back your error code by following the error from top down. So line 72, than line 51, and so forth.
The problem is that I don’t have an AddNodeStructureView class, I guess it is part of the sdk.
I am working on a project named hu.co.unitech.drawer. This is the full error list:
10:58:33.161 ERROR - Crashed while loading {thread: Thread-2 , loggerClass: gui.main.URGUI}
com.google.inject.ProvisionException: Unable to provision, see the following errors:
- Error injecting constructor, java.lang.NullPointerException
at com.ur.program.edit.infrastructure.AddNodeStructureView.(AddNodeStructureView.java:72)
at com.ur.program.edit.infrastructure.AddNodeStructureView.class(AddNodeStructureView.java:51)
while locating com.ur.program.edit.infrastructure.AddNodeStructureView
for the 1st parameter of com.ur.program.edit.infrastructure.G5LeftReplacement.(G5LeftReplacement.java:28)
while locating com.ur.program.edit.infrastructure.G5LeftReplacement
for the 1st parameter of com.ur.program.edit.infrastructure.G5LeftToggle.(G5LeftToggle.java:25)
while locating com.ur.program.edit.infrastructure.G5LeftToggle
for the 2nd parameter of com.ur.program.edit.infrastructure.G5SidePanels.(G5SidePanels.java:26)
while locating com.ur.program.edit.infrastructure.G5SidePanels
while locating gui.tree.SidePlaceholders
for the 3rd parameter of gui.polyscope.program.ProgramPanel.(ProgramPanel.java:115)
at gui.polyscope.program.ProgramPanel.class(ProgramPanel.java:68)
while locating gui.polyscope.program.ProgramPanel
at gui.polyscope.ProgramTab.(ProgramTab.java:38)
at gui.polyscope.ProgramTab.class(ProgramTab.java:25)
while locating gui.polyscope.ProgramTab
at gui.main.MainPanel.(MainPanel.java:23)
at gui.main.MainPanel.class(MainPanel.java:23)
while locating gui.main.MainPanel
for the 1st parameter of gui.main.ExtensibleMainPanel.(ExtensibleMainPanel.java:16)
at gui.main.ExtensibleMainPanel.class(ExtensibleMainPanel.java:16)
while locating gui.main.ExtensibleMainPanel
at gui.main.URGUI.(URGUI.java:108)
at gui.main.URGUI.class(URGUI.java:96)
while locating gui.main.URGUI
1 error
at com.google.inject.internal.InjectorImpl$2.get(InjectorImpl.java:1028) ~[?:?]
at com.google.inject.internal.InjectorImpl.getInstance(InjectorImpl.java:1054) ~[?:?]
at com.ur.injection.GuiceBuilder.get(GuiceBuilder.java:30) ~[polyscope-lang-3.5.10.jar:?]
at gui.main.URGUI.runInitThreads(URGUI.java:385) [polyscope-internal-view-10.9.276.jar:?]
at gui.main.URGUI.run(URGUI.java:217) [polyscope-internal-view-10.9.276.jar:?]
at gui.main.Activator$StartPolyScopeThread.run(Activator.java:81) [polyscope-internal-view-10.9.276.jar:?]
Caused by: java.lang.NullPointerException
at sun.font.FontDesignMetrics.stringWidth(FontDesignMetrics.java:472) ~[?:1.8.0_272]
at com.ur.view.gui.treeview.BaseAccordionView.formatNameIfTooLong(BaseAccordionView.java:262) ~[?:?]
at com.ur.view.gui.treeview.BaseAccordionView.decorateButton(BaseAccordionView.java:251) ~[?:?]
at com.ur.program.edit.infrastructure.AddNodeStructureView.setupButton(AddNodeStructureView.java:193) ~[?:?]
at com.ur.program.edit.infrastructure.AddNodeStructureView.access$1(AddNodeStructureView.java:192) ~[?:?]
at com.ur.program.edit.infrastructure.AddNodeStructureView$NodeFactorySite.addProgramNodeFactory(AddNodeStructureView.java:240) ~[?:?]
at com.ur.view.polyscope.module.programs.ProgramContributionProviderImpl.contributeToProgramFactory(ProgramContributionProviderImpl.java:36) ~[?:?]
at com.ur.program.edit.infrastructure.AddNodeStructureView.(AddNodeStructureView.java:106) ~[?:?]
at com.ur.program.edit.infrastructure.AddNodeStructureView$$FastClassByGuice$$6e8efe4a.newInstance() ~[?:?]
at com.google.inject.internal.DefaultConstructionProxyFactory$FastClassProxy.newInstance(DefaultConstructionProxyFactory.java:89) ~[?:?]
at com.google.inject.internal.ConstructorInjector.provision(ConstructorInjector.java:111) ~[?:?]
at com.google.inject.internal.ConstructorInjector.construct(ConstructorInjector.java:90) ~[?:?]
at com.google.inject.internal.ConstructorBindingImpl$Factory.get(ConstructorBindingImpl.java:268) ~[?:?]
at com.google.inject.internal.ProviderToInternalFactoryAdapter$1.call(ProviderToInternalFactoryAdapter.java:46) ~[?:?]
at com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:1092) ~[?:?]
at com.google.inject.internal.ProviderToInternalFactoryAdapter.get(ProviderToInternalFactoryAdapter.java:40) ~[?:?]
at com.google.inject.internal.SingletonScope$1.get(SingletonScope.java:194) ~[?:?]
at com.google.inject.internal.InternalFactoryToProviderAdapter.get(InternalFactoryToProviderAdapter.java:41) ~[?:?]
at com.google.inject.internal.SingleParameterInjector.inject(SingleParameterInjector.java:38) ~[?:?]
at com.google.inject.internal.SingleParameterInjector.getAll(SingleParameterInjector.java:62) ~[?:?]
at com.google.inject.internal.ConstructorInjector.provision(ConstructorInjector.java:110) ~[?:?]
at com.google.inject.internal.ConstructorInjector.construct(ConstructorInjector.java:90) ~[?:?]
at com.google.inject.internal.ConstructorBindingImpl$Factory.get(ConstructorBindingImpl.java:268) ~[?:?]
at com.google.inject.internal.SingleParameterInjector.inject(SingleParameterInjector.java:38) ~[?:?]
at com.google.inject.internal.SingleParameterInjector.getAll(SingleParameterInjector.java:62) ~[?:?]
at com.google.inject.internal.ConstructorInjector.provision(ConstructorInjector.java:110) ~[?:?]
at com.google.inject.internal.ConstructorInjector.construct(ConstructorInjector.java:90) ~[?:?]
at com.google.inject.internal.ConstructorBindingImpl$Factory.get(ConstructorBindingImpl.java:268) ~[?:?]
at com.google.inject.internal.SingleParameterInjector.inject(SingleParameterInjector.java:38) ~[?:?]
at com.google.inject.internal.SingleParameterInjector.getAll(SingleParameterInjector.java:62) ~[?:?]
at com.google.inject.internal.ConstructorInjector.provision(ConstructorInjector.java:110) ~[?:?]
at com.google.inject.internal.ConstructorInjector.construct(ConstructorInjector.java:90) ~[?:?]
at com.google.inject.internal.ConstructorBindingImpl$Factory.get(ConstructorBindingImpl.java:268) ~[?:?]
at com.google.inject.internal.FactoryProxy.get(FactoryProxy.java:56) ~[?:?]
at com.google.inject.internal.SingleParameterInjector.inject(SingleParameterInjector.java:38) ~[?:?]
at com.google.inject.internal.SingleParameterInjector.getAll(SingleParameterInjector.java:62) ~[?:?]
at com.google.inject.internal.ConstructorInjector.provision(ConstructorInjector.java:110) ~[?:?]
at com.google.inject.internal.ConstructorInjector.construct(ConstructorInjector.java:90) ~[?:?]
at com.google.inject.internal.ConstructorBindingImpl$Factory.get(ConstructorBindingImpl.java:268) ~[?:?]
at com.google.inject.internal.ProviderToInternalFactoryAdapter$1.call(ProviderToInternalFactoryAdapter.java:46) ~[?:?]
at com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:1092) ~[?:?]
at com.google.inject.internal.ProviderToInternalFactoryAdapter.get(ProviderToInternalFactoryAdapter.java:40) ~[?:?]
at com.google.inject.internal.SingletonScope$1.get(SingletonScope.java:194) ~[?:?]
at com.google.inject.internal.InternalFactoryToProviderAdapter.get(InternalFactoryToProviderAdapter.java:41) ~[?:?]
at com.google.inject.internal.InjectorImpl$2$1.call(InjectorImpl.java:1019) ~[?:?]
at com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:1092) ~[?:?]
at com.google.inject.internal.InjectorImpl$2.get(InjectorImpl.java:1015) ~[?:?]
at com.google.inject.internal.InjectorImpl.getInstance(InjectorImpl.java:1054) ~[?:?]
at com.ur.injection.GuiceBuilder.get(GuiceBuilder.java:30) ~[?:?]
at gui.polyscope.ProgramTab.(ProgramTab.java:44) ~[?:?]
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) ~[?:1.8.0_272]
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) ~[?:1.8.0_272]
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) ~[?:1.8.0_272]
at java.lang.reflect.Constructor.newInstance(Constructor.java:423) ~[?:1.8.0_272]
at com.google.inject.internal.DefaultConstructionProxyFactory$ReflectiveProxy.newInstance(DefaultConstructionProxyFactory.java:126) ~[?:?]
at com.google.inject.internal.ConstructorInjector.provision(ConstructorInjector.java:111) ~[?:?]
at com.google.inject.internal.ConstructorInjector.construct(ConstructorInjector.java:90) ~[?:?]
at com.google.inject.internal.ConstructorBindingImpl$Factory.get(ConstructorBindingImpl.java:268) ~[?:?]
at com.google.inject.internal.ProviderToInternalFactoryAdapter$1.call(ProviderToInternalFactoryAdapter.java:46) ~[?:?]
at com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:1092) ~[?:?]
at com.google.inject.internal.ProviderToInternalFactoryAdapter.get(ProviderToInternalFactoryAdapter.java:40) ~[?:?]
at com.google.inject.internal.SingletonScope$1.get(SingletonScope.java:194) ~[?:?]
at com.google.inject.internal.InternalFactoryToProviderAdapter.get(InternalFactoryToProviderAdapter.java:41) ~[?:?]
at com.google.inject.internal.InjectorImpl$2$1.call(InjectorImpl.java:1019) ~[?:?]
at com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:1092) ~[?:?]
at com.google.inject.internal.InjectorImpl$2.get(InjectorImpl.java:1015) ~[?:?]
at com.google.inject.internal.InjectorImpl.getInstance(InjectorImpl.java:1054) ~[?:?]
at com.ur.injection.GuiceBuilder.get(GuiceBuilder.java:30) ~[?:?]
at gui.main.MainPanel.initFlippablePanel(MainPanel.java:33) ~[?:?]
at gui.main.MainPanel.(MainPanel.java:26) ~[?:?]
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) ~[?:1.8.0_272]
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) ~[?:1.8.0_272]
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) ~[?:1.8.0_272]
at java.lang.reflect.Constructor.newInstance(Constructor.java:423) ~[?:1.8.0_272]
at com.google.inject.internal.DefaultConstructionProxyFactory$ReflectiveProxy.newInstance(DefaultConstructionProxyFactory.java:126) ~[?:?]
at com.google.inject.internal.ConstructorInjector.provision(ConstructorInjector.java:111) ~[?:?]
at com.google.inject.internal.ConstructorInjector.construct(ConstructorInjector.java:90) ~[?:?]
at com.google.inject.internal.ConstructorBindingImpl$Factory.get(ConstructorBindingImpl.java:268) ~[?:?]
at com.google.inject.internal.ProviderToInternalFactoryAdapter$1.call(ProviderToInternalFactoryAdapter.java:46) ~[?:?]
at com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:1092) ~[?:?]
at com.google.inject.internal.ProviderToInternalFactoryAdapter.get(ProviderToInternalFactoryAdapter.java:40) ~[?:?]
at com.google.inject.internal.SingletonScope$1.get(SingletonScope.java:194) ~[?:?]
at com.google.inject.internal.InternalFactoryToProviderAdapter.get(InternalFactoryToProviderAdapter.java:41) ~[?:?]
at com.google.inject.internal.SingleParameterInjector.inject(SingleParameterInjector.java:38) ~[?:?]
at com.google.inject.internal.SingleParameterInjector.getAll(SingleParameterInjector.java:62) ~[?:?]
at com.google.inject.internal.ConstructorInjector.provision(ConstructorInjector.java:110) ~[?:?]
at com.google.inject.internal.ConstructorInjector.construct(ConstructorInjector.java:90) ~[?:?]
at com.google.inject.internal.ConstructorBindingImpl$Factory.get(ConstructorBindingImpl.java:268) ~[?:?]
at com.google.inject.internal.ProviderToInternalFactoryAdapter$1.call(ProviderToInternalFactoryAdapter.java:46) ~[?:?]
at com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:1092) ~[?:?]
at com.google.inject.internal.ProviderToInternalFactoryAdapter.get(ProviderToInternalFactoryAdapter.java:40) ~[?:?]
at com.google.inject.internal.SingletonScope$1.get(SingletonScope.java:194) ~[?:?]
at com.google.inject.internal.InternalFactoryToProviderAdapter.get(InternalFactoryToProviderAdapter.java:41) ~[?:?]
at com.google.inject.internal.InjectorImpl$2$1.call(InjectorImpl.java:1019) ~[?:?]
at com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:1092) ~[?:?]
at com.google.inject.internal.InjectorImpl$2.get(InjectorImpl.java:1015) ~[?:?]
at com.google.inject.internal.InjectorImpl.getInstance(InjectorImpl.java:1054) ~[?:?]
at com.ur.injection.GuiceBuilder.get(GuiceBuilder.java:30) ~[?:?]
at gui.main.URGUI.(URGUI.java:125) ~[?:?]
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) ~[?:1.8.0_272]
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) ~[?:1.8.0_272]
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) ~[?:1.8.0_272]
at java.lang.reflect.Constructor.newInstance(Constructor.java:423) ~[?:1.8.0_272]
at com.google.inject.internal.DefaultConstructionProxyFactory$ReflectiveProxy.newInstance(DefaultConstructionProxyFactory.java:126) ~[?:?]
at com.google.inject.internal.ConstructorInjector.provision(ConstructorInjector.java:111) ~[?:?]
at com.google.inject.internal.ConstructorInjector.construct(ConstructorInjector.java:90) ~[?:?]
at com.google.inject.internal.ConstructorBindingImpl$Factory.get(ConstructorBindingImpl.java:268) ~[?:?]
at com.google.inject.internal.ProviderToInternalFactoryAdapter$1.call(ProviderToInternalFactoryAdapter.java:46) ~[?:?]
at com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:1092) ~[?:?]
at com.google.inject.internal.ProviderToInternalFactoryAdapter.get(ProviderToInternalFactoryAdapter.java:40) ~[?:?]
at com.google.inject.internal.SingletonScope$1.get(SingletonScope.java:194) ~[?:?]
at com.google.inject.internal.InternalFactoryToProviderAdapter.get(InternalFactoryToProviderAdapter.java:41) ~[?:?]
at com.google.inject.internal.InjectorImpl$2$1.call(InjectorImpl.java:1019) ~[?:?]
at com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:1085) ~[?:?]
at com.google.inject.internal.InjectorImpl$2.get(InjectorImpl.java:1015) ~[?:?]
… 5 more
Also I got this exception while the Activator tries to activate my Services: org.osgi.framework.bundleexception unable to cache bundle. Unfortunately I can’t reproduce it now.
This might be of some importance, as it seems both errors occur on Thread-2:
16:23:46.994 WARN - Method used before correct value has been received from controller, returning default = joint_max_speed {thread: Thread-2 , loggerClass: com.ur.polyscope.robot.configuration.joint.JointConfigurationSettings}
16:23:46.998 WARN - Ignoring any future reports of error {thread: Thread-2 , loggerClass: com.ur.polyscope.robot.configuration.joint.JointConfigurationSettings}
16:23:50.298 WARN - Not connected to controller, trying to send string:
sec load_installation():
Also the bundleException was solved by running the comman mvn install -P ursim again.
Please help me, my degree may depend on this and I’m very lost.
without looking at your code I cant help you, all I can say is find the NullPointer. Follow the error message. The message should guide you to the problem. Look at you declarations, if you initialized a JSlider, Jbutton, etc. Make sure you initially set their values, make sure your globals/locals were initialized properly.
1 Like
Hi,
Thanks for the recommendation, the Service of one of my Contributions wasn’t finished. I could figure this out thanks to @Ebbe
1 Like