You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by dead_devil_66 <de...@hotmail.com> on 2011/07/29 04:12:43 UTC

ActiveMQ and HttpServlet

Greetings.

I'm doing a simple example here: trying to run a producer, after doing a GET
request to a HttpServlet.

here is my code, for the httpservlet:

http://pastie.org/2287667

and for the Producer (source code from the activemq in action book):

http://pastie.org/2287665


When i start the servlet, i get this output:


29/Jul/2011 3:11:47 org.apache.tomcat.util.digester.SetPropertiesRule begin
WARNING: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting
property 'source' to 'org.eclipse.jst.jee.server:HerveActiveMQProxy' did not
find a matching property.
29/Jul/2011 3:11:47 org.apache.coyote.http11.Http11Protocol init
INFO: Initializing Coyote HTTP/1.1 on http-8080
29/Jul/2011 3:11:47 org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 768 ms
29/Jul/2011 3:11:47 org.apache.catalina.core.StandardService start
INFO: Starting service Catalina
29/Jul/2011 3:11:47 org.apache.catalina.core.StandardEngine start
INFO: Starting Servlet Engine: Apache Tomcat/6.0.28
29/Jul/2011 3:11:47 org.apache.coyote.http11.Http11Protocol start
INFO: Starting Coyote HTTP/1.1 on http-8080
29/Jul/2011 3:11:47 org.apache.catalina.startup.Catalina start
INFO: Server startup in 280 ms
29/Jul/2011 3:11:48 org.apache.catalina.core.StandardWrapperValve invoke
SEVERE: Servlet.service() for servlet SubscribeApi threw exception
java.lang.ClassNotFoundException: javax.jms.ConnectionFactory
	at
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1645)
	at
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1491)
	at SubscribeApi.doGet(SubscribeApi.java:32)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:617)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
	at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
	at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
	at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
	at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
	at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
	at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
	at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
	at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)
	at
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:857)
	at
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588)
	at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
	at java.lang.Thread.run(Thread.java:636)

When i comment the line that initiates the producer, no errors ocurr.

--
View this message in context: http://activemq.2283324.n4.nabble.com/ActiveMQ-and-HttpServlet-tp3702961p3702961.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Re: ActiveMQ and HttpServlet

Posted by dead_devil_66 <de...@hotmail.com>.
problem solved in camel forum:

http://camel.465427.n5.nabble.com/Can-t-use-jersey-library-classes-within-processor-td4657633.html#a4661109

--
View this message in context: http://activemq.2283324.n4.nabble.com/ActiveMQ-and-HttpServlet-tp3702961p3714393.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Re: ActiveMQ and HttpServlet

Posted by dead_devil_66 <de...@hotmail.com>.
ok so no problem with that because i imported that jar.

The main problem remains....any idea????

--
View this message in context: http://activemq.2283324.n4.nabble.com/ActiveMQ-and-HttpServlet-tp3702961p3714259.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Re: ActiveMQ and HttpServlet

Posted by Dejan Bosanac <de...@nighttale.net>.
No, these classes are in activemq-web jar

Regards
-- 
Dejan Bosanac - http://twitter.com/dejanb
-----------------
The experts in open source integration and messaging - http://fusesource.com
ActiveMQ in Action - http://www.manning.com/snyder/
Blog - http://www.nighttale.net


On Sat, Jul 30, 2011 at 10:10 PM, dead_devil_66 <de...@hotmail.com>wrote:

> isnt it supposed that these classes should be inside of activemq-all.jar
>
> org.apache.activemq.web.MessageServlet;
> org.apache.activemq.web.NoDestinationSuppliedException;
> org.apache.activemq.web.WebClient;
>
> ??
>
> --
> View this message in context:
> http://activemq.2283324.n4.nabble.com/ActiveMQ-and-HttpServlet-tp3702961p3706789.html
> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
>

Re: ActiveMQ and HttpServlet

Posted by dead_devil_66 <de...@hotmail.com>.
isnt it supposed that these classes should be inside of activemq-all.jar

org.apache.activemq.web.MessageServlet;
org.apache.activemq.web.NoDestinationSuppliedException;
org.apache.activemq.web.WebClient;

??

--
View this message in context: http://activemq.2283324.n4.nabble.com/ActiveMQ-and-HttpServlet-tp3702961p3706789.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Re: ActiveMQ and HttpServlet

Posted by dead_devil_66 <de...@hotmail.com>.
i already did that. Im using eclipse IDE and i added the jar you pointed out
to the buildpath.

my actual code is this one:

http://pastie.org/2295862

it's giving me the same errors. The critical point in here is that im unable
to call anything that uses activemq classes, in the httpservlet..

--
View this message in context: http://activemq.2283324.n4.nabble.com/ActiveMQ-and-HttpServlet-tp3702961p3706800.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Re: ActiveMQ and HttpServlet

Posted by vincent law <ca...@gmail.com>.
try add activemq-all-5.5.0.jar which is in the ActiveMQ home  directory

2011/7/30 dead_devil_66 <de...@hotmail.com>

> and looks like i can't use anything from the activemq jars...
>
> i tried stomp now and same error..
>
> --
> View this message in context:
> http://activemq.2283324.n4.nabble.com/ActiveMQ-and-HttpServlet-tp3702961p3705775.html
> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
>

Re: ActiveMQ and HttpServlet

Posted by dead_devil_66 <de...@hotmail.com>.
and looks like i can't use anything from the activemq jars...

i tried stomp now and same error..

--
View this message in context: http://activemq.2283324.n4.nabble.com/ActiveMQ-and-HttpServlet-tp3702961p3705775.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Re: ActiveMQ and HttpServlet

Posted by dead_devil_66 <de...@hotmail.com>.
Bumping the topic.

I searched the forum and i "googled" about this issue but no luck... :/

--
View this message in context: http://activemq.2283324.n4.nabble.com/ActiveMQ-and-HttpServlet-tp3702961p3704543.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Re: ActiveMQ and HttpServlet

Posted by dead_devil_66 <de...@hotmail.com>.
Thanks for replying, bojan.

hmmm ok but which container?? and in which file file do i add?

The only thing i did was adding that jar to the project buildpath. And, even
after that, same error.

--
View this message in context: http://activemq.2283324.n4.nabble.com/ActiveMQ-and-HttpServlet-tp3702961p3703658.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Re: ActiveMQ and HttpServlet

Posted by Dejan Bosanac <de...@nighttale.net>.
Try adding activemq-all to you container's classpath


Regards
-- 
Dejan Bosanac - http://twitter.com/dejanb
-----------------
The experts in open source integration and messaging - http://fusesource.com
ActiveMQ in Action - http://www.manning.com/snyder/
Blog - http://www.nighttale.net


On Fri, Jul 29, 2011 at 4:12 AM, dead_devil_66 <de...@hotmail.com>wrote:

> Greetings.
>
> I'm doing a simple example here: trying to run a producer, after doing a
> GET
> request to a HttpServlet.
>
> here is my code, for the httpservlet:
>
> http://pastie.org/2287667
>
> and for the Producer (source code from the activemq in action book):
>
> http://pastie.org/2287665
>
>
> When i start the servlet, i get this output:
>
>
> 29/Jul/2011 3:11:47 org.apache.tomcat.util.digester.SetPropertiesRule begin
> WARNING: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting
> property 'source' to 'org.eclipse.jst.jee.server:HerveActiveMQProxy' did
> not
> find a matching property.
> 29/Jul/2011 3:11:47 org.apache.coyote.http11.Http11Protocol init
> INFO: Initializing Coyote HTTP/1.1 on http-8080
> 29/Jul/2011 3:11:47 org.apache.catalina.startup.Catalina load
> INFO: Initialization processed in 768 ms
> 29/Jul/2011 3:11:47 org.apache.catalina.core.StandardService start
> INFO: Starting service Catalina
> 29/Jul/2011 3:11:47 org.apache.catalina.core.StandardEngine start
> INFO: Starting Servlet Engine: Apache Tomcat/6.0.28
> 29/Jul/2011 3:11:47 org.apache.coyote.http11.Http11Protocol start
> INFO: Starting Coyote HTTP/1.1 on http-8080
> 29/Jul/2011 3:11:47 org.apache.catalina.startup.Catalina start
> INFO: Server startup in 280 ms
> 29/Jul/2011 3:11:48 org.apache.catalina.core.StandardWrapperValve invoke
> SEVERE: Servlet.service() for servlet SubscribeApi threw exception
> java.lang.ClassNotFoundException: javax.jms.ConnectionFactory
>        at
>
> org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1645)
>        at
>
> org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1491)
>        at SubscribeApi.doGet(SubscribeApi.java:32)
>        at javax.servlet.http.HttpServlet.service(HttpServlet.java:617)
>        at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
>        at
>
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
>        at
>
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
>        at
>
> org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
>        at
>
> org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
>        at
>
> org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
>        at
>
> org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
>        at
>
> org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
>        at
> org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)
>        at
> org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:857)
>        at
>
> org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588)
>        at
> org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
>        at java.lang.Thread.run(Thread.java:636)
>
> When i comment the line that initiates the producer, no errors ocurr.
>
> --
> View this message in context:
> http://activemq.2283324.n4.nabble.com/ActiveMQ-and-HttpServlet-tp3702961p3702961.html
> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
>