You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@activemq.apache.org by "Justin Bertram (JIRA)" <ji...@apache.org> on 2015/08/26 23:40:46 UTC

[jira] [Comment Edited] (ARTEMIS-212) Unable to parse IPv6 address

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

Justin Bertram edited comment on ARTEMIS-212 at 8/26/15 9:40 PM:
-----------------------------------------------------------------

Maybe I'm thick, but I can't reproduce this.  Here's the quick unit test I wrote:

{code}
      ConnectionFactoryParser parser = new ConnectionFactoryParser();
      ActiveMQConnectionFactory factory = parser.newObject(new URI("tcp://[fe80::baf6:b1ff:fe12:daf7%en0]:80?foo=bar&baz=blah"), null);
      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();
      in.close();
      bais.close();
{code}

If I try to use "http://[fe80::baf6:b1ff:fe12:daf7%en0]:80?foo=bar&baz=blah" as the URI string then I get {{java.lang.NullPointerException: Schema http not found}}.

Any thoughts on how I can reproduce this in a unit test?


was (Author: jbertram):
Maybe I'm thick, but I can't reproduce this.  Here's the quick unit test I wrote:

{code}
      ActiveMQConnectionFactory factory = parser.newObject(new URI("tcp://[fe80::baf6:b1ff:fe12:daf7%en0]:80?foo=bar&baz=blah"), null);
      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();
      in.close();
      bais.close();
{code}

If I try to use "http://[fe80::baf6:b1ff:fe12:daf7%en0]:80?foo=bar&baz=blah" as the URI string then I get {{java.lang.NullPointerException: Schema http not found}}.

Any thoughts on how I can reproduce this in a unit test?

> 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)