wood burning stoves 2.0*
The moose likes JNLP and Web Start and the fly likes Spring Jar files - Can not find class def Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JNLP and Web Start
Bookmark "Spring Jar files - Can not find class def" Watch "Spring Jar files - Can not find class def" New topic
Author

Spring Jar files - Can not find class def

Mike Wesley
Greenhorn

Joined: Apr 12, 2012
Posts: 1
Hi.

I have a simple swing webstart demo that worked great using the .jnlp file. Then, I converted it to work with the Spring Framework and HttpInvoker. I worked great when I ran it as an application from Webshpere RAD. However, after I created a new .jnlp file to inlcude / download the TreeDemo.jar and all the Spring jars as resources it throws a NoClassDefFoundError :

java.lang.NoClassDefFoundError: org/springframework/context/ApplicationContext

As I understand it from the Oracle / Webstart documentation the resource jars listed in the jnlp file should automatically be downloaded and included in the class path. It finds the Treedemo.jar main class but not the ApplicationContext class from the Spring jar. The confusing part is that ApplicationContext class is in fact in the spring.jar. I can drill down through org/springframework/context/ApplicationContext and get to it in the webapp lib folder as well as import it into classes at compile time.

So, it appears that it is in the class path when run as a application from RAD, but when served via WebStart it does not get included in the class path or it is not reachable by Web Start.

TreeDemo.jnlp


<?xml version="1.0" encoding="utf-8"?>
<jnlp spec="1.0+" codebase="http://localhost:9080/SOSWeb/" href="TreeDemo.jnlp">
<information>
<title>HelloWorld</title>
<vendor>IBM - JWS example of HelloWorld</vendor>
<description>Tree Demo - Example of JWS</description>
<description kind="short">Tree Demo with Spring DB Access example</description>
<offline-allowed/>
</information>
<resources>
<j2se version="1.6+"/>
<jar href="spring.jar"/>
<jar href="TreeDemo.jar"/>
<jar href="spring-web.jar"/>
<jar href="spring-webmvc.jar"/>
<jar href="commons-logging.jar"/>
<jar href="commons-pool.jar"/>
<jar href="commons-lang.jar"/>
<jar href="commons-httpclient.jar"/>
<jar href="xmlconfig.jar"/>


</resources>
<application-desc main-class="org.sos.ss.client.hello.TreeDemo"/>
</jnlp>

Any ideas ?
Thanks in advance.





Martin Vajsar
Sheriff

Joined: Aug 22, 2010
Posts: 3606
    
  60

Welcome to the Ranch!

In my project, the files listed as resource are still listed in classpath in manifest.mf file. I'm not sure whether this is required, but I don't have problems running the app.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Spring Jar files - Can not find class def
 
Similar Threads
Run JAR file in Applet
JNLP I am getting the File Not found exception
update pattern?
Doesn't work properly of my JNLP webstart
ClassNotFound Exception..