• 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

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

 
Ranch Hand
Posts: 287
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
12:51 AM 1/7/2002
Dear All,
Hey,
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
http://127.0.0.1:9191/HelloWorldAppClient.jar
Remote message: Client code for the deployed application HelloWorldApp saved to
C:\bea\jfiles\HelloWorldAppClient.jar.
===========================
Here is the complete session after running the client:-
===========================
C:\bea\jfiles>runclient -client HelloWorldApp.ear -name HelloWorldClient
-textauth
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;
nested
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(Class.java:237)
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:136)
at org.omg.CORBA.portable.ObjectImpl._invoke(ObjectImpl.java:459)
at _HelloWorldHome_Stub.create(Unknown Source)
at HelloWorldClient.main(HelloWorldClient.java:18)
at java.lang.reflect.Method.invoke(Native Method)
at
com.sun.enterprise.util.Utility.invokeApplicationMain(Utility.java:24
3)
at com.sun.enterprise.appclient.Main.main(Main.java:159)
Unbinding name:`java:comp/env/SimpleHelloWorld`
C:\bea\jfiles>
===========================
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.
==========================
HelloWorld.java (The Remote Interface)
import javax.ejb.*;
import java.rmi.*;

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

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

==========================
HelloWorldBean.java (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()");
}
}

==========================
HelloWorldClient.java (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[])
{
try
{
Context initial = new InitialContext();
Object objref=initial.lookup("java:comp/env/SimpleHelloWorld");
HelloWorldHome home=(HelloWorldHome)PortableRemoteObject.narrow(objref,
HelloWorldHome.class);
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");
//sayHello.remove();
}
catch(Exception ex)
{
System.out.println("Caught an Exception: "+ex);
ex.printStackTrace();
}
}
}

==========================

Any help will be appreciated!!
Thanks & Bye,
Tualha Khan
 
Ranch Hand
Posts: 234
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Post your ejb-jar.xml and any other deployment files.
 
Well don't expect me to do the dishes! This ad has been cleaned for your convenience:
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