プラグインをインストールした状態でactivemqブローカーを設定しようとしていますが、ブローカー設定ファイルのプラグインクラスの修飾名を取得できないようです。 以下のブローカ設定に続いてエラーメッセージを貼り付けました。基本的には、XmlValidationPlugin.classファイルへの絶対パスである class = "file:C:/ Marcus/JavaProjects/Project/build/prod/classes/com/foo/jms/amqplugin/XmlValidationPlugin" を指定しています。 (上記のパスに.classを追加しようとしましたが、同じエラーが発生します)。 最初はclass属性が.classファイルを指している必要がありますが、.javaを指し示そうとしていてまだ動作していないと仮定しました。私は開発のプラグイン、よくある質問、春のドキュメントなどにアクティブMQよくある質問を読んだ Javaでプラグインを使用してアクティブなMQブローカーを設定しようとしていますが、<bean class = "...">属性が指すべき場所は?
私のクラスパスが であり、JAVA_HOME \ libに; C:マーカス\ JavaProjects \プロジェクト\; C:マーカス\ JavaProjects \ \プロジェクト\ビルド\ prodには\クラス とJAVA_HOMEは次のとおりです。 Cは:マーカス\ JavaProjects \プロジェクト\ \ との.class SRC:\プログラムファイル\のJava \は
すべてのJavaソースが Cに常駐しjdk1.7.0_03ファイルは C:¥Marcus¥JavaProjects¥Project¥build¥prod¥classes にあります(クラス内のファイル構造はsrc内のファイル構造を反映していますので、例えば com.foo.jm com.foo:s.amqplugin.XmlValidationPlugin は クラス/ COM/fooの/ JMS/amqplugin)問題の
プラグインがXmlValidationPlugin.javaで、パッケージ内のフォルダSRCにある中で、そのの.classファイルを持っています。 jms.amqplugin
私はXmlValidationPlugin.classをJARに入れて、activemqinstalldir/libにJARを入れてみましたが(同様の問題を抱えている他の人には勧められましたが)、これは助けになりませんでした。
私はこれで1日半を費やしましたが、プラグインクラスの属性の値がどんなものかを誰かが知っていれば本当に感謝しています。 ERROR出力の
TOP:
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 [email protected]: 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ファイル:
<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">
<!-- Allows us to use system properties as variables in this configuration file -->
<bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
<property name="locations">
<value>file:${activemq.base}/conf/credentials.properties</value>
</property>
</bean>
<!--The <broker> element is used to configure the ActiveMQ broker. -->
<broker xmlns="http://activemq.apache.org/schema/core" brokerName="localhost"
dataDirectory="${activemq.base}/data">
...
<!--plugin-->
<plugins>
<bean xmlns="http://www.springframework.org/schema/beans"
id="xmlValidationPlugin"
class="com.foo.jms.amqplugin.XmlValidationPlugin"/>
</plugins>
</broker>
</beans>
Matejは本当にありがとうございました。正解でした。私は完全修飾名を使用するだけでなく、自分のソース全体をJARに入れ、activemqinstalldir/libに貼り付ける必要がありました。問題は、これまでlibpathのjarファイルにいくつかのクラスファイルが見つからなかったため、CLASSPATH上のクラスファイルにもかかわらずClassNotFound例外が発生していたことです。ご協力いただきありがとうございます! –