jnlp failure "Could not find the main class"

Questions, answers, tips and ideas on Servoy Client

jnlp failure "Could not find the main class"

Postby richh » Wed Mar 21, 2012 10:27 pm

Apologies if this issue has been solved - but my searches of the forums have been unsuccessful.

Scenario: Servoy Application Server 5.2.2 installed shortly after 5.2.2 was released. The server has been rock solid. There is a LAN with 5 sometimes 6 PCs. The PCs have Win XP or 7 (64bit). JRE varies between 6 update 15 and 29. All work fine.

My client has purchased a new machine running Win 7 32bit. On browsing to the app server port 8080 and clicking 'launch servoy client' the jnlp file downloads. Opening the file results in a failure. The failure message reads:
"Could not find the main class:
[C:\Users\path through temporary Internet files to ]\servoy_client.jnlp. Program will exit."

An OK button closes the failure message.

On opening and examining the downloaded jnlp file, it seems to be OK to me. In particular, it has:
Code: Select all
<application-desc main-class="com.servoy.j2db.smart.J2DBClient">


Testing using Java check applications from the Oracle website shows that the JRE is working OK.

Has anyone come across this behaviour in the past? Is there a recommended way forward?
Richard Hinder
Chartered Engineer and priest
richh
 
Posts: 78
Joined: Sat Jan 14, 2006 8:34 pm
Location: London

Re: jnlp failure "Could not find the main class"

Postby Andrei Costescu » Thu Mar 22, 2012 1:36 pm

The message makes me think it's trying to use the actual .jnlp file as a class to be run directly... Which obviously it is not.

This might be caused by a wrong file association for .jnlp in his OS.
For example (I think) if he ever right clicked a jnlp file and chose "Open with..." then pointed to java.exe then java.exe would give this error message.
Jnlp files must be associated with javaws.exe (and they are by default).
Andrei Costescu
Servoy
Andrei Costescu
 
Posts: 1018
Joined: Tue Jun 26, 2007 3:14 pm

Re: jnlp failure "Could not find the main class"

Postby richh » Thu Mar 22, 2012 8:42 pm

Thanks for your suggestion Andrei.

On the PC concerned, .jnlp is associated with 'Java(TM) Platform SE binary'. To check, I used 'Associate a file type or protocol with a specific program', selected .jnlp, browsed to 'javaws.exe', and confirmed the change. The result: no change in behaviour. The same error message occurs.

Any further thoughts?
Richard Hinder
Chartered Engineer and priest
richh
 
Posts: 78
Joined: Sat Jan 14, 2006 8:34 pm
Location: London

Re: jnlp failure "Could not find the main class"

Postby Andrei Costescu » Fri Mar 23, 2012 1:11 pm

It might also be a browser download association that is wrong. First time you download a .jnlp it usually asks what should be used to open it.
But it's unlikely that someone browsed to java.exe instead of using the system default...

Try to run this on the downloaded jnlp file from a command prompt/shell in the download directory:
Code: Select all
javaws servoy_client.jnlp
assumming that is the jnlp's filename.

If this results in the same message, then something else must be causing it.
Andrei Costescu
Servoy
Andrei Costescu
 
Posts: 1018
Joined: Tue Jun 26, 2007 3:14 pm

Re: jnlp failure "Could not find the main class"

Postby richh » Fri Mar 23, 2012 4:38 pm

Following your suggestion Andrei, I have been able to launch the Servoy client. However, on launching from the now present shortcuts I get errors as shown in the attachments.
java error 1.png
This is the 'Wrapped Exception'. Should the cached launcher be used?
java error 1.png (17.08 KiB) Viewed 8342 times

java error 2.png
This is the 'Exception'.
java error 2.png (14.65 KiB) Viewed 8342 times

Are you able to see the core problem here?
Richard Hinder
Chartered Engineer and priest
richh
 
Posts: 78
Joined: Sat Jan 14, 2006 8:34 pm
Location: London

Re: jnlp failure "Could not find the main class"

Postby Andrei Costescu » Mon Mar 26, 2012 9:48 am

If what I suggested works (you were able to succesfully start and use the client), then it must be a wrong file association. This must be corrected. As you said it's not a OS file association so it must be browser-related. What browser did you use?

The other error messages seem to happen because of a wrong cache (maybe wrong because of the attempts to use the jnlp incorrectly).
Try to clear the java cache from Control panel -> Java -> General -> Settings.
Andrei Costescu
Servoy
Andrei Costescu
 
Posts: 1018
Joined: Tue Jun 26, 2007 3:14 pm

Re: jnlp failure "Could not find the main class" [SOLVED]

Postby richh » Fri Mar 30, 2012 11:02 am

Further trials and investigations confirmed Andrei's view that the root cause was a wrong file association. Many thanks Andrei for your insightfulness and your generous help.

On this particular PC there was a corruption in the registry which prevented the reassignment of .jnlp with javaws.exe.

To correct the issue, I restored the system to an earlier stage of commissioning. This action eliminated the corruption in the registry. I was then able to make the correct assignment of .jnlp using the Control Panel.

Result: Servoy client can now be launched from the browser and from the Start menu and desktop as normal.
Richard Hinder
Chartered Engineer and priest
richh
 
Posts: 78
Joined: Sat Jan 14, 2006 8:34 pm
Location: London

Re: jnlp failure "Could not find the main class"

Postby Andrei Costescu » Fri Mar 30, 2012 2:40 pm

Yw. I'm glad you made it work.
Andrei Costescu
Servoy
Andrei Costescu
 
Posts: 1018
Joined: Tue Jun 26, 2007 3:14 pm


Return to Servoy Client

Who is online

Users browsing this forum: No registered users and 14 guests