# executing jar file

Duane Riech

Ranch Hand

Posts: 52

posted 12 years ago

- 0

I created a jar file for my server. When I try

to execute it in a RANDOM directory, i.e.

C:\, I get the error. Class RegFBNSDatabase starts

the rmiregistry and it's in the jar file.

C:\> dir *.jar

Volume in drive C has no label.

Volume Serial Number is 8C4C-8D25

Directory of C:\

04/07/2003 07:34a 44,647 runserver.jar

1 File(s) 44,647 bytes

0 Dir(s) 71,041,052,672 bytes free

C:\>jar -tvf runserver.jar

0 Mon Apr 07 07:34:24 CDT 2003 META-INF/

114 Mon Apr 07 07:34:24 CDT 2003 META-INF/MANIFEST.MF

0 Mon Apr 07 06:10:36 CDT 2003 suncertify/db/

574 Fri Apr 04 23:41:06 CST 2003 suncertify/db/BookFlightWindow$1.class

4114 Fri Apr 04 23:41:06 CST 2003 suncertify/db/BookFlightWindow$BookEvent.cla

ss

2825 Fri Apr 04 23:41:06 CST 2003 suncertify/db/BookFlightWindow$TextFieldHand

ler.class

6985 Fri Apr 04 23:41:06 CST 2003 suncertify/db/BookFlightWindow.class

1000 Fri Apr 04 11:23:14 CST 2003 suncertify/db/ClientApp.class

608 Fri Apr 04 23:41:08 CST 2003 suncertify/db/ClientID.class

545 Fri Apr 04 23:41:08 CST 2003 suncertify/db/ClientWindow$1.class

1506 Fri Apr 04 23:41:08 CST 2003 suncertify/db/ClientWindow$BookFlightEvent.c

lass

1350 Fri Apr 04 23:41:08 CST 2003 suncertify/db/ClientWindow$FlightDetailEvent

.class

591 Fri Apr 04 23:41:08 CST 2003 suncertify/db/ClientWindow$HelpEvent.class

2288 Fri Apr 04 23:41:08 CST 2003 suncertify/db/ClientWindow$SearchEvent.class

7341 Fri Apr 04 23:41:08 CST 2003 suncertify/db/ClientWindow.class

1358 Fri Apr 04 10:34:46 CST 2003 suncertify/db/CreateReservationDb.class

8499 Fri Apr 04 23:41:10 CST 2003 suncertify/db/Data.class

307 Fri Apr 04 23:41:10 CST 2003 suncertify/db/DatabaseException.class

1016 Fri Apr 04 23:41:10 CST 2003 suncertify/db/DataClient.class

1488 Fri Apr 04 23:41:12 CST 2003 suncertify/db/DataInfo.class

949 Fri Apr 04 23:41:12 CST 2003 suncertify/db/FBNSConnection.class

172 Fri Apr 04 23:41:12 CST 2003 suncertify/db/FBNSDbIntrf.class

2069 Fri Apr 04 23:41:14 CST 2003 suncertify/db/FBNSDbLocal.class

2623 Fri Apr 04 23:41:14 CST 2003 suncertify/db/FBNSDbRemote.class

5472 Fri Apr 04 23:41:48 CST 2003 suncertify/db/FBNSDbRemote_Skel.class

10082 Fri Apr 04 23:41:48 CST 2003 suncertify/db/FBNSDbRemote_Stub.class

564 Fri Apr 04 23:41:14 CST 2003 suncertify/db/FBNSHelpWindow$1.class

2229 Fri Apr 04 23:41:14 CST 2003 suncertify/db/FBNSHelpWindow.class

541 Fri Apr 04 23:41:16 CST 2003 suncertify/db/FieldInfo.class

1021 Fri Apr 04 23:41:16 CST 2003 suncertify/db/FieldSearch.class

584 Fri Apr 04 23:41:16 CST 2003 suncertify/db/FlightDetailWindow$1.class

4546 Fri Apr 04 23:41:16 CST 2003 suncertify/db/FlightDetailWindow.class

1412 Fri Apr 04 23:41:18 CST 2003 suncertify/db/LockTable.class

1978 Mon Apr 07 05:12:08 CDT 2003 suncertify/db/RegFBNSDatabase.class

1743 Fri Apr 04 23:41:18 CST 2003 suncertify/db/TableDataModel.class

C:\>java -jar runserver.jar

Exception in thread "main" java.lang.NoClassDefFoundError: suncertify/db/RegFBNS

Database (wrong name: RegFBNSDatabase)

at java.lang.ClassLoader.defineClass0(Native Method)

at java.lang.ClassLoader.defineClass(Unknown Source)

at java.security.SecureClassLoader.defineClass(Unknown Source)

at java.net.URLClassLoader.defineClass(Unknown Source)

at java.net.URLClassLoader.access$100(Unknown Source)

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)

at java.lang.ClassLoader.loadClassInternal(Unknown Source)

C:\project>dir *.txt

Volume in drive C has no label.

Volume Serial Number is 8C4C-8D25

Directory of C:\project

04/07/2003 07:33a 47 serverManifest.txt

04/07/2003 05:59a 148 versionInfo.txt

2 File(s) 195 bytes

0 Dir(s) 71,041,052,672 bytes free

C:\project>type serverManifest.txt

Main-Class: suncertify.db.RegFBNSDatabase

Thanks

to execute it in a RANDOM directory, i.e.

C:\, I get the error. Class RegFBNSDatabase starts

the rmiregistry and it's in the jar file.

C:\> dir *.jar

Volume in drive C has no label.

Volume Serial Number is 8C4C-8D25

Directory of C:\

04/07/2003 07:34a 44,647 runserver.jar

1 File(s) 44,647 bytes

0 Dir(s) 71,041,052,672 bytes free

C:\>jar -tvf runserver.jar

0 Mon Apr 07 07:34:24 CDT 2003 META-INF/

114 Mon Apr 07 07:34:24 CDT 2003 META-INF/MANIFEST.MF

0 Mon Apr 07 06:10:36 CDT 2003 suncertify/db/

574 Fri Apr 04 23:41:06 CST 2003 suncertify/db/BookFlightWindow$1.class

4114 Fri Apr 04 23:41:06 CST 2003 suncertify/db/BookFlightWindow$BookEvent.cla

ss

2825 Fri Apr 04 23:41:06 CST 2003 suncertify/db/BookFlightWindow$TextFieldHand

ler.class

6985 Fri Apr 04 23:41:06 CST 2003 suncertify/db/BookFlightWindow.class

1000 Fri Apr 04 11:23:14 CST 2003 suncertify/db/ClientApp.class

608 Fri Apr 04 23:41:08 CST 2003 suncertify/db/ClientID.class

545 Fri Apr 04 23:41:08 CST 2003 suncertify/db/ClientWindow$1.class

1506 Fri Apr 04 23:41:08 CST 2003 suncertify/db/ClientWindow$BookFlightEvent.c

lass

1350 Fri Apr 04 23:41:08 CST 2003 suncertify/db/ClientWindow$FlightDetailEvent

.class

591 Fri Apr 04 23:41:08 CST 2003 suncertify/db/ClientWindow$HelpEvent.class

2288 Fri Apr 04 23:41:08 CST 2003 suncertify/db/ClientWindow$SearchEvent.class

7341 Fri Apr 04 23:41:08 CST 2003 suncertify/db/ClientWindow.class

1358 Fri Apr 04 10:34:46 CST 2003 suncertify/db/CreateReservationDb.class

8499 Fri Apr 04 23:41:10 CST 2003 suncertify/db/Data.class

307 Fri Apr 04 23:41:10 CST 2003 suncertify/db/DatabaseException.class

1016 Fri Apr 04 23:41:10 CST 2003 suncertify/db/DataClient.class

1488 Fri Apr 04 23:41:12 CST 2003 suncertify/db/DataInfo.class

949 Fri Apr 04 23:41:12 CST 2003 suncertify/db/FBNSConnection.class

172 Fri Apr 04 23:41:12 CST 2003 suncertify/db/FBNSDbIntrf.class

2069 Fri Apr 04 23:41:14 CST 2003 suncertify/db/FBNSDbLocal.class

2623 Fri Apr 04 23:41:14 CST 2003 suncertify/db/FBNSDbRemote.class

5472 Fri Apr 04 23:41:48 CST 2003 suncertify/db/FBNSDbRemote_Skel.class

10082 Fri Apr 04 23:41:48 CST 2003 suncertify/db/FBNSDbRemote_Stub.class

564 Fri Apr 04 23:41:14 CST 2003 suncertify/db/FBNSHelpWindow$1.class

2229 Fri Apr 04 23:41:14 CST 2003 suncertify/db/FBNSHelpWindow.class

541 Fri Apr 04 23:41:16 CST 2003 suncertify/db/FieldInfo.class

1021 Fri Apr 04 23:41:16 CST 2003 suncertify/db/FieldSearch.class

584 Fri Apr 04 23:41:16 CST 2003 suncertify/db/FlightDetailWindow$1.class

4546 Fri Apr 04 23:41:16 CST 2003 suncertify/db/FlightDetailWindow.class

1412 Fri Apr 04 23:41:18 CST 2003 suncertify/db/LockTable.class

1978 Mon Apr 07 05:12:08 CDT 2003 suncertify/db/RegFBNSDatabase.class

1743 Fri Apr 04 23:41:18 CST 2003 suncertify/db/TableDataModel.class

C:\>java -jar runserver.jar

Exception in thread "main" java.lang.NoClassDefFoundError: suncertify/db/RegFBNS

Database (wrong name: RegFBNSDatabase)

at java.lang.ClassLoader.defineClass0(Native Method)

at java.lang.ClassLoader.defineClass(Unknown Source)

at java.security.SecureClassLoader.defineClass(Unknown Source)

at java.net.URLClassLoader.defineClass(Unknown Source)

at java.net.URLClassLoader.access$100(Unknown Source)

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)

at java.lang.ClassLoader.loadClassInternal(Unknown Source)

C:\project>dir *.txt

Volume in drive C has no label.

Volume Serial Number is 8C4C-8D25

Directory of C:\project

04/07/2003 07:33a 47 serverManifest.txt

04/07/2003 05:59a 148 versionInfo.txt

2 File(s) 195 bytes

0 Dir(s) 71,041,052,672 bytes free

C:\project>type serverManifest.txt

Main-Class: suncertify.db.RegFBNSDatabase

Thanks

Duane Riech

Ranch Hand

Posts: 52

Samual Harvey

Ranch Hand

Posts: 119

posted 12 years ago

- 0

I would check the following:-

1. How I created the jar file, I mean what was the classpath set when I created the jar file and the source directory for the java files given to the jar utility.

2. Make sure the manifest file has correct entry for the main class file i.e package and class name.

3. If this is good then check the version of the jar utility.

Thanks.

1. How I created the jar file, I mean what was the classpath set when I created the jar file and the source directory for the java files given to the jar utility.

2. Make sure the manifest file has correct entry for the main class file i.e package and class name.

3. If this is good then check the version of the jar utility.

Thanks.

Samual Harvey<br />SCJP2<br />SCJD2

Duane Riech

Ranch Hand

Posts: 52

posted 12 years ago

- 0

Here's the manifest file.

C:\project>type serverManifest.txt

Main-Class: suncertify.db.RegFBNSDatabase

It DOES have a <CR> at the end of the line.

How should/would a classpath be specified when

making the jar file.

I've looked at serveral examples in java manuals,

according to them it's right.

C:\project>type serverManifest.txt

Main-Class: suncertify.db.RegFBNSDatabase

It DOES have a <CR> at the end of the line.

How should/would a classpath be specified when

making the jar file.

I've looked at serveral examples in java manuals,

according to them it's right.

Samual Harvey

Ranch Hand

Posts: 119

posted 12 years ago

- 0

I see that you are using manifest.txt instead of manifest.mf file and is missing the following lines:-

Manifest-Version: 1.0

Created-By: 1.x.x (Sun Microsystems Inc.)

where x is the version of sun jdk that u use.

