This week's book giveaway is in the Mac OS forum.
We're giving away four copies of a choice of "Take Control of Upgrading to Yosemite" or "Take Control of Automating Your Mac" and have Joe Kissell on-line!
See this thread for details.
The moose likes EJB Certification (SCBCD/OCPJBCD) and the fly likes AdviceClient again!! Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Certification » EJB Certification (SCBCD/OCPJBCD)
Bookmark "AdviceClient again!!" Watch "AdviceClient again!!" New topic
Author

AdviceClient again!!

Prabu S Arumugam
Ranch Hand

Joined: Apr 30, 2006
Posts: 49
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
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: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:
System.out.println(advisor.getTheMessage());

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() {
try{
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!!!");

System.out.println(advisor.getTheMessage());
}
catch (Exception ex) {
ex.printStackTrace();
}


}


}



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..


Insurance Systems- Architect.
SCBCD 5, SCWCD 1.4, MCP VB 6.0
Richard Rex
Ranch Hand

Joined: Sep 19, 2005
Posts: 100
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!


"If you fail to plan, you plan to fail."<br /> <br />Chad<br />SCJP 1.4<br />SCWCD 1.4<br />SCBCD 1.3<br />SCDJWS (next)
Leigh Su
Greenhorn

Joined: Mar 16, 2006
Posts: 22
Hi Prabu:

Check this post: http://www.coderanch.com/t/160001/java-EJB-SCBCD/certification/Advice-Client. You may get solution.


SCJP 5, SCWCD 1.4, SCBCD 1.3
Matthew Burnett
Greenhorn

Joined: Jul 04, 2006
Posts: 1
Hi-

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.

hth


SCJP SCWCD
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: AdviceClient again!!