Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Problem running enity bean from one Jsp over Tomcat 4.1.18 with JBoss 3.0.4  RSS feed

Javier Huerta
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!