• Post Reply Bookmark Topic Watch Topic
  • New Topic

Problem with Context; Can't access ejb3 component  RSS feed

 
Teena Mariam
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Hi,
I apologize if this is posted before in the web, but i can't find a solution from anywhere.
I created a simple ejb3 component and tried to access it from a jsp page. If i add the 3 jndi properties(java.naming.factory.initial, java.naming.factory.url.pkgs, java.naming.provider.url) to a hash table and use this to initialize my context, the page doesn't throw any exceptions. But it hangs. If i try to use the default initial context, it give me error that 'bean is not bound'. I have taken the full source code from the web site Rima Sriganesh .
I took the code, unzipped it, created a simple ejb project and added the bean and business interface to the project. I copied the ejb-jar.xml file to META-INF directory and deployed the ejb to JBoss AS 4.2.2. It is deployed without any error. Then i created a dynamic web project and created a simple jsp page. I included the ejb project in the class path of the web project.
I don't know what is going wrong over here. Any help will be highly appreciated.

Note : i didn't use the ant build provided with the example. I could create same bean in ejb2.1 and i got the output also.
Thanks in advance,
Teena
 
Teena Mariam
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

This is solved. I made a mistake in the JNDI name. The look up name should be "ejbname/local" when:
1.using JBoss AS4.2
2.accessing from a JSP,
3.you are using your local interface.
For ex:

The look up name is different for Glassfish.(Idont remember it). We can find the ejbname from the jmx-console . For me, when i use JBoss AS4.2, the jar was under "jboss.j2ee". It shows the jars deployed. Use the name of the required ejb jar while you do a lookup.
Please correct me if i provided anything wrong.

HTH,
Teena
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!