10 Replies Latest reply on Feb 9, 2010 4:04 AM by Andy Taylor

    Slash char is not allowed in queue name?

    Zemian Deng Apprentice

      Hi,

       

      I noticed that if I use '/' char for queue name such as "/queue/Q1" in hornetq-jms.xml file, I'll get a xml parsing error. Why restricting the '/'? Is there a allowed char set to use?

       

      Error example:

       

      [main] 00:37:06,410 SEVERE [org.hornetq.utils.XMLUtil]  Invalid configuration

      org.xml.sax.SAXParseException: cvc-datatype-valid.1.2.1: '/queue/Q1' is not a valid value for 'NCName'.

      ...

       

      -Z

        • 1. Re: Slash char is not allowed in queue name?
          Tim Fox Master
          Can you post an example of your config please?
          • 2. Re: Slash char is not allowed in queue name?
            Zemian Deng Apprentice
            Here is hornetq-jms.xml
            <configuration xmlns="urn:hornetq"
                   xsi:schemaLocation="urn:hornetq /schema/hornetq-jms.xsd">
            <connection-factory name="NettyConnectionFactory">
               <connectors>
                     <connector-ref connector-name="netty"/>
               </connectors>
            <entries>
            <entry name="/ConnectionFactory"/>
            <entry name="/XAConnectionFactory"/>
            </entries>
            </connection-factory>
            <queue name="DLQ">
            <entry name="/queue/DLQ"/>
            </queue>
            <queue name="ExpiryQueue">
            <entry name="/queue/ExpiryQueue"/>
            </queue>
            <queue name="/queue/A">
            <entry name="/queue/A"/>
            </queue>
            </configuration>
            And here is the exception stack when starting up the standalone server:
            [main] 18:21:33,758 SEVERE [org.hornetq.utils.XMLUtil]  Invalid configuration
            org.xml.sax.SAXParseException: cvc-datatype-valid.1.2.1: '/queue/A' is not a valid value for 'NCName'.
                    at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:
            195)
                    at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.error(ErrorHandlerWrapper.java:131)
                    at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:384)
                    at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:318)
                    at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator$XSIErrorReporter.reportError(XMLSchemaValidator
            .java:417)
                    at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.reportSchemaError(XMLSchemaValidator.java:3181)
                    at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.processOneAttribute(XMLSchemaValidator.java:277
            6)
                    at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.processAttributes(XMLSchemaValidator.java:2713)
                    at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.handleStartElement(XMLSchemaValidator.java:2065
            )
                    at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.startElement(XMLSchemaValidator.java:705)
                    at com.sun.org.apache.xerces.internal.jaxp.validation.DOMValidatorHelper.beginNode(DOMValidatorHelper.java:273)
                    at com.sun.org.apache.xerces.internal.jaxp.validation.DOMValidatorHelper.validate(DOMValidatorHelper.java:240)
                    at com.sun.org.apache.xerces.internal.jaxp.validation.DOMValidatorHelper.validate(DOMValidatorHelper.java:186)
                    at com.sun.org.apache.xerces.internal.jaxp.validation.ValidatorImpl.validate(ValidatorImpl.java:104)
                    at javax.xml.validation.Validator.validate(Validator.java:127)
                    at org.hornetq.utils.XMLUtil.validate(XMLUtil.java:490)
                    at org.hornetq.jms.server.impl.JMSServerDeployer.validate(JMSServerDeployer.java:95)
                    at org.hornetq.core.deployers.impl.XmlDeployer.deploy(XmlDeployer.java:155)
                    at org.hornetq.core.deployers.impl.FileDeploymentManager.registerDeployer(FileDeploymentManager.java:131)
                    at org.hornetq.core.deployers.impl.XmlDeployer.start(XmlDeployer.java:210)
                    at org.hornetq.jms.server.impl.JMSServerManagerImpl.activated(JMSServerManagerImpl.java:146)
                    at org.hornetq.core.server.impl.HornetQServerImpl.callActivateCallbacks(HornetQServerImpl.java:936)
                    at org.hornetq.core.server.impl.HornetQServerImpl.initialisePart2(HornetQServerImpl.java:1133)
                    at org.hornetq.core.server.impl.HornetQServerImpl.start(HornetQServerImpl.java:301)
                    at org.hornetq.jms.server.impl.JMSServerManagerImpl.start(JMSServerManagerImpl.java:179)
                    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
                    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                    at java.lang.reflect.Method.invoke(Method.java:597)
                    at org.jboss.reflect.plugins.introspection.ReflectionUtils.invoke(ReflectionUtils.java:59)
                    at org.jboss.reflect.plugins.introspection.ReflectMethodInfoImpl.invoke(ReflectMethodInfoImpl.java:150)
                    at org.jboss.joinpoint.plugins.BasicMethodJoinPoint.dispatch(BasicMethodJoinPoint.java:66)
                    at org.jboss.kernel.plugins.dependency.KernelControllerContextAction$JoinpointDispatchWrapper.execute(KernelCont
            rollerContextAction.java:241)
                    at org.jboss.kernel.plugins.dependency.ExecutionWrapper.execute(ExecutionWrapper.java:47)
                    at org.jboss.kernel.plugins.dependency.KernelControllerContextAction.dispatchExecutionWrapper(KernelControllerCo
            ntextAction.java:109)
                    at org.jboss.kernel.plugins.dependency.KernelControllerContextAction.dispatchJoinPoint(KernelControllerContextAc
            tion.java:70)
                    at org.jboss.kernel.plugins.dependency.LifecycleAction.installActionInternal(LifecycleAction.java:221)
                    at org.jboss.kernel.plugins.dependency.InstallsAwareAction.installAction(InstallsAwareAction.java:54)
                    at org.jboss.kernel.plugins.dependency.InstallsAwareAction.installAction(InstallsAwareAction.java:42)
                    at org.jboss.dependency.plugins.action.SimpleControllerContextAction.simpleInstallAction(SimpleControllerContext
            Action.java:62)
                    at org.jboss.dependency.plugins.action.AccessControllerContextAction.install(AccessControllerContextAction.java:
            71)
                    at org.jboss.dependency.plugins.AbstractControllerContextActions.install(AbstractControllerContextActions.java:5
            1)
                    at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:348)
                    at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:1631)
                    at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:934)
                    at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1082)
                    at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:984)
                    at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:774)
                    at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:540)
                    at org.jboss.kernel.plugins.deployment.AbstractKernelDeployer.deployBean(AbstractKernelDeployer.java:319)
                    at org.jboss.kernel.plugins.deployment.AbstractKernelDeployer.deployBeans(AbstractKernelDeployer.java:297)
                    at org.jboss.kernel.plugins.deployment.AbstractKernelDeployer.deploy(AbstractKernelDeployer.java:130)
                    at org.jboss.kernel.plugins.deployment.xml.BeanXMLDeployer.deploy(BeanXMLDeployer.java:96)
                    at org.hornetq.integration.bootstrap.HornetQBootstrapServer.deploy(HornetQBootstrapServer.java:237)
                    at org.hornetq.integration.bootstrap.HornetQBootstrapServer.deploy(HornetQBootstrapServer.java:207)
                    at org.hornetq.integration.bootstrap.HornetQBootstrapServer.bootstrap(HornetQBootstrapServer.java:156)
                    at org.jboss.kernel.plugins.bootstrap.AbstractBootstrap.run(AbstractBootstrap.java:83)
                    at org.hornetq.integration.bootstrap.HornetQBootstrapServer.run(HornetQBootstrapServer.java:117)
                    at org.hornetq.integration.bootstrap.HornetQBootstrapServer.main(HornetQBootstrapServer.java:73)
            [main] 18:21:33,767 SEVERE [org.hornetq.core.deployers.impl.FileDeploymentManager]  Error deploying file:/C:/apps/hornet
            q-2.0.0.GA/config/stand-alone/non-clustered/hornetq-jms.xml
            java.lang.IllegalStateException: Invalid configuration
                    at org.hornetq.utils.XMLUtil.validate(XMLUtil.java:496)
                    at org.hornetq.jms.server.impl.JMSServerDeployer.validate(JMSServerDeployer.java:95)
                    at org.hornetq.core.deployers.impl.XmlDeployer.deploy(XmlDeployer.java:155)
                    at org.hornetq.core.deployers.impl.FileDeploymentManager.registerDeployer(FileDeploymentManager.java:131)
                    at org.hornetq.core.deployers.impl.XmlDeployer.start(XmlDeployer.java:210)
                    at org.hornetq.jms.server.impl.JMSServerManagerImpl.activated(JMSServerManagerImpl.java:146)
                    at org.hornetq.core.server.impl.HornetQServerImpl.callActivateCallbacks(HornetQServerImpl.java:936)
                    at org.hornetq.core.server.impl.HornetQServerImpl.initialisePart2(HornetQServerImpl.java:1133)
                    at org.hornetq.core.server.impl.HornetQServerImpl.start(HornetQServerImpl.java:301)
                    at org.hornetq.jms.server.impl.JMSServerManagerImpl.start(JMSServerManagerImpl.java:179)
                    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
                    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                    at java.lang.reflect.Method.invoke(Method.java:597)
                    at org.jboss.reflect.plugins.introspection.ReflectionUtils.invoke(ReflectionUtils.java:59)
                    at org.jboss.reflect.plugins.introspection.ReflectMethodInfoImpl.invoke(ReflectMethodInfoImpl.java:150)
                    at org.jboss.joinpoint.plugins.BasicMethodJoinPoint.dispatch(BasicMethodJoinPoint.java:66)
                    at org.jboss.kernel.plugins.dependency.KernelControllerContextAction$JoinpointDispatchWrapper.execute(KernelCont
            rollerContextAction.java:241)
                    at org.jboss.kernel.plugins.dependency.ExecutionWrapper.execute(ExecutionWrapper.java:47)
                    at org.jboss.kernel.plugins.dependency.KernelControllerContextAction.dispatchExecutionWrapper(KernelControllerCo
            ntextAction.java:109)
                    at org.jboss.kernel.plugins.dependency.KernelControllerContextAction.dispatchJoinPoint(KernelControllerContextAc
            tion.java:70)
                    at org.jboss.kernel.plugins.dependency.LifecycleAction.installActionInternal(LifecycleAction.java:221)
                    at org.jboss.kernel.plugins.dependency.InstallsAwareAction.installAction(InstallsAwareAction.java:54)
                    at org.jboss.kernel.plugins.dependency.InstallsAwareAction.installAction(InstallsAwareAction.java:42)
                    at org.jboss.dependency.plugins.action.SimpleControllerContextAction.simpleInstallAction(SimpleControllerContext
            Action.java:62)
                    at org.jboss.dependency.plugins.action.AccessControllerContextAction.install(AccessControllerContextAction.java:
            71)
                    at org.jboss.dependency.plugins.AbstractControllerContextActions.install(AbstractControllerContextActions.java:5
            1)
                    at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:348)
                    at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:1631)
                    at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:934)
                    at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1082)
                    at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:984)
                    at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:774)
                    at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:540)
                    at org.jboss.kernel.plugins.deployment.AbstractKernelDeployer.deployBean(AbstractKernelDeployer.java:319)
                    at org.jboss.kernel.plugins.deployment.AbstractKernelDeployer.deployBeans(AbstractKernelDeployer.java:297)
                    at org.jboss.kernel.plugins.deployment.AbstractKernelDeployer.deploy(AbstractKernelDeployer.java:130)
                    at org.jboss.kernel.plugins.deployment.xml.BeanXMLDeployer.deploy(BeanXMLDeployer.java:96)
                    at org.hornetq.integration.bootstrap.HornetQBootstrapServer.deploy(HornetQBootstrapServer.java:237)
                    at org.hornetq.integration.bootstrap.HornetQBootstrapServer.deploy(HornetQBootstrapServer.java:207)
                    at org.hornetq.integration.bootstrap.HornetQBootstrapServer.bootstrap(HornetQBootstrapServer.java:156)
                    at org.jboss.kernel.plugins.bootstrap.AbstractBootstrap.run(AbstractBootstrap.java:83)
                    at org.hornetq.integration.bootstrap.HornetQBootstrapServer.run(HornetQBootstrapServer.java:117)
                    at org.hornetq.integration.bootstrap.HornetQBootstrapServer.main(HornetQBootstrapServer.java:73)
            Caused by: org.xml.sax.SAXParseException: cvc-datatype-valid.1.2.1: '/queue/A' is not a valid value for 'NCName'.
                    at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:
            195)
                    at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.error(ErrorHandlerWrapper.java:131)
                    at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:384)
                    at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:318)
                    at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator$XSIErrorReporter.reportError(XMLSchemaValidator
            .java:417)
                    at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.reportSchemaError(XMLSchemaValidator.java:3181)
                    at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.processOneAttribute(XMLSchemaValidator.java:277
            6)
                    at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.processAttributes(XMLSchemaValidator.java:2713)
                    at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.handleStartElement(XMLSchemaValidator.java:2065
            )
                    at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.startElement(XMLSchemaValidator.java:705)
                    at com.sun.org.apache.xerces.internal.jaxp.validation.DOMValidatorHelper.beginNode(DOMValidatorHelper.java:273)
                    at com.sun.org.apache.xerces.internal.jaxp.validation.DOMValidatorHelper.validate(DOMValidatorHelper.java:240)
                    at com.sun.org.apache.xerces.internal.jaxp.validation.DOMValidatorHelper.validate(DOMValidatorHelper.java:186)
                    at com.sun.org.apache.xerces.internal.jaxp.validation.ValidatorImpl.validate(ValidatorImpl.java:104)
                    at javax.xml.validation.Validator.validate(Validator.java:127)
                    at org.hornetq.utils.XMLUtil.validate(XMLUtil.java:490)
                    ... 43 more
            [main] 18:21:33,843 INFO [org.hornetq.integration.transports.netty.NettyAcceptor]  Started Netty Acceptor version 3.1.5.
            GA-r1772
            [main] 18:21:33,845 INFO [org.hornetq.core.server.impl.HornetQServerImpl]  HornetQ Server version 2.0.0.GA (Hornet Queen
            , 113) started
            • 3. Re: Slash char is not allowed in queue name?
              Jeff Mesnil Master

              in the config, queue name correspond to a XML ID. '/' is not allowed but you can use '.' instead if you want to have a hierarchical name.

               

              http://www.w3.org/TR/REC-xml-names/#NT-NCName

               

              jeff

              • 4. Re: Slash char is not allowed in queue name?
                Zemian Deng Apprentice

                Hum... why tied the queue name rule same as XML ID?

                 

                One concern area is that this name used correspond to jmsSession.createQueue(name) JMS api call. Now most of JMS server (including JBossMessaging) allow '/' in this name. HornetQ disallowing it will break thing. I understand the JMS API javadoc actually stated it's non-portable, but still will be nice to be smother transition from JBoss Messaging to HornetQ for user.

                • 5. Re: Slash char is not allowed in queue name?
                  Clebert Suconic Master

                  You are probably confusing the QueueName with the JNDI address name which are different things on HornetQ.

                   

                  On JBoss Messaging you would have the queue name automatically extracted from the JNDI name, but we improved things quite a bit on HornetQ, letting more choices to users.

                   

                  On HornetQ you can define the JNDI address using slashes.

                   

                  On your case you would do:

                   

                   

                  <queue name="A">
                   <entry name="/queue/A"/>
                   </queue>
                  

                   

                   

                  A queue could have multiple JNDI entries.

                   

                   

                  You will find more about this on the documentation.

                  • 6. Re: Slash char is not allowed in queue name?
                    Zemian Deng Apprentice

                    Hi Clebert,

                     

                    Yes I am aware the JNDI name setting, and I understand multiple JNDI names can be bind for a queue. But my point is that in Jboss Messaging, I can acess my queue in either jndi.lookup("/queue/A") or jmsSession.createQueue("/queue/A"), while HornetQ failed the latter case because we can't create a queue named "/queue/A". I know this is just a minor issue, but I don't get why have that restriction that's all.

                    • 7. Re: Slash char is not allowed in queue name?
                      Clebert Suconic Master
                      Actually, in JBoss Messaging QueueName = JNDIName. That's different on HornetQ
                      • 8. Re: Slash char is not allowed in queue name?
                        Zemian Deng Apprentice

                        clebert.suconic@jboss.com wrote:

                         

                        Actually, in JBoss Messaging QueueName = JNDIName. That's different on HornetQ

                        Hum... yes, and I thought that's what I've tried to say all along in this thread. Sorry if I mis communicated.

                         

                        The question is QueueName == JNDIName bad? I understand the QueueName in HornetQ has whole other meaning (with auto prefix "jms.queue" behind for addressing etc.) but why can't QueueName in HornetQ continue to use '/'. Why restrict to same as XML ID name, which doesn't make sense to me.

                        • 9. Re: Slash char is not allowed in queue name?
                          Tim Fox Master

                          Although we don't recommend using '/' character in queue names, I do agree with Zemian that it should be supported.

                           

                          However, if you use the '/' character you won't be able to benefit from the topic hierarchy functionality which requires the '.' character to be used.

                           

                          Can someone open a JIRA to fix this?