My dear friends ,
I have a few issues that I hope all of you can throw some light on.
Basically I have an application that runs fine when I execute it though eclipse. However when I run it through command line it does not run. I was wondering if you guys can throw some light on what may be going wrong and what I can do to correct the issue.
I think I know what the problem is but dont know how to find a solution. There is still too much of a black box.
On eclipse the command line arguments are as follows: 1 1 ds 6000 5 true all 5000 person
I pass all these variables through the command line options in the Run->launch configuration.
When I run from the command line using the following command I get the following output.
java -cp ./test/build/test.jar scache.test.client.StartSC
acheTestCl
ient 1 1 ds 6000 5 true all 5000 person
I just get a couple of lines from the main method and as soon as some method in a class in a jar file is called the application does not give any output. I dont see any ecception thrown but the program stops executiing,
When I run it using the following command from the command line.
java -cp ./jars/ifcs.jar:./jars/imp
l.jar:./te
st/build/B
C.jar:./te
st/build/D
SClient.ja
r:./test/b
uild/DSPub
Interfaces
.jar:./tes
t/build/DS
RPC.jar:./
test/build
/applicati
on.jars:./
test/build
/audit.jar
:./test/bu
ild/b2b.ja
r:./test/b
uild/build
ing.jar:./
test/build
/codegen.j
ar:./test/
build/comm
on.jar:./t
est/build/
company.ja
r:./test/b
uild/conta
ct.jar:./t
est/build/
dsDev2.jar
:./test/bu
ild/excep.
jar:./test
/build/gro
up.jar:./t
est/build/
jbossall-c
lient.jar:
./test/bui
ld/jnp-cli
ent.jar:./
test/build
/monitor.j
ar:./test/
build/neti
nfo.jar:./
test/build
/network.j
ar:./test/
build/oper
ator.jar:.
/test/buil
d/person.j
ar:./test/
build/refd
ata.jar:./
test/build
/rpctest.j
ar:./test/
build/serv
ices.jar:.
/test/buil
d/sso.jar:
./test/bui
ld/transpo
rt.jar:./t
est/build/
company.ja
r:./test/b
uild/test.
jar scache.test.client.StartSC
acheTestCl
ient 1 1 ds 6000 5 true all 5000 person
It runs a lot further i.e. I see at least a few more lines of output from methods in classes that are in the included jars to run.
So my conclusion is that my problem is that all the jar files are not being found. I don't get any more specific output from the command line. How do I produce more output to help me to debug ?
The output that I have is as follows
=====================
Error Stream has encoding: MacRoman
Hello World
Output Stream has encoding: MacRoman
before setup debug level
In InitFactory before UniversalFactoryImpl.getEl
ementFacto
ry() (<----------this is in the main befor going into the jar files )
IN getElementFactory (<------------------this is inside the jar files )
In InitFactory after UniversalFactoryImpl.getEl
ementFacto
ry() ( this is after returning from the jar files )
=====================
How do I proceed with this ? I dont have the source to all the jars. I could put some more printf's in some of the jars whose source I have. But what about the jars that I dont have the source for . Is there any other way for me to extract more insightful information.
It could also be an issue on specifying the jars in the right order. Is there a way for me to figure out the right order of the jars ?
I could go to eclipse and look under the Project Build Properties and figure out the order in which eclipse calls the jars during the build process. Could I specify the same order for the jars during the runtime. Would this help ?
Any other ideas ?
Could I get some verbose output from teh compiler at build time. Perhaps it reporting some warnings about some issues that can only be resolved at run time. How can I get infomation on these warnings ?
I also created a build.xml to execute the code. The build.xml method does not seem to work for running the code. I am not too sure how to pass command line arguments to a program. Can anyone enlighten me on how to modify to accept command line arguments ?
I know basedir is defined correctly because several other parts of my build.xml file use it and it works correctly. How do I specify all my jars correctly for the runtime. My build works fine with a simlar syntax but my execute doesnt. Can anyone suggest better of alternative syntax for telling my executable where to find the jars ?
<target name="run_test" depends="compile_test" >
<java jar="${basedir}/test/build
/test.jar"
fork="true"/>
<classpath>
<pathelement path="S{basedir}/jars">
<fileset dir="S{basedir}/jars">
<include name="**/*.jar"/>
</fileset>
</pathelement>
</classpath>
</target>