Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Websphere and JNis

Status
Not open for further replies.

Gaelle

Programmer
Jun 20, 2001
62
FR
Hi there !

I am trying to set up a web application, using WebSphere 3.5.4 on Solaris and JNIs.
I have a JSP page that calls a Java Class, which has C native calls.

I tried first to make a small app run, which had only JSP and Java (no .servlet), and I had it working following instructions in the InfoCenter, and using the Administration console.

Now I have done the same with my Jni app, and I get a java.lang.noClassDefFoundError.
Here is my directory structure :
/opt/Websphere/AppServer/hosts/default_host/NombreWebApp/web/ for HTML and JSP
/opt/Websphere/AppServer/hosts/default_host/NombreWebApp/servlets/ for .java, .class, .h, .c and .so

Is there a special way to configure the web application since I have to use JNIs ?
I can’t solve my error, which seems to me like a classpath problem ?…

Thanks,
Gaelle.
 
Hi,

java.lang.noClassDefFoundError simply means that WebSphere is unable to locate the classes required. The standard approach is:

Simple procedure: Default file placement

Configure a new Web application. Accept the default values for its document root and classpath.
In the OS change directory to <was_installation_root>/hosts.
Create a subdirectory with the logical name of the Web application, such as NombreWebApp
Change directory to the <was_installation_root>/hosts/NombreWebApp
Create subdirectories named &quot;servlets&quot; and &quot;web.&quot;
Place the servlet class and JAR files in the servlets directory.
Place all other supporting files in the web directory:
HTML
XML
graphics
In the advanced tab of the Web Application set the document root to:
<was_installation_root>/hosts/NombreWebApp/web/
and the Classpathto <was_installation_root>/hosts/NombreWebApp/servlets and click Apply.
If you are running the ApplicationServer as non-root then be sure that you can run &quot;jar -tvf <jar name>&quot; as the non-root user successfully. Remember WebSphere is really not that complicated you specify the classpath then that is where it will look for the required classes. If it throws a noClassDefFoundError then either the classes are not where it says they are, the jar is corrupt or the particular does not have OS access to that particular directory.

Hope this helps (or did I miss the point???????)

Fearo
&quot;Will McCarthy take Keane back?&quot; Now there's a real question!!

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top