wood burning stoves 2.0*
The moose likes JBoss/WildFly and the fly likes Invoke Ejb from Tomcat 4.1.18 in JBoss 3.0.4 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Products » JBoss/WildFly
Bookmark "Invoke Ejb from Tomcat 4.1.18 in JBoss 3.0.4" Watch "Invoke Ejb from Tomcat 4.1.18 in JBoss 3.0.4" New topic

Invoke Ejb from Tomcat 4.1.18 in JBoss 3.0.4

Javier Huerta

Joined: Apr 29, 2003
Posts: 5
Hi i have the next problem.
i am programming an application for the Web,
i installed tomcat 4.1.18 and Jboss 3.0.4 separately.
i have the structure
i put my home and remote interfaces
i have the jar file necessary for the apllication (Postgres driver.)
i have my jsp's in /webapps/com/jsp
configured in web.xml

in my jsp i can't invoke the entity bean via jndi
with Jboss, i have all files necessarys from Jboss
client in tomcat/common/lib
and others.
i have the next code in my jsp.
NodosRemoteHome remoteHome = null;
NodosRemote peticion = null;
Object ref = null;
Context jndiContext = null;
String error = "";
Hashtable env = new Hashtable();
env.put("java.naming.factory.url.pkgs","org.jboss.naming rg.jnp.interfaces");
try {
jndiContext = new InitialContext(env);
error += " Got Context";
} catch (Exception e) {
error += "Not Got Context - " + e;
try {
ref = jndiContext.lookup("NodosBean");
error += " Got Reference() ref -> " + ref + ";
} catch (Exception e1) {
error += "Not Got Reference() " + e1;
try {
remoteHome = (NodosRemoteHome) PortableRemoteObject.narrow(
ref, NodosRemoteHome.class);
error += "Succesfull: " + remoteHome;
} catch (Exception e2) {
error += " i'cant invoke object - " + e2;
these are results
Got Context()
Got Reference()[ ref -> NodosBeanHome ]
i'cant invoke object java.lang.ClassCastException

please help me what's wrong.
and please guide me with all neccesary between Tomcat and Jboss communication
Andres Gonzalez
Ranch Hand

Joined: Nov 27, 2001
Posts: 1561
Originally posted by Javier Huerta:
Hi i have the next problem.
....i am programming an application for the Web,
i installed tomcat 4.1.18 and Jboss 3.0.4 separately.....

well.. this is not exactly an answer but a suggestion. Jboss comes bundle with tomcat or jetty, so you don't need them separarate as you mentioned. This approach might ease your development. I've worked with Jboss 3.0.4 bundled with tomcat with no problems. Put my EAR file (WAR files -if i have a web app- and JAR's) and deploy it into jboss.
my $0.02

I'm not going to be a Rock Star. I'm going to be a LEGEND! --Freddie Mercury
I agree. Here's the link: http://aspose.com/file-tools
subject: Invoke Ejb from Tomcat 4.1.18 in JBoss 3.0.4
Similar Threads
Problem running enity bean from one Jsp over Tomcat 4.1.18 with JBoss 3.0.4
How tp use SearchFilter with JNDI
jdeveloper look up error for jms
Problem running entity bean from Tomcat 4.1.18 with Jboss 3.0.4