Win a copy of Machine Learning for Business: Using Amazon SageMaker and JupyterE this week in the Jython/Python forum
or Object Design Style Guide in the Object-Oriented programming forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Paul Clapham
  • Jeanne Boyarsky
  • Knute Snortum
Sheriffs:
  • Liutauras Vilda
  • Tim Cooke
  • Junilu Lacar
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Joe Ess
  • salvin francis
  • fred rosenberger

JNLP error: Could not find main class

 
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]
 
Bartender
Posts: 11445
19
Android Google Web Toolkit Mac Eclipse IDE Ubuntu Java
  • 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>
 
Sheriff
Posts: 3838
66
Netbeans IDE Oracle Firefox Browser
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for taking the time to share the solution with us!
 
Run away! Run away! Here, take this tiny ad with you:
Sauce Labs - World's Largest Continuous Testing Cloud for Websites and Mobile Apps
https://coderanch.com/t/722574/Sauce-Labs-World-Largest-Continuous
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!