Hello
I'm trying to configure an activemq broker with a plugin installed, but
can't seem to get the qualified name of the plugin class right in the broker
configuration file.
I have pasted the error message followed by the broker config below.
Basicallly in the <plugins> element I'm specifying
class="file:C:/Marcus/JavaProjects/Project/build/prod/classes/com/foo/jms/amqplugin/XmlValidationPlugin"
which is absolute path to the XmlValidationPlugin.class file(have tried
appending .class to path above but I get the same error).
Initially I assumed that the class attribute should be pointing to the
.class file but have tried pointing it to .java and still doesn't work.
I have read the active MQ faq on developing plugins, FAQs, spring
documentation etc.
My class path is
.;JAVA_HOME\lib;C:\Marcus\JavaProjects\Project;C:\Marcus\JavaProjects\Project\build\prod\classes
and JAVA_HOME is:
C:\Program Files\Java\jdk1.7.0_03
all the java source resides in
C:\Marcus\JavaProjects\Project\src
and the .class files are in
C:\Marcus\JavaProjects\Project\build\prod\classes
( file structure in classes mirrors that in src,so for example
com.foo.jms.amqplugin.XmlValidationPlugin
will have its .class file in
classes/com/foo/jms/amqplugin )
the plugin in question is XmlValidationPlugin.java, and is in folder src in
package:
com.foo.jms.amqplugin
I have tried putting XmlValidationPlugin.class in a JAR and putting the JAR
in activemqinstalldir/lib,( as was recommended to other people who had a
similar problem) but this has not helped.
I have spent a day and a half on this already, and would really appreciate
if anyone has any idea what the value of the plugins class attribute should
be, as I have tried everything... Thanks in advance!
TOP OF ERROR OUTPUT:
C:\Program Files\apache-activemq-5.5.1>bin\activemq
xbean:file:C:/Marcus/JavaProjects/Project/config/custom-broker.xml
Java Runtime: Oracle Corporation 1.7.0_03 C:\Program
Files\Java\jdk1.7.0_03\jre
Heap sizes: current=15872k free=14246k max=506816k
JVM args: -Dcom.sun.management.jmxremote -Xmx512M
-Dorg.apache.activemq.UseDedicatedTaskRunner=true
-Djava.util.logging.config.file=logging.properties
-Dactivemq.classpath=C:\Program Files\apache-
activemq-5.5.1\bin\../conf;C:\Program
Files\apache-activemq-5.5.1\bin\../conf; -Dactivemq.home=C:\Program
Files\apache-activemq-5.5.1\bin\.. -Dactivemq.base=C:\Program
Files\apache-activemq-5.5.1\bin\
..
ACTIVEMQ_HOME: C:\Program Files\apache-activemq-5.5.1\bin\..
ACTIVEMQ_BASE: C:\Program Files\apache-activemq-5.5.1\bin\..
Loading message broker from:
xbean:file:C:/Marcus/JavaProjects/Project/config/custom-broker.xml
INFO | Refreshing org.apache.activemq.xbean.XBeanBrokerFactory$1@7a8ba4:
startup date [Thu Apr 12 10:38:26 CEST 2012]; root of context hierarchy
ERROR: java.lang.RuntimeException: Failed to execute start task. Reason:
org.springframework.beans.factory.BeanDefinitionStoreException: Failed to
load type:
file:C:/Marcus/JavaProjects/Project/build/prod/classes/com/foo/jms/amqplugin/XmlValidationPlugin.
Reason: java.lang.ClassNotFoundException:
file:C:/Marcus/JavaProjects/Project/build/prod/classes/com/foo/jms/amqplugin/XmlValidationPlugin;
nested exception is java.lang.ClassNotFoundException:
file:C:/Marcus/JavaProjects/Project/build/prod/classes/com/foo/jms/amqplugin/XmlValidationPlugin
java.lang.RuntimeException: Failed to execute start task. Reason:
org.springframework.beans.factory.BeanDefinitionStoreException: Failed to
load type:
file:C:/Marcus/JavaProjects/Project/build/prod/classes/com/foo/jms/amqplugin/XmlValidationPlugin.
Reason: java.lang.ClassNotFoundException:
file:C:/Marcus/JavaProjects/Project/build/prod/classes/com/foo/jms/amqplugin/XmlValidationPlugin;
nested exception is java.lang.ClassNotFoundException:
file:C:/Marcus/JavaProjects/Project/build/prod/classes/com/foo/jms/amqplugin/XmlValidationPlugin
at
org.apache.activemq.console.command.StartCommand.runTask(StartCommand.java:98)
at
org.apache.activemq.console.command.AbstractCommand.execute(AbstractCommand.java:57)
at
org.apache.activemq.console.command.ShellCommand.runTask(ShellCommand.java:143)
at
org.apache.activemq.console.command.AbstractCommand.execute(AbstractCommand.java:57)
at
org.apache.activemq.console.command.ShellCommand.main(ShellCommand.java:85)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
...
BROKER CONFIG FILE:
<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"
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">
<bean
class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
<property name="locations">
<value>file:${activemq.base}/conf/credentials.properties</value>
</property>
</bean>
<broker xmlns="http://activemq.apache.org/schema/core"
brokerName="localhost"
dataDirectory="${activemq.base}/data">
...
<plugins>
<bean xmlns="http://www.springframework.org/schema/beans"
id="xmlValidationPlugin"
class="com.foo.jms.amqplugin.XmlValidationPlugin"/>
</plugins>
</broker>
</beans>
--
View this message in context:
http://activemq.2283324.n4.nabble.com/ClassNotFound-for-activeMQ-plugin-tp4551349p4551349.html
Sent from the ActiveMQ - Dev mailing list archive at Nabble.com.