-
1. Re: JBOSS 6.0.0.CR1 JMS ConnectionFactory lookup with JNDI
jithu.mada Dec 6, 2010 11:29 AM (in response to paulh9)Maybe you can try implementing JNDI event listeners.
-
2. Re: JBOSS 6.0.0.CR1 JMS ConnectionFactory lookup with JNDI
paulh9 Dec 6, 2010 1:52 PM (in response to jithu.mada)Well, I guess I could do that. But my application is started when it is deployed, the JMS service needs to be available when my application is deployed. So what I'm really looking for is an answer why JMS ConnectionFactories are not available through JNDI when my application is deployed at JBOSS server startup time. These services should be already initialized but it seems that something is not quite right. I'm new to JBOSS, but it seems to me that there is something wrong.
-
3. Re: JBOSS 6.0.0.CR1 JMS ConnectionFactory lookup with JNDI
shelly.mcgowan Dec 6, 2010 2:08 PM (in response to paulh9)Can you enable DEBUG logging when booting AS server (passing -Djboss.boot.server.log.level=DEBUG)? Provide relevant info here.
-
4. Re: JBOSS 6.0.0.CR1 JMS ConnectionFactory lookup with JNDI
paulh9 Dec 6, 2010 3:00 PM (in response to shelly.mcgowan)Okay, I enabled DEBUG logging and I see that hornetQ is deploying the ConnectionFactories, queues and topics at the very end of the boot sequence. This is well after my beans are deployed. ....
14:11:20,128 DEBUG [MCJavaEEApplication] Installed context org.jnp.interfaces.NamingContext@1bd9c75 for JavaEE application disc_oid.proper
14:11:20,128 DEBUG [MCJavaEEApplication] Installed context org.jnp.interfaces.NamingContext@1fdc01b for JavaEE application hornetq-configuration
14:11:20,143 DEBUG [HornetQQueueDeployment] Deploying Queue DLQ
14:11:20,159 DEBUG [HornetQConnectionFactoryDeployment] Deploying ConnectionFactory NettyConnectionFactory
14:11:20,175 DEBUG [MCJavaEEApplication] Installed context org.jnp.interfaces.NamingContext@102ae46 for JavaEE application hornetq-jms
14:11:20,175 DEBUG [HornetQTopicDeployment] Deploying Topic rmaAlarmsTopic
14:11:20,190 DEBUG [HornetQConnectionFactoryDeployment] Deploying ConnectionFactory NettyThroughputConnectionFactory
14:11:20,190 DEBUG [HornetQConnectionFactoryDeployment] Deploying ConnectionFactory InVMConnectionFactory
14:11:20,190 DEBUG [HornetQQueueDeployment] Deploying Queue ExpiryQueue
14:11:20,206 INFO [service] Removing bootstrap log handlersIs this intentionally done with way? Is there a way I can have my bean depend on this deployment?
thanks,
Paul
-
5. Re: JBOSS 6.0.0.CR1 JMS ConnectionFactory lookup with JNDI
shelly.mcgowan Dec 6, 2010 7:11 PM (in response to paulh9)To rule out configuration issues, refer to the HornetQ documentation available from the JBoss AS Docmentation Page.
-
6. Re: JBOSS 6.0.0.CR1 JMS ConnectionFactory lookup with JNDI
paulh9 Dec 7, 2010 10:43 AM (in response to shelly.mcgowan)Thanks Shelly,
I think the configuration is okay. I run JBOSS 6 without any of my applications deployed and it still deploys the HornetQ JMS ConnectionFactories last. I'd like to know if there is a way to make a dependency on these conections so my application wouldn't be deployed until the services are ready to go. I'm in the process of migrating from JBOSS 4 to 6 and I'm using JMX Beans xml to do dependencys (see below). But I don't know how to configure a dependency for JNDI JMS resources.
<depends>jboss.jca:service=DataSourceBinding,name=PostgresDS</depends>
<depends>jboss.jca:service=ConnectionFactoryBinding,name=JmsXA</depends>thanks,
Paul
-
7. Re: JBOSS 6.0.0.CR1 JMS ConnectionFactory lookup with JNDI
smarlow Dec 8, 2010 11:49 AM (in response to paulh9)As a test, try to start the server without your application in the deploy folder. Then copy your application into deploy and see if you get better results.
-
8. Re: JBOSS 6.0.0.CR1 JMS ConnectionFactory lookup with JNDI
paulh9 Dec 8, 2010 1:43 PM (in response to smarlow)Yes, I've done that and my application is able to lookup the JMS objects. The problem is really timing. I really need to deploy my application when JBOSS starts.
Paul
-
9. Re: JBOSS 6.0.0.CR1 JMS ConnectionFactory lookup with JNDI
jaikiran Dec 9, 2010 2:55 AM (in response to paulh9)Try adding a <depends> on either of the following connection factory MBeans:
<depends>org.hornetq:module=JMS,name="InVMConnectionFactory",type=ConnectionFactory</depends>
<depends>org.hornetq:module=JMS,name="NettyConnectionFactory",type=ConnectionFactory</depends>
<depends>org.hornetq:module=JMS,name="NettyThroughputConnectionFactory",type=ConnectionFactory</depends>
-
10. Re: JBOSS 6.0.0.CR1 JMS ConnectionFactory lookup with JNDI
paulh9 Dec 9, 2010 9:48 AM (in response to jaikiran)Hi Jaikiran,
I tried your suggestion using the <depends> in my mbean _service.xml. However I get the following error(s)
Deployment "org.hornetq:module=JMS,name=NettyThroughputConnectionFactory,type=ConnectionFactory" is in error due to the following reason(s): ** NOT FOUND Depends on 'org.hornetq:module=JMS,name=NettyThroughputConnectionFactory,type=ConnectionFactory' **
Deployment "org.hornetq:module=JMS,name=NettyConnectionFactory,type=ConnectionFactory" is in error due to the following reason(s): ** NOT FOUND Depends on 'org.hornetq:module=JMS,name=NettyConnectionFactory,type=ConnectionFactory' **
Deployment "org.hornetq:module=JMS,name=InVMConnectionFactory,type=ConnectionFactory" is in error due to the following reason(s): ** NOT FOUND Depends on 'org.hornetq:module=JMS,name=InVMConnectionFactory,type=ConnectionFactory' **-Paul
-
11. Re: JBOSS 6.0.0.CR1 JMS ConnectionFactory lookup with JNDI
jaikiran Dec 9, 2010 10:21 AM (in response to paulh9)That's strange, because I see those MBeans in the jmx-console. Have you changed anything in the server installation or is this a clean install? What does the JBOSS_HOME/server/<servername>/deploy/hornetq/hornetq-jms.xml look like? And do you see those MBeans in your jmx-console?
-
12. Re: JBOSS 6.0.0.CR1 JMS ConnectionFactory lookup with JNDI
paulh9 Dec 9, 2010 10:30 AM (in response to jaikiran)Yes it is strange. I also see those MBeans in the jmx-console. I haven't modifed the hornetq-jms.xml. I'm wondering if it has to so with my mbean definition. Here's it is...
<?xml version="1.0" encoding="UTF-8"?>
<server>
<classpath codebase="./deploy/harris-rma/" archives="BeOnNetMan.jar" />
<classpath codebase="./deploy/harris-rma/"/>
<mbean code="com.harris.rf.beon.alarms.eventlog.EventLogManager"
name="BeOnNetworkManager:service=BeOnEventLog"
xmbean-dd="">
<xmbean>
<attribute access="read-only" getMethod="getEventCount">
<name>Total Logged Events</name>
<type>int</type>
</attribute>
<operation>
<description>Get Most Recent Events</description>
<name>getMostRecentEvents</name>
<parameter>
<description>count to retrieve</description>
<name>count</name>
<type>int</type>
</parameter>
<return-type>java.lang.String</return-type>
</operation>
<operation>
<description>Standard MBean lifecycle method</description>
<name>create</name>
</operation>
<operation>
<description>The start lifecycle operation</description>
<name>start</name>
</operation>
<operation>
<description>The stop lifecycle operation</description>
<name>stop</name>
</operation>
<operation>
<description>The destroy lifecycle operation</description>
<name>destroy</name>
</operation>
</xmbean><!-- depends>org.hornetq:module=JMS,name=InVMConnectionFactory,type=ConnectionFactory</depends -->
<depends>org.hornetq:module=JMS,name=NettyConnectionFactory,type=ConnectionFactory</depends>
<!-- depends>org.hornetq:module=JMS,name=NettyThroughputConnectionFactory,type=ConnectionFactory</depends -->
<depends>jboss.jca:service=DataSourceBinding,name=PostgresDS</depends>
<depends>jboss.jca:service=ConnectionFactoryBinding,name=JmsXA</depends>
</mbean>
</server> -
13. Re: JBOSS 6.0.0.CR1 JMS ConnectionFactory lookup with JNDI
jaikiran Dec 16, 2010 6:20 AM (in response to paulh9)Just found out what the problem was. I had a typo in that post where I showed you the dependencies. The correct dependencies are:
<depends>org.hornetq:module=JMS,name="NettyConnectionFactory",type=ConnectionFactory</depends>
<depends>org.hornetq:module=JMS,name="InVMConnectionFactory",type=ConnectionFactory</depends>
<depends>org.hornetq:module=JMS,name="NettyThroughputConnectionFactory",type=ConnectionFactory</depends>
Note the use of double quotes in that name. Give it a try and see if that works.
[Edit: Crazy horrible editor. Turns out I had posted the correct MBean names, but the double quotes get eaten up by the forum editor if I wrap that text in a XML syntax highlighting block. Removed the syntax highlighting to fix the rendering.]
-
14. Re: JBOSS 6.0.0.CR1 JMS ConnectionFactory lookup with JNDI
paulh9 Dec 16, 2010 10:03 AM (in response to jaikiran)Thanks Jaikiran.
This solved the problem!
Paul