NeuroBox3D / VRL-NeuroBox-Plugin

VRL-NeuroBox-Plugin is the plugin for detailed simulations in Neuroscience.
http://neurobox.eu
2 stars 1 forks source link

Running project as ConsoleApp causes NPE in DomainAndFunctionDefinition component #27

Closed miho closed 9 years ago

miho commented 9 years ago

Steps to reproduce:

NOTE this assumes that issue #25 is fixed.

java.lang.reflect.InvocationTargetException
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:497)
    at eu.mihosoft.vrl.system.VSessionRunner.runMain(VSessionRunner.java:251)
    at eu.mihosoft.vrl.system.VSessionRunner.run(VSessionRunner.java:181)
    at eu.mihosoft.vrl.system.VSessionRunner$run.call(Unknown Source)
    at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:45)
    at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:110)
    at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:122)
    at eu.mihosoft.vrl.user.VSessionMainClass.main(VSessionMainClass.groovy:10)
Caused by: java.lang.NullPointerException
    at edu.gcsc.vrl.neurobox.control.DomainAndFunctionDefiniton.defineDomainAndFunction(DomainAndFunctionDefiniton.java:90)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:497)
    at org.codehaus.groovy.runtime.callsite.PojoMetaMethodSite$PojoCachedMethodSite.invoke(PojoMetaMethodSite.java:189)
    at org.codehaus.groovy.runtime.callsite.PojoMetaMethodSite.call(PojoMetaMethodSite.java:53)
    at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:45)
    at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:110)
    at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:138)
    at eu.mihosoft.vrl.user.Main.run(Main.groovy:39)
    ... 11 more
miho commented 9 years ago

@stephanmg how did you fix your console app issues? do you have a fix for this one?

stephanmg commented 9 years ago

@miho for the above issue I don't have a guess, sorry, I circumvented only the resource path issue in console apps a different way. but your fix for issue #25 is more appropriate.

bsumirak commented 9 years ago

I cannot reproduce this. And I do not see why DomainAndFunctionDefiniton.java:90 which is

String subsets = "";

should result in a NPE. However, it does not work for me either, failing with:

java.lang.reflect.InvocationTargetException
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:497)
    at eu.mihosoft.vrl.system.VSessionRunner.runMain(VSessionRunner.java:251)
    at eu.mihosoft.vrl.system.VSessionRunner.run(VSessionRunner.java:181)
    at eu.mihosoft.vrl.system.VSessionRunner$run.call(Unknown Source)
    at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:45)
    at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:108)
    at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:120)
    at eu.mihosoft.vrl.user.VSessionMainClass.main(VSessionMainClass.groovy:10)
Caused by: java.lang.NoClassDefFoundError: edu/gcsc/vrl/neurobox/control/ResourcePathProvider
    at eu.mihosoft.vrl.user.Main.run(Main.groovy:13)
    ... 11 more
Caused by: java.lang.ClassNotFoundException: class name: edu.gcsc.vrl.neurobox.control.ResourcePathProvider
    at eu.mihosoft.vrl.system.VClassLoader.findClass(VClassLoader.java:164)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
    at eu.mihosoft.vrl.system.VSessionRunner$1.loadClass(VSessionRunner.java:155)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
    ... 12 more

@miho Maybe you understand what this one means?

stephanmg commented 9 years ago

@bsumirak: did you update your branch? you need to export the edu.gcsc.vrl.neurobox package.

I'm sorry, I did not export all sub-packages of the edu.gcsc.vrl.neurobox package explicit, I think this should be mandatory @miho, shouldn't it?

miho commented 9 years ago

@stephanmg check the documentation There are exportPackage-methods that automatically export subpackages.

bsumirak commented 9 years ago

@stephanmg It appears you really have to export all sub-packages individually. Having done this, I can now reproduce the described error. I will look into it.

stephanmg commented 9 years ago

@miho: ah, that's great. thanks. seems I need to update my VRL :) :+1: @bsumirak: great!

bsumirak commented 9 years ago

Fixed. Bug was due to unimplemented getValueAsCode() of FunctionDefinitionType in VRL-UserData plugin.

bsumirak commented 9 years ago

Well, maybe I was wrong...

bsumirak commented 9 years ago

Ok, the problem was solved by using *.class.getName() instead of plain class name as used in direct code. Apparently, the problem was that the name for nested types is not appended by a ".", but by a "$".

stephanmg commented 9 years ago

Okay.

@bsumirak can you commit your Code?

I see, it's in the VRL-Userdata project...