aspose file tools
The moose likes EJB and other Java EE Technologies and the fly likes JNDI and PortableRemoteObject Problems Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Reply Bookmark "JNDI and PortableRemoteObject Problems" Watch "JNDI and PortableRemoteObject Problems" New topic
Author

JNDI and PortableRemoteObject Problems

Stefan Gesigora
Greenhorn

Joined: Jan 19, 2004
Posts: 1
Hi folks!
I've got some problems with jndi and the PortableRemoteObject Class.
I have two different deployed enterprise applications on an AppServer. Application 1 is the main application, application 2 is the application that should test the business logic of application 1 with JUnitEE. For this I have built an ejb.jar of the ejb directory of app 1 and included it under WEB-INF/lib/ into the web-module of app 2. Under WEB-INF/classes/ in app 2 there are my test classes...
So, when I try to get the HomeInterface of my Class via the PortableRemoteObject Class, I always get an ClassCastException. If I do this in my app1 there is no problem to get the HomeInterface.

--snip--
...
import App1Class1Home ;
import App1Class1;
Context context = new InitialContext();
Object ref = context.lookup("ejb/App1Class1");
App1Class1Home home = (App1Class1Home)PortableRemoteObject.narrow(ref, App1Class1Home.class);
--> ClassCastException
this.app1Class1 = home.create();
...
--snip--
Any suggestion?
Thanks a lot
Steven
 
I agree. Here's the link: http://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: JNDI and PortableRemoteObject Problems
 
Similar Threads
linking webapp with ejb in ear
ClassCastException when casting to home interface
New to EJB, advice please
Setting up a new JSF web app for an existing J2EE app
Two Web App communicating problem