Re: Problems using a compiled jar with gcj

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 08/11/2010 04:25 PM, Andrew Haley wrote:
> On 08/11/2010 03:50 PM, Andrew Haley wrote:
>> On 08/11/2010 03:32 PM, Lothar Werzinger wrote:
>>> On Wednesday, August 11, 2010, Andrew Haley wrote:
>>>>>>> As my app needs the "Bindings" Class from JSR 223 and the downloaded
>>>>>>> jar did for some reason not contain it I tried extracting
>>>>>>> javax/scripting from a JDK1.6 rt.jar
>>>>>>>
>>>>>>> Now the ominous NoClassDefFoundError is back. Any ideas?
>>>>>>>
>>>>>>> $ ./build.sh
>>>>>>> testgcj
>>>>>>> Create JavaVM ...
>>>>>>> Create JavaVM done.
>>>>>>> Java Exception:
>>>>>>> java.lang.NoClassDefFoundError: javax.script.ScriptEngineManager
>>>>>>
>>>>>> I don't know what is causing this.  I'll debug it tomorrow.
>>>>>
>>>>> Thanks, I appreciate that very much!
>>>>
>>>> I'm not seeing any problem with javax.script.ScriptEngineManager.
>>>> Well, I was, but I had duplicate copies of that class.
>>>>
>>>> You really do need PrintStackTrace().
>>>
>>> I did add that.
>>>
>>>> I now see:
>>>>
>>>> java.lang.NoClassDefFoundError:
>>>> com.sun.script.javascript.RhinoScriptEngineFactory at
>>>> java.lang.Class.initializeClass(natClass.cc:730)
>>>>    at java.lang.Class.forName(natClass.cc:111)
>>>>    at java.lang.Class.forName(Class.java:133)
>>>>    at javax.script.ScriptEngineManager.addSpi(ScriptEngineManager.java:320)
>>>>    at javax.script.ScriptEngineManager.<init>(ScriptEngineManager.java:70)
>>>> Caused by: java.lang.ClassNotFoundException: org.mozilla.javascript.Context
>>>> not found in gnu.gcj.runtime.SystemClassLoader{urls=[file:./],
>>>> parent=gnu.gcj.runtime.ExtensionClassLoader{urls=[], parent=null}} at
>>>> java.net.URLClassLoader.findClass(URLClassLoader.java:531)
>>>>    at java.lang.ClassLoader.loadClass(ClassLoader.java:452)
>>>>    at java.lang.ClassLoader.loadClass(ClassLoader.java:387)
>>>>    at java.lang.Class.initializeClass(natClass.cc:720)
>>>>    ...4 more
>>>
>>> Did you use my latest code (including the scripting.jar that I extracted from 
>>> JDK1.6)? I attached it again.

But why do you want to extract scripting.jar from JDK1.6?  The one you had
before is much more likely to work.

The only problem there was that you didn't have the jython engine and
implementation.

>>> Your attached script suggests that you are still using the downloaded one that 
>>> for some reason lacks the "Bindings" class.
>>>
>>>
>>> $ ./build.sh
>>> gcjtest/main.cpp
>>> gcjtest/build.sh
>>> gcjtest/scripting.jar
>>> testgcj
>>> Create JavaVM ...
>>> Create JavaVM done.
>>> Java Exception:
>>> java.lang.NoClassDefFoundError: javax.script.ScriptEngineManager
>>>    at java.lang.Class.initializeClass(libgcj.so.10)
>>> Caused by: java.lang.NullPointerException
>>>    at java.lang.Class.initializeClass(libgcj.so.10)
>>
>> I don't get that.  I get
>>
>> Create JavaVM done.
>> Java Exception:
>> java.lang.NullPointerException
>>    <<No stacktrace available>>
>>
>> because there is no jython engine present.
> 
> My mistake.  I'm investigating.

Your gcj is too old.  You're missing this patch:

http://gcc.gnu.org/ml/java-patches/2010-q1/msg00023.html

By the way, the missing class in question is sun.misc.Service.

Andrew.


[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux