aspose file tools*
The moose likes EJB and other Java EE Technologies and the fly likes NameNotFoundException in EJB? could anyone tell me?  Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "NameNotFoundException in EJB? could anyone tell me?  " Watch "NameNotFoundException in EJB? could anyone tell me?  " New topic
Author

NameNotFoundException in EJB? could anyone tell me?

frankie huang
Greenhorn

Joined: Dec 17, 2002
Posts: 18
I got a NameNotFoundException in my EJB's client. "javax.naming.NameNotFoundException: myes not bound" ( "myes" is the name of my war).
I depoly a .jar file(EJBs) and a .war file.
The .war contains:
[index.jsp]
-------------------------------------------------
try {
//Properties props = System.getProperties();
//Context ctx = new InitialContext(props);
Context ctx = new InitialContext();
HelloHome lHome = (HelloHome) ctx.lookup("java:comp/env/ejb/myestest/Hello");
Hello hello = lHome.create();
out.println("return:"+hello.hello());
}catch( Exception e ) {
out.println( "Caugth exception: " + e.getMessage() );
e.printStackTrace();
}
-------------------------------------------------
[WEB-INF/web.xml]
-------------------------------------------------
<ejb-ref>
<ejb-ref-name>ejb/myestest/Hello</ejb-ref-name>
<ejb-ref-type>Session</ejb-ref-type>
<home>com.funyear.myes.test.HelloHome</home>
<remote>com.funyear.myes.test.Hello</remote>
</ejb-ref>
-------------------------------------------------
[WEB-INF/jboss-web.xml]
-------------------------------------------------
<ejb-ref>
<ejb-ref-name>ejb/myestest/Hello</ejb-ref-name>
<jndi-name>ejb/myes/Hello</jndi-name>
</ejb-ref>
-------------------------------------------------
The .jar file contains:
[ejb-jar.xml]
-------------------------------------------------
<session >
<description><![CDATA[stateless session bean]]></description>
<ejb-name>com.funyear.myes.test.Hello</ejb-name>
<home>com.funyear.myes.test.HelloHome</home>
<remote>com.funyear.myes.test.Hello</remote>
<ejb-class>com.funyear.myes.test.HelloBean</ejb-class>
<session-type>Stateless</session-type>
<transaction-type>Container</transaction-type>
</session>
-------------------------------------------------
[jboss.xml]
-------------------------------------------------
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE jboss PUBLIC "-//JBoss//DTD JBOSS//EN" "http://www.jboss.org/j2ee/dtd/jboss.dtd">
<jboss>
<enterprise-beans>
<session>
<ejb-name>com.funyear.myes.test.Hello</ejb-name>
<jndi-name>com/funyear/myes/test/Hello</jndi-name>
</session>
</enterprise-beans>
<resource-managers>
</resource-managers>
</jboss>
-----------------------------------------------
and beans.
Is there anyone know why? could you tell me? thank you very much!
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: NameNotFoundException in EJB? could anyone tell me?