[ April 07, 2003: Message edited by: Samual Harvey ]

Manifest-Version: 1.0

Created-By: 1.x.x (Sun Microsystems Inc.)

where x is the version of sun jdk that u use.

[ April 07, 2003: Message edited by: Samual Harvey ]

Samual Harvey<br />SCJP2<br />SCJD2

Duane Riech

Ranch Hand

Posts: 52

posted 12 years ago

- 0

Here's my new manifest file (renamed):

C:\project>type *.mf

serverManifest.mf

Main-Class: suncertify.db.RegFBNSDatabase

Manifest-Version: 1.0

Created-By: 1.4.1 (Sun Microsystems Inc.)

Here's my command to make the .jar file:

C:\project>jar -cvmf serverManifest.mf runserver.jar suncertify\db

added manifest

adding: suncertify/db/(in = 0) (out= 0)(stored 0%)

adding: suncertify/db/BookFlightWindow$1.class(in = 574) (out= 353)(deflated 38%

)

adding: suncertify/db/BookFlightWindow$BookEvent.class(in = 4114) (out= 2075)(de

flated 49%)

adding: suncertify/db/BookFlightWindow$TextFieldHandler.class(in = 2825) (out= 1

575)(deflated 44%)

adding: suncertify/db/BookFlightWindow.class(in = 6985) (out= 3293)(deflated 52%

)

adding: suncertify/db/ClientApp.class(in = 1000) (out= 576)(deflated 42%)

adding: suncertify/db/ClientID.class(in = 608) (out= 410)(deflated 32%)

adding: suncertify/db/ClientWindow$1.class(in = 545) (out= 351)(deflated 35%)

adding: suncertify/db/ClientWindow$BookFlightEvent.class(in = 1506) (out= 753)(d

eflated 50%)

adding: suncertify/db/ClientWindow$FlightDetailEvent.class(in = 1350) (out= 693)

(deflated 48%)

adding: suncertify/db/ClientWindow$HelpEvent.class(in = 591) (out= 357)(deflated

39%)

adding: suncertify/db/ClientWindow$SearchEvent.class(in = 2288) (out= 1196)(defl

ated 47%)

adding: suncertify/db/ClientWindow.class(in = 7341) (out= 3503)(deflated 52%)

adding: suncertify/db/CreateReservationDb.class(in = 1358) (out= 782)(deflated 4

2%)

adding: suncertify/db/Data.class(in = 8499) (out= 4647)(deflated 45%)

adding: suncertify/db/DatabaseException.class(in = 307) (out= 224)(deflated 27%)

adding: suncertify/db/DataClient.class(in = 1016) (out= 440)(deflated 56%)

adding: suncertify/db/DataInfo.class(in = 1488) (out= 771)(deflated 48%)

adding: suncertify/db/db.db(in = 1646) (out= 584)(deflated 64%)

adding: suncertify/db/FBNSConnection.class(in = 949) (out= 516)(deflated 45%)

adding: suncertify/db/FBNSDbIntrf.class(in = 172) (out= 141)(deflated 18%)

adding: suncertify/db/FBNSDbLocal.class(in = 2069) (out= 923)(deflated 55%)

adding: suncertify/db/FBNSDbRemote.class(in = 2623) (out= 1166)(deflated 55%)

adding: suncertify/db/FBNSDbRemote_Skel.class(in = 5472) (out= 2407)(deflated 56

%)

adding: suncertify/db/FBNSDbRemote_Stub.class(in = 10082) (out= 3676)(deflated 6

3%)

adding: suncertify/db/FBNSHelpWindow$1.class(in = 564) (out= 350)(deflated 37%)

adding: suncertify/db/FBNSHelpWindow.class(in = 2229) (out= 1254)(deflated 43%)

adding: suncertify/db/FieldInfo.class(in = 541) (out= 357)(deflated 34%)

adding: suncertify/db/FieldSearch.class(in = 1021) (out= 474)(deflated 53%)

adding: suncertify/db/FlightDetailWindow$1.class(in = 584) (out= 352)(deflated 3

9%)

adding: suncertify/db/FlightDetailWindow.class(in = 4546) (out= 2468)(deflated 4

5%)

adding: suncertify/db/LockTable.class(in = 1412) (out= 720)(deflated 49%)

adding: suncertify/db/RegFBNSDatabase.class(in = 1978) (out= 1098)(deflated 44%)

adding: suncertify/db/Reservationdb.db(in = 140) (out= 108)(deflated 22%)

adding: suncertify/db/TableDataModel.class(in = 1743) (out= 1021)(deflated 41%)

Notice that RegFBNSDatabase.class was added near

the end.

Here the command to execute the .jar file:

C:\project>java -jar runserver.jar

Exception in thread "main" java.lang.NoClassDefFoundError: suncertify/db/RegFBNS

Database (wrong name: RegFBNSDatabase)

at java.lang.ClassLoader.defineClass0(Native Method)

at java.lang.ClassLoader.defineClass(Unknown Source)

at java.security.SecureClassLoader.defineClass(Unknown Source)

at java.net.URLClassLoader.defineClass(Unknown Source)

at java.net.URLClassLoader.access$100(Unknown Source)

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)

at java.lang.ClassLoader.loadClassInternal(Unknown Source)

I just don't understand what it means by "wrong name".

Thanks,

C:\project>type *.mf

serverManifest.mf

Main-Class: suncertify.db.RegFBNSDatabase

Manifest-Version: 1.0

Created-By: 1.4.1 (Sun Microsystems Inc.)

Here's my command to make the .jar file:

C:\project>jar -cvmf serverManifest.mf runserver.jar suncertify\db

added manifest

adding: suncertify/db/(in = 0) (out= 0)(stored 0%)

adding: suncertify/db/BookFlightWindow$1.class(in = 574) (out= 353)(deflated 38%

)

adding: suncertify/db/BookFlightWindow$BookEvent.class(in = 4114) (out= 2075)(de

flated 49%)

adding: suncertify/db/BookFlightWindow$TextFieldHandler.class(in = 2825) (out= 1

575)(deflated 44%)

adding: suncertify/db/BookFlightWindow.class(in = 6985) (out= 3293)(deflated 52%

)

adding: suncertify/db/ClientApp.class(in = 1000) (out= 576)(deflated 42%)

adding: suncertify/db/ClientID.class(in = 608) (out= 410)(deflated 32%)

adding: suncertify/db/ClientWindow$1.class(in = 545) (out= 351)(deflated 35%)

adding: suncertify/db/ClientWindow$BookFlightEvent.class(in = 1506) (out= 753)(d

eflated 50%)

adding: suncertify/db/ClientWindow$FlightDetailEvent.class(in = 1350) (out= 693)

(deflated 48%)

adding: suncertify/db/ClientWindow$HelpEvent.class(in = 591) (out= 357)(deflated

39%)

adding: suncertify/db/ClientWindow$SearchEvent.class(in = 2288) (out= 1196)(defl

ated 47%)

adding: suncertify/db/ClientWindow.class(in = 7341) (out= 3503)(deflated 52%)

adding: suncertify/db/CreateReservationDb.class(in = 1358) (out= 782)(deflated 4

2%)

adding: suncertify/db/Data.class(in = 8499) (out= 4647)(deflated 45%)

adding: suncertify/db/DatabaseException.class(in = 307) (out= 224)(deflated 27%)

adding: suncertify/db/DataClient.class(in = 1016) (out= 440)(deflated 56%)

adding: suncertify/db/DataInfo.class(in = 1488) (out= 771)(deflated 48%)

adding: suncertify/db/db.db(in = 1646) (out= 584)(deflated 64%)

adding: suncertify/db/FBNSConnection.class(in = 949) (out= 516)(deflated 45%)

adding: suncertify/db/FBNSDbIntrf.class(in = 172) (out= 141)(deflated 18%)

adding: suncertify/db/FBNSDbLocal.class(in = 2069) (out= 923)(deflated 55%)

adding: suncertify/db/FBNSDbRemote.class(in = 2623) (out= 1166)(deflated 55%)

adding: suncertify/db/FBNSDbRemote_Skel.class(in = 5472) (out= 2407)(deflated 56

%)

adding: suncertify/db/FBNSDbRemote_Stub.class(in = 10082) (out= 3676)(deflated 6

3%)

adding: suncertify/db/FBNSHelpWindow$1.class(in = 564) (out= 350)(deflated 37%)

adding: suncertify/db/FBNSHelpWindow.class(in = 2229) (out= 1254)(deflated 43%)

adding: suncertify/db/FieldInfo.class(in = 541) (out= 357)(deflated 34%)

adding: suncertify/db/FieldSearch.class(in = 1021) (out= 474)(deflated 53%)

adding: suncertify/db/FlightDetailWindow$1.class(in = 584) (out= 352)(deflated 3

9%)

adding: suncertify/db/FlightDetailWindow.class(in = 4546) (out= 2468)(deflated 4

5%)

adding: suncertify/db/LockTable.class(in = 1412) (out= 720)(deflated 49%)

adding: suncertify/db/RegFBNSDatabase.class(in = 1978) (out= 1098)(deflated 44%)

adding: suncertify/db/Reservationdb.db(in = 140) (out= 108)(deflated 22%)

adding: suncertify/db/TableDataModel.class(in = 1743) (out= 1021)(deflated 41%)

Notice that RegFBNSDatabase.class was added near

the end.

Here the command to execute the .jar file:

C:\project>java -jar runserver.jar

Exception in thread "main" java.lang.NoClassDefFoundError: suncertify/db/RegFBNS

Database (wrong name: RegFBNSDatabase)

at java.lang.ClassLoader.defineClass0(Native Method)

at java.lang.ClassLoader.defineClass(Unknown Source)

at java.security.SecureClassLoader.defineClass(Unknown Source)

at java.net.URLClassLoader.defineClass(Unknown Source)

at java.net.URLClassLoader.access$100(Unknown Source)

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)

at java.lang.ClassLoader.loadClassInternal(Unknown Source)

I just don't understand what it means by "wrong name".

Thanks,

Samual Harvey

Ranch Hand

Posts: 119

posted 12 years ago

- 0

Based on what you have said above I am assuming that you have a folder suncertify under project directory. If not then copy the suncertify folder under project.

Then try using the following command :-

c:\project>set classpath=c:\.

C:\project>jar -cvfm runserver.jar serverManifest.mf project\suncertify\ .

Let me know if this works.

Thanks.

Then try using the following command :-

c:\project>set classpath=c:\.

C:\project>jar -cvfm runserver.jar serverManifest.mf project\suncertify\ .

Let me know if this works.

Thanks.

Samual Harvey<br />SCJP2<br />SCJD2

Duane Riech

Ranch Hand

Posts: 52

posted 12 years ago

- 0

Thanks,

Yes, my directory structure is:

C:\project\suncertify\db

All of the .class files are in the project\suncertify\db directory.

I tried it, it didn't work.

Here's the output.

C:\project>set classpath=c:\.

C:\project>jar -cvfm runserver.jar serverManifest.mf project\suncertify\ .

project\suncertify : no such file or directory

added manifest

adding: code/(in = 0) (out= 0)(stored 0%)

adding: code/suncertify/(in = 0) (out= 0)(stored 0%)

adding: code/suncertify/db/(in = 0) (out= 0)(stored 0%)

adding: code/suncertify/db/BookFlightWindow.java(in = 26033) (out= 4213)(deflate

d 83%)

adding: code/suncertify/db/ClientApp.java(in = 2447) (out= 621)(deflated 74%)

adding: code/suncertify/db/ClientID.java(in = 1068) (out= 483)(deflated 54%)

adding: code/suncertify/db/ClientWindow.java(in = 19188) (out= 3809)(deflated 80

%)

adding: code/suncertify/db/CreateReservationDb.java(in = 2415) (out= 622)(deflat

ed 74%)

adding: code/suncertify/db/Data.java(in = 27012) (out= 5689)(deflated 78%)

adding: code/suncertify/db/DatabaseException.java(in = 502) (out= 239)(deflated

52%)

