You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by farhad <me...@farhad.eu> on 2011/12/06 16:46:10 UTC
Using Amon with maven-activemq-plugin
Hi,
Has Anybody successfully tried to use amon tool/framework with the maven
activemq plugin? My specific problem is to make sure that the following
artifacts are in the classpath of the plugin. Adding the "<dependency>"
clauses to the plugin def. is apparently not enough.
- I have no problem using amon with standalone activemq, using the depicted
activemq.xml below
- The amon license file is put in the src/main/resource dir. I'm not sure if
it is enough.
When running "mvn clean install", I get the following error:
----
Embedded error: Unexpected exception parsing XML document from URL
[file:/home/fade/projects/misc/activemq/amon/src/main/resources/META-INF/activemq.xml];
nested exception is java.lang.NoClassDefFoundError:
org/apache/camel/component/event/EventEndpoint
....
....
---
Below is my plugin definition together with the activemq.xml file:
I'd appreciate any help.
-Farhad D.
=========== Plugin def. ==================
<plugin>
<groupId>org.apache.activemq.tooling</groupId>
<artifactId>maven-activemq-plugin</artifactId>
<configuration>
<configUri>xbean:file://${project.basedir}/src/main/resources/META-INF/activemq.xml</configUri>
<fork>${activemq.plugin.fork}</fork>
<systemProperties>
<property>
<name>javax.net.ssl.keyStorePassword</name>
<value>activemq</value>
</property>
<property>
<name>org.apache.activemq.default.directory.prefix</name>
<value>./target/</value>
</property>
<property>
<name>log4j.configuration</name>
<value>file://${project.basedir}/src/main/resources/log4j.properties</value>
</property>
</systemProperties>
</configuration>
<dependencies>
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-core</artifactId>
<version>${camel.version}</version>
</dependency>
<dependency>
<groupId>com.ttm.activemq</groupId>
<artifactId>amon</artifactId>
<version>${amon.version}</version>
</dependency>
<dependency>
<groupId>de.odysseus.juel</groupId>
<artifactId>juel</artifactId>
<version>2.1.0</version>
</dependency>
<dependency>
<groupId>jdmk</groupId>
<artifactId>jdmkrt</artifactId>
<version>5.1.3</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>${slf4j.version}</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
<version>${slf4j.version}</version>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-daemon</artifactId>
<version>1.0.3</version>
</dependency>
<dependency>
<groupId>org.apache.activemq</groupId>
<artifactId>activemq-console</artifactId>
<version>5.5.0</version>
<exclusions>
<exclusion>
<groupId>commons-daemon</groupId>
<artifactId>commons-daemon</artifactId>
</exclusion>
</exclusions>
</dependency>
</dependencies>
<executions>
<execution>
<id>start-activemq</id>
<phase>process-test-classes</phase>
<goals>
<goal>run</goal>
</goals>
</execution>
</executions>
</plugin>
=======================================
=========== activemq.xml ==================
<?xml version="1.0"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:amq="http://activemq.apache.org/schema/core"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:camel="http://camel.apache.org/schema/spring"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
http://activemq.apache.org/schema/core
http://activemq.apache.org/schema/core/activemq-core.xsd
http://camel.apache.org/schema/spring
http://camel.apache.org/schema/spring/camel-spring.xsd
">
<broker xmlns="http://activemq.apache.org/schema/core"
brokerName="localhost" useJmx="true" useShutdownHook="false"
dataDirectory="./target/activemq-data" persistent="false"
schedulerSupport="true">
<destinationPolicy>
<policyMap>
<policyEntries>
<policyEntry queue=">">
<deadLetterStrategy>
<individualDeadLetterStrategy
queuePrefix="DLQ."
useQueueForQueueMessages="true"
processExpired="false"
processNonPersistent="false"/>
</deadLetterStrategy>
</policyEntry>
</policyEntries>
</policyMap>
</destinationPolicy>
<managementContext>
<managementContext connectorPort="11099" rmiServerPort="11098" />
</managementContext>
<plugins>
<bean id="monitor" class="com.ttm.activemq.monitor.MonitorPlugin"
xmlns="http://www.springframework.org/schema/beans"/>
</plugins>
<transportConnectors>
<transportConnector name="openwire" uri="tcp://localhost:61616"/>
</transportConnectors>
</broker>
<camelContext id="AmonCamel"
xmlns="http://camel.apache.org/schema/spring">
<package>myown.activemq.monlets</package>
</camelContext>
</beans>
==========================================
--
View this message in context: http://activemq.2283324.n4.nabble.com/Using-Amon-with-maven-activemq-plugin-tp4165185p4165185.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.
Re: Using Amon with maven-activemq-plugin
Posted by farhad <me...@farhad.eu>.
Thank you Claus,That did the trick.
Bests,
-Farhad
--
View this message in context: http://activemq.2283324.n4.nabble.com/Using-Amon-with-maven-activemq-plugin-tp4165185p4168128.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.
Re: Using Amon with maven-activemq-plugin
Posted by Claus Ibsen <cl...@gmail.com>.
Hi
Can you add camel-spring to your dependency. The event component is
from that module.
On Tue, Dec 6, 2011 at 4:46 PM, farhad <me...@farhad.eu> wrote:
> Hi,
> Has Anybody successfully tried to use amon tool/framework with the maven
> activemq plugin? My specific problem is to make sure that the following
> artifacts are in the classpath of the plugin. Adding the "<dependency>"
> clauses to the plugin def. is apparently not enough.
> - I have no problem using amon with standalone activemq, using the depicted
> activemq.xml below
> - The amon license file is put in the src/main/resource dir. I'm not sure if
> it is enough.
>
> When running "mvn clean install", I get the following error:
> ----
> Embedded error: Unexpected exception parsing XML document from URL
> [file:/home/fade/projects/misc/activemq/amon/src/main/resources/META-INF/activemq.xml];
> nested exception is java.lang.NoClassDefFoundError:
> org/apache/camel/component/event/EventEndpoint
> ....
> ....
> ---
> Below is my plugin definition together with the activemq.xml file:
> I'd appreciate any help.
> -Farhad D.
>
> =========== Plugin def. ==================
> <plugin>
> <groupId>org.apache.activemq.tooling</groupId>
> <artifactId>maven-activemq-plugin</artifactId>
> <configuration>
>
> <configUri>xbean:file://${project.basedir}/src/main/resources/META-INF/activemq.xml</configUri>
> <fork>${activemq.plugin.fork}</fork>
> <systemProperties>
> <property>
> <name>javax.net.ssl.keyStorePassword</name>
> <value>activemq</value>
> </property>
> <property>
> <name>org.apache.activemq.default.directory.prefix</name>
> <value>./target/</value>
> </property>
> <property>
> <name>log4j.configuration</name>
>
> <value>file://${project.basedir}/src/main/resources/log4j.properties</value>
> </property>
> </systemProperties>
> </configuration>
> <dependencies>
> <dependency>
> <groupId>org.apache.camel</groupId>
> <artifactId>camel-core</artifactId>
> <version>${camel.version}</version>
> </dependency>
> <dependency>
> <groupId>com.ttm.activemq</groupId>
> <artifactId>amon</artifactId>
> <version>${amon.version}</version>
> </dependency>
> <dependency>
> <groupId>de.odysseus.juel</groupId>
> <artifactId>juel</artifactId>
> <version>2.1.0</version>
> </dependency>
> <dependency>
> <groupId>jdmk</groupId>
> <artifactId>jdmkrt</artifactId>
> <version>5.1.3</version>
> </dependency>
> <dependency>
> <groupId>org.slf4j</groupId>
> <artifactId>slf4j-api</artifactId>
> <version>${slf4j.version}</version>
> </dependency>
> <dependency>
> <groupId>org.slf4j</groupId>
> <artifactId>slf4j-log4j12</artifactId>
> <version>${slf4j.version}</version>
> </dependency>
>
> <dependency>
> <groupId>org.apache.commons</groupId>
> <artifactId>commons-daemon</artifactId>
> <version>1.0.3</version>
> </dependency>
> <dependency>
> <groupId>org.apache.activemq</groupId>
> <artifactId>activemq-console</artifactId>
> <version>5.5.0</version>
> <exclusions>
> <exclusion>
> <groupId>commons-daemon</groupId>
> <artifactId>commons-daemon</artifactId>
> </exclusion>
> </exclusions>
> </dependency>
> </dependencies>
> <executions>
> <execution>
> <id>start-activemq</id>
> <phase>process-test-classes</phase>
> <goals>
> <goal>run</goal>
> </goals>
> </execution>
> </executions>
> </plugin>
> =======================================
> =========== activemq.xml ==================
> <?xml version="1.0"?>
> <beans xmlns="http://www.springframework.org/schema/beans"
> xmlns:amq="http://activemq.apache.org/schema/core"
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> xmlns:camel="http://camel.apache.org/schema/spring"
> xsi:schemaLocation="http://www.springframework.org/schema/beans
> http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
> http://activemq.apache.org/schema/core
> http://activemq.apache.org/schema/core/activemq-core.xsd
> http://camel.apache.org/schema/spring
> http://camel.apache.org/schema/spring/camel-spring.xsd
> ">
> <broker xmlns="http://activemq.apache.org/schema/core"
> brokerName="localhost" useJmx="true" useShutdownHook="false"
> dataDirectory="./target/activemq-data" persistent="false"
> schedulerSupport="true">
> <destinationPolicy>
> <policyMap>
> <policyEntries>
> <policyEntry queue=">">
> <deadLetterStrategy>
>
>
> <individualDeadLetterStrategy
> queuePrefix="DLQ."
> useQueueForQueueMessages="true"
> processExpired="false"
> processNonPersistent="false"/>
> </deadLetterStrategy>
> </policyEntry>
> </policyEntries>
> </policyMap>
> </destinationPolicy>
>
> <managementContext>
> <managementContext connectorPort="11099" rmiServerPort="11098" />
> </managementContext>
>
> <plugins>
> <bean id="monitor" class="com.ttm.activemq.monitor.MonitorPlugin"
> xmlns="http://www.springframework.org/schema/beans"/>
> </plugins>
>
> <transportConnectors>
> <transportConnector name="openwire" uri="tcp://localhost:61616"/>
> </transportConnectors>
>
> </broker>
>
> <camelContext id="AmonCamel"
> xmlns="http://camel.apache.org/schema/spring">
> <package>myown.activemq.monlets</package>
> </camelContext>
>
> </beans>
> ==========================================
>
>
> --
> View this message in context: http://activemq.2283324.n4.nabble.com/Using-Amon-with-maven-activemq-plugin-tp4165185p4165185.html
> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
--
Claus Ibsen
-----------------
FuseSource
Email: cibsen@fusesource.com
Web: http://fusesource.com
Twitter: davsclaus, fusenews
Blog: http://davsclaus.blogspot.com/
Author of Camel in Action: http://www.manning.com/ibsen/