• 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
  • Ron McLeod
  • Paul Clapham
  • Tim Cooke
  • Devaka Cooray
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Rob Spoor
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
Bartenders:
  • Carey Brown
  • Roland Mueller

Runtime error with AviceBean from HFE

 
Ranch Hand
Posts: 469
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
When I run client program I am getting the following error
java.lang.ClassCastException
at com.sun.corba.se.internal.javax.rmi.PortableRemoteObject.narrow(Porta
bleRemoteObject.java:293)
at javax.rmi.PortableRemoteObject.narrow(PortableRemoteObject.java:134)
at AdviceClient.go(AdviceClient.java:18)
at AdviceClient.main(AdviceClient.java:10)
I have included AdviceAppClient.jar in classpath so I am running AdviceClient program using following command line
java AdviceClient
What might me the problem?
Thanks
Veena
 
Ranch Hand
Posts: 143
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Please redeploy the bean. It seems there's a naming conflict. See the link below
https://coderanch.com/forums/
Attach your AdviceClient code with the post.
 
Veena Pointi
Ranch Hand
Posts: 469
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks.Here is my AdviceClient code

Mistake I did was I named AdviceBean as Adviser ,was calling Advisor in client programme.So I undeployed Bean,gave JNDI name as Advisor and run client code again.But I keep getting this exception.
Thanks again
Veena
 
Veena Pointi
Ranch Hand
Posts: 469
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Can somebody tell me if they have faced same problem?I undeployed and redeployed again.But still not working.
Thanks
Veena
 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Got the same error, not debugged yet, hope to find the clue about it in chapter 3(Client view).
 
Sudhir V
Ranch Hand
Posts: 143
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
See its pretty obvious that the error is in this line
AdviceHome home=(AdviceHome)PortableRemoteObject.narrow(o,AdviceHome.class)
The cast operation ((AdviceHome)) is throwing error means that something which is beng returned from PortableRemoteObject.narrow(o,AdviceHome.class)
is not castable.
So the error narrows down to "PortableRemoteObject.narrow(o,AdviceHome.class)"
the container is able to recognize the PortableRemoteObject function but probably its not narrowing it down to an object which is castable. Most likely the error is with AdviceHome.class or the container is not able to find this class. Please make sure that classpath for the jar file is set right. Instead of setting the classpath permanently specify the path at runtime using java -cp.
Please check your other classpaths using this link
http://www.oreilly.com/catalog/hfjejb/errata/hfjejb.help
and compile using "javac -cp" and run using "java -cp"
 
Veena Pointi
Ranch Hand
Posts: 469
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I tried to print the object "o" which is result of narrowing.
System.out.println("lookup object: "+ o) gives
lookup object: com.sun.corba.ee.internal.iiop.CDRInputStream_1_0$1:IOR:00000000000002a524d493a6865616466697273742e416476696365486f6d653a303030303030303030303003030303000000000000001000000000000015c000102
It has long binar digits at the end which I have truncated
Thanks
Veena
[ February 08, 2004: Message edited by: Veena Point ]
 
Veena Pointi
Ranch Hand
Posts: 469
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Sudhir Vallam:
likely the error is with AdviceHome.class or the container is not able to find this class. Please make sure that classpath for the jar file is set right. Instead of setting the classpath permanently specify the path at runtime using java -cp.


Classpath for jar jar file is set right.I checked it.When I run using
java -cp {$CLASSPATH}:AdviceAppClient.jar AdviceClient command I get the following error
Exception in thread "main" java.lang.NoClassDefFoundError: ex
Everything is fine.But still not working.
Veena
 
manishguptaonweb Gupta
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am getting an error in the last line of the code for the client(System.out.println(advisor.getAdvice()) . Any clues, it is giving the error( headfirst._Advice_Stub.getAdvice(Unknown Source)).
The whole stack trace is below.
java.rmi.RemoteException: CORBA BAD_OPERATION 0 No; nested exception is:
org.omg.CORBA.BAD_OPERATION: vmcid: 0x0 minor code: 0 completed: No
at com.sun.corba.ee.internal.iiop.ShutdownUtilDelegate.mapSystemExceptio
n(ShutdownUtilDelegate.java:137)
at javax.rmi.CORBA.Util.mapSystemException(Util.java:65)
at headfirst._Advice_Stub.getAdvice(Unknown Source)
at AdviceClient.go(AdviceClient.java:22)
at AdviceClient.main(AdviceClient.java:9)
Caused by: org.omg.CORBA.BAD_OPERATION: vmcid: 0x0 minor code: 0 completed:
No
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstruct
orAccessorImpl.java:39)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingC
onstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:274)
at java.lang.Class.newInstance0(Class.java:306)
at java.lang.Class.newInstance(Class.java:259)
at com.sun.corba.ee.internal.iiop.messages.ReplyMessage_1_2.getSystemExc
eption(ReplyMessage_1_2.java:93)
at com.sun.corba.ee.internal.iiop.ClientResponseImpl.getSystemException(
ClientResponseImpl.java:108)
at com.sun.corba.ee.internal.POA.GenericPOAClientSC.invoke(GenericPOACli
entSC.java:132)
at org.omg.CORBA.portable.ObjectImpl._invoke(ObjectImpl.java:457)
at headfirst._Advice_Stub.getAdvice(Unknown Source)
 
What are you doing? You are supposed to be reading this tiny ad!
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic