• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Chapter 1 in HFEJB

 
Bharathi Kongara
Ranch Hand
Posts: 56
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Everyone,

I'm just starting prep for SCBCD, tried to implement the exact same thing taught in Chapter 1 step-by-step, but I'm stuck accessing the bean from the client at the end. Am wondering if somebody had the same problem and figured out why - I did the following (its almost identical to the book):

1. Start the server.
2. Deployed a statless session bean (with remote interfaces) successfully with the J2EE RI.
3. Tried to access the bean from the client, a stand-alone Java program with a main() - it is throwing exception when I'm running the Java class
Exception in thread "main" java.lang.NoClassDefFoundError: com/sun/corba/se/inte
rnal/util/JDKBridge
at com.sun.corba.ee.internal.core.IOR$LocalCodeBaseSingletonHolder.<clin
it>(IOR.java:90)
at com.sun.corba.ee.internal.core.IOR.<init>(IOR.java:238)
at com.sun.corba.ee.internal.iiop.messages.LocateReplyMessage_1_2.read(L
ocateReplyMessage_1_2.java:137)
at com.sun.corba.ee.internal.iiop.IIOPInputStream.unmarshalHeader(IIOPIn
putStream.java:126)
at com.sun.corba.ee.internal.iiop.IIOPConnection.getResponse(IIOPConnect
ion.java:671)
at com.sun.corba.ee.internal.iiop.IIOPConnection.send(IIOPConnection.jav
a:778)
at com.sun.corba.ee.internal.corba.InitialNamingClient.locateObject(Init
ialNamingClient.java:786)
at com.sun.corba.ee.internal.corba.InitialNamingClient.getIORUsingHostIn
fo(InitialNamingClient.java:597)
at com.sun.corba.ee.internal.corba.InitialNamingClient.resolveCorbaloc(I
nitialNamingClient.java:573)
at com.sun.corba.ee.internal.corba.InitialNamingClient.resolveUsingORBIn
itRef(InitialNamingClient.java:544)
at com.sun.corba.ee.internal.corba.InitialNamingClient.cachedInitialRefe
rences(InitialNamingClient.java:1080)
at com.sun.corba.ee.internal.corba.InitialNamingClient.resolve_initial_r
eferences(InitialNamingClient.java:981)
at com.sun.corba.ee.internal.corba.ORB.resolve_initial_references(ORB.ja
va:2425)
at com.sun.enterprise.naming.SerialContext.getProvider(SerialContext.jav
a:52)
at com.sun.enterprise.naming.SerialContext.lookup(SerialContext.java:120
)
at javax.naming.InitialContext.lookup(Unknown Source)
at AdviceClient.go(AdviceClient.java:21)
at AdviceClient.main(AdviceClient.java:11)

I made sure that I'm looking up the same JNDI name I gave while deploying the bean - infact I redeployed the bean with a different name and updated the client class, didn't work..

Any help would be greatly appreciated...

Thanks in advance,
Bharathi
 
Shirley Santiago
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Try adding j2ee.jar in your classpath.
 
Bharathi Kongara
Ranch Hand
Posts: 56
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for the reply ... but I already have j2ee.jar in the classpath. The client won't even compile without j2ee.jar in the classpath..
 
Bharathi Kongara
Ranch Hand
Posts: 56
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Actually it worked thanks to another similar post (http://www.coderanch.com/t/161143/java-EJB-SCBCD/certification/AdviceClient)

I changed my CLASSPATH to this
CLASSPATH = E:\j2sdkee1.3.1\lib\j2ee.jar;E:\j2sdk1.4.2_12\jre\lib\rt.jar;
 
Sirish Kumar Gongal Reddy
Ranch Hand
Posts: 109
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

It seems a deployment problem. your request is not reached even to server. please explore the .ear file in the servere and make sure all .xml files are availble or not. please follow the procedure..

1.Compile (Client and server classes)

2. make a pack (.class files and .xml)

3. deploy the component.

while learning don't use any tool do manually. (deployment, packing..stuff..)

Thanks/Sirish
 
Jeroen T Wenting
Ranch Hand
Posts: 1847
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hmm, the "LocateReplyMessage" in there makes me think it's a problem elsewhere.
Most likely something to do with JNDI rather than deployment.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic