• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Paul Clapham
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Roland Mueller
  • Piet Souris
Bartenders:

AdviceClient again!!

 
Ranch Hand
Posts: 49
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
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..
 
Ranch Hand
Posts: 100
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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!
 
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Prabu:

Check this post: https://coderanch.com/t/160001/java-EJB-SCBCD/certification/Advice-Client. You may get solution.
 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic