• 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

Tomcat 4.1 + JBoss 3.0.7+ EJB not found

 
Ranch Hand
Posts: 111
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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

 
I wasn't selected to go to mars. This tiny ad got in ahead of me:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic