NAG Kum [
http://community.jboss.org/people/nk_2010] replied to the discussion
"Error working wih EJB3, Struts2 & JBoss 4.2GA"
To view the discussion, visit:
http://community.jboss.org/message/540010#540010
--------------------------------------------------------------
Hi Wolfgang,
*Client Code* :
ServiceLocator.getEJB :
public static Object getEJB(String jndiName) {
Object object = null;
Context ctx = null;
try {
ctx = new InitialContext();
object = ctx.lookup(jndiName);
} catch (Exception e) {
e.printStackTrace();
}
return object;
}
public static final String RemoteJNDIName = "AuthenticationBean/remote";
AuthenticationRemote authEjb =
(AuthenticationRemote)ServiceLocator.getEJB(AuthenticationBean.RemoteJNDIName);
System.out.println("EJB Look up successfull ");
*Jndi View* :
+- AuthenticationBean (class: org.jnp.interfaces.NamingContext) | +- remote (class:
org.jnp.interfaces.NamingContext) | | +- UserTransaction[link -> UserTransaction]
(class: javax.naming.LinkRef) | | +- metaData (class:
org.jboss.metadata.client.jboss.JBossClientMetaData) | | +- env (class:
org.jnp.interfaces.NamingContext) | | | +-
com.tarangtech.mtg.authentication.AuthenticationBean[link -> AuthenticationBean/remote]
(class: javax.naming.LinkRef) | | +- classPathEntries (class: java.util.ArrayList)
Pls find *jboss-client.xml*
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE jboss-client PUBLIC
"-//JBoss//DTD Application Client 5.0//EN"
"
http://www.jboss.org/j2ee/dtd/jboss-client_5_0.dtd
http://www.jboss.org/j2ee/dtd/jboss-client_5_0.dtd">
<jboss-client>
<jndi-name>AuthenticationBean/remote</jndi-name>
<ejb-ref>
<ejb-ref-name>com.tarangtech.mtg.authentication.AuthenticationBean</ejb-ref-name>
<jndi-name>AuthenticationBean/remote</jndi-name>
</ejb-ref>
</jboss-client>
Pls .. suggest me as it is urgent ......
Regds,
NK
--------------------------------------------------------------
Reply to this message by going to Community
[
http://community.jboss.org/message/540010#540010]
Start a new discussion in EJB 3.0 at Community
[
http://community.jboss.org/choose-container!input.jspa?contentType=1&...]