Recent Posts
Archives

Posts Tagged ‘ConfigurationException’

PostHeaderIcon javax.naming.ConfigurationException / java.net.MalformedURLException

Context

I have to send JMS messages on queues on clustered servers: t3://firstServer:1234 and t3://secondServer:5678.

The destination queues are retrieved in Spring, thanks to a property like:
[xml]<property name="providerURL" value="t3://firstServer:1234,t3://secondServer:5678"/>[/xml]

Error:

I receive the following error:

[java]javax.naming.ConfigurationException [Root exception is java.net.MalformedURLException: port expected: t3://firstServer:1234,t3://secondServer:5678][/java]

Explanation and fix:

When you send messages on many queues, you must not repeat the protocol (here: t3://)! Fixing the issue is very simple: you have to remove the second t3:// in Spring property:

[xml]<property name="providerURL" value="t3://firstServer:1234,secondServer:5678"/>[/xml]