adding: code/suncertify/db/DataClient.java(in = 9123) (out= 1860)(deflated 79%)

adding: code/suncertify/db/DataInfo.java(in = 3334) (out= 971)(deflated 70%)

adding: code/suncertify/db/FBNSConnection.java(in = 1532) (out= 575)(deflated 62

%)

adding: code/suncertify/db/FBNSDbIntrf.java(in = 501) (out= 274)(deflated 45%)

adding: code/suncertify/db/FBNSDbLocal.java(in = 7938) (out= 2008)(deflated 74%)

adding: code/suncertify/db/FBNSDbRemote.java(in = 11137) (out= 2283)(deflated 79

%)

adding: code/suncertify/db/FBNSHelpWindow.java(in = 2280) (out= 804)(deflated 64

%)

adding: code/suncertify/db/FieldInfo.java(in = 962) (out= 382)(deflated 60%)

adding: code/suncertify/db/FieldSearch.java(in = 2609) (out= 608)(deflated 76%)

adding: code/suncertify/db/FlightDetailWindow.java(in = 8338) (out= 1963)(deflat

ed 76%)

adding: code/suncertify/db/LockTable.java(in = 5682) (out= 1256)(deflated 77%)

adding: code/suncertify/db/RegFBNSDatabase.java(in = 3287) (out= 927)(deflated 7

1%)

adding: code/suncertify/db/TableDataModel.java(in = 3760) (out= 1213)(deflated 6

7%)

adding: db.db(in = 1646) (out= 584)(deflated 64%)

adding: docs/(in = 0) (out= 0)(stored 0%)

adding: docs/javadocs/(in = 0) (out= 0)(stored 0%)

adding: docs/javadocs/allclasses-frame.html(in = 2112) (out= 670)(deflated 68%)

adding: docs/javadocs/allclasses-noframe.html(in = 1942) (out= 664)(deflated 65%

)

adding: docs/javadocs/constant-values.html(in = 4289) (out= 944)(deflated 77%)

adding: docs/javadocs/deprecated-list.html(in = 4179) (out= 921)(deflated 77%)

adding: docs/javadocs/help-doc.html(in = 7413) (out= 2178)(deflated 70%)

adding: docs/javadocs/index-all.html(in = 38514) (out= 5170)(deflated 86%)

adding: docs/javadocs/index.html(in = 712) (out= 435)(deflated 38%)

adding: docs/javadocs/overview-tree.html(in = 7786) (out= 1535)(deflated 80%)

adding: docs/javadocs/package-list(in = 15) (out= 17)(deflated -13%)

adding: docs/javadocs/packages.html(in = 685) (out= 377)(deflated 44%)

adding: docs/javadocs/serialized-form.html(in = 14418) (out= 1822)(deflated 87%)

adding: docs/javadocs/stylesheet.css(in = 1328) (out= 442)(deflated 66%)

adding: docs/javadocs/suncertify/(in = 0) (out= 0)(stored 0%)

adding: docs/javadocs/suncertify/db/(in = 0) (out= 0)(stored 0%)

adding: docs/javadocs/suncertify/db/BookFlightWindow.html(in = 21493) (out= 3980

)(deflated 81%)

adding: docs/javadocs/suncertify/db/ClientID.html(in = 8754) (out= 1783)(deflate

d 79%)

adding: docs/javadocs/suncertify/db/ClientWindow.html(in = 21076) (out= 3950)(de

flated 81%)

adding: docs/javadocs/suncertify/db/Data.html(in = 24665) (out= 3875)(deflated 8

4%)

adding: docs/javadocs/suncertify/db/DatabaseException.html(in = 8807) (out= 1799

)(deflated 79%)

adding: docs/javadocs/suncertify/db/DataClient.html(in = 24618) (out= 3654)(defl

ated 85%)

adding: docs/javadocs/suncertify/db/DataInfo.html(in = 13584) (out= 2463)(deflat

ed 81%)

adding: docs/javadocs/suncertify/db/FBNSConnection.html(in = 10247) (out= 1975)(

deflated 80%)

adding: docs/javadocs/suncertify/db/FBNSDbIntrf.html(in = 8172) (out= 1710)(defl

ated 79%)

adding: docs/javadocs/suncertify/db/FBNSDbLocal.html(in = 29049) (out= 4143)(def

lated 85%)

adding: docs/javadocs/suncertify/db/FBNSDbRemote.html(in = 33046) (out= 4380)(de

flated 86%)

adding: docs/javadocs/suncertify/db/FBNSHelpWindow.html(in = 20412) (out= 3764)(

deflated 81%)

adding: docs/javadocs/suncertify/db/FieldInfo.html(in = 9757) (out= 1935)(deflat

ed 80%)

adding: docs/javadocs/suncertify/db/FieldSearch.html(in = 13742) (out= 2210)(def

lated 83%)

adding: docs/javadocs/suncertify/db/FlightDetailWindow.html(in = 21549) (out= 39

72)(deflated 81%)

adding: docs/javadocs/suncertify/db/LockTable.html(in = 15720) (out= 2584)(defla

ted 83%)

adding: docs/javadocs/suncertify/db/package-frame.html(in = 2375) (out= 727)(def

lated 69%)

adding: docs/javadocs/suncertify/db/package-summary.html(in = 8737) (out= 1804)(

deflated 79%)

adding: docs/javadocs/suncertify/db/package-tree.html(in = 7992) (out= 1517)(def

lated 81%)

adding: docs/javadocs/suncertify/db/TableDataModel.html(in = 13531) (out= 2548)(

deflated 81%)

adding: Reservationdb.db(in = 140) (out= 108)(deflated 22%)

adding: serverManifest.mf(in = 121) (out= 109)(deflated 9%)

adding: suncertify/(in = 0) (out= 0)(stored 0%)

adding: suncertify/db/(in = 0) (out= 0)(stored 0%)

adding: suncertify/db/BookFlightWindow$1.class(in = 574) (out= 353)(deflated 38%

)

adding: suncertify/db/BookFlightWindow$BookEvent.class(in = 4114) (out= 2075)(de

flated 49%)

