I'm working on expanding Christophe Coenraets' JMS chat example on the
Testdrive Server for Tomcat... the one located in
\fds-tomcat\webapps\ROOT\jms.  

The example works fine.  Both the Flex chat client and the
javachat.bat script in \fds-tomcat\bin work fine.  

I'm trying to edit the java source of the swing-based Chat.java
implementation located at 
\fds-tomcat\webapps\ROOT\WEB-INF\src\flex\samples\jms\Chat.java

First of all, I copied the Chat.java into my own workspace and tried
to compile it and run it.  With the fds-tomcat server runing, this
should be the equivalent as running the javachat script in the
\fds-tomcat\bin directory right?  Instead, I get the following error:

javax.naming.NameNotFoundException: JmsConnectionFactory
        at
org.apache.activemq.jndi.ReadOnlyContext.lookup(ReadOnlyContext.java:215)
        at javax.naming.InitialContext.lookup(Unknown Source)
        at Chat.<init>(Chat.java:41)
        at Chat.main(Chat.java:26)

Upon closer inspection of the javachat.bat script, I see the following:

@echo off
SET WEBINF=..\webapps\ROOT\WEB-INF
java -classpath
%WEBINF%\lib\flex-messaging.jar;%WEBINF%\lib\geronimo-jms_1.1_spec-1.0.jar;%WEBINF%\lib\activemq-core-4.1.0-incubator.jar;%WEBINF%\lib\backport-util-concurrent.jar;%WEBINF%\lib\commons-logging.jar;%WEBINF%\lib\geronimo-j2ee-management_1.0_spec-1.0.jar;%WEBINF%\classes
flex.samples.jms.Chat

Which is fine since I imported the same jar files into the java build
path in my eclipse sandbox version.  Why does the supplied chat.java
work while my local sandbox copy fails to locate the connection factory?



Reply via email to