You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Tejo Vamsi Prayaga <te...@yahoo.com> on 2004/06/03 23:20:22 UTC

java.lang.NoClassDefFoundError on invocation of a native method

Hi All,

I am new to JNI and Servlets and I am facing one of the
infamous problems, which is not getting resolved even after
lot of debugging and setup changes. We are using
Struts framework and Tomcat 4.X
In one of our service implementations, which is invoked
from an action class,
we are using native code, which fails to load external
classes. 

This class is already present in the web application's lib
directory
(<web-app>/WEB-INF/lib) in the form of a jar file. But even
then the
native code failed to load. When looked at the
documentation of FindClass
present in jni.h, it said that it will search for the
classes in the
elements specified in the CLASSPATH variable. So I have
included that jar file
int the CLASSPATH, in the tomcat startup.sh script, but no
luck. It gave rise to
one more new error and could not load the ActionServlet
itself

java.lang.NoClassDefFoundError:
org/apache/struts/action/ActionServlet
	at java.lang.ClassLoader.defineClass0(Native Method)
	at java.lang.ClassLoader.defineClass(ClassLoader.java:488)
				.
				.
				.	
				
1)				
Has anyone encountered this kind of problem. If yes, could
you please let me
know what could be the probable reason for this, and what
can be done to avoid
this problem.

2) 
Typically, where should these native code accessible
classes be placed and what
is the kind of configuration setup we have to do so that
these classes will be
picked up by the native code.

Thanks a lot for your time.

Regards
Tejo


	
		
__________________________________
Do you Yahoo!?
Friends.  Fun.  Try the all-new Yahoo! Messenger.
http://messenger.yahoo.com/ 

---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org