adding: suncertify/db/BookFlightWindow$TextFieldHandler.class(in = 2825) (out= 1

575)(deflated 44%)

adding: suncertify/db/BookFlightWindow.class(in = 6985) (out= 3293)(deflated 52%

)

adding: suncertify/db/ClientApp.class(in = 1000) (out= 576)(deflated 42%)

adding: suncertify/db/ClientID.class(in = 608) (out= 410)(deflated 32%)

adding: suncertify/db/ClientWindow$1.class(in = 545) (out= 351)(deflated 35%)

adding: suncertify/db/ClientWindow$BookFlightEvent.class(in = 1506) (out= 753)(d

eflated 50%)

adding: suncertify/db/ClientWindow$FlightDetailEvent.class(in = 1350) (out= 693)

(deflated 48%)

adding: suncertify/db/ClientWindow$HelpEvent.class(in = 591) (out= 357)(deflated

39%)

adding: suncertify/db/ClientWindow$SearchEvent.class(in = 2288) (out= 1196)(defl

ated 47%)

adding: suncertify/db/ClientWindow.class(in = 7341) (out= 3503)(deflated 52%)

adding: suncertify/db/CreateReservationDb.class(in = 1358) (out= 782)(deflated 4

2%)

adding: suncertify/db/Data.class(in = 8499) (out= 4647)(deflated 45%)

adding: suncertify/db/DatabaseException.class(in = 307) (out= 224)(deflated 27%)

adding: suncertify/db/DataClient.class(in = 1016) (out= 440)(deflated 56%)

adding: suncertify/db/DataInfo.class(in = 1488) (out= 771)(deflated 48%)

adding: suncertify/db/db.db(in = 1646) (out= 584)(deflated 64%)

adding: suncertify/db/FBNSConnection.class(in = 949) (out= 516)(deflated 45%)

adding: suncertify/db/FBNSDbIntrf.class(in = 172) (out= 141)(deflated 18%)

adding: suncertify/db/FBNSDbLocal.class(in = 2069) (out= 923)(deflated 55%)

adding: suncertify/db/FBNSDbRemote.class(in = 2623) (out= 1166)(deflated 55%)

adding: suncertify/db/FBNSDbRemote_Skel.class(in = 5472) (out= 2407)(deflated 56

%)

adding: suncertify/db/FBNSDbRemote_Stub.class(in = 10082) (out= 3676)(deflated 6

3%)

adding: suncertify/db/FBNSHelpWindow$1.class(in = 564) (out= 350)(deflated 37%)

adding: suncertify/db/FBNSHelpWindow.class(in = 2229) (out= 1254)(deflated 43%)

adding: suncertify/db/FieldInfo.class(in = 541) (out= 357)(deflated 34%)

adding: suncertify/db/FieldSearch.class(in = 1021) (out= 474)(deflated 53%)

adding: suncertify/db/FlightDetailWindow$1.class(in = 584) (out= 352)(deflated 3

9%)

adding: suncertify/db/FlightDetailWindow.class(in = 4546) (out= 2468)(deflated 4

5%)

adding: suncertify/db/LockTable.class(in = 1412) (out= 720)(deflated 49%)

adding: suncertify/db/RegFBNSDatabase.class(in = 1978) (out= 1098)(deflated 44%)

adding: suncertify/db/Reservationdb.db(in = 140) (out= 108)(deflated 22%)

adding: suncertify/db/TableDataModel.class(in = 1743) (out= 1021)(deflated 41%)

adding: versionInfo.txt(in = 148) (out= 119)(deflated 19%)

C:\project>java -jar runserver.jar

Exception in thread "main" java.lang.NoClassDefFoundError: suncertify/db/RegFBNS

Database (wrong name: RegFBNSDatabase)

at java.lang.ClassLoader.defineClass0(Native Method)

at java.lang.ClassLoader.defineClass(Unknown Source)

at java.security.SecureClassLoader.defineClass(Unknown Source)

at java.net.URLClassLoader.defineClass(Unknown Source)

at java.net.URLClassLoader.access$100(Unknown Source)

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)

at java.lang.ClassLoader.loadClassInternal(Unknown Source)

C:\project>

I just noticed a error message at the start of creating the jar file:

C:\project>jar -cvfm runserver.jar serverManifest.mf project\suncertify\ .

project\suncertify : no such file or directory

So I changed the jar command to

jar -cvfm runserver.jar serverManifest.mf c:\project\suncertify .

But I got the same error.

Thanks,

Yes, my directory structure is:

C:\project\suncertify\db

All of the .class files are in the project\suncertify\db directory.

I tried it, it didn't work.

Here's the output.

C:\project>set classpath=c:\.

C:\project>jar -cvfm runserver.jar serverManifest.mf project\suncertify\ .

project\suncertify : no such file or directory

added manifest

adding: code/(in = 0) (out= 0)(stored 0%)

adding: code/suncertify/(in = 0) (out= 0)(stored 0%)

adding: code/suncertify/db/(in = 0) (out= 0)(stored 0%)

adding: code/suncertify/db/BookFlightWindow.java(in = 26033) (out= 4213)(deflate

d 83%)

adding: code/suncertify/db/ClientApp.java(in = 2447) (out= 621)(deflated 74%)

adding: code/suncertify/db/ClientID.java(in = 1068) (out= 483)(deflated 54%)

adding: code/suncertify/db/ClientWindow.java(in = 19188) (out= 3809)(deflated 80

%)

adding: code/suncertify/db/CreateReservationDb.java(in = 2415) (out= 622)(deflat

ed 74%)

adding: code/suncertify/db/Data.java(in = 27012) (out= 5689)(deflated 78%)

adding: code/suncertify/db/DatabaseException.java(in = 502) (out= 239)(deflated

52%)

adding: code/suncertify/db/DataClient.java(in = 9123) (out= 1860)(deflated 79%)

adding: code/suncertify/db/DataInfo.java(in = 3334) (out= 971)(deflated 70%)

adding: code/suncertify/db/FBNSConnection.java(in = 1532) (out= 575)(deflated 62

%)

