You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by "dean.ward" <de...@bakedbean.org.uk> on 2012/08/21 19:38:35 UTC

Apollo as Windows Service

Hi all,
I've followed the instructions at
http://activemq.apache.org/apollo/documentation/user-manual.html#On_Windows
to install a broker as a Windows Service. Unfortunately I it fails to start
the service with the following error in apollo-broker-service.err.log:

Exception in thread "main" java.lang.ClassNotFoundException:
org.apache.activemq.apollo.cli.Apollo
	at java.net.URLClassLoader$1.run(Unknown Source)
	at java.net.URLClassLoader$1.run(Unknown Source)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.net.URLClassLoader.findClass(Unknown Source)
	at java.lang.ClassLoader.loadClass(Unknown Source)
	at java.lang.ClassLoader.loadClass(Unknown Source)
	at org.apache.activemq.apollo.boot.Apollo.main(Apollo.java:92)

If I run the broker from the command line (from
apollo-broker-service.wrapper.log) it runs just fine. Any ideas?

Cheers,
Dean



--
View this message in context: http://activemq.2283324.n4.nabble.com/Apollo-as-Windows-Service-tp4655390.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Re: Apollo as Windows Service

Posted by chirino <hi...@hiramchirino.com>.
Hi Dean,

Windows is known to be tricky to get classpaths right when jars are in a
path with a space in it.  Perhaps this is going on here.  Did you by any
chance install to a directory path that has a space in it?

Regards,
Hiram


dean.ward wrote
> 
> Hi all,
> I've followed the instructions at
> http://activemq.apache.org/apollo/documentation/user-manual.html#On_Windows
> to install a broker as a Windows Service. Unfortunately I it fails to
> start the service with the following error in
> apollo-broker-service.err.log:
> 
> Exception in thread "main" java.lang.ClassNotFoundException:
> org.apache.activemq.apollo.cli.Apollo
> 	at java.net.URLClassLoader$1.run(Unknown Source)
> 	at java.net.URLClassLoader$1.run(Unknown Source)
> 	at java.security.AccessController.doPrivileged(Native Method)
> 	at java.net.URLClassLoader.findClass(Unknown Source)
> 	at java.lang.ClassLoader.loadClass(Unknown Source)
> 	at java.lang.ClassLoader.loadClass(Unknown Source)
> 	at org.apache.activemq.apollo.boot.Apollo.main(Apollo.java:92)
> 
> If I run the broker from the command line (from
> apollo-broker-service.wrapper.log) it runs just fine. Any ideas?
> 
> Cheers,
> Dean
> 




--
View this message in context: http://activemq.2283324.n4.nabble.com/Apollo-as-Windows-Service-tp4655390p4655422.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Re: Apollo as Windows Service

Posted by ceposta <ch...@gmail.com>.
This has been fixed in latest trunk, Dean. Feel free to verify it!
You can checkout the latest snapshot builds from here:

http://activemq.apache.org/apollo/download.html



-----
http://www.christianposta.com/blog
--
View this message in context: http://activemq.2283324.n4.nabble.com/Apollo-as-Windows-Service-tp4655390p4655770.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Re: Apollo as Windows Service

Posted by "dean.ward" <de...@bakedbean.org.uk>.
Thanks Christian, much appreciated!
Dean



--
View this message in context: http://activemq.2283324.n4.nabble.com/Apollo-as-Windows-Service-tp4655390p4655491.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Re: Apollo as Windows Service

Posted by ceposta <ch...@gmail.com>.
I can recreate this as you've described. Not sure why it's happening. I've
opened a JIRA for it and will hack at it when I get a sec.

https://issues.apache.org/jira/browse/APLO-246




-----
http://www.christianposta.com/blog
--
View this message in context: http://activemq.2283324.n4.nabble.com/Apollo-as-Windows-Service-tp4655390p4655458.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Re: Apollo as Windows Service

Posted by "dean.ward" <de...@bakedbean.org.uk>.
Further investigation seems to show that if I extract Apollo into C:\Apollo
it works just fine. If I extract to D:\Apollo it does not. 

If I extract and install from D:\Apollo and then (just to test) extract to
C:\Apollo before starting the Windows Service it will start just fine. Looks
like there's a dependency on C: somewhere. If I remove C:\Apollo and run
procmon it indicates that there is probing going on for C:\Apollo but then
it seems to look in D:\Apollo.

Anyway, that seems to be the root cause. We'll stick to C:\Apollo for the
binaries for now and stick our queues on another disk.

Cheers,
Dean



--
View this message in context: http://activemq.2283324.n4.nabble.com/Apollo-as-Windows-Service-tp4655390p4655457.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Re: Apollo as Windows Service

Posted by "dean.ward" <de...@bakedbean.org.uk>.
Sure... I've no spaces in my path with the exception of the location of
java.exe. apollo-broker-service.xml looks like this:



<service>
  <id>org.apache.activemq.apollo.Test</id>
  <name>Apollo: Test</name>
  <description>Apache Apollo is a reliable messaging broker</description>

  <logpath>D:\Apollo\Test\log</logpath>
  <logmode>roll</logmode>

  <executable>"C:\Program Files\Java\jre7\bin\java.exe"</executable>
  <argument>-server</argument>
  <argument>-Xrs</argument>
  <argument>-Xmx1G</argument>
  <argument>-Dcom.sun.management.jmxremote</argument>
 
<argument>"-Djava.util.logging.config.file=D:\Apollo\etc\jul.properties"</argument>
  <argument>"-Dapollo.base=D:\Apollo\Test"</argument>
  <argument>"-Dapollo.home=D:\Apollo"</argument>
  <argument>-classpath</argument>
  <argument>"D:\Apollo\Test\etc;D:\Apollo\lib\apollo-boot.jar"</argument>
  <argument>org.apache.activemq.apollo.boot.Apollo</argument>
  <argument>"D:\Apollo\Test\lib:D:\Apollo\lib"</argument>
  <argument>org.apache.activemq.apollo.cli.Apollo</argument>
  <argument>run</argument>

</service>

Thanks for the help :)

Dean



--
View this message in context: http://activemq.2283324.n4.nabble.com/Apollo-as-Windows-Service-tp4655390p4655453.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Re: Apollo as Windows Service

Posted by ceposta <ch...@gmail.com>.
I just tried on Windows Server 2008 R2 on EC2. I suspected what Hiram
mentioned, but it still worked (path with spaces). Could you post your
apollo-broker-service.xml?



-----
http://www.christianposta.com/blog
--
View this message in context: http://activemq.2283324.n4.nabble.com/Apollo-as-Windows-Service-tp4655390p4655428.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Re: Apollo as Windows Service

Posted by "dean.ward" <de...@bakedbean.org.uk>.
We're running Apollo 1.4 under Windows 7 and Windows Server 2008 R2; same
problem on both. procmon doesn't seem to bring anything obvious from a
permissions perspective so I'm struggling a little to pinpoint the cause!



--
View this message in context: http://activemq.2283324.n4.nabble.com/Apollo-as-Windows-Service-tp4655390p4655417.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Re: Apollo as Windows Service

Posted by ceposta <ch...@gmail.com>.
What version (apollo and/or windows) are you using?
I just tried on WinXP and it works fine with Apollo v1.4



-----
http://www.christianposta.com/blog
--
View this message in context: http://activemq.2283324.n4.nabble.com/Apollo-as-Windows-Service-tp4655390p4655403.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.