[jira] Created: (AMQ-841) NullPointerException when using MasterConnector and specifying the broker name with space in it.

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

[jira] Created: (AMQ-841) NullPointerException when using MasterConnector and specifying the broker name with space in it.

JIRA jira@apache.org
NullPointerException when using MasterConnector and specifying the broker name with space in it.
------------------------------------------------------------------------------------------------

                 Key: AMQ-841
                 URL: https://issues.apache.org/activemq/browse/AMQ-841
             Project: ActiveMQ
          Issue Type: Bug
          Components: Broker
    Affects Versions: 4.0.1
         Environment: Linux, jdk1.5.0_06
            Reporter: Richard Wafer
            Priority: Minor


I've got a hard time trying to figure out why I got a null pointer trying to use the Master/slave configuration for ActiveMQ.

Finnally by looking at the code I've saw the following:
In BrokerService.java
public void initializeMasterConnector(URI remoteURI) throws Exception {
...
URI localURI = getVmConnectorURI();
...
}

public URI getVmConnectorURI() {
        if (vmConnectorURI == null) {
            try {
                vmConnectorURI = new URI("vm://" + getBrokerName());
            }
            catch (URISyntaxException e) {
            }
        }
        return vmConnectorURI;
}

My problem is that I've specified a broker name with space in it  "Slave Broker". So I the new URI() here throw a URISyntaxException that was badly absorb. And this leads to a null pointer at line:159 of TransportFactory.java.
   String scheme = location.getScheme(); when location is null du to the previous exception.

The link between the error and the cause was not clear at the first sigth.

A precondition on the setBrokerName could do the job.

--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://issues.apache.org/activemq/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

       
Reply | Threaded
Open this post in threaded view
|

[jira] Commented: (AMQ-841) NullPointerException when using MasterConnector and specifying the broker name with space in it.

JIRA jira@apache.org
    [ https://issues.apache.org/activemq/browse/AMQ-841?page=comments#action_37531 ]
           
Marlon Santos commented on AMQ-841:
-----------------------------------

Hi,
 
     i had seen that the problem was when the URISyntaxException was catched, there was no actual value given to the vmConnectorURI so it stays null. I can create a patch for this but i dont know which is the best approach, because of some issues.

a) shutdown the broker gracefully and display a warn sign that the broker is shutting down because of invalid brokername
b) trim the starting and ending space, and change spaces in - between the brokername.



> NullPointerException when using MasterConnector and specifying the broker name with space in it.
> ------------------------------------------------------------------------------------------------
>
>                 Key: AMQ-841
>                 URL: https://issues.apache.org/activemq/browse/AMQ-841
>             Project: ActiveMQ
>          Issue Type: Bug
>          Components: Broker
>    Affects Versions: 4.0.1
>         Environment: Linux, jdk1.5.0_06
>            Reporter: Richard Wafer
>            Priority: Minor
>
> I've got a hard time trying to figure out why I got a null pointer trying to use the Master/slave configuration for ActiveMQ.
> Finnally by looking at the code I've saw the following:
> In BrokerService.java
> public void initializeMasterConnector(URI remoteURI) throws Exception {
> ...
> URI localURI = getVmConnectorURI();
> ...
> }
> public URI getVmConnectorURI() {
>         if (vmConnectorURI == null) {
>             try {
>                 vmConnectorURI = new URI("vm://" + getBrokerName());
>             }
>             catch (URISyntaxException e) {
>             }
>         }
>         return vmConnectorURI;
> }
> My problem is that I've specified a broker name with space in it  "Slave Broker". So I the new URI() here throw a URISyntaxException that was badly absorb. And this leads to a null pointer at line:159 of TransportFactory.java.
>    String scheme = location.getScheme(); when location is null du to the previous exception.
> The link between the error and the cause was not clear at the first sigth.
> A precondition on the setBrokerName could do the job.

--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://issues.apache.org/activemq/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

       
Reply | Threaded
Open this post in threaded view
|

[jira] Commented: (AMQ-841) NullPointerException when using MasterConnector and specifying the broker name with space in it.

