[EJB 3.0] - Re: Remote Client to EJB 3.0 fail .. :( javax.naming.Communi
by J0Ke
hm .
org.jboss.annotation.ejb.RemoteBinding(jndiBinding="SimpleEJB")
in which jar is located this ? i cant find it on client/*.jars
btw i Try SimpleEJB/remote it says remote not bound.
i try somethink different i write this code :
and the output is:
XAConnectionFactory: org.jboss.mq.SpyXAConnectionFactory
TopicConnectionFactory: org.jboss.naming.LinkRefPair
EventDispatcher: org.jboss.ws.eventing.mgmt.DispatcherDelegate
UserTransactionSessionFactory: $Proxy42
UIL2ConnectionFactory: javax.naming.LinkRef
UIL2XAConnectionFactory: javax.naming.LinkRef
QueueConnectionFactory: org.jboss.naming.LinkRefPair
topic: org.jnp.interfaces.NamingContext
queue: org.jnp.interfaces.NamingContext
SimpleEJBBean: org.jnp.interfaces.NamingContext
ConnectionFactory: org.jboss.mq.SpyConnectionFactory
UserTransaction: org.jboss.tm.usertx.client.ClientUserTransaction
jmx: org.jnp.interfaces.NamingContext
UILXAConnectionFactory: javax.naming.LinkRef
UILConnectionFactory: javax.naming.LinkRef
so the EJB is deloyed.
then i try this client:
InitialContext ctx;
try {
ctx = new InitialContext();
ctx.addToEnvironment("java.naming.factory.initial",
"org.jnp.interfaces.NamingContextFactory");
ctx.addToEnvironment("java.naming.factory.url.pkgs",
"org.jboss.naming:org.jnp.interfaces");
ctx.addToEnvironment(Context.PROVIDER_URL, "jnp://localhost:1099");
SimpleEJB ejb=
(SimpleEJB)ctx.lookup("SimpleEJBBean"); // i try SimpleEJBBean becouse there is SimpleEJBBean in the list
System.out.println(simpleSession.sayHello("EJB3"));
} catch (NamingException e) {
e.printStackTrace();
}
but now my client says :
Exception in thread main
java.lang.ClassCastException: org.jnp.interfaces.NamingContext
at client.SimpleEJBClient.main(SimpleEJBClient.java:39)
Process exited with exit code 1.
line 39 is
SimpleSession simpleSession =
(SimpleSession)ctx.lookup("SimpleSessionBean");
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3957116#3957116
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3957116
19 years, 9 months
[JBoss Seam] - Re: registration-sample ear does not work when renamed
by javidjamae
The current SEAM documentation shows the contents of the components.xml file as follows:
<components>
|
| <component name="org.jboss.seam.core.init">
| <!-- JNDI name pattern for JBoss EJB 3.0 -->
| <property name="jndiPattern">#{ejbName}/local</property>
| </component>
|
| </components>
But using this code doesn't seem to work. The example code that ships with the distribution uses the following for components.xml:
<components>
|
| <component name="org.jboss.seam.core.init">
| <property name="myFacesLifecycleBug">true</property>
| <property name="jndiPattern">jboss-seam-registration/#{ejbName}/local</property>
| </component>
|
| <component class="org.jboss.seam.core.Ejb"
| installed="false"/>
|
| </components>
|
|
In this case, they are prefixing the jndiPattern with "jboss-seam-registration" which is the name of the archive file. This version works.
But, is this necessary? Isn't there a way to reference the EJB without having to provide the name of the archive/application context? This prevents you from being able to rename the EJB jar file without remembering to update a framework-specific properties file. Can't you reference a bean using the ENC?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3957111#3957111
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3957111
19 years, 9 months