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

Problem invoking an EJB method from a JAVA client

 
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I have written and deployed a EJB object on an J2EE server. I am invoking it from a JAVA client. Below is the source code for the java client:

package headfirst;

import javax.naming.*;
import java.rmi.*;
import javax.rmi.*;
import headfirst.*;
import javax.ejb.*;

public class AdviceClient
{

public void go()
{
try
{
Context ic = new InitialContext();

if(ic != null)
System.out.println("Got the Context");
Object o = ic.lookup("Advisor");

if(o != null)
System.out.println("Got the Lookup Object");


AdviceHome home = (AdviceHome) PortableRemoteObject.narrow(o,AdviceHome.class);

if(home != null)
System.out.println("Got the ADviceHome");

Advice advisor = home.create();

if(advisor != null)
System.out.println("Got the Advisor");

System.out.println(advisor.getAdvice());
}
catch(Exception e)
{
e.printStackTrace();
}
}

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

I have compiled this code using the client jar created by J2EE deploy tool. By while running the code, I got the following exception:

C:\Rohan\JavaProject\EJB\Advice>java headfirst.AdviceClient
Got the Context
Got the Lookup Object
Got the ADviceHome
Got the Advisor
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
at javax.rmi.CORBA.Util.mapSystemException(Util.java:65)
at headfirst._Advice_Stub.getAdvice(Unknown Source)
at headfirst.AdviceClient.go(AdviceClient.java:36)
at headfirst.AdviceClient.main(AdviceClient.java:46)
Caused by: org.omg.CORBA.BAD_OPERATION: vmcid: 0x0 minor code: 0 completed:
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstruct
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingC
at java.lang.reflect.Constructor.newInstance(Constructor.java:274)
at java.lang.Class.newInstance0(Class.java:296)
at java.lang.Class.newInstance(Class.java:249)
at com.sun.corba.ee.internal.iiop.messages.ReplyMessage_1_2.getSystemExc
at com.sun.corba.ee.internal.iiop.ClientResponseImpl.getSystemException(
at com.sun.corba.ee.internal.POA.GenericPOAClientSC.invoke(GenericPOACli
at org.omg.CORBA.portable.ObjectImpl._invoke(ObjectImpl.java:457)
at headfirst._Advice_Stub.getAdvice(Unknown Source)
... 2 more


Can anybody help me understand why this is happening?
 
Not looking good. I think this might be the end. Wait! Is that a tiny ad?
New web page for Paul's Rocket Mass Heaters movies
https://coderanch.com/t/785239/web-page-Paul-Rocket-Mass
reply
    Bookmark Topic Watch Topic
  • New Topic