JIRA jira@apache.org
In reply to this post by JIRA jira@apache.org
    [ https://issues.apache.org/activemq/browse/AMQ-841?page=comments#action_37532 ]
           
Marlon Santos commented on AMQ-841:
-----------------------------------

It also happens with other broker configurations and present in the windows xp os..

> NullPointerException when using MasterConnector and specifying the broker name with space in it.
> ------------------------------------------------------------------------------------------------
>
>                 Key: AMQ-841
>                 URL: https://issues.apache.org/activemq/browse/AMQ-841
>             Project: ActiveMQ
>          Issue Type: Bug
>          Components: Broker
>    Affects Versions: 4.0.1
>         Environment: Linux, jdk1.5.0_06
>            Reporter: Richard Wafer
>            Priority: Minor
>
> I've got a hard time trying to figure out why I got a null pointer trying to use the Master/slave configuration for ActiveMQ.
> Finnally by looking at the code I've saw the following:
> In BrokerService.java
> public void initializeMasterConnector(URI remoteURI) throws Exception {
> ...
> URI localURI = getVmConnectorURI();
> ...
> }
> public URI getVmConnectorURI() {
>         if (vmConnectorURI == null) {
>             try {
>                 vmConnectorURI = new URI("vm://" + getBrokerName());
>             }
>             catch (URISyntaxException e) {
>             }
>         }
>         return vmConnectorURI;
> }
> My problem is that I've specified a broker name with space in it  "Slave Broker". So I the new URI() here throw a URISyntaxException that was badly absorb. And this leads to a null pointer at line:159 of TransportFactory.java.
>    String scheme = location.getScheme(); when location is null du to the previous exception.
> The link between the error and the cause was not clear at the first sigth.
> A precondition on the setBrokerName could do the job.

--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://issues.apache.org/activemq/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

       
Reply | Threaded
Open this post in threaded view
|

[jira] Assigned: (AMQ-841) NullPointerException when using MasterConnector and specifying the broker name with space in it.

JIRA jira@apache.org
In reply to this post by JIRA jira@apache.org
     [ https://issues.apache.org/activemq/browse/AMQ-841?page=all ]

Rob Davies reassigned AMQ-841:
------------------------------

    Assignee: Rob Davies

> NullPointerException when using MasterConnector and specifying the broker name with space in it.
> ------------------------------------------------------------------------------------------------
>
>                 Key: AMQ-841
>                 URL: https://issues.apache.org/activemq/browse/AMQ-841
>             Project: ActiveMQ
>          Issue Type: Bug
>          Components: Broker
>    Affects Versions: 4.0.1
>         Environment: Linux, jdk1.5.0_06
>            Reporter: Richard Wafer
>         Assigned To: Rob Davies
>            Priority: Minor
>
> I've got a hard time trying to figure out why I got a null pointer trying to use the Master/slave configuration for ActiveMQ.
> Finnally by looking at the code I've saw the following:
> In BrokerService.java
> public void initializeMasterConnector(URI remoteURI) throws Exception {
> ...
> URI localURI = getVmConnectorURI();
> ...
> }
> public URI getVmConnectorURI() {
>         if (vmConnectorURI == null) {
>             try {
>                 vmConnectorURI = new URI("vm://" + getBrokerName());
>             }
>             catch (URISyntaxException e) {
>             }
>         }
>         return vmConnectorURI;
> }
> My problem is that I've specified a broker name with space in it  "Slave Broker". So I the new URI() here throw a URISyntaxException that was badly absorb. And this leads to a null pointer at line:159 of TransportFactory.java.
>    String scheme = location.getScheme(); when location is null du to the previous exception.
> The link between the error and the cause was not clear at the first sigth.
> A precondition on the setBrokerName could do the job.

--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://issues.apache.org/activemq/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

       
Reply | Threaded
Open this post in threaded view
|

[jira] Resolved: (AMQ-841) NullPointerException when using MasterConnector and specifying the broker name with space in it.

JIRA jira@apache.org
In reply to this post by JIRA jira@apache.org
     [ https://issues.apache.org/activemq/browse/AMQ-841?page=all ]

Rob Davies resolved AMQ-841.
----------------------------

    Fix Version/s: 4.2.0
       Resolution: Fixed

Fixed in SVN revision 490786

> NullPointerException when using MasterConnector and specifying the broker name with space in it.
> ------------------------------------------------------------------------------------------------
>
>                 Key: AMQ-841
>                 URL: https://issues.apache.org/activemq/browse/AMQ-841
>             Project: ActiveMQ
>          Issue Type: Bug
>          Components: Broker
>    Affects Versions: 4.0.1
>         Environment: Linux, jdk1.5.0_06
>            Reporter: Richard Wafer
>         Assigned To: Rob Davies
>            Priority: Minor
>             Fix For: 4.2.0
>
>
> I've got a hard time trying to figure out why I got a null pointer trying to use the Master/slave configuration for ActiveMQ.
> Finnally by looking at the code I've saw the following:
> In BrokerService.java
> public void initializeMasterConnector(URI remoteURI) throws Exception {
> ...
> URI localURI = getVmConnectorURI();
> ...
> }
> public URI getVmConnectorURI() {
>         if (vmConnectorURI == null) {
>             try {
>                 vmConnectorURI = new URI("vm://" + getBrokerName());
>             }
>             catch (URISyntaxException e) {
>             }
>         }
>         return vmConnectorURI;
> }
> My problem is that I've specified a broker name with space in it  "Slave Broker". So I the new URI() here throw a URISyntaxException that was badly absorb. And this leads to a null pointer at line:159 of TransportFactory.java.
>    String scheme = location.getScheme(); when location is null du to the previous exception.
> The link between the error and the cause was not clear at the first sigth.
> A precondition on the setBrokerName could do the job.

--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://issues.apache.org/activemq/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira