Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > JNI JVM invocation works in 1.3.1, but get NoClassDefFoundError in 1.4.2

Reply
Thread Tools

JNI JVM invocation works in 1.3.1, but get NoClassDefFoundError in 1.4.2

 
 
Brian Whitney
Guest
Posts: n/a
 
      11-05-2003
I've spent a day reading posts from javasoft forums
and Google groups on this topic, but no solutions have worked....

The basic problem is that when I switch from using
1.3.1 to 1.4.2, using the same EXACT CLASSPATH and
code, I get a this when I run a C++ application that
uses JNI to invoke the JVM:

Exception in thread "main" java.lang.NoClassDefFoundError:
xxx.yyy.myclass

To switch from 1.3.1 to 1.4.2 I just change my JAVA_HOME and recompile
everything. My application has worked fine for months under 1.3.1, but
breaks with the exception using 1.4.2. I'm using third party jars that
were not compiled under 1.4.2. Even though I have control over the JVM
version I'm running, I tried -target 1.1 anyway, but it does not fix
the problem using 1.4.2.

I set 3 arguments to the options for JNI_CreateJavaVM:
1) -Djava.class.path <my_classpath>
2) -Djava.security.policy (all permissions granted)
3) -Xusealtsigs
I set the version to JNI_VERSION_1_4;

Tried using JNI_GetDefaultJavaVMInitArgs to see default args to JVM,
but as noted in other postings, this method does not fill in the init
args structure.

I am running everything on the same host and am running
as an application, NOT an applet.

Again, unless there is some new nuance in 1.4.2, this is NOT a
classpath issue.

Also, I'm running under Solaris.

Any help on this would be greatly appreciated.
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
JVM invocation with JDK1.4 using JNI Uri Java 1 10-21-2004 09:03 AM
NoClassDefFoundError with MSJVM but not with Sun's JVM NB Java 3 07-31-2004 08:49 AM
NoClassDefFoundError with MSJVM but not with Sun's JVM NB Java 1 07-31-2004 08:41 AM
java.lang.NoClassDefFoundError: java.lang.NoClassDefFoundError: org/apache/commons/logging/LogFactory greg.knaddison@gmail.com Python 1 06-22-2004 10:58 PM
IBM's JNI fails where Sun's JNI works Alex Hunsley Java 4 11-04-2003 10:34 AM



Advertisments