Ah - the NPE is because Proton sends stuff without waiting for a reply, and
the Java Broker is not ignoring data that has been sent after it has
already decided to close the connection (because the vhost doesn't exist).

Your underlying problem is the vhost one, when I send without the vhost
"localhost" being set up I see:

./send -a amqp://guest:guest@localhost/amq.fanout

CONNECTION ERROR (amqp:not-found) Unknown hostname localhost

And then the NPE in the broker logs.  The broker error can be ignored,
though I'll raise a JIRA to fix the underlying issue.


-- Rob


On 26 August 2014 10:50, Rob Godfrey <rob.j.godf...@gmail.com> wrote:

> So, I ran last night with a virtualhost called localhost and the address
> amqp://guest:guest@localhost:5672/amq.fanout and it worked fine...  (I
> also got it working with SSL - I think my mistake previously was forgetting
> that messenger would try to connect to port 5671 for amqps)
>
> Unfortunately that line in Session_1_0 is a horrible compound statement
>
>                 linkRegistry =
> getVirtualHost().getLinkRegistry(endpoint.getSession().getConnection().getRemoteContainerId());
>
> so it's a little hard to guess which particular thing is null - but it's
> probably the virtual host.
>
> I would suggest creating a virtualhost called localhost (or just editing
> your config file to replace default with localhost if you like).
>
> For the next release I'm looking to add aliasing to virtualhosts to make
> this a little easier, and have the default virtual host initially also have
> aliases of "localhost", "127.0.0.1", etc
>
> -- Rob
>
>
>
>
>
> On 26 August 2014 10:27, Fraser Adams <fraser.ad...@blueyonder.co.uk>
> wrote:
>
>> Hey Rob,
>> Thanks for the responses, some more info. I added: "secureOnlyMechanisms"
>> : [],
>>
>> so my password file authentication provider section looks like this:
>>
>>
>>   "authenticationproviders" : [ {
>>     "id" : "cf7bd327-ec0f-4917-bd27-d033e49a23fb",
>>
>>     "name" : "passwordFile",
>>     "secureOnlyMechanisms" : [],
>>     "path" : "${qpid.home_dir}/etc/passwd",
>>     "preferencesproviders" : [ {
>>       "id" : "50b2fd82-d002-462d-9e65-4230328b8b63",
>>
>>       "name" : "fileSystemPreferences",
>>       "path" : "${qpid.work_dir}/user.preferences.json",
>>       "type" : "FileSystemPreferences"
>>     } ],
>>     "type" : "PlainPasswordFile"
>>   } ],
>>
>>
>> I tried again with:
>> ./send -a amqp://guest:guest@localhost:5672/amq.fanout
>>
>> and the error is now saying:
>> CONNECTION ERROR (amqp:not-found) Unknown hostname localhost (which
>> probably points to your virtualhost comment), however when I did that the
>> Broker errored with an NPE:
>>
>>
>>
>>
>> 00 53 12 d0 00 00 00 5f 00 00 00 0a a1 0a 73 65 6e
>> 64 65 72 2d 78 78 78 52 00 42 50 02 50 00 00 53 28
>> d0 00 00 00 1c 00 00 00 0b a1 0a 61 6d 71 2e 66 61
>> 6e 6f 75 74 52 00 40 52 00 42 40 40 40 40 40 40 00
>> 53 29 d0 00 00 00 18 00 00 00 07 a1 0a 61 6d 71 2e
>> 66 61 6e 6f 75 74 52 00 40 52 00 42 40 40 40 40 52
>> 00
>> java.lang.NullPointerException
>>     at org.apache.qpid.server.protocol.v1_0.Session_1_0.
>> remoteLinkCreation(Session_1_0.java:134)
>>     at org.apache.qpid.server.protocol.v1_0.Connection_1_0$
>> 2$1.run(Connection_1_0.java:172)
>>     at java.security.AccessController.doPrivileged(Native Method)
>>     at javax.security.auth.Subject.doAs(Subject.java:356)
>>     at org.apache.qpid.server.protocol.v1_0.Connection_1_0$
>> 2.remoteLinkCreation(Connection_1_0.java:167)
>>     at org.apache.qpid.amqp_1_0.transport.SessionEndpoint.
>> receiveAttach(SessionEndpoint.java:300)
>>     at org.apache.qpid.amqp_1_0.transport.ConnectionEndpoint.
>> receiveAttach(ConnectionEndpoint.java:633)
>>     at org.apache.qpid.amqp_1_0.type.transport.Attach.invoke(
>> Attach.java:352)
>>     at org.apache.qpid.amqp_1_0.transport.ConnectionEndpoint.
>> receive(ConnectionEndpoint.java:802)
>>     at org.apache.qpid.amqp_1_0.framing.FrameHandler.parse(
>> FrameHandler.java:242)
>>     at org.apache.qpid.amqp_1_0.framing.AMQPProtocolHeaderHandler.parse(
>> AMQPProtocolHeaderHandler.java:72)
>>     at org.apache.qpid.amqp_1_0.codec.ProtocolHeaderHandler.
>> parse(ProtocolHeaderHandler.java:107)
>>     at org.apache.qpid.server.protocol.v1_0.ProtocolEngine_
>> 1_0_0_SASL$4.run(ProtocolEngine_1_0_0_SASL.java:383)
>>     at org.apache.qpid.server.protocol.v1_0.ProtocolEngine_
>> 1_0_0_SASL$4.run(ProtocolEngine_1_0_0_SASL.java:379)
>>     at java.security.AccessController.doPrivileged(Native Method)
>>     at javax.security.auth.Subject.doAs(Subject.java:356)
>>     at org.apache.qpid.server.protocol.v1_0.ProtocolEngine_
>> 1_0_0_SASL.received(ProtocolEngine_1_0_0_SASL.java:378)
>>     at org.apache.qpid.server.protocol.v1_0.ProtocolEngine_
>> 1_0_0_SASL.received(ProtocolEngine_1_0_0_SASL.java:65)
>>     at org.apache.qpid.server.protocol.MultiVersionProtocolEngine.
>> received(MultiVersionProtocolEngine.java:133)
>>     at org.apache.qpid.server.protocol.MultiVersionProtocolEngine.
>> received(MultiVersionProtocolEngine.java:49)
>>     at org.apache.qpid.transport.network.io.IoReceiver.run(
>> IoReceiver.java:161)
>>     at java.lang.Thread.run(Thread.java:722)
>>
>>
>>
>> following up on the virtualhost train of thought I tried:
>>
>> ./send -a amqp://guest:guest@/localhost:5672/amq.fanout
>>
>> and
>>
>> ./send -a amqp://guest:guest@default/localhost:5672/amq.fanout
>>
>>
>> My default virtual host is default:
>>
>>   "defaultVirtualHost" : "default",
>>
>> .....
>> and
>>
>>   "virtualhostnodes" : [ {
>>     "context" : {
>>       "virtualhostBlueprint" : "{ \"type\" : \"DERBY\", \"storePath\" :
>> \"${qpid.work_dir}/default/messages\" }",
>>       "virtualhostBlueprintUtilised" : "true"
>>     },
>>     "createdBy" : null,
>>     "createdTime" : 0,
>>     "id" : "13fe911a-2dbb-493e-b652-d3b70013e8d9",
>>     "lastUpdatedBy" : null,
>>     "lastUpdatedTime" : 1404484979134,
>>     "name" : "default",
>>     "storePath" : "${qpid.work_dir}/default/config",
>>     "type" : "JSON"
>>   } ]
>>
>>
>>
>> Has this stuff changed recently, clearly the disabling plain
>> authentication has, but not so sure about any virtual host stuff. I really
>> am pretty sure that I tried the basic
>> ./send -a amqp://guest:guest@localhost:5672/amq.fanout
>>
>> a couple of months ago and it worked fine???
>>
>> Frase
>>
>>
>>
>>
>>
>>
>> On 25/08/14 20:22, Rob Godfrey wrote:
>>
>>> OK - there's that issue... and then there is an authentication problem.
>>>   Namely that on trunk the Java Broker does not offer PLAIN
>>> authentication
>>> over non-SSL ports by default.  It offers CRAM-MD5, SCRAM-SHA1 and
>>> SCRAM-SHA256... but I'm presuming the messenger client doesn't yet
>>> implement any of these.
>>>
>>> Connecting over SSL should work... but I wan't having any success with
>>> that
>>> either - which warrants investigation.
>>>
>>> However, to reenable PLAIN authentication on non-secure connections add
>>> the
>>> attribute/value pair
>>>
>>>   "secureOnlyMechanisms" : [],
>>>
>>> into the configuration for you authentication provider in your
>>> config.json.
>>>
>>> As an example, my password file authentication provider section looks
>>> like
>>> this:
>>>
>>> {
>>>
>>>      "id" : "ef78d9a3-7011-459f-8a53-2e91d3bf30da",
>>>
>>>      "name" : "passwordFile",
>>>
>>>      "secureOnlyMechanisms" : [],
>>>
>>>      "path" : "${qpid.home_dir}/etc/passwd",
>>>
>>>      "type" : "PlainPasswordFile",
>>>
>>>      "preferencesproviders" : [ {
>>>
>>>        "id" : "db265e14-c9d2-4fca-8f77-ae4c2bcf9203",
>>>
>>>        "name" : "fileSystemPreferences",
>>>
>>>        "path" : "${qpid.work_dir}/user.preferences.json",
>>>
>>>        "type" : "FileSystemPreferences"
>>>
>>>      }
>>>
>>>
>>> -- Rob
>>>
>>>
>>> On 25 August 2014 20:47, Rob Godfrey <rob.j.godf...@gmail.com> wrote:
>>>
>>>  Hi Fraser,
>>>>
>>>> the 1-0 support is on by default... The issue may be related to virtual
>>>> hosts...  IIRC proton is telling the broker that the host it wants to
>>>> open
>>>> is "localhost" so if you don't have a localhost virtualhost inside the
>>>> broker then it may fail...  The error could obviously do with some work,
>>>> whatever the cause.
>>>>
>>>> I'll try to fire up a fresh broker and clean proton install and see
>>>> what I
>>>> can see,
>>>>
>>>> Cheers,
>>>> Rob
>>>>
>>>>
>>>> On 25 August 2014 18:37, Fraser Adams <fraser.ad...@blueyonder.co.uk>
>>>> wrote:
>>>>
>>>>  Hello,
>>>>> I've just tried using proton's send example with the Java Broker:
>>>>>
>>>>> ./send -a amqp://guest:guest@localhost/amq.fanout
>>>>>
>>>>> and I get the helpful response:
>>>>> [0x21ff810]:ERROR[0] (null)
>>>>>
>>>>> [0x21ff810]:ERROR[0] (null)
>>>>>
>>>>> CONNECTION ERROR connection aborted (remote)
>>>>>
>>>>>
>>>>>
>>>>> I'm pretty sure that I've previously had this working with the Java
>>>>> Broker but I can't think what I'm doing wrong. I can't remember if
>>>>> there's
>>>>> something I need to add to the broker config JSON to make it work with
>>>>> AMQP
>>>>> 1.0, if so what's the incantation I need, if not what am I doing wrong
>>>>> with
>>>>> send?
>>>>>
>>>>> Cheers.
>>>>> Frase
>>>>>
>>>>> ---------------------------------------------------------------------
>>>>> To unsubscribe, e-mail: users-unsubscr...@qpid.apache.org
>>>>> For additional commands, e-mail: users-h...@qpid.apache.org
>>>>>
>>>>>
>>>>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscr...@qpid.apache.org
>> For additional commands, e-mail: users-h...@qpid.apache.org
>>
>>
>

Reply via email to