• Post Reply Bookmark Topic Watch Topic
  • New Topic

Tomcat 4.1 + JBoss 3.0.7+ EJB not found

 
Sanjay Deshpande
Ranch Hand
Posts: 111
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am having Tomcat 4.1 and JBoss 3.0.7 (saperate editions)
I have integrated the TomCat/JBoss as per following link.
http://www.purposesolutions.com/Resources/EclipseJ2EE.html#TOMCAT_JBOSS_INTEGRATION
I have my EJb deployed in JBoss and i am calling the EJB from jsp.
Problem :the jsp is not able to find ejb and gives a compile time error.
jsp , with all other imports, is like this :
<%!MyTestSessionHome testSessionBean; %>
<%
try {
InitialContext ctx = new InitialContext();
Object objref = ctx.lookup("com.sanjay.ejb.MyTestSessionBean");
testSessionBean = (MyTestSessionHome)PortableRemoteObject.narrow(objref, MyTestSessionHome.class);
} catch (Exception NamingException) {
NamingException.printStackTrace();
}
%>
I want to know the following:
1. why ejb is not identified by jsp?
2.If jboss+tomcat integration is correct?
Any other solution for above 2
 
Parul Patidar
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
try following. I htink it may help
Properties p = new Properties();
p.put("java.naming.factory.initial", "org.jnp.interfaces.NamingContextFactory");
p.put("java.naming.factory.url.pkgs","org.jboss.naming rg.jnp.interfaces");
p.put("java.naming.provider.url","YOURHOSTNAME");
Context ctx = new InitialContext(p);
ctx.lookup("Whatever is in <ejb-name> tag")

Originally posted by Sanjay Deshpande:
I am having Tomcat 4.1 and JBoss 3.0.7 (saperate editions)
I have integrated the TomCat/JBoss as per following link.
http://www.purposesolutions.com/Resources/EclipseJ2EE.html#TOMCAT_JBOSS_INTEGRATION
I have my EJb deployed in JBoss and i am calling the EJB from jsp.
Problem :the jsp is not able to find ejb and gives a compile time error.
jsp , with all other imports, is like this :
<%!MyTestSessionHome testSessionBean; %>
<%
try {
InitialContext ctx = new InitialContext();
Object objref = ctx.lookup("com.sanjay.ejb.MyTestSessionBean");
testSessionBean = (MyTestSessionHome)PortableRemoteObject.narrow(objref, MyTestSessionHome.class);
} catch (Exception NamingException) {
NamingException.printStackTrace();
}
%>
I want to know the following:
1. why ejb is not identified by jsp?
2.If jboss+tomcat integration is correct?
Any other solution for above 2
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!