• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

JNDI and PortableRemoteObject Problems

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic