activemq-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jeff Mesnil (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (ARTEMIS-212) Unable to parse IPv6 address
Date Thu, 27 Aug 2015 08:47:46 GMT

    [ https://issues.apache.org/jira/browse/ARTEMIS-212?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14716295#comment-14716295
] 

Jeff Mesnil commented on ARTEMIS-212:
-------------------------------------

this test fails:

{noformat}
   @Test
   public void testFoo() throws Exception {
      Map<String,Object> params = new HashMap<>();
      params.put("host", "fe80::baf6:b1ff:fe12:daf7%en0");
      params.put("port", 5445);
      TransportConfiguration transport = new TransportConfiguration(NettyConnectorFactory.class.getName(),
params);
      ActiveMQConnectionFactory factory = ActiveMQJMSClient.createConnectionFactoryWithoutHA(JMSFactoryType.CF,
transport);

      ByteArrayOutputStream baos = new ByteArrayOutputStream();
      ObjectOutputStream outStream = new ObjectOutputStream(baos);
      outStream.writeObject(factory);
      outStream.close();
      baos.close();
      ByteArrayInputStream bais = new ByteArrayInputStream(baos.toByteArray());
      ObjectInputStream in = new ObjectInputStream(bais);
      factory = (ActiveMQConnectionFactory) in.readObject();
      System.out.println("factory = " + factory);
      in.close();
      bais.close();
   }
{noformat}

If instead, the host value is enclosed in square bracket, it works.

However square brackets are required only when Artemis use it to build its URI. The correct
fix should be to detect whether the host string corresponds to a IPv6 address and encloses
it in square brackets to build its URI.


> Unable to parse IPv6 address
> ----------------------------
>
>                 Key: ARTEMIS-212
>                 URL: https://issues.apache.org/jira/browse/ARTEMIS-212
>             Project: ActiveMQ Artemis
>          Issue Type: Bug
>    Affects Versions: 1.0.0
>            Reporter: Jeff Mesnil
>            Assignee: Justin Bertram
>
> In our test suite, we have tests failing when using IPv6:
> {noformat}
> Caused by: java.io.InvalidObjectException: URLDecoder: Illegal hex characters in escape
(%) pattern - For input string: "et"
> at org.apache.activemq.artemis.jms.client.ActiveMQConnectionFactory.readExternal(ActiveMQConnectionFactory.java:117)
> at org.jboss.marshalling.river.RiverUnmarshaller.doReadNewObject(RiverUnmarshaller.java:1308)
> at org.jboss.marshalling.river.RiverUnmarshaller.doReadObject(RiverUnmarshaller.java:276)
> at org.jboss.marshalling.river.RiverUnmarshaller.doReadObject(RiverUnmarshaller.java:209)
> at org.jboss.marshalling.AbstractObjectInput.readObject(AbstractObjectInput.java:41)
> at org.jboss.naming.remote.protocol.v1.Protocol$1$3.read(Protocol.java:156)
> at org.jboss.naming.remote.protocol.v1.Protocol$1$3.read(Protocol.java:149)
> at org.jboss.naming.remote.protocol.v1.BaseProtocolCommand.readResult(BaseProtocolCommand.java:59)
> at org.jboss.naming.remote.protocol.v1.Protocol$1.handleClientMessage(Protocol.java:149)
> at org.jboss.naming.remote.protocol.v1.RemoteNamingStoreV1$MessageReceiver$1.run(RemoteNamingStoreV1.java:232)
> at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
> at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
> at java.lang.Thread.run(Thread.java:745)
> {noformat}
> This issue can be reproduced by using URLDecoder to decode an URL with IPv6 address such
as "http://[fe80::baf6:b1ff:fe12:daf7%en0]:80?foo=bar&baz=blah"



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message