You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by davidvg77 <da...@gmail.com> on 2015/02/02 13:09:51 UTC

NoSuchMethod exception running ActiveMQ 5.10.0

Hi All!I'm trying to deploy ActiveMQ 5.10.0 (I tried 5.10.1 with same
results), but getting following exception on start.Everything is untouched
from the binary distribution archive.
"java -version" is java version "1.7.0_03"OpenJDK Runtime Environment
(IcedTea7 2.1.7) (7u3-2.1.7-1)OpenJDK 64-Bit Server VM (build 22.0-b10,
mixed mode)
Thanks in advance for your help.
Loading message broker from: xbean:activemq.xmlERROR:
java.lang.RuntimeException: Failed to execute start task. Reason:
org.springframework.beans.factory.BeanCreationException: Error creating bean
with name 'Server' defined in class path resource [jetty.xml]: Invocation of
init method failed; nested exception is java.lang.NoSuchMethodError:
javax.servlet.ServletContext.getContextPath()Ljava/lang/String;java.lang.RuntimeException:
Failed to execute start task. Reason:
org.springframework.beans.factory.BeanCreationException: Error creating bean
with name 'Server' defined in class path resource [jetty.xml]: Invocation of
init method failed; nested exception is java.lang.NoSuchMethodError:
javax.servlet.ServletContext.getContextPath()Ljava/lang/String;        at
org.apache.activemq.console.command.StartCommand.runTask(StartCommand.java:91)       
at
org.apache.activemq.console.command.AbstractCommand.execute(AbstractCommand.java:57)       
at
org.apache.activemq.console.command.ShellCommand.runTask(ShellCommand.java:150)       
at
org.apache.activemq.console.command.AbstractCommand.execute(AbstractCommand.java:57)       
at
org.apache.activemq.console.command.ShellCommand.main(ShellCommand.java:104)       
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)        at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)       
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)       
at java.lang.reflect.Method.invoke(Method.java:601)        at
org.apache.activemq.console.Main.runTaskClass(Main.java:262)        at
org.apache.activemq.console.Main.main(Main.java:115)Caused by:
org.springframework.beans.factory.BeanCreationException: Error creating bean
with name 'Server' defined in class path resource [jetty.xml]: Invocation of
init method failed; nested exception is java.lang.NoSuchMethodError:
javax.servlet.ServletContext.getContextPath()Ljava/lang/String;        at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1512)       
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:521)       
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:458)       
at
org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:296)       
at
org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:223)       
at
org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:293)       
at
org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194)       
at
org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:628)       
at
org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:932)       
at
org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:479)       
at
org.apache.xbean.spring.context.ResourceXmlApplicationContext.(ResourceXmlApplicationContext.java:64)       
at
org.apache.xbean.spring.context.ResourceXmlApplicationContext.(ResourceXmlApplicationContext.java:52)       
at
org.apache.activemq.xbean.XBeanBrokerFactory$1.(XBeanBrokerFactory.java:104)       
at
org.apache.activemq.xbean.XBeanBrokerFactory.createApplicationContext(XBeanBrokerFactory.java:104)       
at
org.apache.activemq.xbean.XBeanBrokerFactory.createBroker(XBeanBrokerFactory.java:67)       
at
org.apache.activemq.broker.BrokerFactory.createBroker(BrokerFactory.java:71)       
at
org.apache.activemq.broker.BrokerFactory.createBroker(BrokerFactory.java:54)       
at
org.apache.activemq.console.command.StartCommand.runTask(StartCommand.java:87)       
... 10 moreCaused by: java.lang.NoSuchMethodError:
javax.servlet.ServletContext.getContextPath()Ljava/lang/String;        at
org.springframework.web.servlet.FrameworkServlet.configureAndRefreshWebApplicationContext(FrameworkServlet.java:630)       
at
org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:602)       
at
org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:665)       
at
org.springframework.web.servlet.FrameworkServlet.initWebApplicationContext(FrameworkServlet.java:521)       
at
org.springframework.web.servlet.FrameworkServlet.initServletBean(FrameworkServlet.java:462)       
at
org.springframework.web.servlet.HttpServletBean.init(HttpServletBean.java:136)       
at javax.servlet.GenericServlet.init(GenericServlet.java:256)        at
org.eclipse.jetty.servlet.ServletHolder.initServlet(ServletHolder.java:477)       
at org.eclipse.jetty.servlet.ServletHolder.doStart(ServletHolder.java:293)       
at
org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64)       
at
org.eclipse.jetty.servlet.ServletHandler.initialize(ServletHandler.java:730)       
at
org.eclipse.jetty.servlet.ServletContextHandler.startContext(ServletContextHandler.java:254)       
at
org.eclipse.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1238)       
at
org.eclipse.jetty.server.handler.ContextHandler.doStart(ContextHandler.java:689)       
at org.eclipse.jetty.webapp.WebAppContext.doStart(WebAppContext.java:480)       
at
org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64)       
at
org.eclipse.jetty.server.handler.HandlerCollection.doStart(HandlerCollection.java:229)       
at
org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64)       
at
org.eclipse.jetty.server.handler.HandlerWrapper.doStart(HandlerWrapper.java:95)       
at
org.eclipse.jetty.security.SecurityHandler.doStart(SecurityHandler.java:381)       
at
org.eclipse.jetty.security.ConstraintSecurityHandler.doStart(ConstraintSecurityHandler.java:233)       
at
org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64)       
at
org.eclipse.jetty.server.handler.HandlerCollection.doStart(HandlerCollection.java:229)       
at
org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64)       
at
org.eclipse.jetty.server.handler.HandlerWrapper.doStart(HandlerWrapper.java:95)       
at org.eclipse.jetty.server.Server.doStart(Server.java:279)        at
org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64)       
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)        at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)       
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)       
at java.lang.reflect.Method.invoke(Method.java:601)        at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeCustomInitMethod(AbstractAutowireCapableBeanFactory.java:1638)       
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1579)       
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1509)       
... 27 more




--
View this message in context: http://activemq.2283324.n4.nabble.com/NoSuchMethod-exception-running-ActiveMQ-5-10-0-tp4690810.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Re: NoSuchMethod exception running ActiveMQ 5.10.0

Posted by davidvg77 <da...@gmail.com>.
Thank you for your response.
It worked for Oracle Java 8.



--
View this message in context: http://activemq.2283324.n4.nabble.com/NoSuchMethod-exception-running-ActiveMQ-5-10-0-tp4690810p4690912.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Re: NoSuchMethod exception running ActiveMQ 5.10.0

Posted by Jon Gorrono <jp...@ucdavis.edu>.
Sounds to me like a conflicting (duplicate) or missing server-api v2.5+ jar
file

The recommendations in the accepted answer below are reasonable,
particularly #3 which is about jar duplicates.... activemq has a version
2.5 already, so if you installation has one the classloader will likely
complain like u see.

http://stackoverflow.com/questions/8611777/java-lang-nosuchmethoderror-javax-servlet-servletcontext-getcontextpathljava

On Mon, Feb 2, 2015 at 6:42 PM, artnaseef <ar...@artnaseef.com> wrote:

> Hmm, OpenJDK -- isn't that a kind of "pre-release" of the next gen of java?
>
> Can you try with a standard oracle java distribution?
>
>
>
> --
> View this message in context:
> http://activemq.2283324.n4.nabble.com/NoSuchMethod-exception-running-ActiveMQ-5-10-0-tp4690810p4690904.html
> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
>



-- 
Jon Gorrono
PGP Key: 0x5434509D - http{
pgp.mit.edu:11371/pks/lookup?search=0x5434509D&op=index}
http{middleware.ucdavis.edu}

Re: NoSuchMethod exception running ActiveMQ 5.10.0

Posted by artnaseef <ar...@artnaseef.com>.
Hmm, OpenJDK -- isn't that a kind of "pre-release" of the next gen of java?

Can you try with a standard oracle java distribution?



--
View this message in context: http://activemq.2283324.n4.nabble.com/NoSuchMethod-exception-running-ActiveMQ-5-10-0-tp4690810p4690904.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Re: NoSuchMethod exception running ActiveMQ 5.10.0

Posted by artnaseef <ar...@artnaseef.com>.
Can you provide the precise steps to start the broker?  I have started 5.10.0
and 5.10.1 brokers without problem.

Also, is this with Windows, Linux, Mac, or another environment?



--
View this message in context: http://activemq.2283324.n4.nabble.com/NoSuchMethod-exception-running-ActiveMQ-5-10-0-tp4690810p4690903.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Re: NoSuchMethod exception running ActiveMQ 5.10.0

Posted by davidvg77 <da...@gmail.com>.
This is not the final solution but it allows me to go on.

I've removed "Server" bean in conf/jetty.xml:

     <bean id="Server" depends-on="jettyPort"
class="org.eclipse.jetty.server.Server" init-method="start"
         destroy-method="stop">




--
View this message in context: http://activemq.2283324.n4.nabble.com/NoSuchMethod-exception-running-ActiveMQ-5-10-0-tp4690810p4690814.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.