File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes EJB and other Java EE Technologies and the fly likes I need some help here............Please Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "I need some help here............Please" Watch "I need some help here............Please" New topic

I need some help here............Please

Tualha Khan
Ranch Hand

Joined: Nov 22, 2000
Posts: 287
12:51 AM 1/7/2002
Dear All,
I have successfully, deployed my first EJB. However there seems to be some problem in the client code. I am using the J2EE's deploytool to deploy the Application. Here is the summary from the Deploytool
Deploy the application in C:\bea\jfiles\HelloWorldApp.ear on the server
localhost saving the client jar as C:\bea\jfiles\HelloWorldAppClient.jar
Sender object Deploy Tool : Deploy HelloWorldApp on localhost
Remote message: Contacted Server....
Remote message: Application HelloWorldApp transferred.
Remote message: HelloWorldApp has 1 ejbs, 0 web components to deploy.
Remote message: Deploying Ejbs....
Remote message: Processing beans ....
Remote message: Compiling wrapper code ....
Remote message: Compiling RMI-IIOP code ....
Remote message: Making client JARs ....
Remote message: Making server JARs ....
Remote message: Deployment of HelloWorldApp is complete..
Sender object Deploy Tool : client code at
Remote message: Client code for the deployed application HelloWorldApp saved to
Here is the complete session after running the client:-
C:\bea\jfiles>runclient -client HelloWorldApp.ear -name HelloWorldClient
Initiating login ...
Username = null
Enter Username:guest
Enter Password:guest123
Binding name:`java:comp/env/SimpleHelloWorld`
Before Object Creation --->>>
Caught an Exception: java.rmi.AccessException: CORBA NO_PERMISSION 0 No;
exception is:
org.omg.CORBA.NO_PERMISSION: minor code: 0 completed: No
java.rmi.AccessException: CORBA NO_PERMISSION 0 No; nested exception is:
org.omg.CORBA.NO_PERMISSION: minor code: 0 completed: No
org.omg.CORBA.NO_PERMISSION: minor code: 0 completed: No
at java.lang.Class.newInstance0(Native Method)
at java.lang.Class.newInstance(
at org.omg.CORBA.portable.ObjectImpl._invoke(
at _HelloWorldHome_Stub.create(Unknown Source)
at HelloWorldClient.main(
at java.lang.reflect.Method.invoke(Native Method)
at com.sun.enterprise.appclient.Main.main(
Unbinding name:`java:comp/env/SimpleHelloWorld`
The StackTrace suggests some problem arises when I call the create() method on the Home interface of my app. Following are
the four source files.
========================== (The Remote Interface)
import javax.ejb.*;
import java.rmi.*;

public interface HelloWorld extends EJBObject
public String hello() throws RemoteException;
========================== (The Home Interface)
import javax.ejb.*;
import java.rmi.*;

public interface HelloWorldHome extends EJBHome
HelloWorld create() throws RemoteException, CreateException;

========================== (The Enterprise Bean Class)
import javax.ejb.*;
import java.rmi.*;

public class HelloWorldBean implements SessionBean
public String hello()
System.out.println("Cool EJB Ultimately Worked??");
return "Yep, it Did!!";
public void ejbCreate()
System.out.println("In ejbCreate()");
public void ejbRemove()
System.out.println("In ejbRemove()");
public void ejbActivate()
System.out.println("In ejbActivate()");
public void ejbPassivate()
System.out.println("In ejbPassivate()");
public void setSessionContext(SessionContext ctx)
System.out.println("In setSessionContext()");

========================== (The Application Client)
import javax.naming.Context;
import javax.naming.InitialContext;
import javax.rmi.PortableRemoteObject;
import HelloWorld;
import HelloWorldHome;
public class HelloWorldClient
public static void main(String args[])
Context initial = new InitialContext();
Object objref=initial.lookup("java:comp/env/SimpleHelloWorld");
HelloWorldHome home=(HelloWorldHome)PortableRemoteObject.narrow(objref,
System.out.println("Before Object Creation --->>>");
HelloWorld sayHello = home.create();
//String hellosaid=sayHello.hello();
//System.out.println("The Reply from EJB is : "+hellosaid);
System.out.println("Client Seems to be ok");
catch(Exception ex)
System.out.println("Caught an Exception: "+ex);


Any help will be appreciated!!
Thanks & Bye,
Tualha Khan

SCJP2, BEA WLS 6.0, DB2 UDB 7.1
BJ Grau
Ranch Hand

Joined: Jul 10, 2001
Posts: 234
Post your ejb-jar.xml and any other deployment files.
I agree. Here's the link:
subject: I need some help here............Please
It's not a secret anymore!