activemq-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF subversion and git services (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (ARTEMIS-1456) createQueue(null, ...) is failing, even though documentation says this is valid call
Date Tue, 17 Oct 2017 09:04:00 GMT

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

ASF subversion and git services commented on ARTEMIS-1456:
----------------------------------------------------------

Commit eee72a61d1d14ba7cfaaa417f040f8f7f8c81bc5 in activemq-artemis's branch refs/heads/master
from [~jbertram]
[ https://git-wip-us.apache.org/repos/asf?p=activemq-artemis.git;h=eee72a6 ]

ARTEMIS-1456 use queue name when null address on createQueue


> createQueue(null, ...) is failing, even though documentation says this is valid call
> ------------------------------------------------------------------------------------
>
>                 Key: ARTEMIS-1456
>                 URL: https://issues.apache.org/jira/browse/ARTEMIS-1456
>             Project: ActiveMQ Artemis
>          Issue Type: Bug
>          Components: Broker
>    Affects Versions: 2.4.0
>            Reporter: Jiri Daněk
>            Assignee: Justin Bertram
>
> Documentation at https://activemq.apache.org/artemis/docs/javadocs/javadoc-latest/org/apache/activemq/artemis/api/core/management/ActiveMQServerControl.html#createQueue-java.lang.String-java.lang.String-java.lang.String-
states
> bq. If address is null it will be defaulted to name. 
> I have the following program
> {code}
> public class ManagementServiceImplTest extends ActiveMQTestBase {
>    @Test
>    public void testCreateDurableQueue() throws Exception {
>       String address = RandomUtil.randomString();
>       Configuration config = createBasicConfig().setJMXManagementEnabled(false);
>       ActiveMQServer server = addServer(ActiveMQServers.newActiveMQServer(config, false));
>       server.start();
>       // invoke attribute and operation on the server
>       CoreMessage message = new CoreMessage(1, 100);
>       ManagementHelper.putOperationInvocation(message, ResourceNames.BROKER, "createQueue",
null, address, null, true);
>       Message reply = server.getManagementService().handleMessage(message);
>       System.out.println(reply.toString());
>       Assert.assertTrue(ManagementHelper.hasOperationSucceeded(reply));
>       System.out.println("REZULTZ HERE:");
>       for (Binding binding : server.getPostOffice().getBindingsForAddress(SimpleString.toSimpleString(address)).getBindings())
{
>          System.out.println(binding);
>          System.out.println(((LocalQueueBinding) binding).getQueue().isDurable());
>       }
>    }
> {code}
> If I run it, I get {{AssertionError}} from {{ManagementHelper.hasOperationSucceeded}}.
The cause is the following exception
> {noformat}
> java.lang.reflect.InvocationTargetException
> 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
> 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> 	at java.lang.reflect.Method.invoke(Method.java:498)
> 	at org.apache.activemq.artemis.core.server.management.impl.ManagementServiceImpl.invokeOperation(ManagementServiceImpl.java:748)
> 	at org.apache.activemq.artemis.core.server.management.impl.ManagementServiceImpl.handleMessage(ManagementServiceImpl.java:391)
> 	at org.apache.activemq.artemis.tests.integration.management.ManagementServiceImplTest.testCreateDurableQueue(ManagementServiceImplTest.java:66)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
> 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> 	at java.lang.reflect.Method.invoke(Method.java:498)
> 	at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47)
> 	at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
> 	at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44)
> 	at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
> 	at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26)
> 	at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27)
> 	at org.junit.rules.ExternalResource$1.evaluate(ExternalResource.java:48)
> 	at org.junit.rules.TestWatcher$1.evaluate(TestWatcher.java:55)
> 	at org.junit.rules.ExternalResource$1.evaluate(ExternalResource.java:48)
> 	at org.junit.rules.ExternalResource$1.evaluate(ExternalResource.java:48)
> 	at org.junit.rules.TestWatcher$1.evaluate(TestWatcher.java:55)
> 	at org.junit.rules.RunRules.evaluate(RunRules.java:20)
> 	at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:271)
> 	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:70)
> 	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
> 	at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238)
> 	at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63)
> 	at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236)
> 	at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53)
> 	at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229)
> 	at org.junit.runners.ParentRunner.run(ParentRunner.java:309)
> 	at org.junit.runner.JUnitCore.run(JUnitCore.java:160)
> 	at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:68)
> 	at com.intellij.rt.execution.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:47)
> 	at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:242)
> 	at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:70)
> Caused by: java.lang.NullPointerException
> 	at java.util.concurrent.ConcurrentHashMap.get(ConcurrentHashMap.java:936)
> 	at org.apache.activemq.artemis.core.settings.impl.HierarchicalObjectRepository.getMatch(HierarchicalObjectRepository.java:185)
> 	at org.apache.activemq.artemis.core.management.impl.ActiveMQServerControlImpl.createQueue(ActiveMQServerControlImpl.java:746)
> 	... 37 more
> {noformat}
> Reason for it is the line
> {code}
>       createQueue(address, name, filterStr, durable, server.getAddressSettingsRepository().getMatch(address).getDefaultQueueRoutingType().toString());
> {code}
> because {{getMatch(null)}} throws.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Mime
View raw message