Me Again! Getting error "Could not find main-class" when trying to run an application using WebStart

Hi,

I am trying (and failing) to install an java app using WebStart.  But I am getting the error message ...

Could not find main-class com.churchillchina.gapanalysis.GapDataClient in http://localhost/jars/gapdataclient.jar

I have posted below the build bat I use to construct the jar file, the JNLP file that launches WebStart and the full error message that I get in WebStart when it tries to run the app.  I copy the jar from my dev machine to the server.  Hopefully someone will know what I'm doing wrong!

Cheers,
Steve



BUILDGAPDATACLIENT.BAT ==================

javac com\churchillchina\gapanalysis\GapDataClient.java -d build\gapdataclient\lib
javac com\churchillchina\gapanalysis\GapDataClientEngine.java -d build\gapdataclient\lib
javac com\churchillchina\gapanalysis\GapDataClientFrame.java -d build\gapdataclient\lib
javac com\churchillchina\gapanalysis\GapDataType.java -d build\gapdataclient\lib
javac com\churchillchina\gapanalysis\GapDataValue.java -d build\gapdataclient\lib
javac com\churchillchina\gapanalysis\GapException.java -d build\gapdataclient\lib
javac com\churchillchina\gapanalysis\GapGlobals.java -d build\gapdataclient\lib
javac com\churchillchina\gapanalysis\GapMessage.java -d build\gapdataclient\lib
javac com\churchillchina\gapanalysis\PriceRanges.java -d build\gapdataclient\lib
javac com\churchillchina\gapanalysis\ProdInRet.java -d build\gapdataclient\lib
javac com\churchillchina\gapanalysis\Product.java -d build\gapdataclient\lib
javac com\churchillchina\gapanalysis\Retailer.java -d build\gapdataclient\lib
javac com\churchillchina\gapanalysis\SearchResults.java -d build\gapdataclient\lib

jar cvfm build\\gapdataclient\\gapdataclient.jar build\\gapdataclient\\jar_manifest.txt build\gapdataclient\lib\com\churchillchina\gapanalysis\*.class com\churchillchina\gapanalysis\GapCombo.properties com\churchillchina\gapanalysis\GapJdbc.properties com\churchillchina\gapanalysis\GapNetwork.properties com\churchillchina\gapanalysis\images\gap_logo_48_48.gif lib\jt400.jar

cd build
sign gapdataclient\gapdataclient.jar

END OF BUILDGAPDATACLIENT.BAT ==================



SIGN.BAT ==================

jarsigner %1 steve
jarsigner -verify -certs %1
C:\WINNT\System32\rundll32.exe cryptext.dll,CryptExtAddCER steve.crt

END OF SIGN.BAT ==================




GAPDATACLIENT.JNLP =========================

<?xml version="1.0" encoding="utf-8"?>
<!-- JNLP File for Gap Analysis Application -->
<!-- <jnlp spec="1.5+" codebase="http://localhost/webstart" href="jnlp/gapdataclient.jnlp"> -->
<jnlp spec="1.5+" codebase="http://localhost" href="jnlp/gapdataclient.jnlp">
      <information>    
            <title>Gap Analysis Application</title>
            <vendor>Churchill China (UK) Ltd</vendor>
            <homepage href="docs/help.html" />
            <description>Gap Analysis Application</description>
            <description kind="short">Client-Server application for recording and viewing product placement marketing data.</description>
          <icon href="assets/gap_logo_48_48.gif" />
          <icon kind="splash" href="assets/gap_logo_48_48.gif" />
          <offline-allowed />
          <association mime-type="application-x/gapanalysis-file" extensions="gapanalysis" />
          <shortcut online="false">
                <desktop />
                <menu submenu="Churchill China Applications" />
          </shortcut>  
   </information>  
   
   <information os="linux">      
            <title>Gap Analysis on Linux</title>
            <homepage href="docs/linuxhelp.html" />  
      </information>  
      <security>
            <all-permissions/>  
      </security>  
      <resources>    
            <j2se version="1.4.2+" java-vm-args="-esa -Xnoclassgc" />    
            <jar href="/jars/gapdataclient.jar"/>  
      </resources>  
      <application-desc main-class="com.churchillchina.gapanalysis.GapDataClient" />
</jnlp>

END OF GAPDATACLIENT.JNLP =========================


ERROR IN WEBSTART    =========================


An error occurred while launching/running the application.

