5 Replies Latest reply on Nov 4, 2011 3:46 PM by pat.flanigan

    Running Example Code

    pat.flanigan

      I am trying to run run example code from the ActiveMQ in action book, directly from unmodified jar files and the war files. This example is taken from chapter 8, and is the jms-webapp-local, though I've done the webapp-global with the same results.  I'm running on a Mac OS/X under Lion.  I think this is the key. I've used Tomcat 6.0.33 for this latest test.  This war file appears to deploy, but won't start because of a listener error.  Here is the relevant log during startup.

       

       

      INFO: Deploying configuration descriptor manager.xml

      Oct 26, 2011 10:38:05 AM org.apache.catalina.startup.HostConfig deployWAR

      INFO: Deploying web application archive jms-webapp.war

      Oct 26, 2011 10:38:06 AM org.apache.catalina.core.StandardContext start

      SEVERE: Error listenerStart

      Oct 26, 2011 10:38:06 AM org.apache.catalina.core.StandardContext start

      SEVERE: Context /jms-webapp startup failed due to previous errors

      Oct 26, 2011 10:38:06 AM org.apache.catalina.startup.HostConfig deployDirectory

      INFO: Deploying web application directory docs

      Oct 26, 2011 10:38:06 AM org.apache.catalina.startup.HostConfig deployDirectory

      INFO: Deploying web application directory examples

      Oct 26, 2011 10:38:06 AM org.apache.catalina.startup.HostConfig deployDirectory

      INFO: Deploying web application directory ROOT

      Oct 26, 2011 10:38:06 AM org.apache.coyote.http11.Http11Protocol start

      INFO: Starting Coyote HTTP/1.1 on http-8080

      Oct 26, 2011 10:38:06 AM org.apache.jk.common.ChannelSocket init

      INFO: JK: ajp13 listening on /0.0.0.0:8009

      Oct 26, 2011 10:38:06 AM org.apache.jk.server.JkMain start

      INFO: Jk running ID=0 time=0/15  config=null

      Oct 26, 2011 10:38:06 AM org.apache.catalina.startup.Catalina start

      INFO: Server startup in 992 ms

       

      Also taking place during this time is a message issued by the kernel.  This message is new to Lion.  I don't know if this is affecting things, but it seems to be affecting other development systems.

       

      10/26/11 10:38:07.000 AM kernel: nstat_lookup_entry failed: 2

       

      Has anyone else gotten this example to run on Mac OS/X Lion?

        • 1. Re: Running Example Code
          pat.flanigan

          In doing further research on this problem, it appears that the issue has little to do with Mac OS/X and Lion.  Instead it is caused by a class path problem, hinted at but not defined by the listnerStart error message. Once I figured out how to turn on the debug information, and add the additional jar files that were missing from the information provided from Fusesource, the web app would at least load.  It still doesn't run. The following is a problem it is having reading the configuration file.  The file is in the correct directory, but it looks like there is an absolute vs relative path problem with the io routine.  I'm not sure how to correct this.

           

           

          SEVERE: Servlet.service() for servlet in context with path /jms-webapp threw exception [Request processing failed; nested exception is org.springframework.jms.UncategorizedJmsException: Uncategorized exception occured during JMS processing; nested exception is javax.jms.JMSException: Could not create Transport. Reason: org.springframework.beans.factory.BeanDefinitionStoreException: IOException parsing XML document from class path resource ; nested exception is java.io.FileNotFoundException: class path resource cannot be opened because it does not exist] with root cause

          java.io.FileNotFoundException: class path resource cannot be opened because it does not exist

               at org.springframework.core.io.ClassPathResource.getInputStream(ClassPathResource.java:158)

               at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:328)

               at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:302)

               at org.apache.xbean.spring.context.ResourceXmlApplicationContext.loadBeanDefinitions(ResourceXmlApplicationContext.java:111)

           

          Any help is greatly appreciated.

           

          Edited by: pat.flanigan on Nov 3, 2011 9:31 PM

          • 2. Re: Running Example Code
            davsclaus

            Check in your configuration files for http://conf/activemq.xml or just conf/activemq.xml as there seems something odd.

             

            Maybe attach the web.xml, and other XML configuration files for you web app. As there must be something wrong.

            • 3. Re: Running Example Code
              pat.flanigan

              As far as I can tell, there is nothing in configuration files that references conf/activemq.xml by name or any thing close to it.  I did a search of everything in the project on activemq and nothing was listed.  I'm attaching the xml configuration files.  Maybe you can see something that looks out of place.  What it seems like to me is that the I/O routine somehow doesn't know where the Tomcat home or catalina home is, or isn't using that information when attempting to open the file.  Is this a possible explanation?  If so, under what exact name is it looking for it?

              • 4. Re: Running Example Code
                davsclaus

                What does this file contain?

                /WEB-INF/spring/jms-context.xml

                • 5. Re: Running Example Code
                  pat.flanigan

                  Here is the file.