1 2 Previous Next 25 Replies Latest reply on Oct 25, 2010 11:03 PM by mirkasim Go to original post
      • 15. Re: Running HornetQ as a windows service
        david.taylor
        Well, I'd  like to try the one from Tanuki Software David, but I wouldn't know  where to get the last free release before the license change. Any ideas?

         

        I'll keep trying...

         

        The original non-GPL files are are still up on SourceForge:  http://sourceforge.net/projects/wrapper/files. Take a look at wrapper-windows-x86-32-3.2.3.zip. That version is very stable based on our experience.

        1 of 1 people found this helpful
        • 16. Re: Running HornetQ as a windows service
          hughbragg

          Thanks David. This one from Tanuki Software works well.

          My experience with all the others was bad.

          I had to modify jsl C++ code to even get it to recognise directory classpath arguments, but I couldn't get to the bottom of some argument mismatch when trying to run it as a service. This would have been great since it ran the jvm right out of the native file so I could rename them to see which one was which in the battery.

          I implemented the winRun4J wrapper but I didn't have a lot of time to see why it failed. It seemed to be a classpath issue too.

          Just like WinRun4J, apache procrun also seemed to have a classpath issue.

          Finally, Tanuki Software wrapper runs perfectly. If only I could distinguish jvms in the battery or if killing the wrapper killed the corresponding jvm.

          • 17. Re: Running HornetQ as a windows service
            david.taylor

            Glad it is working well. I have tried most of the service wrappers and like Java Service Wrapper the best of the bunch. Crash detection and recovery is particularly helpful for the survival mission critical applications that run 24 x 7 with little or no support.

             

            Would you consider sharing your configuration file? I suspect other users with a similar requirement would find it helpful.

            • 18. Re: Running HornetQ as a windows service
              hughbragg

              I'd be happy to. @see attached

              I just wrapped it up in the most basic way. No graceful shutdown or anything. But it worked fine.

              I'm sure implementing the wrapper class would work just as well.

              • 19. Re: Running HornetQ as a windows service
                dawidw

                I actually did the same thing yesterday. Here's my configuration that uses wrapper class.

                Still, it doesn't support the graceful shutdown since in hornet one does it by running stop.bat (that touches STOP_ME dir). I am yet to figure how to make the wrapper support it, but from what I have already found out I'm afraid it can't be done.

                 

                My configuration assumes that the necessary wrapper files are copied to Hornet dir as described here: http://wrapper.tanukisoftware.com/doc/english/integrate-simple-win.html

                • 20. Re: Running HornetQ as a windows service
                  hughbragg

                  This shouldn't be a problem at all.

                  Just create a new class which extends the wrapper class and knows how to instantiate HornetQ. All it needs is the entry point. The same one you use in you wrapper.conf. Implement a start and a stop method. Th stop method just creates that STOP_ME file.

                  Zip up your class and include it in the class path. Go through the steps for the second option of installing the wrapper.

                  Alternatively, HornetQ allows you to run your own server. You can write you own hornetq application server and use the wrapper on it.

                  From what I remember there is 3 ways to implement the wrapper.

                  • 21. Re: Running HornetQ as a windows service
                    dawidw

                    Thanks Hugh, I didn't think of it at first. I'll try that later.

                    • 22. Re: Running HornetQ as a windows service
                      hughbragg

                      Running HornetQ standalone as a Windows 2008 service has come completely unstuck.

                       

                      Some error occurred in the night causing 2 clients executing a receive(200) to throw JMSException and attempt to rollback. The rollback failed and a new connection attempt was attempted. The createConnection() attempt blocked for 8 hours trying to write to a log.

                       

                      The jconsole thread dump:

                      Name: Thread-2
                      State: RUNNABLE
                      Total blocked: 125,069  Total waited: 898,727

                       

                      Stack trace:
                      java.io.FileOutputStream.writeBytes(Native Method)
                      java.io.FileOutputStream.write(Unknown Source)
                      java.io.BufferedOutputStream.write(Unknown Source)
                         - locked java.io.BufferedOutputStream@1b4920f8
                      java.io.PrintStream.write(Unknown Source)
                         - locked java.io.PrintStream@5e1387c6
                      sun.nio.cs.StreamEncoder.writeBytes(Unknown Source)
                      sun.nio.cs.StreamEncoder.implFlushBuffer(Unknown Source)
                      sun.nio.cs.StreamEncoder.implFlush(Unknown Source)
                      sun.nio.cs.StreamEncoder.flush(Unknown Source)
                         - locked java.io.OutputStreamWriter@5437086a
                      java.io.OutputStreamWriter.flush(Unknown Source)
                      java.util.logging.StreamHandler.flush(Unknown Source)
                         - locked java.util.logging.ConsoleHandler@69099257
                      java.util.logging.ConsoleHandler.publish(Unknown Source)
                      java.util.logging.Logger.log(Unknown Source)
                      java.util.logging.Logger.doLog(Unknown Source)
                      java.util.logging.Logger.log(Unknown Source)
                      org.hornetq.core.logging.impl.JULLogDelegate.error(JULLogDelegate.java:68)
                      org.hornetq.core.logging.Logger.error(Logger.java:169)
                      org.hornetq.core.remoting.impl.netty.NettyConnector.createConnection(NettyConnector.java:483)
                      org.hornetq.core.client.impl.FailoverManagerImpl.getConnection(FailoverManagerImpl.java:953)
                      org.hornetq.core.client.impl.FailoverManagerImpl.getConnectionWithRetry(FailoverManagerImpl.java:834)
                      org.hornetq.core.client.impl.FailoverManagerImpl.createSession(FailoverManagerImpl.java:342)
                         - locked java.lang.Object@5fb57890
                         - locked java.lang.Object@c1dfe1a
                      org.hornetq.core.client.impl.ClientSessionFactoryImpl.createSessionInternal(ClientSessionFactoryImpl.java:1123)
                         - locked org.hornetq.core.client.impl.ClientSessionFactoryImpl@3f2221f6
                      org.hornetq.core.client.impl.ClientSessionFactoryImpl.createSession(ClientSessionFactoryImpl.java:849)
                      org.hornetq.jms.client.HornetQConnection.authorize(HornetQConnection.java:565)
                      org.hornetq.jms.client.HornetQConnectionFactory.createConnectionInternal(HornetQConnectionFactory.java:624)
                         - locked org.hornetq.jms.client.HornetQConnectionFactory@76c5a2f7
                      org.hornetq.jms.client.HornetQConnectionFactory.createConnection(HornetQConnectionFactory.java:116)
                      org.hornetq.jms.client.HornetQConnectionFactory.createConnection(HornetQConnectionFactory.java:111)
                      com.agilityapplications.adapt.JmsQ.setupReceiver(JmsQ.java:236)
                      com.agilityapplications.adapt.JmsQ.bounce(JmsQ.java:180)
                      com.agilityapplications.adapt.JmsQ.startMe(JmsQ.java:90)
                      com.agilityapplications.adapt.simpsons.Homer.myTask(Homer.java:56)
                      com.agilityapplications.adapt.simpsons.Simpson.run(Simpson.java:44)

                       

                      As soon as I restart the consumer application everything went ahead as it should.

                       

                      I suspect that Windows server 2008 does something odd with anything getting logged to the console.

                      Earlier I discovered a bug with readNoWait and I needed to do a lot of logging. These got blocked as well.

                      • 23. Re: Running HornetQ as a windows service
                        mirkasim

                        Attached wrapper.zip contains all files except the wrapper.jar, wrapper.exe & wrapper.dll.

                         

                        You will have to extract this into the hornetq installation folder and you will get a new folder wrapper with all the required .bat files & a wrapper based on Method 3.

                         

                        You will have to get the wrapper (wrapper.jar, wrapper.exe & wrapper.dll) files from the latest version of wrapper (wrapper-windows-x86-32-3.5.6) which can be downloaded from http://sourceforge.net/projects/wrapper/files/; and copy these three files into the wrapper folder.   Once that is done, you can now install the JBoss HornetQ service using InstallHornetQ-NT.bat.

                         

                        Tested this with hornetq version 2.1.2.Final, worked fine for me in Windows 7 but have not tested on other windows platforms.

                        • 24. Re: Running HornetQ as a windows service
                          hughbragg

                          Thanks Syed, this is helpful.

                           

                          I worked this out before and although it's the best alternative, it still has 2 very annoying problems.

                           

                          1. It runs as a wrapper and actually launches Hornetq as a seperate process. If you kill the wrapper, it doesn't kill the java process.

                          2. If you have a battery of these, there is no way to distinguish one java process from another.

                           

                          Thanks again anyway. It's good work.

                          • 25. Re: Running HornetQ as a windows service
                            mirkasim

                            Hi Bragg,

                             

                                Regarding issue 1 you mentioned, I tested it by running the wrapper batch file to start HornetQ and then killing the wrapper.exe; it also killed the java.exe process. 

                             

                                Issue 2 is valid if the wrapper.exe is used for all instances; one way to differentiate is by

                            • renaming wrapper.exe to make it unique for each instance (wrapper1.exe, wrapper2.exe etc..)
                            • then in the HornetQ.bat file for each instance, amend

                             

                                 set _WRAPPER_BASE=wrapper

                                 to reflect the unique wrapper name

                                 e.g.

                                 set _WRAPPER_BASE=wrapper1


                                 In this way, each instance can be differentiated from the process list.


                            1 2 Previous Next