Jython Classes in Packages

  1 post   Feedicon  
Replies: 0 - Last Post: April 25, 2013 17:10
by: Sergio Valdez
« Older Topic » Newer Topic
showing 1 - 1 of 1
 
Posted: April 25, 2013 17:10 by Sergio Valdez
Hi,

I'm trying to use this lib, but i want to know if its possible tu call Modules that are contained into a package, i was traing but not succes here is my code.

PySystemObjectFactory factory = new PySystemObjectFactory(MessageHandlerType.class, "pkg/MessageHandler", "pkg.MessageHandler");
		MessageHandlerType handler = (MessageHandlerType)factory.createObject();


Seem like the module was found but something wrong with the class

Stacktrace:
Caught: Traceback (most recent call last):
  File "__pyclasspath__/pkg/MessageHandler.py", line 11, in <module>
java.lang.NoClassDefFoundError: IllegalName: org.python.proxies.pkg/MessageHandler$MessageHandler$0

	at java.lang.ClassLoader.preDefineClass(ClassLoader.java:477)

	at java.lang.ClassLoader.defineClassCond(ClassLoader.java:626)

	at java.lang.ClassLoader.defineClass(ClassLoader.java:616)

	at org.python.core.BytecodeLoader$Loader.loadClassFromBytes(BytecodeLoader.java:119)

	at org.python.core.BytecodeLoader.makeClass(BytecodeLoader.java:37)

	at org.python.core.BytecodeLoader.makeClass(BytecodeLoader.java:52)

	at org.python.core.MakeProxies.makeClass(MakeProxies.java:29)

	at org.python.core.MakeProxies.makeProxy(MakeProxies.java:73)

	at org.python.core.PyType.setupProxy(PyType.java:632)

	at org.python.core.PyType.newType(PyType.java:196)

	at org.python.core.PyType.type___new__(PyType.java:150)

	at org.python.core.PyType$exposed___new__.new_impl(Unknown Source)

	at org.python.core.PyType.invokeNew(PyType.java:466)

	at org.python.core.PyType.type___call__(PyType.java:1558)

	at org.python.core.PyType.__call__(PyType.java:1548)

	at org.python.core.PyObject.__call__(PyObject.java:422)

	at org.python.core.Py.makeClass(Py.java:1639)

	at org.python.core.Py.makeClass(Py.java:1600)

	at org.python.core.Py.makeClass(Py.java:1592)

	at pkg.MessageHandler$py.f$0(__pyclasspath__/pkg/MessageHandler.py:11)

	at pkg.MessageHandler$py.call_function(__pyclasspath__/pkg/MessageHandler.py)

	at org.python.core.PyTableCode.call(PyTableCode.java:165)

	at org.python.core.PyCode.call(PyCode.java:18)

	at org.python.core.imp.createFromCode(imp.java:386)

	at org.python.core.util.importer.importer_load_module(importer.java:109)

	at org.python.core.ClasspathPyImporter.ClasspathPyImporter_load_module(ClasspathPyImporter.java:63)

	at org.python.core.ClasspathPyImporter$ClasspathPyImporter_load_module_exposer.__call__(Unknown Source)

	at org.python.core.PyBuiltinMethodNarrow.__call__(PyBuiltinMethodNarrow.java:47)

	at org.python.core.imp.loadFromLoader(imp.java:513)

	at org.python.core.imp.find_module(imp.java:467)

	at org.python.core.imp.import_next(imp.java:713)

	at org.python.core.imp.import_name(imp.java:824)

	at org.python.core.imp.importName(imp.java:884)

	at org.python.core.ImportFunction.__call__(__builtin__.java:1220)

	at org.python.core.PyObject.__call__(PyObject.java:387)

	at org.plyjy.factory.PySystemObjectFactory.<init>(PySystemObjectFactory.java:33)

	at org.plyjy.factory.PySystemObjectFactory.<init>(PySystemObjectFactory.java:39)

	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)

	at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)

	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)

	at java.lang.reflect.Constructor.newInstance(Constructor.java:513)

	at org.codehaus.groovy.reflection.CachedConstructor.invoke(CachedConstructor.java:77)

	at org.codehaus.groovy.runtime.callsite.ConstructorSite$ConstructorSiteNoUnwrapNoCoerce.callConstructor(ConstructorSite.java:102)

	at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallConstructor(CallSiteArray.java:57)

	at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callConstructor(AbstractCallSite.java:182)

	at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callConstructor(AbstractCallSite.java:198)

	at Test.main(Test.groovy:10)

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

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

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

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

	at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:90)

	at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:233)

	at groovy.lang.MetaClassImpl.invokeStaticMethod(MetaClassImpl.java:1315)

	at org.codehaus.groovy.runtime.InvokerHelper.invokeMethod(InvokerHelper.java:822)

	at groovy.lang.GroovyShell.runScriptOrMainOrTestOrRunnable(GroovyShell.java:264)

	at groovy.lang.GroovyShell.run(GroovyShell.java:220)

	at groovy.lang.GroovyShell.run(GroovyShell.java:150)

	at groovy.ui.GroovyMain.processOnce(GroovyMain.java:556)

	at groovy.ui.GroovyMain.run(GroovyMain.java:343)

	at groovy.ui.GroovyMain.process(GroovyMain.java:329)

	at groovy.ui.GroovyMain.processArgs(GroovyMain.java:118)

	at groovy.ui.GroovyMain.main(GroovyMain.java:98)

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

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

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

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

	at org.codehaus.groovy.tools.GroovyStarter.rootLoader(GroovyStarter.java:106)

	at org.codehaus.groovy.tools.GroovyStarter.main(GroovyStarter.java:128)

Replies: 0 - Last Post: April 25, 2013 17:10
by: Sergio Valdez
« Older Topic » Newer Topic
  • Mysql
  • Glassfish
  • Jruby
  • Rails
  • Nblogo
Terms of Use; Privacy Policy;
© 2014, Oracle Corporation and/or its affiliates
(revision 20160708.bf2ac18)
 
 
Close
loading
Please Confirm
Close