• Post Reply Bookmark Topic Watch Topic
  • New Topic

Make SERVLET talk to EJB

 
Sanya, Kapoor
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi!
I have started working on an application where my SERVLET retrieves parameters from an html page, transfers them to the ejb container, then it receives results from the Session Bean through the container, and Publishes back the result as an html file, to the end user.
Now the problem is, while I write the source code for the Servlet i.e the .java file, I need to import javax.rmi.PortableRemoteObject, so as to create an instance of the home interface of the Session Bean. I get the error: "Class javax.rmi.PortableRemoteObject not found in import." though all other javax imports work.
And thus I am not able to compile the servlet. Though I am able to compile the home interface, remote interface, the session bean.
I am working with:
1. Weblogic Server 4.5.1
2. Jakarta-Tomcat-3.2.1
3. jdk1.2.2
4. Windows 98 - Operating System
My all class paths and paths are well set, Since everything else compiles except for:
import javax.rmi.PortableRemoteObject;
or rather javax.rmi package
It could be that Weblogic Server 4.5.1 does not contain the above package. If that is the case, then I would like to know, in what other way I can solve this problem of mine? I do not wish to change my application server or the operating system.
Please, if anybody can advice me on this.
Sanya
 
Peter den Haan
author
Ranch Hand
Posts: 3252
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If (this version of) Weblogic does not use RMI/IIOP, an ordinary cast instead of PortableRemoteObject.narrow() should do - but that would make your application non-portable to application servers which do use RMI/IIOP.
I'm not entirely sure if this is the right way to go about it, but you could either download the JDK 1.2 RMI/IIOP add-on or, if upgrading your JDK is an option, download JDK 1.3 which ships with RMI/IIOP.
If the server does use RMI/IIOP, then there must be a jar somewere with the javax.rmi.* classes in.
- Peter
 
Sanya, Kapoor
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I got that. I infact downloaded j2sdkee1.2.1 and added j2ee.jar in my classpath. Thanks Peter, anyway, for your help.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!