You're attempting to connect to the port 61616 which is not for REST clients. You need to connect to the embedded HTTP server which, by default, listens on 8081.
Justin ----- Original Message ----- From: "Julien d" <julie...@iki.fi> To: dev@activemq.apache.org Sent: Friday, April 29, 2016 3:19:38 AM Subject: Embedding REST Hello, After trying Justin's example [1]. I cannot get any reply from the embedded REST server. curl -I http://localhost:61616/queues/jms.queue.orders -> the command hangs. And same goes with the REST example then. What could be wrong with the embedded server? Thank you for your patience, I am quite new to ActiveMQ in general and this part is not yet documented to my knowledge. I am currently working on my master thesis in order to have a proof-of-concept of a context aware pub/sub. Regards, Julien [1] https://github.com/jbertram/activemq-artemis/commit/875b8764aabb13794578c8c436b4cdc527502d59 Julien D. Alternative email address : julie...@protonmail.ch On 04/26/2016 09:29 PM, Justin Bertram wrote: > I'm not exactly sure why you're getting that exception. I just created a > simple, Mavenized example demonstrating how to create an embedded REST server > here [1]. Try that out. > > > Justin > > [1] > https://github.com/jbertram/activemq-artemis/commit/875b8764aabb13794578c8c436b4cdc527502d59 > > ----- Original Message ----- > From: "Julien d" <julie...@iki.fi> > To: dev@activemq.apache.org > Sent: Tuesday, April 26, 2016 12:50:17 PM > Subject: Re: Need help with > org.apache.activemq.artemis.rest.integration.EmbeddedRestActiveMQ > > Here it is : > > /usr/lib/jvm/java-8-openjdk/bin/java -Didea.launcher.port=7533 > -Didea.launcher.bin.path=/usr/share/intellij-idea-ultimate-edition/bin > -Dfile.encoding=UTF-8 -classpath > > /usr/lib/jvm/java-8-openjdk/jre/lib/charsets.jar:/usr/lib/jvm/java-8-openjdk/jre/lib/ext/cldrdata.jar:/usr/lib/jvm/java-8-openjdk/jre/lib/ext/dnsns.jar:/usr/lib/jvm/java-8-openjdk/jre/lib/ext/jaccess.jar:/usr/lib/jvm/java-8-openjdk/jre/lib/ext/localedata.jar:/usr/lib/jvm/java-8-openjdk/jre/lib/ext/nashorn.jar:/usr/lib/jvm/java-8-openjdk/jre/lib/ext/sunec.jar:/usr/lib/jvm/java-8-openjdk/jre/lib/ext/sunjce_provider.jar:/usr/lib/jvm/java-8-openjdk/jre/lib/ext/sunpkcs11.jar:/usr/lib/jvm/java-8-openjdk/jre/lib/ext/zipfs.jar:/usr/lib/jvm/java-8-openjdk/jre/lib/jce.jar:/usr/lib/jvm/java-8-openjdk/jre/lib/jsse.jar:/usr/lib/jvm/java-8-openjdk/jre/lib/management-agent.jar:/usr/lib/jvm/java-8-openjdk/jre/lib/resources.jar:/usr/lib/jvm/java-8-openjdk/jre/lib/rt.jar:/home/johnny/IdeaProjects/activemq-artemis-master/artemis-rest/target/classes:/home/johnny/.m2/repository/org/jboss/logging/jboss-logging/3.3.0.Final/jboss-logging-3.3.0.Final.jar:/home/johnny/.m2/repository/org/jboss/resteasy/resteasy-jaxrs/3.0.16.Final/resteasy-jaxrs-3.0.16.Final.jar:/home/johnny/.m2/repository/org/jboss/spec/javax/ws/rs/jboss-jaxrs-api_2.0_spec/1.0.0.Final/jboss-jaxrs-api_2.0_spec-1.0.0.Final.jar:/home/johnny/.m2/repository/org/jboss/spec/javax/annotation/jboss-annotations-api_1.2_spec/1.0.0.Final/jboss-annotations-api_1.2_spec-1.0.0.Final.jar:/home/johnny/.m2/repository/javax/activation/activation/1.1.1/activation-1.1.1.jar:/home/johnny/.m2/repository/org/apache/httpcomponents/httpclient/4.3.6/httpclient-4.3.6.jar:/home/johnny/.m2/repository/org/apache/httpcomponents/httpcore/4.3.3/httpcore-4.3.3.jar:/home/johnny/.m2/repository/commons-logging/commons-logging/1.2/commons-logging-1.2.jar:/home/johnny/.m2/repository/commons-codec/commons-codec/1.6/commons-codec-1.6.jar:/home/johnny/.m2/repository/commons-io/commons-io/2.1/commons-io-2.1.jar:/home/johnny/.m2/repository/net/jcip/jcip-annotations/1.0/jcip-annotations-1.0.jar:/home/johnny/.m2/repository/org/jboss/resteasy/resteasy-jaxb-provider/3.0.16.Final/resteasy-jaxb-provider-3.0.16.Final.jar:/home/johnny/.m2/repository/org/jboss/resteasy/resteasy-jackson-provider/3.0.16.Final/resteasy-jackson-provider-3.0.16.Final.jar:/home/johnny/.m2/repository/org/codehaus/jackson/jackson-core-asl/1.9.12/jackson-core-asl-1.9.12.jar:/home/johnny/.m2/repository/org/codehaus/jackson/jackson-mapper-asl/1.9.12/jackson-mapper-asl-1.9.12.jar:/home/johnny/.m2/repository/org/codehaus/jackson/jackson-jaxrs/1.9.12/jackson-jaxrs-1.9.12.jar:/home/johnny/.m2/repository/org/codehaus/jackson/jackson-xc/1.9.12/jackson-xc-1.9.12.jar:/home/johnny/.m2/repository/org/jboss/resteasy/resteasy-atom-provider/3.0.16.Final/resteasy-atom-provider-3.0.16.Final.jar:/home/johnny/.m2/repository/com/sun/xml/bind/jaxb-impl/2.2.7/jaxb-impl-2.2.7.jar:/home/johnny/.m2/repository/com/sun/xml/bind/jaxb-core/2.2.7/jaxb-core-2.2.7.jar:/home/johnny/.m2/repository/javax/xml/bind/jaxb-api/2.2.7/jaxb-api-2.2.7.jar:/home/johnny/.m2/repository/com/sun/istack/istack-commons-runtime/2.16/istack-commons-runtime-2.16.jar:/home/johnny/.m2/repository/com/sun/xml/fastinfoset/FastInfoset/1.2.12/FastInfoset-1.2.12.jar:/home/johnny/.m2/repository/javax/xml/bind/jsr173_api/1.0/jsr173_api-1.0.jar:/home/johnny/.m2/repository/org/jboss/resteasy/tjws/3.0.16.Final/tjws-3.0.16.Final.jar:/home/johnny/.m2/repository/javax/servlet/servlet-api/2.5/servlet-api-2.5.jar:/home/johnny/.m2/repository/io/netty/netty-all/4.0.32.Final/netty-all-4.0.32.Final.jar:/home/johnny/.m2/repository/org/apache/activemq/artemis-server/1.3.0-SNAPSHOT/artemis-server-1.3.0-20160426.031638-43.jar:/home/johnny/.m2/repository/org/apache/activemq/artemis-commons/1.3.0-SNAPSHOT/artemis-commons-1.3.0-20160426.030416-44.jar:/home/johnny/.m2/repository/commons-beanutils/commons-beanutils/1.9.2/commons-beanutils-1.9.2.jar:/home/johnny/.m2/repository/commons-collections/commons-collections/3.2.2/commons-collections-3.2.2.jar:/home/johnny/.m2/repository/com/google/guava/guava/18.0/guava-18.0.jar:/home/johnny/.m2/repository/org/apache/activemq/artemis-selector/1.3.0-SNAPSHOT/artemis-selector-1.3.0-20160426.030831-44.jar:/home/johnny/.m2/repository/org/apache/activemq/artemis-journal/1.3.0-SNAPSHOT/artemis-journal-1.3.0-20160426.031147-44.jar:/home/johnny/.m2/repository/org/apache/activemq/artemis-native/1.3.0-SNAPSHOT/artemis-native-1.3.0-20160426.031126-44.jar:/home/johnny/.m2/repository/org/apache/activemq/artemis-jdbc-store/1.3.0-SNAPSHOT/artemis-jdbc-store-1.3.0-20160426.031157-43.jar:/home/johnny/.m2/repository/org/apache/activemq/artemis-core-client/1.3.0-SNAPSHOT/artemis-core-client-1.3.0-20160426.030751-43.jar:/home/johnny/.m2/repository/org/jgroups/jgroups/3.6.8.Final/jgroups-3.6.8.Final.jar:/home/johnny/.m2/repository/org/apache/activemq/artemis-jms-server/1.3.0-SNAPSHOT/artemis-jms-server-1.3.0-20160426.032135-43.jar:/home/johnny/.m2/repository/org/apache/activemq/artemis-jms-client/1.3.0-SNAPSHOT/artemis-jms-client-1.3.0-20160426.031055-43.jar:/home/johnny/.m2/repository/javax/inject/javax.inject/1/javax.inject-1.jar:/home/johnny/.m2/repository/org/apache/activemq/artemis-service-extensions/1.3.0-SNAPSHOT/artemis-service-extensions-1.3.0-20160426.031945-43.jar:/home/johnny/.m2/repository/org/apache/geronimo/specs/geronimo-ejb_3.0_spec/1.0.1/geronimo-ejb_3.0_spec-1.0.1.jar:/home/johnny/.m2/repository/org/apache/geronimo/specs/geronimo-jta_1.1_spec/1.1.1/geronimo-jta_1.1_spec-1.1.1.jar:/home/johnny/.m2/repository/org/apache/geronimo/specs/geronimo-jms_2.0_spec/1.0-alpha-2/geronimo-jms_2.0_spec-1.0-alpha-2.jar:/home/johnny/.m2/repository/org/apache/geronimo/specs/geronimo-annotation_1.1_spec/1.0.1/geronimo-annotation_1.1_spec-1.0.1.jar:/usr/share/intellij-idea-ultimate-edition/lib/idea_rt.jar > com.intellij.rt.execution.application.AppMain fi.julien.artemisrest.Main > [Fatal Error] :2:6: The processing instruction target matching > "[xX][mM][lL]" is not allowed. > Exception in thread "main" org.xml.sax.SAXParseException; > lineNumber: 2; columnNumber: 6; The processing instruction target > matching "[xX][mM][lL]" is not allowed. > at > > com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(DOMParser.java:257) > at > > com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:339) > at > org.apache.activemq.artemis.utils.XMLUtil.readerToElement(XMLUtil.java:86) > at > org.apache.activemq.artemis.utils.XMLUtil.stringToElement(XMLUtil.java:52) > at > > org.apache.activemq.artemis.core.config.FileDeploymentManager.readConfiguration(FileDeploymentManager.java:76) > at > > org.apache.activemq.artemis.core.server.embedded.EmbeddedActiveMQ.initStart(EmbeddedActiveMQ.java:127) > at > > org.apache.activemq.artemis.core.server.embedded.EmbeddedActiveMQ.start(EmbeddedActiveMQ.java:115) > at > > org.apache.activemq.artemis.rest.integration.EmbeddedRestActiveMQ.start(EmbeddedRestActiveMQ.java:59) > at fi.julien.artemisrest.Main.main(Main.java:37) > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > at > > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) > at > > sun.reflect.DelegatingMethodAccessorImpl.invokeDelegatingMethodAccessorImpl.java:43) > at java.lang.reflect.Method.invoke(Method.java:498) > at > com.intellij.rt.execution.application.AppMain.main(AppMain.java:144) > > Process finished with exit code 1 > > I am using Github's master branch from last week Wednesday, 1.3.0-SNAPSHOT > Thanks > > Julien D. > > Alternative email address : julie...@protonmail.ch > > On 04/26/2016 08:01 PM, Justin Bertram wrote: >> Can you provide the full stack-trace? >> >> Also, what version of Artemis are you using? >> >> >> Justin >> >> ----- Original Message ----- >> From: "Julien d" <julie...@iki.fi> >> To: dev@activemq.apache.org >> Sent: Tuesday, April 26, 2016 11:34:20 AM >> Subject: Re: Need help with >> org.apache.activemq.artemis.rest.integration.EmbeddedRestActiveMQ >> >> Thank you for your answer Justin. >> When using the following one : >> >> <?xml version='1.0'?> <!-- Licensed to the Apache Software Foundation >> (ASF) under one or more contributor license agreements. See the NOTICE >> file distributed with this work for additional information regarding >> copyright ownership. The ASF licenses this file to you under the Apache >> License, Version 2.0 (the "License"); you may not use this file except >> in compliance with the License. You may obtain a copy of the License at >> http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable >> law or agreed to in writing, software distributed under the License is >> distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY >> KIND, either express or implied. See the License for the specific >> language governing permissions and limitations under the License. --> >> <configuration xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" >> xmlns="urn:activemq" xsi:schemaLocation="urn:activemq >> /schema/artemis-server.xsd"> <jms xmlns="urn:activemq:jms"> <!--the >> queue used by the example--> <queue name="orders"/> </jms> <core >> xmlns="urn:activemq:core"> <persistence-enabled>false</persistence-enabled> >> <!-- Connectors --> <connectors> <connector >> name="in-vm">vm://0</connector> </connectors> <acceptors> <acceptor >> name="in-vm">vm://0</acceptor> <acceptor >> name="netty-acceptor">tcp://localhost:61616</acceptor> </acceptors> <!-- >> Other config --> <security-settings> >> <!--security for example queue--> <security-setting match="#"> >> <permission type="createDurableQueue" roles="guest"/> <permission >> type="deleteDurableQueue" roles="guest"/> <permission >> type="createNonDurableQueue" roles="guest"/> <permission >> type="deleteNonDurableQueue" roles="guest"/> <permission type="consume" >> roles="guest"/> <permission type="send" roles="guest"/> >> </security-setting> </security-settings> </core> </configuration> >> >> >> I get the following error : >> >> [Fatal Error] :2:6: The processing instruction target matching >> "[xX][mM][lL]" is not allowed. >> Exception in thread "main" org.xml.sax.SAXParseException; lineNumber: 2; >> columnNumber: 6; The processing instruction target matching >> "[xX][mM][lL]" is not allowed. >> at >> com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(DOMParser.java:257) >> >> Would you know why? >> >> Julien D. >> >> Alternative email address : julie...@protonmail.ch >> >> On 04/26/2016 07:13 PM, Justin Bertram wrote: >>> You should be able to put the broker.xml anywhere on the application's >>> classpath. >>> >>> >>> Justin >>> >>> ----- Original Message ----- >>> From: "Julien d" <julie...@iki.fi> >>> To: dev@activemq.apache.org >>> Sent: Tuesday, April 26, 2016 11:00:48 AM >>> Subject: Need help with >>> org.apache.activemq.artemis.rest.integration.EmbeddedRestActiveMQ >>> >>> Hi everyone, >>> >>> Sorry for bothering, I am having some troubles working with Artemis, >>> more particularly >>> org.apache.activemq.artemis.rest.integration.EmbeddedRestActiveMQ and I >>> would like to know if someone here could give me a hand please. I did >>> not find this part documented, I could document it after understanding >>> it better. >>> >>> Where should I put the broker.xml ? >>> I have started a project where I have >>> org.apache.activemq.artemis.rest.integration.EmbeddedRestActiveMQ and >>> org.myproject packages in the same directory. >>> >>> At the moment my program is as simple as that since it is my first time >>> working with Artemis : >>> >>> public static void main(String[] args) throws Exception{ >>> >>> EmbeddedRestActiveMQ Restserver = new EmbeddedRestActiveMQ(); >>> Restserver.start(); } >>> >>> Thank you very much in advance, >>>