Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Calling Entity Bean from Tomcat Servlet  RSS feed

 
John Fairbairn
Ranch Hand
Posts: 55
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am having trouble calling my entity bean residing on a JBoss app server (2.4.4) on the same machine from a servlet in Tomcat. It is failing on the JNDI lookup.
I call the entity bean in my code like:

I get the error:

Thanks,
John
 
John Fairbairn
Ranch Hand
Posts: 55
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Still having a problem...
I took out the Properties object I was using to create an InitialContext. I created an ejb-ref in the web.xml to tell my servlet about the entity bean:

This is how I am now referencing the bean in my code:

I am now getting the error:

I do not get any error, if my client is a standalone application which calls the entity bean. In this case though, I have a jndi.properties file in the classpath with the following entries:
java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
java.naming.provider.url=localhost:1100
java.naming.factory.url.pkgs=org.jboss.naming
I think I should be using these entries somewhere within Tomcat to get my InitialContext - not sure where.
Any help is appreciated.
 
Tim Holloway
Bartender
Posts: 18705
71
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Your problem is really related more to JBoss than Tomcat. Try asking over in the JBoss Forum.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!