• 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Bear Bibeault
  • Henry Wong
  • Devaka Cooray
Saloon Keepers:
  • salvin francis
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Frits Walraven
Bartenders:
  • Jj Roberts
  • Carey Brown
  • Scott Selikoff

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?
 
There is no "i" in denial. Tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic