This content has been marked as final.
Show 4 replies
-
1. Re: Docs\examples\ejb\simplemessage
andrejt Jan 9, 2005 5:30 PM (in response to andrejt)Here are also my configuration files:
CLIENT:
jboss-client.xml:<jboss-client> <jndi-name>SimpleMessageClient</jndi-name> <resource-ref> <res-ref-name>jms/QueueConnectionFactory</res-ref-name> <jndi-name>XAConnectionFactory</jndi-name> </resource-ref> <resource-env-ref> <resource-env-ref-name>jms/QueueName</resource-env-ref-name> <jndi-name>queue/avrisQueue</jndi-name> </resource-env-ref> </jboss-client>
application-client.xml:<display-name>MyAppClient</display-name> <resource-ref> <res-ref-name>jms/QueueConnectionFactory</res-ref-name> <res-type>javax.jms.ConnectionFactory</res-type> <res-auth>Container</res-auth> <res-sharing-scope>Shareable</res-sharing-scope> </resource-ref> <resource-env-ref> <resource-env-ref-name>jms/QueueName</resource-env-ref-name> <resource-env-ref-type>javax.jms.Queue</resource-env-ref-type> </resource-env-ref>
MDB:
jboss.xml:<jboss> <enterprise-beans> <message-driven> <ejb-name>SimpleMessageEJB</ejb-name> <destination-jndi-name>queue/avrisQueue</destination-jndi-name> </message-driven> </enterprise-beans> </jboss>
ejb-jar.xml:<ejb-jar> <display-name>SimpleMessageJAR</display-name> <enterprise-beans> <message-driven> <display-name>SimpleMessageEJB</display-name> <ejb-name>SimpleMessageEJB</ejb-name> <ejb-class>si.avris.centrala.MessageBean</ejb-class> <transaction-type>Container</transaction-type> <message-driven-destination> <destination-type>javax.jms.Queue</destination-type> </message-driven-destination> </message-driven> </enterprise-beans> </ejb-jar>
-
2. Re: Docs\examples\ejb\simplemessage
genman Jan 11, 2005 3:01 AM (in response to andrejt)What is your JNDI conf. on your client?
-
3. Re: Docs\examples\ejb\simplemessage
andrejt Jan 11, 2005 3:28 AM (in response to andrejt)Here is my jndi.properties:
java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
java.naming.provider.url=jnp://localhost:1099
java.naming.factory.url.pkgs=org.jboss.naming.client
j2ee.clientName=si.avris.prevoznik.SimpleMessageClient
But in the mean time I have the solution. Look to the previous client code:connectionFactory = (ConnectionFactory) jndiContext.lookup("jms/QueueConnectionFactory"); destination = (Queue) jndiContext.lookup("avrisQueue");
The working version has queue/avrisQueue instead of avrisQueue:connectionFactory = (ConnectionFactory) jndiContext.lookup("jms/QueueConnectionFactory"); destination = (Queue) jndiContext.lookup("queue/avrisQueue");
And now it works. I think my example (client running outside JBoss and MDB running within JBoss) is more common for real situations where one programmer works on client code while another one works on the EJB code.
I have one more question.
I have seen examples where people use jndi properties in different ways.
My setting is the default one (from Getting started example):java.naming.provider.url=jnp://localhost:1099
Where on the JBoss is the port 1099 specified? -
4. Re: Docs\examples\ejb\simplemessage
zarniwoop Jan 11, 2005 12:44 PM (in response to andrejt)Hi there,
the JNDI Port (default 1099) is specified in your servers conf directory
in the file jboss-service.xml.
I had to change that due to conflicts with my virus protection software.
Rgds
Jens