Win a copy of Java Mock Exams (software) this week in the Programmer Certification (OCPJP) forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

JNLP error: Could not find main class

 
akita deepak
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
[Thumbnail for JVM Launcher error.jpg]
 
Maneesh Godbole
Bartender
Posts: 11445
18
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can you show us your jnlp launch file?
 
akita deepak
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
any suggestions please
 
akita deepak
Greenhorn
Posts: 6
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 3752
62
Chrome Netbeans IDE Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for taking the time to share the solution with us!
 
What are you doing? You are supposed to be reading this tiny ad!
the new thread boost feature brings a LOT of attention to your favorite threads
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!