aspose file tools*
The moose likes JNLP and Web Start and the fly likes JNLP error: Could not find main class 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 "JNLP error: Could not find main class" Watch "JNLP error: Could not find main class" New topic
Author

JNLP error: Could not find main class

akita deepak
Greenhorn

Joined: Oct 09, 2013
Posts: 6
Hi,

I have a TrainingDNA.jnlp for TrainingDNA.jar. The jar and jnlp both are host from Tomcat Apache 6(webapps/root) on linux server. The jnlp launches jar file application fine in 64bit Windows OS but when I try from:
1. IE browser 32bit OS, Win XP it gives me error : "Could not find main class : " (Attached JVM Launcher error.jpeg), I had enabled java console to see output, below is the java console error:

Java Web Start 1.6.0_43
Using JRE version 1.6.0_43-b01 Java HotSpot(TM) Client VM
User home directory = C:\Documents and Settings\s-projectusertwod
----------------------------------------------------
c: clear console window
f: finalize objects on finalization queue
g: garbage collect
h: display this help message
m: print memory usage
o: trigger logging
p: reload proxy configuration
q: hide console
r: reload policy configuration
s: dump system and deployment properties
t: dump thread list
v: dump thread stack
0-5: set trace level to <n>
----------------------------------------------------
java.class.path=C:\\Program Files\\Java\\jre6\\lib\\deploy.jar
java.majorVersion=1
java.minorVersion=6
Class-Start=com.sangha.gui.Main
Class-Memory=1024
-propsResource
/com/sangha/gui/client.cfg
DNA.Client
Java Path=null
MAX MEMORY=259522560
Executing: javaw.exe -Xmx1024M -classpath C:\\Program Files\\Java\\jre6\\lib\\deploy.jar com.sangha.gui.Main -propsResource /com/sangha/gui/client.cfg DNA.Client
java.lang.NoClassDefFoundError: com/sangha/gui/Main
Caused by: java.lang.ClassNotFoundException: com.sangha.gui.Main
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)


2. From Firefox just java Java 6 window comes and java console flashes for a second.

PS: There is nothing wrong with the TrainingDNA.jar since it runs fine on 32bit if I don't use JNLP and double click and run it.

Regards,
Akita


[JVM Launcher error.jpg]

Maneesh Godbole
Saloon Keeper

Joined: Jul 26, 2007
Posts: 10523
    
    9

Can you show us your jnlp launch file?


[How to ask questions] [Donate a pint, save a life!] [Onff-turn it on!]
akita deepak
Greenhorn

Joined: Oct 09, 2013
Posts: 6
Sure..below is my jnlp file:

<?xml version="1.0" encoding="utf-8"?>
<jnlp spec="1.0+" codebase="http://192.168.244.25:8080/" href="TrainingDNA.jnlp">
<information>
<title>Training DNA</title>
<vendor>DNA</vendor>
<homepage href="http://www.google.com" />
<description>Web Porting Testing</description>
</information>
<security>
<all-permissions/>
</security>
<resources>
<jar href="TrainingDNA.jar" main="true" />
<j2se version="1.6+" />
</resources>
<application-desc main-class="com.sangha.util.Relauncher" />
</jnlp>


*The main class mentioned above 'Relauncher' is just an entry point to the application, in this class it reads a config file 'relauncher.config' which in turn specifies the main class for application. the contents of config file are as below:

Class-Start: com.sangha.gui.Main
Class-Memory: 1024
Class-Arg-0: -propsResource
Class-Arg-1: /com/sangha/gui/client.cfg
Class-Arg-2: DNA.Client
java.majorVersion: 1
java.minorVersion: 6
akita deepak
Greenhorn

Joined: Oct 09, 2013
Posts: 6
any suggestions please
akita deepak
Greenhorn

Joined: Oct 09, 2013
Posts: 6
It started working in 32bit java, did foll:
Replaced:
<resources>
<jar href="TrainingDNA.jar" main="true" />
<j2se version="1.6+" />
</resources>
with:
<resources>
<j2se version="1.6+" java-vm-args="-Xmx1024M"/>
<jar href="TrainingDNA.jar" main="true" />
<property name="sun.java2d.noddraw" value="true"/>
</resources>
Martin Vajsar
Sheriff

Joined: Aug 22, 2010
Posts: 3611
    
  60

Thanks for taking the time to share the solution with us!
 
 
subject: JNLP error: Could not find main class