JBOSS 消息中间件hornetq的使用(一)
???????????? hornetq 的使用实例如下,采用简单的嵌入式容器实现简单的HornetQ发送消息的简单实例。
关于hornetq的两个核心的配置文件为,hornetq-beans.xml和hornet-configuration.xml配置:
hornetq-beans.xml的配置如下:
?
?
hornetq的嵌入式代码实现如下:
?
DEPLOYMENTS MISSING DEPENDENCIES:
Deployment "HornetQServer" is missing the following dependencies:
Dependency "Configuration" (should be in state "Installed", but is actually in state "**ERROR**")
at org.jboss.kernel.plugins.deployment.AbstractKernelDeployer.internalValidate(AbstractKernelDeployer.java:278)
at org.jboss.kernel.plugins.deployment.AbstractKernelDeployer.validate(AbstractKernelDeployer.java:174)
at org.hornetq.integration.bootstrap.HornetQBootstrapServer.bootstrap(HornetQBootstrapServer.java:158)
at org.jboss.kernel.plugins.bootstrap.AbstractBootstrap.run(AbstractBootstrap.java:83)
at org.hornetq.integration.bootstrap.HornetQBootstrapServer.run(HornetQBootstrapServer.java:116)
at honetq.EmbeddedMicroContainer.main(EmbeddedMicroContainer.java:56)
java.lang.IllegalStateException: Incompletely deployed:
DEPLOYMENTS IN ERROR:
Deployment "Configuration" is in error due to: java.net.MalformedURLException: no protocol: hornetq-configuration.xml
DEPLOYMENTS MISSING DEPENDENCIES:
Deployment "HornetQServer" is missing the following dependencies:
Dependency "Configuration" (should be in state "Installed", but is actually in state "**ERROR**")
at org.jboss.kernel.plugins.deployment.AbstractKernelDeployer.internalValidate(AbstractKernelDeployer.java:278)
at org.jboss.kernel.plugins.deployment.AbstractKernelDeployer.validate(AbstractKernelDeployer.java:174)
at org.hornetq.integration.bootstrap.HornetQBootstrapServer.bootstrap(HornetQBootstrapServer.java:158)
at org.jboss.kernel.plugins.bootstrap.AbstractBootstrap.run(AbstractBootstrap.java:83)
at org.hornetq.integration.bootstrap.HornetQBootstrapServer.run(HornetQBootstrapServer.java:116)
at honetq.EmbeddedMicroContainer.main(EmbeddedMicroContainer.java:56)
--------------------------------------------
经过调试,发现是在执行hornetQ.run()这句的时候,报的异常,请高手帮我看看为何呢?
DEPLOYMENTS MISSING DEPENDENCIES:
Deployment "HornetQServer" is missing the following dependencies:
Dependency "Configuration" (should be in state "Installed", but is actually in state "**ERROR**")
at org.jboss.kernel.plugins.deployment.AbstractKernelDeployer.internalValidate(AbstractKernelDeployer.java:278)
at org.jboss.kernel.plugins.deployment.AbstractKernelDeployer.validate(AbstractKernelDeployer.java:174)
at org.hornetq.integration.bootstrap.HornetQBootstrapServer.bootstrap(HornetQBootstrapServer.java:158)
at org.jboss.kernel.plugins.bootstrap.AbstractBootstrap.run(AbstractBootstrap.java:83)
at org.hornetq.integration.bootstrap.HornetQBootstrapServer.run(HornetQBootstrapServer.java:116)
at honetq.EmbeddedMicroContainer.main(EmbeddedMicroContainer.java:56)
java.lang.IllegalStateException: Incompletely deployed:
DEPLOYMENTS IN ERROR:
Deployment "Configuration" is in error due to: java.net.MalformedURLException: no protocol: hornetq-configuration.xml
DEPLOYMENTS MISSING DEPENDENCIES:
Deployment "HornetQServer" is missing the following dependencies:
Dependency "Configuration" (should be in state "Installed", but is actually in state "**ERROR**")
at org.jboss.kernel.plugins.deployment.AbstractKernelDeployer.internalValidate(AbstractKernelDeployer.java:278)
at org.jboss.kernel.plugins.deployment.AbstractKernelDeployer.validate(AbstractKernelDeployer.java:174)
at org.hornetq.integration.bootstrap.HornetQBootstrapServer.bootstrap(HornetQBootstrapServer.java:158)
at org.jboss.kernel.plugins.bootstrap.AbstractBootstrap.run(AbstractBootstrap.java:83)
at org.hornetq.integration.bootstrap.HornetQBootstrapServer.run(HornetQBootstrapServer.java:116)
at honetq.EmbeddedMicroContainer.main(EmbeddedMicroContainer.java:56)
--------------------------------------------
经过调试,发现是在执行hornetQ.run()这句的时候,报的异常,请高手帮我看看为何呢?
不知道你在JBoss下面配置哪个Hornetq的部署目录了吗?貌似你没有配置 3 楼 hnjwlwj 2011-11-17 上面hornet-configuration.xml 这个文件名错了,应该是hornetq-configuration.xml