adding: code/suncertify/db/FBNSDbIntrf.java(in = 501) (out= 274)(deflated 45%)

adding: code/suncertify/db/FBNSDbLocal.java(in = 7938) (out= 2008)(deflated 74%)

adding: code/suncertify/db/FBNSDbRemote.java(in = 11137) (out= 2283)(deflated 79

%)

adding: code/suncertify/db/FBNSHelpWindow.java(in = 2280) (out= 804)(deflated 64

%)

adding: code/suncertify/db/FieldInfo.java(in = 962) (out= 382)(deflated 60%)

adding: code/suncertify/db/FieldSearch.java(in = 2609) (out= 608)(deflated 76%)

adding: code/suncertify/db/FlightDetailWindow.java(in = 8338) (out= 1963)(deflat

ed 76%)

adding: code/suncertify/db/LockTable.java(in = 5682) (out= 1256)(deflated 77%)

adding: code/suncertify/db/RegFBNSDatabase.java(in = 3287) (out= 927)(deflated 7

1%)

adding: code/suncertify/db/TableDataModel.java(in = 3760) (out= 1213)(deflated 6

7%)

adding: db.db(in = 1646) (out= 584)(deflated 64%)

adding: docs/(in = 0) (out= 0)(stored 0%)

adding: docs/javadocs/(in = 0) (out= 0)(stored 0%)

adding: docs/javadocs/allclasses-frame.html(in = 2112) (out= 670)(deflated 68%)

adding: docs/javadocs/allclasses-noframe.html(in = 1942) (out= 664)(deflated 65%

)

adding: docs/javadocs/constant-values.html(in = 4289) (out= 944)(deflated 77%)

adding: docs/javadocs/deprecated-list.html(in = 4179) (out= 921)(deflated 77%)

adding: docs/javadocs/help-doc.html(in = 7413) (out= 2178)(deflated 70%)

adding: docs/javadocs/index-all.html(in = 38514) (out= 5170)(deflated 86%)

adding: docs/javadocs/index.html(in = 712) (out= 435)(deflated 38%)

adding: docs/javadocs/overview-tree.html(in = 7786) (out= 1535)(deflated 80%)

adding: docs/javadocs/package-list(in = 15) (out= 17)(deflated -13%)

adding: docs/javadocs/packages.html(in = 685) (out= 377)(deflated 44%)

adding: docs/javadocs/serialized-form.html(in = 14418) (out= 1822)(deflated 87%)

adding: docs/javadocs/stylesheet.css(in = 1328) (out= 442)(deflated 66%)

adding: docs/javadocs/suncertify/(in = 0) (out= 0)(stored 0%)

adding: docs/javadocs/suncertify/db/(in = 0) (out= 0)(stored 0%)

adding: docs/javadocs/suncertify/db/BookFlightWindow.html(in = 21493) (out= 3980

)(deflated 81%)

adding: docs/javadocs/suncertify/db/ClientID.html(in = 8754) (out= 1783)(deflate

d 79%)

adding: docs/javadocs/suncertify/db/ClientWindow.html(in = 21076) (out= 3950)(de

flated 81%)

adding: docs/javadocs/suncertify/db/Data.html(in = 24665) (out= 3875)(deflated 8

4%)

adding: docs/javadocs/suncertify/db/DatabaseException.html(in = 8807) (out= 1799

)(deflated 79%)

adding: docs/javadocs/suncertify/db/DataClient.html(in = 24618) (out= 3654)(defl

ated 85%)

adding: docs/javadocs/suncertify/db/DataInfo.html(in = 13584) (out= 2463)(deflat

ed 81%)

adding: docs/javadocs/suncertify/db/FBNSConnection.html(in = 10247) (out= 1975)(

deflated 80%)

adding: docs/javadocs/suncertify/db/FBNSDbIntrf.html(in = 8172) (out= 1710)(defl

ated 79%)

adding: docs/javadocs/suncertify/db/FBNSDbLocal.html(in = 29049) (out= 4143)(def

lated 85%)

adding: docs/javadocs/suncertify/db/FBNSDbRemote.html(in = 33046) (out= 4380)(de

flated 86%)

adding: docs/javadocs/suncertify/db/FBNSHelpWindow.html(in = 20412) (out= 3764)(

deflated 81%)

adding: docs/javadocs/suncertify/db/FieldInfo.html(in = 9757) (out= 1935)(deflat

ed 80%)

adding: docs/javadocs/suncertify/db/FieldSearch.html(in = 13742) (out= 2210)(def

lated 83%)

adding: docs/javadocs/suncertify/db/FlightDetailWindow.html(in = 21549) (out= 39

72)(deflated 81%)

adding: docs/javadocs/suncertify/db/LockTable.html(in = 15720) (out= 2584)(defla

ted 83%)

adding: docs/javadocs/suncertify/db/package-frame.html(in = 2375) (out= 727)(def

lated 69%)

adding: docs/javadocs/suncertify/db/package-summary.html(in = 8737) (out= 1804)(

deflated 79%)

adding: docs/javadocs/suncertify/db/package-tree.html(in = 7992) (out= 1517)(def

lated 81%)

adding: docs/javadocs/suncertify/db/TableDataModel.html(in = 13531) (out= 2548)(

deflated 81%)

adding: Reservationdb.db(in = 140) (out= 108)(deflated 22%)

adding: serverManifest.mf(in = 121) (out= 109)(deflated 9%)

adding: suncertify/(in = 0) (out= 0)(stored 0%)

adding: suncertify/db/(in = 0) (out= 0)(stored 0%)

adding: suncertify/db/BookFlightWindow$1.class(in = 574) (out= 353)(deflated 38%

)

adding: suncertify/db/BookFlightWindow$BookEvent.class(in = 4114) (out= 2075)(de

flated 49%)

adding: suncertify/db/BookFlightWindow$TextFieldHandler.class(in = 2825) (out= 1

575)(deflated 44%)

adding: suncertify/db/BookFlightWindow.class(in = 6985) (out= 3293)(deflated 52%

)

adding: suncertify/db/ClientApp.class(in = 1000) (out= 576)(deflated 42%)

