Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Duplicate
    • Affects Version/s: 5.4.0, 5.4.1
    • Fix Version/s: None
    • Component/s: Broker
    • Labels:
      None
    • Environment:

      Windows 7 x64. Java 1.6.0_20 32-bit

      Description

      Having troubles launching ActiveMQ broker from the win32 wrapper. This is an issue with 5.4.0 and 5.4.1. Works in 5.3.2 (but not sure if working correctly, see below).

      Steps, from admin cmd, from \bin\win32:

      • uninstallservice.bat
      • installservice.bat
      • net start activemq

      look at \data\wrapper.log

      I'm including dumps from wrapper.log from both 5.4.0 and 5.3.2. The 5.3.2 dump starts the broker fine, but there are some warnings there in the same vicinity as the exceptions in the 5.4.x dump. So perhaps they're related.

      dump from 5.4.0:

      ================

      2010-09-27 16:25:11,606 | WARN | destroyApplicationContextOnStop parameter is deprecated, please use shutdown hooks instead | org.apache.activemq.xbean.XBeanBrokerService | WrapperSimpleAppMain
      2010-09-27 16:25:11,611 | INFO | PListStore:\edwork\vh_temp\vh-vendor-apache\apache-activemq\5.4.0\bin\win32\..\..\data\localhost\tmp_storage started | org.apache.activemq.store.kahadb.plist.PListStore | WrapperSimpleAppMain
      2010-09-27 16:25:11,636 | INFO | Using Persistence Adapter: KahaDBPersistenceAdapter[D:\edwork\vh_temp\vh-vendor-apache\apache-activemq\5.4.0\bin\win32\..\..\data\kahadb] | org.apache.activemq.broker.BrokerService | WrapperSimpleAppMain
      2010-09-27 16:25:11,930 | INFO | ActiveMQ 5.4.0 JMS Message Broker (localhost) is starting | org.apache.activemq.broker.BrokerService | WrapperSimpleAppMain
      2010-09-27 16:25:11,930 | INFO | For help or more information please see: http://activemq.apache.org/ | org.apache.activemq.broker.BrokerService | WrapperSimpleAppMain
      2010-09-27 16:25:12,095 | INFO | Scheduler using directory: activemq-data\scheduler | org.apache.activemq.broker.scheduler.SchedulerBroker | WrapperSimpleAppMain
      2010-09-27 16:25:12,147 | INFO | Listening for connections at: tcp://cruz7:61616 | org.apache.activemq.transport.TransportServerThreadSupport | WrapperSimpleAppMain
      2010-09-27 16:25:12,147 | INFO | Connector openwire Started | org.apache.activemq.broker.TransportConnector | WrapperSimpleAppMain
      2010-09-27 16:25:12,150 | INFO | ActiveMQ JMS Message Broker (localhost, ID:cruz7-60197-1285629911976-0:0) started | org.apache.activemq.broker.BrokerService | WrapperSimpleAppMain
      2010-09-27 16:25:12,281 | INFO | Logging to org.slf4j.impl.JCLLoggerAdapter(org.eclipse.jetty.util.log) via org.eclipse.jetty.util.log.Slf4jLog | org.eclipse.jetty.util.log | WrapperSimpleAppMain
      2010-09-27 16:25:12,281 | INFO | jetty-7.0.1.v20091125 | org.eclipse.jetty.util.log | WrapperSimpleAppMain
      2010-09-27 16:25:12,353 | WARN | tmpdir | org.eclipse.jetty.util.log | WrapperSimpleAppMain
      java.io.IOException: The system cannot find the path specified
      at java.io.WinNTFileSystem.createFileExclusively(Native Method)
      at java.io.File.checkAndCreate(Unknown Source)
      at java.io.File.createTempFile(Unknown Source)
      at java.io.File.createTempFile(Unknown Source)
      at org.eclipse.jetty.webapp.WebInfConfiguration.resolveTempDirectory(WebInfConfiguration.java:295)
      at org.eclipse.jetty.webapp.WebInfConfiguration.preConfigure(WebInfConfiguration.java:43)
      at org.eclipse.jetty.webapp.WebAppContext.doStart(WebAppContext.java:347)
      at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:55)
      at org.eclipse.jetty.server.handler.HandlerCollection.doStart(HandlerCollection.java:165)
      at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:55)
      at org.eclipse.jetty.server.handler.HandlerWrapper.doStart(HandlerWrapper.java:92)
      at org.eclipse.jetty.security.SecurityHandler.doStart(SecurityHandler.java:340)
      at org.eclipse.jetty.security.ConstraintSecurityHandler.doStart(ConstraintSecurityHandler.java:231)
      at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:55)
      at org.eclipse.jetty.server.handler.HandlerCollection.doStart(HandlerCollection.java:165)
      at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:55)
      at org.eclipse.jetty.server.handler.HandlerWrapper.doStart(HandlerWrapper.java:92)
      at org.eclipse.jetty.server.Server.doStart(Server.java:228)
      at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:55)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
      at java.lang.reflect.Method.invoke(Unknown Source)
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeCustomInitMethod(AbstractAutowireCapableBeanFactory.java:1536)
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1477)
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1409)
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:519)
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)
      at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:291)
      at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
      at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:288)
      at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:190)
      at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:574)
      at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:895)
      at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:425)
      at org.apache.xbean.spring.context.ResourceXmlApplicationContext.<init>(ResourceXmlApplicationContext.java:64)
      at org.apache.xbean.spring.context.ResourceXmlApplicationContext.<init>(ResourceXmlApplicationContext.java:52)
      at org.apache.activemq.xbean.XBeanBrokerFactory.createApplicationContext(XBeanBrokerFactory.java:96)
      at org.apache.activemq.xbean.XBeanBrokerFactory.createBroker(XBeanBrokerFactory.java:52)
      at org.apache.activemq.broker.BrokerFactory.createBroker(BrokerFactory.java:71)
      at org.apache.activemq.broker.BrokerFactory.createBroker(BrokerFactory.java:54)
      at org.apache.activemq.console.command.StartCommand.startBroker(StartCommand.java:115)
      at org.apache.activemq.console.command.StartCommand.runTask(StartCommand.java:74)
      at org.apache.activemq.console.command.AbstractCommand.execute(AbstractCommand.java:57)
      at org.apache.activemq.console.command.ShellCommand.runTask(ShellCommand.java:137)
      at org.apache.activemq.console.command.AbstractCommand.execute(AbstractCommand.java:57)
      at org.apache.activemq.console.command.ShellCommand.main(ShellCommand.java:83)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
      at java.lang.reflect.Method.invoke(Unknown Source)
      at org.apache.activemq.console.Main.runTaskClass(Main.java:251)
      at org.apache.activemq.console.Main.main(Main.java:107)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
      at java.lang.reflect.Method.invoke(Unknown Source)
      at org.tanukisoftware.wrapper.WrapperSimpleApp.run(WrapperSimpleApp.java:240)
      at java.lang.Thread.run(Unknown Source)
      2010-09-27 16:25:12,402 | INFO | ActiveMQ Message Broker (localhost, ID:cruz7-60197-1285629911976-0:0) is shutting down | org.apache.activemq.broker.BrokerService | ActiveMQ ShutdownHook
      2010-09-27 16:25:14,148 | INFO | Connector openwire Stopped | org.apache.activemq.broker.TransportConnector | ActiveMQ ShutdownHook
      2010-09-27 16:25:14,169 | INFO | PListStore:\edwork\vh_temp\vh-vendor-apache\apache-activemq\5.4.0\bin\win32\..\..\data\localhost\tmp_storage stopped | org.apache.activemq.store.kahadb.plist.PListStore | ActiveMQ ShutdownHook
      2010-09-27 16:25:14,169 | INFO | Stopping async queue tasks | org.apache.activemq.store.kahadb.KahaDBStore | ActiveMQ ShutdownHook
      2010-09-27 16:25:14,169 | INFO | Stopping async topic tasks | org.apache.activemq.store.kahadb.KahaDBStore | ActiveMQ ShutdownHook
      2010-09-27 16:25:14,169 | INFO | Stopped KahaDB | org.apache.activemq.store.kahadb.KahaDBStore | ActiveMQ ShutdownHook
      2010-09-27 16:25:14,444 | INFO | ActiveMQ JMS Message Broker (localhost, ID:cruz7-60197-1285629911976-0:0) stopped | org.apache.activemq.broker.BrokerService | ActiveMQ ShutdownHook

      ==================================

      dump from 5.3.2:

      2010-09-27 16:27:10,152 | INFO | Using Persistence Adapter: org.apache.activemq.store.kahadb.KahaDBPersistenceAdapter@5b8827 | org.apache.activemq.broker.BrokerService | WrapperSimpleAppMain
      2010-09-27 16:27:10,410 | INFO | ActiveMQ 5.3.0 JMS Message Broker (localhost) is starting | org.apache.activemq.broker.BrokerService | WrapperSimpleAppMain
      2010-09-27 16:27:10,410 | INFO | For help or more information please see: http://activemq.apache.org/ | org.apache.activemq.broker.BrokerService | WrapperSimpleAppMain
      2010-09-27 16:27:10,597 | INFO | Listening for connections at: tcp://cruz7:61616 | org.apache.activemq.transport.TransportServerThreadSupport | WrapperSimpleAppMain
      2010-09-27 16:27:10,597 | INFO | Connector openwire Started | org.apache.activemq.broker.TransportConnector | WrapperSimpleAppMain
      2010-09-27 16:27:10,598 | INFO | ActiveMQ JMS Message Broker (localhost, ID:cruz7-60209-1285630030428-0:0) started | org.apache.activemq.broker.BrokerService | WrapperSimpleAppMain
      2010-09-27 16:27:10,643 | INFO | Logging to org.slf4j.impl.JCLLoggerAdapter(org.mortbay.log) via org.mortbay.log.Slf4jLog | org.mortbay.log | WrapperSimpleAppMain
      2010-09-27 16:27:10,652 | INFO | jetty-6.1.9 | org.mortbay.log | WrapperSimpleAppMain
      2010-09-27 16:27:11,019 | INFO | ActiveMQ WebConsole initialized. | org.apache.activemq.web.WebConsoleStarter | WrapperSimpleAppMain
      2010-09-27 16:27:11,064 | WARN | PWC5963: The scratchDir you specified: C:\Windows\system32\config\systemprofile\AppData\Local\Temp\Jetty_0_0_0_0_8161_admin_admin_9l5s6p\jsp is unusable. | org.apache.jasper.EmbeddedServletOptions | WrapperSimpleAppMain
      2010-09-27 16:27:11,115 | INFO | Initializing Spring FrameworkServlet 'dispatcher' | /admin | WrapperSimpleAppMain
      2010-09-27 16:27:11,181 | INFO | ActiveMQ Console at http://0.0.0.0:8161/admin | org.mortbay.log | WrapperSimpleAppMain
      2010-09-27 16:27:11,374 | INFO | Initializing Spring root WebApplicationContext | /camel | WrapperSimpleAppMain
      2010-09-27 16:27:12,259 | INFO | Connector vm://localhost Started | org.apache.activemq.broker.TransportConnector | WrapperSimpleAppMain
      2010-09-27 16:27:13,593 | WARN | PWC5963: The scratchDir you specified: C:\Windows\system32\config\systemprofile\AppData\Local\Temp\Jetty_0_0_0_0_8161_camel_camel_-3v7y27\jsp is unusable. | org.apache.jasper.EmbeddedServletOptions | WrapperSimpleAppMain
      2010-09-27 16:27:13,594 | INFO | Camel Console at http://0.0.0.0:8161/camel | org.mortbay.log | WrapperSimpleAppMain
      2010-09-27 16:27:13,692 | WARN | PWC5963: The scratchDir you specified: C:\Windows\system32\config\systemprofile\AppData\Local\Temp\Jetty_0_0_0_0_8161_demo_demo_uj3swb\jsp is unusable. | org.apache.jasper.EmbeddedServletOptions | WrapperSimpleAppMain
      2010-09-27 16:27:13,694 | INFO | ActiveMQ Web Demos at http://0.0.0.0:8161/demo | org.mortbay.log | WrapperSimpleAppMain
      2010-09-27 16:27:13,784 | WARN | PWC5963: The scratchDir you specified: C:\Windows\system32\config\systemprofile\AppData\Local\Temp\Jetty_0_0_0_0_8161_fileserver_fileserver_rlvn9v\jsp is unusable. | org.apache.jasper.EmbeddedServletOptions | WrapperSimpleAppMain
      2010-09-27 16:27:13,785 | INFO | RESTful file access application at http://0.0.0.0:8161/fileserver | org.mortbay.log | WrapperSimpleAppMain
      2010-09-27 16:27:13,797 | INFO | Started SelectChannelConnector@0.0.0.0:8161 | org.mortbay.log | WrapperSimpleAppMain

        Issue Links

          Activity

          Hide
          Daniel Ellis added a comment -

          Same issue on Windows Server 2008 R2, when attempting to run ActiveMQ as a service.

          ActiveMQ will start at the command prompt using activemq.bat, but not when running as a service, the result is the same error as above.

          The only way I can get it to start as a service is to comment out the Jetty section at the bottom of activemq.conf. (However, you will loose access to the web console).

          Eg. Replace

          <import resource="jetty.xml"/>

          with

          <!-- <import resource="jetty.xml"/> -->

          So the issue is most definitely somewhere within jetty.

          Show
          Daniel Ellis added a comment - Same issue on Windows Server 2008 R2, when attempting to run ActiveMQ as a service. ActiveMQ will start at the command prompt using activemq.bat , but not when running as a service, the result is the same error as above. The only way I can get it to start as a service is to comment out the Jetty section at the bottom of activemq.conf . (However, you will loose access to the web console). Eg. Replace <import resource="jetty.xml"/> with <!-- <import resource="jetty.xml"/> --> So the issue is most definitely somewhere within jetty.
          Hide
          Jonathan Ward added a comment -

          I had this same problem on Windows Server 2008 when running as a service. It seems to be related to a problem in determing or creating the temp folder that Jetty needs. The "work" folder is one of the locations that Jetty looks for, so I resolved this problem by creating a "work" folder here:

          {amq-home}

          /bin/win32

          Show
          Jonathan Ward added a comment - I had this same problem on Windows Server 2008 when running as a service. It seems to be related to a problem in determing or creating the temp folder that Jetty needs. The "work" folder is one of the locations that Jetty looks for, so I resolved this problem by creating a "work" folder here: {amq-home} /bin/win32
          Hide
          Eddie Fast added a comment -

          Pardon the naive question, but how did you set the 'work' folder for Jetty to look for?

          Show
          Eddie Fast added a comment - Pardon the naive question, but how did you set the 'work' folder for Jetty to look for?
          Hide
          Paddy Daly added a comment - - edited

          Just create a work folder under win32.

          {amq-home}/bin/win32/work
          and
          {amq-home}

          /bin/win32/temp

          I created a temp folder too, not sure if it really needed.

          Show
          Paddy Daly added a comment - - edited Just create a work folder under win32. {amq-home}/bin/win32/work and {amq-home} /bin/win32/temp I created a temp folder too, not sure if it really needed.
          Hide
          Eddie Fast added a comment -

          Great! What a simple fix. I just added 'work' and the service starts successfully. Thanks so much.

          Show
          Eddie Fast added a comment - Great! What a simple fix. I just added 'work' and the service starts successfully. Thanks so much.
          Hide
          Greg Henry added a comment -

          Same with ActiveMQ 5.5.0 on Win 2008 R2 / 64 bits running with a Win 32 jvm ....

          Show
          Greg Henry added a comment - Same with ActiveMQ 5.5.0 on Win 2008 R2 / 64 bits running with a Win 32 jvm ....
          Hide
          Rajesh Rangaswami added a comment -

          A better way to solve this problem is to set the TMP environment variable to point to a temporary folder. To do that in the install script add _TMP variable and pass it on the command line.

          set _TMP="set.TMP=<temp folder>"

          "%ACTIVEMQ_HOME%\bin\win32\wrapper.exe" -i %_WRAPPER_CONF% %_ACTIVEMQ_HOME% %_ACTIVEMQ_BASE% %_JAVA_HOME% %_TMP%

          or in the wrapper conf add set.default.TMP=<tmp folder>

          That solves the problem without polluting the activemq installation folder.

          Show
          Rajesh Rangaswami added a comment - A better way to solve this problem is to set the TMP environment variable to point to a temporary folder. To do that in the install script add _TMP variable and pass it on the command line. set _TMP="set.TMP=<temp folder>" "%ACTIVEMQ_HOME%\bin\win32\wrapper.exe" -i %_WRAPPER_CONF% %_ACTIVEMQ_HOME% %_ACTIVEMQ_BASE% %_JAVA_HOME% %_TMP% or in the wrapper conf add set.default.TMP=<tmp folder> That solves the problem without polluting the activemq installation folder.
          Hide
          Paul Morris added a comment -

          i think you will eventually find, like i did, that when starting the service as the local admin account the temp directory that it is looking for is located here .. C:\Windows\System32\config\systemprofile\AppData\Local\Temp and when this directory does not exist it refuses to create it by itself... so just add a line to your start script if you do things that way, or add it to the install service script to make sure that that directory is created

          as soon as you have created that directory things are then perfectly fine

          Show
          Paul Morris added a comment - i think you will eventually find, like i did, that when starting the service as the local admin account the temp directory that it is looking for is located here .. C:\Windows\System32\config\systemprofile\AppData\Local\Temp and when this directory does not exist it refuses to create it by itself... so just add a line to your start script if you do things that way, or add it to the install service script to make sure that that directory is created as soon as you have created that directory things are then perfectly fine
          Hide
          Timothy Bish added a comment -

          This is an issue of the script not being able to find or access the temp dir, you need to ensure that its properly configured and accessibe for the logged in user.

          Show
          Timothy Bish added a comment - This is an issue of the script not being able to find or access the temp dir, you need to ensure that its properly configured and accessibe for the logged in user.
          Hide
          Eddie Fast added a comment -

          I agree that the bug has been resolved with the comments above, but I don't agree that it's simply a user-configuration problem.

          • The distribution should include a \work folder (Paddy's suggestion)
          • Or the wrapper should set the TMP folder according to %TEMP% (Rajesh's suggestion)
          • Or the documentation should note that you have to explicitly perform this step. ("enure that it's properly configured")

          If you don't do one of the above, the wrapper will refuse to run.

          So I think there needs to be some sort of action (ie, one of the steps above)

          Show
          Eddie Fast added a comment - I agree that the bug has been resolved with the comments above, but I don't agree that it's simply a user-configuration problem. The distribution should include a \work folder (Paddy's suggestion) Or the wrapper should set the TMP folder according to %TEMP% (Rajesh's suggestion) Or the documentation should note that you have to explicitly perform this step. ("enure that it's properly configured") If you don't do one of the above, the wrapper will refuse to run. So I think there needs to be some sort of action (ie, one of the steps above)

            People

            • Assignee:
              Unassigned
              Reporter:
              Eddie Fast
            • Votes:
              4 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development