Expand my Community achievements bar.

FDS, Tomcat, JOTM and Beta3

Avatar

Level 1
I have a Flex app that uses JMS deployed on Tomcat.

This app worked under Beta2. I upgraded to Beta3, and
installed JOTM on Tomcat.

I can't figure out how to configure the app correctly. Based
on the log (debug level),

it doesn't even seem to be attempting to connect to my JMS.



Originally, I had the following in my
app/WEB-INF/flex/flex-message-service.xml:



<destination id="chat-topic-jms">

<properties>

<server>

<durable>false</durable>


<durable-store-manager>flex.messaging.durability.FileStoreManager</durable-store-manager>

</server>

<jms>

<destination-type>Topic</destination-type>


<message-type>javax.jms.TextMessage</message-type>


<connection-factory>MessagingTopic</connection-factory>


<destination-jndi-name>GlobalEvents</destination-jndi-name>

<durable-consumers>false</durable-consumers>

<delivery-mode>NON_PERSISTENT</delivery-mode>


<message-priority>DEFAULT_PRIORITY</message-priority>


<acknowledge-mode>AUTO_ACKNOWLEDGE</acknowledge-mode>

<transacted-sessions>false</transacted-sessions>

<initial-context-environment>

<property>

<name>java.naming.factory.initial</name>


<value>com.sonicsw.jndi.mfcontext.MFContextFactory</value>

</property>

<property>

<name>com.sonicsw.jndi.mfcontext.domain</name>

<value>Domain1</value>

</property>

<property>

<name>java.naming.provider.url</name>

<value>tcp://jmsserver:2506</value>

</property>

<property>

<name>java.naming.security.principle</name>

<value>jms_user</value>

</property>

<property>

<name>java.naming.security.credentials</name>

<value>jms_pass</value>

</property>

</initial-context-environment>

</jms>

</properties>

<channels>

<channel ref="my-rtmp"/>

</channels>

<adapter ref="jms"/>

</destination>



As near as I can figure, I need to modify
$TOMCAT_HOME/conf/Catalina/localhost/app.xml

to this:



<?xml version="1.0" encoding="utf-8" ?>

<Context displayName="Flex Enterprise Services"

path="/app"

docBase="<tomcathome>/webapps/app"

workDir="work/Catalina/localhost/app">

<!-- Description of the resource "UserTransaction" -->


<Resource name="UserTransaction"

auth="Container"

type="javax.transaction.UserTransaction" />

<ResourceParams name="UserTransaction">

<parameter>

<name>factory</name>


<value>org.objectweb.jotm.UserTransactionFactory</value>

</parameter>

<parameter>

<name>jotm.timeout</name>

<value>60</value>

</parameter>

</ResourceParams>

<Resource name="GlobalEvents"

auth="Container"

type="javax.jms.TextMessage"

factory="TopicConnectionFactory"

physicalName="chat-topic-jms" />

</Context>





As near as I can tell, the app isn't even trying to connect
to the JMS.

Can anyone provide a clue to what I've missed?



Thanks,

-kevin

3 Replies

Avatar

Level 2
In flex-enterprise-services.xml, enable logging and the debug
level and check your server console for errors.



Another thing that might be helpful is ensure that you can
reach the destinations via jndi.

You can do this by using a jsp page. If the page runs without
stack traces, then you know that your jndi and jms factory and
destination are configured correctly. Be sure to update
flex-message-service.xml with those jndi names.



jndiTest.jsp



<%@ page import="javax.naming.*,javax.util.*" %>



<%

Properties p = new Properties();

// as configured in your destination's
initial-context-environment in flex-message-service.xml


p.setProperty("java.naming.factory.initial","com.sonicsw.jndi.mfcontext.MFContextFactory");


p.setProperty("com.sonicsw.jndi.mfcontext.domain","Domain1");


p.setProperty("java.naming.provider.url","tcp://jmsserver:2506");

p.setProperty("java.naming.security.principle","jms_user");


p.setProperty("java.naming.security.credentials","jms_pass");



Context ctx = new InitialContext(p);

ctx.lookup("MessagingTopic"); // this maps to
connection-factory on the destination in flex-message-service.xml

ctx.lookup("GlobalEvents"); // this maps to
destination-jndi-name on the destination in
flex-message-service.xml

%>



/* If you get an exception running with the above try,
generally application servers make resource available to the
application at java:comp/env/<resource-name>. In the app.xml,
you've specified GlobalEvents as the resource name. I don't see
MessageTopic specified in app.xml, which may be an issue. Once you
have these lookup calls running, you should go back and update
flex-message-service.xml with these jndi names.



ctx.lookup("java:comp/env/GlobalEvents");

ctx.lookup("java:comp/env/MessageTopic");

*/

Avatar

Level 1
I had the logging set to "debug" and turned on, but saw
nothing.

Back in Beta2, I use to get a lot messages about trying to
connect to the JMS.



Well, the JSP worked fine (after I changed the "javax.util.*"
to "java.util.*).

So I assume my connection is good.



You mentioned putting MessageTopic in the app.xml, any hints
on how it should look?



Thanks,

-kevin

Avatar

Level 2
> You mentioned putting MessageTopic in the app.xml, any
hints on how it should look?

You'll need to reference the instructions for integrating
your JMS server with Tomcat. If the jsp page works, it's likely
that you topics and connection factories are set up correctly.



> I had the logging set to "debug" and turned on, but saw
nothing.

Back in Beta2, I use to get a lot messages about trying to
connect to the JMS.



You should be seeing the incoming rtmp messages logged to
your server console.

If you're not seeing any messages on the server console, then
something is wrong with your configuration.



Check that the destination name you're using in your mxml
application matches the destination defined in
flex-message-service.xml.