• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

appserv-rt.jar needed for AdviceBean?

 
Craig Wong
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi ranchers,

I am working through the AdviceBean example in Head First EJB. I have encountered a series of errors, but by browsing javaranch and other web sites, I see that I am not alone! Errors have included: NoInitialContextException, NoClassDefFoundError, something with LoadClass0, something with JDKBridge.

I have read a few people indicate that including appserv-rt.jar in the classpath is helpful. HFE says to use J2EE 1.3 (j2sdkee1.3.1); is there an appserv-rt.jar for that release? I don't see it. If I stick to 1.3, is there an eqivalent to appserv-rt.jar?

Big picture, this process of getting this one example up and running (not yet) has been really time consuming. Most of the errors so far have centered around either version compatibilities of the JDK and J2EE or on classpath definition. Educational, I guess, in a weird sort of way. But can you tell me is this book buggy later on, too, or is it so narrowly written that any little compatibility issue will derail a student for days like this problem? Or is just the nature of EJB, JNDI, etc. that first solo usages of those technologies can be really painful?

Thanks!
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
But can you tell me is this book buggy later on, too, or is it so narrowly written that any little compatibility issue will derail a student for days like this problem? Or is just the nature of EJB, JNDI, etc. that first solo usages of those technologies can be really painful?

The book is fine. If you're using JDK1.3 with J2EE1.3.1 FCS, then you'll be ok. Check also the following : http://www.oreilly.com/catalog/hfjejb/errata/hfjejb.help
 
Craig Wong
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks, I checked that o'reilly page, and I think I have everything correct so far.

Here is a summary of what I have tried so far:

/* DOS window 1: */
c:\projects\advice\src> c:\jdk1.3.1_20\bin\javac �d ..\classes �classpath c:\j2sdkee1.3.1\lib\j2ee.jar headfirst\*.java

/* DOS window 2: */
set java_home=c:\jdk1.3.1_20
c:\j2sdkee1.3.1\bin> cloudscape �start

/* DOS window 3: */
set java_home=c:\jdk1.3.1_20
c:\j2sdkee1.3.1\bin>j2ee �verbose

/* DOS window 4: */
set java_home=c:\jdk1.3.1_20
c:\projects\advice> c:\j2sdkee1.3.1\bin\deploytool
/* build the bean like the book tells me to, this seemed to work fine */

/* DOS window 1 again: */
c:\projects\advice> c:\jdk1.3.1_20\bin\javac �classpath .\AdviceAppClient.jar;c:\j2sdkee1.3.1\lib\j2ee.jar AdviceClient.java

/* Then, finally, in DOS window 1 again: */
c:\projects\advice> java -classpath .\AdviceAppClient.jar;c:\j2sdkee1.3.1\lib\j2ee.jar;.;c:\jdk1.3.1_20\jre\lib\rt.jar AdviceClient

Currently I get javax.naming.CommunicationException: Can't find SerialContextProvider

I do see some old posts about the SerialContextProvider message, so I will walk down those trails next.

In the meantime, I am still wondering about appserv-rt.jar. Is it part of the solution using j2sdkee1.3.1?

Thanks!
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I don't remember using appserv-rt anywhere when I studied for the exam. And I've also used HFEJB. I don't think it will change anything, but try the following :
java -classpath .\AdviceAppClient.jar;c:\j2sdkee1.3.1\lib\j2ee.jar;. AdviceClient

Do you have a jndi.properties somewhere in your classpath, or in AdviceAppClient.jar ?
[ July 24, 2007: Message edited by: Christophe Verre ]
 
Craig Wong
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Running that java command that you wrote out yields
NoClassDefFoundError...JDKBridge.

I don't have a jndi.properties. I double checked in c:\jdk1.3.1_20\lib and every other jdk or j2sdkee1.3.1 I could think of. Should I expect it somewhere in the standard downloads?

Thanks.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic