• Post Reply Bookmark Topic Watch Topic
  • New Topic

AdviceClient again!!  RSS feed

Prabu S Arumugam
Ranch Hand
Posts: 49
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
C:\Prabu\mycode\J2EE\EJB\AdviceApp\Advice>java AdviceClient
Context Created!!!
Exception in thread "main" java.lang.NoClassDefFoundError: com/sun/corba/se/internal/util/JDKBridge
at com.sun.corba.ee.internal.core.IOR$LocalCodeBaseSingletonHolder.<clin
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
at com.sun.corba.ee.internal.iiop.IIOPInputStream.unmarshalHeader(IIOPIn
at com.sun.corba.ee.internal.iiop.IIOPConnection.getResponse(IIOPConnect
at com.sun.corba.ee.internal.iiop.IIOPConnection.send(IIOPConnection.jav
at com.sun.corba.ee.internal.corba.InitialNamingClient.locateObject(Init
at com.sun.corba.ee.internal.corba.InitialNamingClient.getIORUsingHostIn
at com.sun.corba.ee.internal.corba.InitialNamingClient.resolveCorbaloc(I
at com.sun.corba.ee.internal.corba.InitialNamingClient.resolveUsingORBIn
at com.sun.corba.ee.internal.corba.InitialNamingClient.cachedInitialRefe
at com.sun.corba.ee.internal.corba.InitialNamingClient.resolve_initial_r
at com.sun.corba.ee.internal.corba.ORB.resolve_initial_references(ORB.ja
at com.sun.enterprise.naming.SerialContext.getProvider(SerialContext.jav
at com.sun.enterprise.naming.SerialContext.lookup(SerialContext.java:120
at javax.naming.InitialContext.lookup(Unknown Source)
at AdviceClient.go(AdviceClient.java:19)
at AdviceClient.main(AdviceClient.java:10)

Changed the business method name to getTheMessage as there were posts asking to change it from getAdvice-some conflict with Inteface name Advice:

Context Created!!!
is being printed out.. so Initial Context part is OK..
is there some problem with JNDI look up (Advisor).. ??!!
& this is AdviceClient.java:
import javax.naming.*;
import java.rmi.*;
import javax.rmi.*;
import headfirst.*;
import javax.ejb.*;

public class AdviceClient {

public static void main(String[] args) {
new AdviceClient().go();

public void go() {
Context ic = new InitialContext();
System.out.println("Context Created!!!");

Object o = ic.lookup("Advisor");
System.out.println("Lookup DONE!!!");

AdviceHome home = (AdviceHome) PortableRemoteObject.narrow(o,AdviceHome.class);
System.out.println("Narrowing DONE!!!");

Advice advisor = home.create();
System.out.println("Remote Object Created!!!");

catch (Exception ex) {



This is my CLASSPATH:

C:\Prabu\mycode\J2EE\EJB\ADVICE~1\Advice>echo %CLASSPATH%
C:\Program Files\Apache Software Foundation\Tomcat 5.5\common\lib\servlet-api.jar;C:\Program Files\QuickTime\QTSystem\QTJava.zip;C:\j2sdkee1.3.1\lib\j2ee.jar;C:\Prabu\mycode\J2EE\EJB\AdviceApp\Advice\AdviceAppClient.jar;.

Anyone got similar errors.. lemme know..
Richard Rex
Ranch Hand
Posts: 100
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Prabu Arumugam,

I also encountered before the same error you are having now. I haven't figure out why I was getting such an error. But I am pretty much sure that the error is not in the code, it's in my settings. So what I did is to start all over again. Try doing everything from scratch again. And this time make it slow and as accurate as it can be specially with the settings of your path and classpath. Good luck!
Leigh Su
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Prabu:

Check this post: http://www.coderanch.com/t/160001/java-EJB-SCBCD/certification/Advice-Client. You may get solution.
Matthew Burnett
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

At your command prompt, type

java -version

Sometimes the jvm might default to a version that doesn't work with the supplied code (I don't know why and am not that interested in why). Mine was defaulting to 1.5.0_06 all day, and was annoying me badly until I did the following:

java -version:1.4.2_06 -cp (the rest of the line from the book goes here)

Please note that this is completely different from the CORBA problem that Kathy fixed with the code you can pull off of the wickedlysmart website.

It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!