我正在尝试将ActiveMQ与Tomcat集成在本教程中 How to embed ActiveMQ in Tomcat
当我启动服务器时,我收到了无法创建目录'activemq-data \ localhost \ KahaDB'。
如何解决?
我也不知道在哪里放参数
-Dwebconsole.type=properties
-Dwebconsole.jms.url = TCP://本地主机:61616 -Dwebconsole.jmx.url =服务:JMX:RMI:/// JNDI / RMI://本地主机:1099 / Jmxrmi
日志:
java.lang.RuntimeException:java.io.IOException:无法创建目录'activemq-data \ localhost \ KahaDB' 在org.apache.activemq.store.kahadb.KahaDBStore.size(KahaDBStore.java:1208) 在org.apache.activemq.store.kahadb.KahaDBPersistenceAdapter.size(KahaDBPersistenceAdapter.java:217) 在org.apache.activemq.usage.StoreUsage.retrieveUsage(StoreUsage.java:56) at org.apache.activemq.usage.Usage.caclPercentUsage(Usage.java:283) 在org.apache.activemq.usage.Usage.onLimitChange(Usage.java:188) 在org.apache.activemq.usage.Usage.setLimit(Usage.java:172) 在org.apache.activemq.broker.BrokerService.getSystemUsage(BrokerService.java:1156) at org.apache.activemq.broker.BrokerService.checkMemorySystemUsageLimits(BrokerService.java:2136) 在org.apache.activemq.broker.BrokerService.start(BrokerService.java:599) 在info.octera.utils.LoadActiveMQ.init(LoadActiveMQ.java:32) 在javax.servlet.GenericServlet.init(GenericServlet.java:158) 在org.apache.catalina.core.StandardWrapper.initServlet(StandardWrapper.java:1183) 在org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1099) 在org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:989) 在org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:4921) at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5231) 在org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183) 在org.apache.catalina.core.ContainerBase $ StartChild.call(ContainerBase.java:1439) 在org.apache.catalina.core.ContainerBase $ StartChild.call(ContainerBase.java:1429) at java.util.concurrent.FutureTask.run(FutureTask.java:266) 在org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:75) at java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:134) 在org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:953) 在org.apache.catalina.core.StandardHost.startInternal(StandardHost.java:872) 在org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183) 在org.apache.catalina.core.ContainerBase $ StartChild.call(ContainerBase.java:1439) 在org.apache.catalina.core.ContainerBase $ StartChild.call(ContainerBase.java:1429) at java.util.concurrent.FutureTask.run(FutureTask.java:266) 在org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:75) at java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:134) 在org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:953) 在org.apache.catalina.core.StandardEngine.startInternal(StandardEngine.java:262) 在org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183) at org.apache.catalina.core.StandardService.startInternal(StandardService.java:422) 在org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183) at org.apache.catalina.core.StandardServer.startInternal(StandardServer.java:793) 在org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183) 在org.apache.catalina.startup.Catalina.start(Catalina.java:655) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) 在org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:355) 在org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:495) 引起:java.io.IOException:无法创建目录'activemq-data \ localhost \ KahaDB' 在org.apache.activemq.util.IOHelper.mkdirs(IOHelper.java:331) 在org.apache.activemq.store.kahadb.MessageDatabase.createPageFile(MessageDatabase.java:3118) 在org.apache.activemq.store.kahadb.MessageDatabase.getPageFile(MessageDatabase.java:3283) 在org.apache.activemq.store.kahadb.KahaDBStore.size(KahaDBStore.java:1206) ... 43更多
答案 0 :(得分:0)
在Windows上,我需要指定前面带有驱动器号的目录,以使此功能正常工作,例如
<amq:broker useJmx="false" persistent="true" schedulerSupport="true" dataDirectory="c:\active-mq"> ....