3

I recently developed a whole system in Java that connects to a database (using jtds.jdbc.Driver) and exports and imports the table content to an excel sheet using Apache POI. I used Swing for the user interface. The user will interact with it for authentication and file management.

Apparently the client wants it deployed so I started to deploy using Java Web Start on an Apache tomcat server.

I put in reference this interesting tutorial. Since I followed it

Launch file

<jnlp spec="1.0+" codebase="http://localhost:8080/" href="Test.jnlp">
  <information>
    <title>Talisman</title>
    <vendor>CCT</vendor>
    <homepage href="http://localhost:8080/"/>
    <description>Testing Testing</description>
  </information>
  <resources>
    <j2se version="1.6+"/>
    <jar href="Talisman.jar"/>
  </resources>
  <application-desc main-class="cct.karim.karim"/>
</jnlp>

Run-time exception

java.lang.NoClassDefFoundError: org/apache/poi/ss/usermodel/CellStyle
    at java.lang.Class.getDeclaredMethods0(Native Method)
    at java.lang.Class.privateGetDeclaredMethods(Class.java:2442)
    at java.lang.Class.getMethod0(Class.java:2685)
    at java.lang.Class.getMethod(Class.java:1620)
    at com.sun.javaws.Launcher.executeApplication(Unknown Source)
    at com.sun.javaws.Launcher.executeMainClass(Unknown Source)
    at com.sun.javaws.Launcher.doLaunchApp(Unknown Source)
    at com.sun.javaws.Launcher.run(Unknown Source)
    at java.lang.Thread.run(Thread.java:722)
Caused by: java.lang.ClassNotFoundException: org.apache.poi.ss.usermodel.CellStyle
    at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
    at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
    at com.sun.jnlp.JNLPClassLoader.findClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:423)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:356)
    ... 9 more

What seems to be the problem?

1 Answer 1

1

You're not including your POI jar with your deployment. I suspect there'll be other jars that you need to deploy too. Everything your app needs has to be downloaded and installed on your client's host.

You'll need a line like:

   <jar href="apache-poi.x.y.jar"/>

for each jar file.

Sign up to request clarification or add additional context in comments.

4 Comments

well i did this <jar href="poi-3.9-20121203.jar"/> and I got this com.sun.deploy.net.FailedDownloadException: Unable to load resource: localhost:8080/poi-3.9-20121203.jar
I used a lot of Jars in in my project then I exported my project into a jar(Talisman.jar)
Since the codebase points to http://localhost:8080/, check the location of each Jar in the browser using something like.. http://localhost:8080/poi-3.9-20121203.jar If you cannot download it directly in the browser, neither can the JRE.
all my jars are internal jars inside the project direcotry

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.