adding: suncertify/db/ClientID.class(in = 608) (out= 410)(deflated 32%)

adding: suncertify/db/ClientWindow$1.class(in = 545) (out= 351)(deflated 35%)

adding: suncertify/db/ClientWindow$BookFlightEvent.class(in = 1506) (out= 753)(d

eflated 50%)

adding: suncertify/db/ClientWindow$FlightDetailEvent.class(in = 1350) (out= 693)

(deflated 48%)

adding: suncertify/db/ClientWindow$HelpEvent.class(in = 591) (out= 357)(deflated

39%)

adding: suncertify/db/ClientWindow$SearchEvent.class(in = 2288) (out= 1196)(defl

ated 47%)

adding: suncertify/db/ClientWindow.class(in = 7341) (out= 3503)(deflated 52%)

adding: suncertify/db/CreateReservationDb.class(in = 1358) (out= 782)(deflated 4

2%)

adding: suncertify/db/Data.class(in = 8499) (out= 4647)(deflated 45%)

adding: suncertify/db/DatabaseException.class(in = 307) (out= 224)(deflated 27%)

adding: suncertify/db/DataClient.class(in = 1016) (out= 440)(deflated 56%)

adding: suncertify/db/DataInfo.class(in = 1488) (out= 771)(deflated 48%)

adding: suncertify/db/db.db(in = 1646) (out= 584)(deflated 64%)

adding: suncertify/db/FBNSConnection.class(in = 949) (out= 516)(deflated 45%)

adding: suncertify/db/FBNSDbIntrf.class(in = 172) (out= 141)(deflated 18%)

adding: suncertify/db/FBNSDbLocal.class(in = 2069) (out= 923)(deflated 55%)

adding: suncertify/db/FBNSDbRemote.class(in = 2623) (out= 1166)(deflated 55%)

adding: suncertify/db/FBNSDbRemote_Skel.class(in = 5472) (out= 2407)(deflated 56

%)

adding: suncertify/db/FBNSDbRemote_Stub.class(in = 10082) (out= 3676)(deflated 6

3%)

adding: suncertify/db/FBNSHelpWindow$1.class(in = 564) (out= 350)(deflated 37%)

adding: suncertify/db/FBNSHelpWindow.class(in = 2229) (out= 1254)(deflated 43%)

adding: suncertify/db/FieldInfo.class(in = 541) (out= 357)(deflated 34%)

adding: suncertify/db/FieldSearch.class(in = 1021) (out= 474)(deflated 53%)

adding: suncertify/db/FlightDetailWindow$1.class(in = 584) (out= 352)(deflated 3

9%)

adding: suncertify/db/FlightDetailWindow.class(in = 4546) (out= 2468)(deflated 4

5%)

adding: suncertify/db/LockTable.class(in = 1412) (out= 720)(deflated 49%)

adding: suncertify/db/RegFBNSDatabase.class(in = 1978) (out= 1098)(deflated 44%)

adding: suncertify/db/Reservationdb.db(in = 140) (out= 108)(deflated 22%)

adding: suncertify/db/TableDataModel.class(in = 1743) (out= 1021)(deflated 41%)

adding: versionInfo.txt(in = 148) (out= 119)(deflated 19%)

C:\project>java -jar runserver.jar

Exception in thread "main" java.lang.NoClassDefFoundError: suncertify/db/RegFBNS

Database (wrong name: RegFBNSDatabase)

at java.lang.ClassLoader.defineClass0(Native Method)

at java.lang.ClassLoader.defineClass(Unknown Source)

at java.security.SecureClassLoader.defineClass(Unknown Source)

at java.net.URLClassLoader.defineClass(Unknown Source)

at java.net.URLClassLoader.access$100(Unknown Source)

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)

at java.lang.ClassLoader.loadClassInternal(Unknown Source)

C:\project>

I just noticed a error message at the start of creating the jar file:

C:\project>jar -cvfm runserver.jar serverManifest.mf project\suncertify\ .

project\suncertify : no such file or directory

So I changed the jar command to

jar -cvfm runserver.jar serverManifest.mf c:\project\suncertify .

But I got the same error.

Thanks,

Samual Harvey

Ranch Hand

Posts: 119

Duane Riech

Ranch Hand

Posts: 52

posted 12 years ago

- 0

No, the top level (main) code was NOT part of the

suncertify.db package. But that wasn't the problem afterall.....

I had compiled the .java files in another, original, code testing directory. I had built the C:\project\suncertify\db directory structure just to create the .jar files I would need for submission and then COPIED the .class files into the appropriate subdirectory. I guess you can't do that. I had to build under the project subdirectory, with my classpath set to c:\project, then create my jar file. Then it would run.

BUT, if I take the jar file, copy it to, say, the c:\ directory, set my classpath to c:\ then run it, it will run, HOWEVER, I still have a problem.

By design requirements, I have to open the db.db file. Is there a way to force the

application to use the .jar copy of the file. But that wouldn't work anyway since it's probably compressed. Or can you?

If I can't use the .jar version of the file, then that forces the user to expand the jar file back onto the user's file system... right? And if they have to do that, why not give instructions to run the application in the normal way?

How have successfult SCJD candidates done it???

Thanks,

suncertify.db package. But that wasn't the problem afterall.....

I had compiled the .java files in another, original, code testing directory. I had built the C:\project\suncertify\db directory structure just to create the .jar files I would need for submission and then COPIED the .class files into the appropriate subdirectory. I guess you can't do that. I had to build under the project subdirectory, with my classpath set to c:\project, then create my jar file. Then it would run.

BUT, if I take the jar file, copy it to, say, the c:\ directory, set my classpath to c:\ then run it, it will run, HOWEVER, I still have a problem.

By design requirements, I have to open the db.db file. Is there a way to force the

application to use the .jar copy of the file. But that wouldn't work anyway since it's probably compressed. Or can you?

If I can't use the .jar version of the file, then that forces the user to expand the jar file back onto the user's file system... right? And if they have to do that, why not give instructions to run the application in the normal way?

How have successfult SCJD candidates done it???

Thanks,

I agree. Here's the link: http://aspose.com/file-tools |