It's all about the answers!

Ask a question

JazzPlainJava snippets failed to run


Guowei Jim Hu (1.0k910353) | asked Mar 04 '09, 10:49 a.m.
I got the following error when trying to run the snippets downloaded from JazzPlainJavaClient-0.6.zip.
I followed all the steps described in the README.TXT.

Looking around the forum, seeing several posts about the log4j warning, but non of them is related to the log4j configure. It is very confusing. Please help.

log4j:WARN No appenders could be found for logger (org.apache.commons.httpclient.params.DefaultHttpParams).
log4j:WARN Please initialize the log4j system properly.
Exception in thread "main" java.lang.NullPointerException
at java.security.SecureRandom.nextBytes(SecureRandom.java:430)
at java.security.SecureRandom.next(SecureRandom.java:452)
at java.util.Random.nextInt(Random.java:202)
at com.ibm.jsse2.bc.engineInit(bc.java:95)
at javax.net.ssl.SSLContext.init(SSLContext.java:11)
at com.ibm.team.repository.transport.client.SecureInterruptableSocketFac
tory.createSSLContext(SecureInterruptableSocketFactory.java:48)
at com.ibm.team.repository.transport.client.SecureInterruptableSocketFac
tory.<init>(SecureInterruptableSocketFactory.java:66)
at com.ibm.team.repository.transport.client.RemoteTeamServer.ensureIniti
alized(RemoteTeamServer.java:145)
at com.ibm.team.repository.transport.client.RemoteTeamServer.setCredenti
als(RemoteTeamServer.java:170)
at com.ibm.team.repository.client.internal.TeamRepository.<init>(TeamRep
ository.java:332)
at com.ibm.team.repository.client.internal.TeamRepositoryService.createS
haredTeamRepository(TeamRepositoryService.java:366)
at com.ibm.team.repository.client.internal.TeamRepositoryService.getTeam
Repository(TeamRepositoryService.java:91)
at com.ibm.team.repository.client.internal.TeamRepositoryService.getTeam
Repository(TeamRepositoryService.java:110)
at snippets.Snippet1.login(Snippet1.java:37)
at snippets.Snippet1.main(Snippet1.java:28)

4 answers



permanent link
Jean-Michel Lemieux (2.5k11) | answered Mar 04 '09, 4:29 p.m.
JAZZ DEVELOPER
You need the JRE ext dir on your classpath. Somehow this isn't happening. The snippets readme should outline this.
Jean-Michel

permanent link
Guowei Jim Hu (1.0k910353) | answered Mar 05 '09, 10:26 a.m.
Thanks for the tips.

But I think I did when I run it on command line as below:
>java -Djava.ext.dirs="F:\Program Files\IBM\TeamConcert"\jre\lib/ext;. snippets.Snippet1.class

I can make it work in Eclipse client UI. But I really need to get it work on command line. What do I miss now?

permanent link
Ralph Schoon (63.4k33646) | answered Mar 06 '09, 7:08 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
Hello ghu,

in my batch file the following finally worked:

cd JazzPlain
C:\JazzDemo\build\jdk1.6.0_05\bin\java -Djava.ext.dirs=C:/JazzDemo/build/jdk1.6.0_05/jre/lib/ext;snippets;.
snippets.Snippet2
pause

the issue could be the darn \ vs / problem, couldn't it?

Thanks for the tips.

But I think I did when I run it on command line as below:

java -Djava.ext.dirs="F:\Program

Files\IBM\TeamConcert"\jre\lib/ext;. snippets.Snippet1.class

I can make it work in Eclipse client UI. But I really need to get it
work on command line. What do I miss now?

permanent link
Guowei Jim Hu (1.0k910353) | answered Mar 06 '09, 1:46 p.m.
Ralph,
Thanks for the help.
Yes it is the path but it is more than the typo I had.
It looks like I have a different Java defined on the PATH. SO I saw you use the same path for your Java and Djava, I tried and it finally worked:
>"F:\Program Files\IBM\TeamConcert"\jdk\jre\bin\java -Djava.ext.dirs="F:\Program Files\IBM\TeamConcert"\jdk\jre\lib\ext;snippets;. snippets.Snippet1.class
log4j:WARN No appenders could be found for logger (org.apache.commons.httpclient.params.DefaultHttpParams).
log4j:WARN Please initialize the log4j system properly.
Contacting https://localhost:9443/jazz/...
Connected

Your answer


Register or to post your answer.


Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.