I have local tessted SessionBean ( the same is tof LocalEntityBean).
In jboss.xml I have settings for set localEJB to the global INDI Namespace
<enterprise-beans>
<ejb-name>Counter</ejb-name>
<local-jndi-name>Counter</local-jndi-name>
</enterprise-beans>
on jmx-console pages I can check that JNDI name is coorect.
+- UserTransaction (class: org.jboss.tm.usertx.client.ClientUserTransaction)
+- Counter (proxy: $Proxy49 implements interface session1.CountLocalHome)
+- invokers (class: org.jnp.interfaces.NamingContext)
I have tested class in web to communicate with local EJB.
.....
Hashtable env = new Hashtable();
env.put(Context.INITIAL_CONTEXT_FACTORY,
"org.jnp.interfaces.NamingContextFactory");
env.put(Context.PROVIDER_URL, "localhost:1099");
env.put("java.naming.factory.url.pkgs",
"org.jboss.naming:org.jnp.interfaces");
String message="get message";
int i=1;
Context ctx = new InitialContext(env);
Object obj=ctx.lookup("Counter");
CountLocalHome home=(CountLocalHome)obj;
.....
That code is correct in JBoss-3.2.5, but
in JBoss-4.0.0 it is not correct
I have Exception
21:34:07,523 INFO [STDOUT] java.lang.ClassCastException
21:34:07,523 INFO [STDOUT] at test.Session1.getSession1(Unknown Source)
21:34:07,523 INFO [STDOUT] at org.apache.jsp.test_jsp._jspService(test_jsp.java:74)
What is wrong?
I can send tested ear package and sources.
riwat
riwat@albatros.gliwice.pl