Hi Jeffrey,
I find this quite interesting to see that it is possible to define an
ActiveMQ queue and provider in WAS. It is also a bit complicated though.
So my question is why don´t you simply use an ActiveMQConnectionFactory
in spring and skip all the JNDI stuff. I have done some deployments in
an enterprise environment
and we most times did not use jndi. If you do this to separate the
config from the jar you can also do this using the spring property
placeholder configurer.
In the cases where we used jndi we simply pointed the Initialcontext to
ActiveMQ. There the ConnectionFactory and queues were already defined.
Still I think such an example could be intersting as some people want to
configure using jndi I just don´t understand the reason.
Btw. I can help you with the pom. I guess that you do not need a bundle
for osgi. So you could change the packaging to war and move the webapp
dir to src/main/webapp.
I have built you a small pom.xml that should do the trick. The pom you
have will not work as it is based on a parent pom.
You simply do mvn install and a war is created. You do mvn jetty:run to
run your project in a embedded jetty.
Your web.xml seems to contain a CXFServlet but you don´t use CXF so you
could throw that out. What you will need is a parameter for
contextloaderlistener to tell it where the spring context is.
I also would put the spring context in src/main/resources.
Christian
-----
<!-- location of spring xml files -->
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>classpath:/applicationContextTemplate.xml</param-value>
</context-param>
<!-- the listener that kick-starts Spring -->
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
-----
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.apache.camel</groupId>
<artifactId>camel-example-jms-file</artifactId>
<version>1.0.0</version>
<packaging>war</packaging>
<name>Camel :: Example :: JMS-File</name>
<description>An example that persists messages from JMS to
files</description>
<properties>
<activemq.version>5.4.2</activemq.version>
<cxf.version>2.3.2</cxf.version>
<camel.version>2.6.0</camel.version>
<jetty.version>7.2.2.v20101205</jetty.version>
</properties>
<dependencies>
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-core</artifactId>
<version>${camel.version}</version>
</dependency>
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-jms</artifactId>
<version>${camel.version}</version>
</dependency>
<dependency>
<groupId>org.apache.activemq</groupId>
<artifactId>activemq-core</artifactId>
<version>${activemq.version}</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<scope>test</scope>
<version>4.8.2</version>
</dependency>
</dependencies>
<build>
<resources>
<resource>
<directory>src/main/resources</directory>
<filtering>true</filtering>
</resource>
</resources>
<plugins>
<plugin>
<groupId>org.mortbay.jetty</groupId>
<artifactId>jetty-maven-plugin</artifactId>
<version>${jetty.version}</version>
<configuration>
<connectors>
<connector
implementation="org.eclipse.jetty.server.nio.SelectChannelConnector">
<port>8080</port>
<maxIdleTime>60000</maxIdleTime>
</connector>
</connectors>
</configuration>
</plugin>
</plugins>
</build>
</project>
-----
Am 11.02.2011 00:01, schrieb Jeffrey Knight:
You should upload it somewhere and then send the link with a request for feed
back to the list. Perhaps one of the free file hosters will do.
Please give me feedback on this work-in-progress JNDI example. I think
this example would be useful for those integrating with WebSphere /
JNDI:
http://dl.dropbox.com/u/19646117/camel-example-jms-jndi.zip
--
----
http://www.liquid-reality.de