Here follows a part of the code I used from a class running under
Tomcat(running as a separate bundle) to retrieve a reference to a session
bean deployed under Jboss:
try {
InitialContext context;
//setJbossProperties returns a Properties object loaded with jndi.properties
(see at bottom its
Dear all ,
Hello ! I am a beginner of JBoss 3.0.7. I encounter a problem of JNDI in JSP . The file structure like follow :
E:\JBoss3T\test_EJB\com\sample\HelloWorld.class
E:\JBoss3T\test_EJB\com\sample\HelloWorldBean.class
E:\JBoss3T\test_EJB\com\sample\HelloWorldHome.class
And the ejb-jar.xml
You should change
your lookup from "java:comp/env/com/sample/HelloWorld" to
"java:/com/sample/HelloWorld". The "comp/env" scope is only used to lookup
bean specific environment attributes that are defined in ejb-jar.xml that is
deployed with the ejb.
Hope that
helps,
Dustin
A couple of considerations:
1) If your JSP is running from a context different
from Jboss, then you should create the InitialContext using the jndi.properties
file like:
InitialContext context = new InitialContext(properties);
2) The jndi name of your bean could be
probablylooked upas:
Dear all ,
Hello ! Thank you for all your help . I try to rewrite the JSP like follow :
%@ page session="false" isThreadSafe="true" isErrorPage="false" import="javax.naming.*,java.util.*, com.sample.*"%
% try { Properties properties = new