You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by archaeopteryx <ad...@gmail.com> on 2006/08/12 11:46:28 UTC

whitespace in directory for broker config file

Hi,

I'm running an application that makes use of ActiveMQ. The transport is
configured like that:

<initialContext>
  <property name="java.naming.provider.url"
value="vm://DaisyJMS?brokerConfig=xbean:file:c:/my_folder/activemq-conf.xml"/>          
  <property name="..." value="..."/>
</initialContext>

Everything works fine.

However, as soon as the file activemq-conf.xml is located in a directory
that contains spaces, this fails: <property name="java.naming.provider.url"
value="vm://DaisyJMS?brokerConfig=xbean:file:c:/my%20folder/activemq-conf.xml"/>          
  <property name="..." value="..."/>

I read in the configuraton that you have to be careful about whitespace,
since URI configurations are based on the java.net.URI class.
Is there any workaround for that? Or how else can I overcome that problem
(other than to not use a directory which contains spaces)?

Thanks in advance for any hint.

Andreas

PS. The stack strace:

Exception: javax.jms.JMSException
Message: Could not connect to broker URL:
vm://DaisyJMS?brokerConfig=xbean:file:c:/my%20folder/activemq-conf.xml.
Reason: java.net.URISyntaxException: Illegal character in query at index 38:
DaisyJMS?brokerConfig=xbean:file:c:/my folder/activemq-conf.xml
---- cause
---------------------------------------------------------------------
Exception: java.net.URISyntaxException
Message: Illegal character in query at index 38:
DaisyJMS?brokerConfig=xbean:file:c:/my folder/activemq-conf.xml
---- stack trace
---------------------------------------------------------------
java.net.URISyntaxException: Illegal character in query at index 38:
DaisyJMS?brokerConfig=xbean:file:c:/my folder/activemq-conf.xml
java.net.URI$Parser.fail(URI.java:2809)
java.net.URI$Parser.checkChars(URI.java:2982)
java.net.URI$Parser.parseHierarchical(URI.java:3072)
java.net.URI$Parser.parse(URI.java:3024)
java.net.URI.<init>(URI.java:578)
org.apache.activemq.util.URISupport.parseComposite(URISupport.java:185)
org.apache.activemq.util.URISupport.parseComposite(URISupport.java:143)
org.apache.activemq.transport.vm.VMTransportFactory.doCompositeConnect(VMTransportFactory.java:55)
org.apache.activemq.transport.vm.VMTransportFactory.doConnect(VMTransportFactory.java:48)
org.apache.activemq.transport.TransportFactory.doConnect(TransportFactory.java:42)
org.apache.activemq.transport.TransportFactory.connect(TransportFactory.java:76)
org.apache.activemq.ActiveMQConnectionFactory.createActiveMQConnection(ActiveMQConnectionFactory.java:224)
org.apache.activemq.ActiveMQConnectionFactory.createConnection(ActiveMQConnectionFactory.java:166)
org.outerj.daisy.jms.impl.JmsClientImpl.initializeJmsConnection(JmsClientImpl.java:141)
org.outerj.daisy.jms.impl.JmsClientImpl.initialize(JmsClientImpl.java:130)
...
java.lang.Thread.run(Thread.java:595)

-- 
View this message in context: http://www.nabble.com/whitespace-in-directory-for-broker-config-file-tf2094676.html#a5774209
Sent from the ActiveMQ - User forum at Nabble.com.


Re: whitespace in directory for broker config file

Posted by archaeopteryx <ad...@gmail.com>.
If someone searches the archives:
I just came across the solution to allowing whitespace in a file URL:

You have to triple encode the space, like that:

<property name="java.naming.provider.url"
value="vm://DaisyJMS?brokerConfig=xbean:file:c:/my%252520folder/activemq-conf.xml"/>          

See also the following thread:
http://lists.cocoondev.org/pipermail/daisy/2006-August/004838.html

Regards
--
Andreas

---------------
<initialContext>
  <property name="java.naming.provider.url"
value="vm://DaisyJMS?brokerConfig=xbean:file:c:/my_folder/activemq-conf.xml"/>          
  <property name="..." value="..."/>
</initialContext>

Everything works fine.

However, as soon as the file activemq-conf.xml is located in a directory
that contains spaces, this fails: <property name="java.naming.provider.url"
value="vm://DaisyJMS?brokerConfig=xbean:file:c:/my%20folder/activemq-conf.xml"/>          
  <property name="..." value="..."/>

I read in the configuraton that you have to be careful about whitespace,
since URI configurations are based on the java.net.URI class.
Is there any workaround for that? Or how else can I overcome that problem
(other than to not use a directory which contains spaces)?

Thanks in advance for any hint.

Andreas
-- 
View this message in context: http://www.nabble.com/whitespace-in-directory-for-broker-config-file-tf2094676.html#a5896258
Sent from the ActiveMQ - User forum at Nabble.com.