Title: Gap Analysis Application
Vendor: Churchill China (UK) Ltd
Category: Launch File Error

Could not find main-class com.churchillchina.gapanalysis.GapDataClient in http://localhost/jars/gapdataclient.jar


JNLPException[category: Launch File Error : Exception: null : LaunchDesc:
<jnlp spec="1.5+" codebase="http://localhost/" href="http://localhost/jnlp/gapdataclient.jnlp">
  <information>
    <title>Gap Analysis Application</title>
    <vendor>Churchill China (UK) Ltd</vendor>
    <homepage href="http://localhost/docs/help.html"/>
    <description>Gap Analysis Application</description>
    <description kind="short">Client-Server application for recording and viewing product placement marketing data.</description>
    <icon href="http://localhost/assets/gap_logo_48_48.gif" kind="default"/>
    <icon href="http://localhost/assets/gap_logo_48_48.gif" kind="splash"/>
    <shortcut online="false">
      <menu submenu="Churchill China Applications"/>
    </shortcut>
    <association extensions="gapanalysis" mime-type="application-x/gapanalysis-file"/>
    <offline-allowed/>
  </information>
  <security>
    <all-permissions/>
  </security>
  <resources>
    <j2se java-vm-args="-esa -Xnoclassgc" version="1.4.2+"/>
    <jar href="http://localhost/jars/gapdataclient.jar" download="eager" main="false"/>
  </resources>
  <application-desc main-class="com.churchillchina.gapanalysis.GapDataClient"/>
</jnlp> ]
      at com.sun.javaws.LaunchDownload.getMainClassName(Unknown Source)
      at com.sun.javaws.Launcher.continueLaunch(Unknown Source)
      at com.sun.javaws.Launcher.handleApplicationDesc(Unknown Source)
      at com.sun.javaws.Launcher.handleLaunchFile(Unknown Source)
      at com.sun.javaws.Launcher.run(Unknown Source)
      at java.lang.Thread.run(Unknown Source)
LVL 5
steve_bagnallAsked:
Who is Participating?
 
TimYatesCommented:
you need the

    -C build

option with the jar command
0
 
CEHJCommented:
Have you got

Main-Class: com.churchillchina.gapanalysis.GapDataClient

in your manifest?
0
 
steve_bagnallAuthor Commented:
Hi,

Yeah this is my manifest file:

Manifest-Version: 1.0
Main-Class: com.churchillchina.gapanalysis.GapDataClient


Cheers,
Steve
0
Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
TimYatesCommented:
Open gapdataclient.jar in WinZip

is the class there?

In the correct folder?

Probably not :-/

I reckon there's an issue with your jar building bit of your script...

Tim
0
 
CEHJCommented:
>>jar cvfm build\\gapdataclient\\gapdataclient.jar build\\gapdataclient\\jar_manifest.txt

I think you should remove those double slashes and replace by single ones
0
 
steve_bagnallAuthor Commented:
Yeah GapDataClient.class is there (379k).  But the path is

build\gapdataclient\lib\com\churchillchina\gapanalysis\

should it be

com\churchillchina\gapanalysis\

if so how do I ensure this whilst keeping my build\lib structure intact, as I find this quite an organised way of doing it?

Cheers,
Steve
0
 
TimYatesCommented:
jar cvfm build\\gapdataclient\\gapdataclient.jar build\\gapdataclient\\jar_manifest.txt -C build gapdataclient\lib\com\churchillchina\gapanalysis\*.class com\churchillchina\gapanalysis\GapCombo.properties com\churchillchina\gapanalysis\GapJdbc.properties com\churchillchina\gapanalysis\GapNetwork.properties com\churchillchina\gapanalysis\images\gap_logo_48_48.gif lib\jt400.jar

(I think)
0
 
TimYatesCommented:
or...

cd build\gapdataclient\lib

before you call jar (which may be easier) -- I can't get the -C option to work right on my machine (but I am on linux...it may work ok on Windows)
0
 
steve_bagnallAuthor Commented:
Tim,

Although the GapDataClient.java file was being compiled into the lib directory, it wasn't being added to the jar with the *.class command, so I had to add it manually with its own line.  I now have it coming up with a NullPointerException (well this is Java!), but that'll be my App.  Thanks for all your help!

Cheers,
Steve
0
 
TimYatesCommented:
Good luck again ;-)

Hope you find the bug ok!

Tim
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.