You are not logged in.

#1 2007-04-21 18:45:09

sven
Member
Registered: 2005-02-01
Posts: 311

First J2EE test in Arch and a problem with database adapter SOLVED

I am trying to get my feet wet with J2EE and spotted a nice walkthrough article here - http://www.sitepoint.com/article/java-6 … c-web-apps.

All went fine until the part when I should have got the data from the database at the end of the first part - "java -classpath .;./mysql-connector-java-5.0.5-bin.jar com.sitepoint.ToDoTest" This command ends up displaying weird scrambled output like this:

    -agentlib:<libname>[=<options>]
                  load native agent library <libname>, e.g. -agentlib:hprof
                    see also, -agentlib:jdwp=help and -agentlib:hprof=help
    -agentpath:<pathname>[=<options>]
                  load native agent library by full pathname
    -javaagent:<jarpath>[=<options>]
                  load Java programming language agent, see java.lang.instrument
    -splash:<imagepath>
                  show splash screen with specified image
./mysql-connector-java-5.0.5-bin.jar: line 1: PK: command not found
./mysql-connector-java-5.0.5-bin.jar: line 2: Ža6: command not found
./mysql-connector-java-5.0.5-bin.jar: line 3: käHJÀËÐ G» sáÜ: ambiguous redirect
./mysql-connector-java-5.0.5-bin.jar: line 3: ¥DÝ€ü׶sJR: command not found
./mysql-connector-java-5.0.5-bin.jar: line 14: ¸¤ T`Ãm€bCIî@¨yÖÇüZ,ùÏò"Mª
                                                                         ²R+g}ïÏ
TbJIvÑmæ÷綆+%"¤ „)kŒEJª"n´'apò£íwÛ,E÷Z«Xô•am]Âþ,BIaº
                                                      `x'"}õµg¹E¬›íÞ‚wåFÌãü7-¼¨Ç5bÜøOè×–fñ7PK

Ža6com/PK

Ža6
com/mysql/PK
Ža6com/mysql/jdbc/PK
Ža6JÆ Ø'-com/mysql/jdbc/AssertionFailedException.class RMOÛ@}›¤qbÌGJ
                                                                    "!  q¤¢¢¨ˆCȪH\*mì%,rìÔýY½$U'Ú{TÕY»h–gôfgÞì¯ßßØDMÃœ†ç^èHc>‡‹x©À'ŽWXÎaE eV5"ƃs/rì†ònW¸

Not sure how to proceed here - I guess I am missing something.

Last edited by sven (2007-04-21 20:18:36)

Offline

#2 2007-04-21 18:59:01

paulr
Member
Registered: 2007-03-23
Posts: 53

Re: First J2EE test in Arch and a problem with database adapter SOLVED

"java -classpath .;./mysql-connector-java-5.0.5-bin.jar com.sitepoint.ToDoTest"

I think this is your problem. I *think* that the original application was set up on Windows, which uses semicolons as directory seperators (for the classpath). Linux uses colons.

Linux uses the semicolon as a delimiter between commands, so your command is actually two commands run one after the other.

java -classpath .
./mysql-connector-java-5.0.5-bin.jar com.sitepoint.ToDoTest

What you have with your gobbledegook is the tail end of the java help (because you've tried to run a java application but not given it anything to run.

The second bit is because you have tried to run the mysql-connector-java-5.0.5.bin.jar as a shell script.  It isn't one, which is why you get gobbledegook error messages.

So, try changing the semicolon to a colon smile

Last edited by paulr (2007-04-21 18:59:40)

Offline

#3 2007-04-21 20:16:18

sven
Member
Registered: 2005-02-01
Posts: 311

Re: First J2EE test in Arch and a problem with database adapter SOLVED

Thanks, I got it to work now! I used this line instead at the classes-dir:
"java -classpath .:../mysql-connector-java-5.0.5-bin.jar com.sitepoint.ToDoTest" and it ran nicely.

Last edited by sven (2007-04-21 20:17:39)

Offline

Board footer

Powered by FluxBB