7 Replies Latest reply on Apr 19, 2013 7:35 AM by johnwasmat

    Hornetq-Configuration.xml No protocol exception.

    johnwasmat

      Hello,

       

      I`m having problems deploying my .war file in jboss . Following is my hornetqq-configuration.xml file. I`m struggling with this for a week and fnally decided to start a discussion to see if I`m missing anything.

       

      <configuration xmlns="urn:hornetq"

                     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

                     xsi:schemaLocation="urn:hornetq /schema/hornetq-configuration.xsd">

       

          <persistence-enabled>false</persistence-enabled>

          <!-- Connectors -->

       

          <connectors>

              <connector name="in-vm">

                  <factory-class>org.hornetq.core.remoting.impl.invm.InVMConnectorFactory</factory-class>

              </connector>

              <connector name="netty-connector">

                        <factory-class>org.hornetq.core.remoting.impl.netty.NettyConnectorFactory</factory-class>

              <param key="host" value="${jboss.bind.address:localhost}" />

                 <param key="port" value="${hornetq.remoting.netty.port:5445}" />

              </connector>

          </connectors>

       

          <acceptors>

              <acceptor name="in-vm">

                  <factory-class>org.hornetq.core.remoting.impl.invm.InVMAcceptorFactory</factory-class>

              </acceptor>

              <acceptor name="netty-acceptor">

                 <factory-class>org.hornetq.core.remoting.impl.netty.NettyAcceptorFactory</factory-class>

                             <param key="host" value="${jboss.bind.address:localhost}" />

                 <param key="port" value="${hornetq.remoting.netty.port:5445}" />                

              </acceptor>

          </acceptors>

       

          <!-- Other config -->

          <queues>  

            <queue name="jms.queue.jmsFormTest">

               <address>jms.queue.jmsFormTest</address>

            </queue>

        </queues>

       

          <security-settings>

              <!--security for example queue-->

              <security-setting match="#">

                  <permission type="createDurableQueue" roles="guest"/>

                  <permission type="deleteDurableQueue" roles="guest"/>

                  <permission type="createNonDurableQueue" roles="guest"/>

                  <permission type="deleteNonDurableQueue" roles="guest"/>

                  <permission type="consume" roles="guest"/>

                  <permission type="send" roles="guest"/>

              </security-setting>

          </security-settings>

       

      </configuration>

       

      and following is the error I`m getting

       

      22:54:01,492 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[default-host].[/testwebproj]] (MSC service thread 1-4) Exception sending context initialized event to listener instance of class org.hornetq.rest.integration.HornetqBootstrapListener: java.lang.RuntimeException: java.net.MalformedURLException: no protocol: hornetq-configuration.xml

                at org.hornetq.rest.integration.HornetqBootstrapListener.contextInitialized(HornetqBootstrapListener.java:28) [hornetq-rest-2.3.0.Alpha.jar:]

                at org.apache.catalina.core.StandardContext.contextListenerStart(StandardContext.java:3392) [jbossweb-7.0.13.Final.jar:]

                at org.apache.catalina.core.StandardContext.start(StandardContext.java:3850) [jbossweb-7.0.13.Final.jar:]

                at org.jboss.as.web.deployment.WebDeploymentService.start(WebDeploymentService.java:90) [jboss-as-web-7.1.1.Final.jar:7.1.1.Final]

                at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811)

                at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746)

                at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [rt.jar:1.7.0_17]

                at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [rt.jar:1.7.0_17]

                at java.lang.Thread.run(Thread.java:722) [rt.jar:1.7.0_17]

      Caused by: java.net.MalformedURLException: no protocol: hornetq-configuration.xml

                at java.net.URL.<init>(URL.java:585) [rt.jar:1.7.0_17]

                at java.net.URL.<init>(URL.java:482) [rt.jar:1.7.0_17]

                at java.net.URL.<init>(URL.java:431) [rt.jar:1.7.0_17]

                at org.hornetq.core.config.impl.FileConfiguration.start(FileConfiguration.java:67) [hornetq-core-2.2.13.Final.jar:]

                at org.hornetq.core.server.embedded.EmbeddedHornetQ.initStart(EmbeddedHornetQ.java:86) [hornetq-core-2.2.13.Final.jar:]

                at org.hornetq.jms.server.embedded.EmbeddedJMS.start(EmbeddedJMS.java:88) [hornetq-jms-2.2.13.Final.jar:]

                at org.hornetq.rest.integration.HornetqBootstrapListener.contextInitialized(HornetqBootstrapListener.java:24) [hornetq-rest-2.3.0.Alpha.jar:]

                ... 8 more

       

       

      22:54:01,671 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[default-host].[/testwebproj]] (MSC service thread 1-4) Exception sending context initialized event to listener instance of class org.hornetq.rest.integration.RestMessagingBootstrapListener: java.lang.RuntimeException: HornetQException[errorCode=2 message=Cannot connect to server(s). Tried with all available servers.]

                at org.hornetq.rest.integration.RestMessagingBootstrapListener.contextInitialized(RestMessagingBootstrapListener.java:40) [hornetq-rest-2.3.0.Alpha.jar:]

                at org.apache.catalina.core.StandardContext.contextListenerStart(StandardContext.java:3392) [jbossweb-7.0.13.Final.jar:]

                at org.apache.catalina.core.StandardContext.start(StandardContext.java:3850) [jbossweb-7.0.13.Final.jar:]

                at org.jboss.as.web.deployment.WebDeploymentService.start(WebDeploymentService.java:90) [jboss-as-web-7.1.1.Final.jar:7.1.1.Final]

                at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811)

                at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746)

                at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [rt.jar:1.7.0_17]

                at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [rt.jar:1.7.0_17]

                at java.lang.Thread.run(Thread.java:722) [rt.jar:1.7.0_17]

      Caused by: HornetQException[errorCode=2 message=Cannot connect to server(s). Tried with all available servers.]

                at org.hornetq.core.client.impl.ServerLocatorImpl.createSessionFactory(ServerLocatorImpl.java:769) [hornetq-core-2.2.13.Final.jar:]

                at org.hornetq.rest.MessageServiceManager.start(MessageServiceManager.java:153) [hornetq-rest-2.3.0.Alpha.jar:]

                at org.hornetq.rest.integration.RestMessagingBootstrapListener.contextInitialized(RestMessagingBootstrapListener.java:34) [hornetq-rest-2.3.0.Alpha.jar:]

                ... 8 more

       

       

      22:54:01,723 ERROR [org.apache.catalina.core.StandardContext] (MSC service thread 1-4) Error listenerStart

      22:54:01,723 ERROR [org.apache.catalina.core.StandardContext] (MSC service thread 1-4) Context [/testwebproj] startup failed due to previous errors

      22:54:01,740 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[default-host].[/testwebproj]] (MSC service thread 1-4) Exception sending context destroyed event to listener instance of class org.hornetq.rest.integration.HornetqBootstrapListener: java.lang.RuntimeException: java.lang.NullPointerException

                at org.hornetq.rest.integration.HornetqBootstrapListener.contextDestroyed(HornetqBootstrapListener.java:40) [hornetq-rest-2.3.0.Alpha.jar:]

                at org.apache.catalina.core.StandardContext.listenerStop(StandardContext.java:3489) [jbossweb-7.0.13.Final.jar:]

                at org.apache.catalina.core.StandardContext.stop(StandardContext.java:3999) [jbossweb-7.0.13.Final.jar:]

                at org.apache.catalina.core.StandardContext.start(StandardContext.java:3917) [jbossweb-7.0.13.Final.jar:]

                at org.jboss.as.web.deployment.WebDeploymentService.start(WebDeploymentService.java:90) [jboss-as-web-7.1.1.Final.jar:7.1.1.Final]

                at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811)

                at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746)

                at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [rt.jar:1.7.0_17]

                at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [rt.jar:1.7.0_17]

                at java.lang.Thread.run(Thread.java:722) [rt.jar:1.7.0_17]

      Caused by: java.lang.NullPointerException

                at org.hornetq.jms.server.embedded.EmbeddedJMS.stop(EmbeddedJMS.java:107) [hornetq-jms-2.2.13.Final.jar:]

                at org.hornetq.rest.integration.HornetqBootstrapListener.contextDestroyed(HornetqBootstrapListener.java:36) [hornetq-rest-2.3.0.Alpha.jar:]

                ... 9 more

       

       

      22:54:01,752 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-4) MSC00001: Failed to start service jboss.web.deployment.default-host./testwebproj: org.jboss.msc.service.StartException in service jboss.web.deployment.default-host./testwebproj: JBAS018040: Failed to start context

                at org.jboss.as.web.deployment.WebDeploymentService.start(WebDeploymentService.java:95)

                at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]

                at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]

                at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [rt.jar:1.7.0_17]

                at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [rt.jar:1.7.0_17]

                at java.lang.Thread.run(Thread.java:722) [rt.jar:1.7.0_17]


        • 1. Re: Hornetq-Configuration.xml No protocol exception.
          jagadish.chandra

          Could you please tell which version of HornetQ and JBoss you are using? 

          • 2. Re: Hornetq-Configuration.xml No protocol exception.
            jaikiran

            I'm not sure AS7 allows configuring all those details via hornetq-configuration.xml. Have you checked the messaging subsystem in your standalone/domain configuration file?

            • 3. Re: Hornetq-Configuration.xml No protocol exception.
              jmesnil

              From your logs, it looks you are using the HornetQ REST API with HornetQ server embedded in your Web app. Is that correct?

               

              What's the layout of your web app? Did you put the hornetq-configuration.xml file in the WEB-INF/classes directory?

              • 4. Re: Hornetq-Configuration.xml No protocol exception.
                johnwasmat

                Hey Jagadish,

                 

                Thank you for your reply. I`m using JBoss AS 7.1.1. I think AS 7 has inbuilt hornetq. I`m not sure if the versions hornetq-core and hornetq-rest jars are a problem,

                • 5. Re: Hornetq-Configuration.xml No protocol exception.
                  johnwasmat

                  Hey jaikiran,

                   

                  I have checked standalone-full.xml file and the connectors and acceptors are in there. Should I get rid of the hornetq-configuration.xml file and try deplyoing the war again? Thanks.

                  • 6. Re: Hornetq-Configuration.xml No protocol exception.
                    johnwasmat

                    Hey Jeff,

                     

                    yes I`m using HornetQ Rest API with HornetQ server embedded in my Web app. I hornetq-configuratoin.xml hornetq-users.xml, hornetq-jms.xml and hornetq-rest.xml placed in the WEB_INF/classes directory. Thank you for your reply.

                    • 7. Re: Hornetq-Configuration.xml No protocol exception.
                      johnwasmat

                      Alright for those in a similar situation I figured it out. I removed the HornetQBootStrapper listener from hornetq-configuration.xml and all possible hornetq jars from the war file to be deployed. Also in the web.xml file of the war file, the following section should not be containing any hornetq dependenices. Good Luck!!

                       

                      <plugin>

                                                              <groupId>org.apache.maven.plugins</groupId>

                                                              <artifactId>maven-war-plugin</artifactId>

                                                              <version>${version.maven.war.plugin}</version>

                        <configuration>

                                                                  <webXml>WebContent\WEB-INF\web.xml</webXml>

                                                                  <archive>

                        <manifestEntries>

                                                                                            <!-- 

                                                                                            <Dependencies>org.hornetq, org.jboss.netty</Dependencies>

                                                                                            -->

                        <Dependencies>org.jboss.netty</Dependencies>

                        </manifestEntries>

                        </archive>

                        </configuration>

                        </plugin>

                       

                      Good Luck!!