java - Whenever I try to run Tomcat with Jersey, it refuses to load -
basically trying create simple hello world program using rational software architect. create server use tomcat , jersey. found when create server without putting jersey jar files web-inf/lib rather create custom user library jar files, tomcat compile fine url not load "hello world" text, 404 error. simple http://localhost:8080/project name/rest/class path name , nothing come up. think because don't have jersey files in web-inf/lib when put jersey jar files in folder , try run tomcat server, "server tomcat v7.0 server @ localhost failed start." error.
please me out , in advance.
jun 10, 2015 12:56:28 pm org.apache.tomcat.util.digester.setpropertiesrule begin warning: [setpropertiesrule]{server/service/engine/host/context} setting property 'source' 'org.eclipse.jst.jee.server:resthello' did not find matching property. jun 10, 2015 12:56:28 pm org.apache.catalina.startup.versionloggerlistener log info: server version: apache tomcat/7.0.62 jun 10, 2015 12:56:28 pm org.apache.catalina.startup.versionloggerlistener log info: server built: may 7 2015 17:14:55 utc jun 10, 2015 12:56:28 pm org.apache.catalina.startup.versionloggerlistener log info: server number: 7.0.62.0 jun 10, 2015 12:56:28 pm org.apache.catalina.startup.versionloggerlistener log info: os name: windows 7 jun 10, 2015 12:56:28 pm org.apache.catalina.startup.versionloggerlistener log info: os version: 6.1 build 7601 service pack 1 jun 10, 2015 12:56:28 pm org.apache.catalina.startup.versionloggerlistener log info: architecture: x86 jun 10, 2015 12:56:28 pm org.apache.catalina.startup.versionloggerlistener log info: java home: c:\sdp80x\jdk\jre jun 10, 2015 12:56:28 pm org.apache.catalina.startup.versionloggerlistener log info: jvm version: jvmwi3260sr9-20110324_78506 jun 10, 2015 12:56:28 pm org.apache.catalina.startup.versionloggerlistener log info: jvm vendor: ibm corporation jun 10, 2015 12:56:28 pm org.apache.catalina.startup.versionloggerlistener log info: catalina_base: c:\ezrazws\.metadata\.plugins\org.eclipse.wst.server.core\tmp1 jun 10, 2015 12:56:28 pm org.apache.catalina.startup.versionloggerlistener log info: catalina_home: c:\restws\tomcat 7.0 jun 10, 2015 12:56:28 pm org.apache.catalina.startup.versionloggerlistener log info: command line argument: -xjcl:jclscar_24 jun 10, 2015 12:56:28 pm org.apache.catalina.startup.versionloggerlistener log info: command line argument: -dcom.ibm.oti.vm.bootstrap.library.path=c:\sdp80x\jdk\jre\bin jun 10, 2015 12:56:28 pm org.apache.catalina.startup.versionloggerlistener log info: command line argument: -dsun.boot.library.path=c:\sdp80x\jdk\jre\bin jun 10, 2015 12:56:28 pm org.apache.catalina.startup.versionloggerlistener log info: command line argument: -djava.library.path=c:\sdp80x\jdk\jre\bin;.;c:/sdp80x/jdk/jre/bin/j9vm;c:/sdp80x/jdk/jre/bin;c:/sdp80x/jdk/jre/lib/i386;c:\eip40\tibco\tibrv\8.4\bin;c:\eip40\tibco\tibrv\8.3\bin;c:\windows\system32;c:\windows;c:\windows\system32\wbem;c:\windows\system32\windowspowershell\v1.0\;c:\program files (x86)\intel\opencl sdk\2.0\bin\x86;c:\program files (x86)\intel\opencl sdk\2.0\bin\x64;c:\rationalsdlc\clearcase\bin;c:\rationalsdlc\common;c:\program files (x86)\webex\productivity tools;c:\program files\dell\dell data protection\encryption\;c:\program files (x86)\nodejs\;c:\sdp80x\jdk\bin;;c:\sdp80x; jun 10, 2015 12:56:28 pm org.apache.catalina.startup.versionloggerlistener log info: command line argument: -djava.home=c:\sdp80x\jdk\jre jun 10, 2015 12:56:28 pm org.apache.catalina.startup.versionloggerlistener log info: command line argument: -djava.ext.dirs=c:\sdp80x\jdk\jre\lib\ext jun 10, 2015 12:56:28 pm org.apache.catalina.startup.versionloggerlistener log info: command line argument: -duser.dir=c:\sdp80x jun 10, 2015 12:56:28 pm org.apache.catalina.startup.versionloggerlistener log info: command line argument: _j2se_j9=71168 jun 10, 2015 12:56:28 pm org.apache.catalina.startup.versionloggerlistener log info: command line argument: -xdump jun 10, 2015 12:56:28 pm org.apache.catalina.startup.versionloggerlistener log info: command line argument: -djava.class.path=c:\eip40\tibco\tibrv\8.4\lib\tibrvnative.jar;c:\eip40\tibco\tibrv\8.3\lib\tibrvnative.jar;c:\sdp80x\jdk\bin; jun 10, 2015 12:56:28 pm org.apache.catalina.startup.versionloggerlistener log info: command line argument: -dcatalina.base=c:\ezrazws\.metadata\.plugins\org.eclipse.wst.server.core\tmp1 jun 10, 2015 12:56:28 pm org.apache.catalina.startup.versionloggerlistener log info: command line argument: -dcatalina.home=c:\restws\tomcat 7.0 jun 10, 2015 12:56:28 pm org.apache.catalina.startup.versionloggerlistener log info: command line argument: -dwtp.deploy=c:\ezrazws\.metadata\.plugins\org.eclipse.wst.server.core\tmp1\wtpwebapps jun 10, 2015 12:56:28 pm org.apache.catalina.startup.versionloggerlistener log info: command line argument: -djava.endorsed.dirs=c:\restws\tomcat 7.0\endorsed jun 10, 2015 12:56:28 pm org.apache.catalina.startup.versionloggerlistener log info: command line argument: -dfile.encoding=cp1252 jun 10, 2015 12:56:28 pm org.apache.catalina.startup.versionloggerlistener log info: command line argument: -djava.class.path=c:\restws\tomcat 7.0\bin\bootstrap.jar;c:\restws\tomcat 7.0\bin\tomcat-juli.jar;c:\sdp80x\jdk\lib\tools.jar;c:\ezrazws\resthello\webcontent\web-inf\lib\jersey-client.jar;c:\ezrazws\resthello\webcontent\web-inf\lib\jersey-common.jar;c:\ezrazws\resthello\webcontent\web-inf\lib\jersey-container-servlet.jar;c:\ezrazws\resthello\webcontent\web-inf\lib\jersey-container-servlet-core.jar;c:\ezrazws\resthello\webcontent\web-inf\lib\jersey-media-jaxb.jar;c:\ezrazws\resthello\webcontent\web-inf\lib\jersey-server.jar jun 10, 2015 12:56:28 pm org.apache.catalina.startup.versionloggerlistener log info: command line argument: -dsun.java.command=org.apache.catalina.startup.bootstrap start jun 10, 2015 12:56:28 pm org.apache.catalina.startup.versionloggerlistener log info: command line argument: -dsun.java.launcher=sun_standard jun 10, 2015 12:56:28 pm org.apache.catalina.startup.versionloggerlistener log info: command line argument: _port_library jun 10, 2015 12:56:28 pm org.apache.catalina.startup.versionloggerlistener log info: command line argument: _org.apache.harmony.vmi.portlib jun 10, 2015 12:56:28 pm org.apache.catalina.core.aprlifecyclelistener lifecycleevent info: apr based apache tomcat native library allows optimal performance in production environments not found on java.library.path: c:\sdp80x\jdk\jre\bin;.;c:/sdp80x/jdk/jre/bin/j9vm;c:/sdp80x/jdk/jre/bin;c:/sdp80x/jdk/jre/lib/i386;c:\eip40\tibco\tibrv\8.4\bin;c:\eip40\tibco\tibrv\8.3\bin;c:\windows\system32;c:\windows;c:\windows\system32\wbem;c:\windows\system32\windowspowershell\v1.0\;c:\program files (x86)\intel\opencl sdk\2.0\bin\x86;c:\program files (x86)\intel\opencl sdk\2.0\bin\x64;c:\rationalsdlc\clearcase\bin;c:\rationalsdlc\common;c:\program files (x86)\webex\productivity tools;c:\program files\dell\dell data protection\encryption\;c:\program files (x86)\nodejs\;c:\sdp80x\jdk\bin;;c:\sdp80x; jun 10, 2015 12:56:28 pm org.apache.coyote.abstractprotocol init info: initializing protocolhandler ["http-bio-8080"] jun 10, 2015 12:56:28 pm org.apache.coyote.abstractprotocol init info: initializing protocolhandler ["ajp-bio-8009"] jun 10, 2015 12:56:28 pm org.apache.catalina.startup.catalina load info: initialization processed in 559 ms jun 10, 2015 12:56:28 pm org.apache.catalina.core.standardservice startinternal info: starting service catalina jun 10, 2015 12:56:28 pm org.apache.catalina.core.standardengine startinternal info: starting servlet engine: apache tomcat/7.0.62 jun 10, 2015 12:56:28 pm org.apache.catalina.core.containerbase startinternal severe: child container failed during start throwable occurred: java.util.concurrent.executionexception: org.apache.catalina.lifecycleexception: failed start component [standardengine[catalina].standardhost[localhost].standardcontext[]] @ java.util.concurrent.futuretask$sync.innerget(futuretask.java:233) @ java.util.concurrent.futuretask.get(futuretask.java:94) @ org.apache.catalina.core.containerbase.startinternal(containerbase.java:1123) @ org.apache.catalina.core.standardhost.startinternal(standardhost.java:819) @ org.apache.catalina.util.lifecyclebase.start(lifecyclebase.java:150) @ org.apache.catalina.core.containerbase$startchild.call(containerbase.java:1575) @ org.apache.catalina.core.containerbase$startchild.call(containerbase.java:1565) @ java.util.concurrent.futuretask$sync.innerrun(futuretask.java:314) @ java.util.concurrent.futuretask.run(futuretask.java:149) @ java.util.concurrent.threadpoolexecutor$worker.runtask(threadpoolexecutor.java:897) @ java.util.concurrent.threadpoolexecutor$worker.run(threadpoolexecutor.java:919) @ java.lang.thread.run(thread.java:736) caused by: org.apache.catalina.lifecycleexception: failed start component [standardengine[catalina].standardhost[localhost].standardcontext[]] @ org.apache.catalina.util.lifecyclebase.start(lifecyclebase.java:154) ... 7 more caused by: java.lang.unsupportedclassversionerror: jvmcfre003 bad major version; class=org/glassfish/jersey/servlet/init/jerseyservletcontainerinitializer, offset=6 @ java.lang.classloader.defineclass(classloader.java:275) @ java.security.secureclassloader.defineclass(secureclassloader.java:69) @ java.net.urlclassloader.defineclass(urlclassloader.java:540) @ java.net.urlclassloader.defineclass(urlclassloader.java:451) @ java.net.urlclassloader.access$300(urlclassloader.java:79) @ java.net.urlclassloader$classfinder.run(urlclassloader.java:1038) @ java.security.accesscontroller.doprivileged(accesscontroller.java:284) @ java.net.urlclassloader.findclass(urlclassloader.java:429) @ java.lang.classloader.loadclass(classloader.java:653) @ sun.misc.launcher$appclassloader.loadclass(launcher.java:358) @ java.lang.classloader.loadclass(classloader.java:645) @ java.lang.classloader.loadclass(classloader.java:619) @ java.lang.class.fornameimpl(native method) @ java.lang.class.forname(class.java:172) @ org.apache.catalina.loader.webappclassloader.loadclass(webappclassloader.java:1707) @ org.apache.catalina.loader.webappclassloader.loadclass(webappclassloader.java:1571) @ java.lang.class.fornameimpl(native method) @ java.lang.class.forname(class.java:172) @ org.apache.catalina.startup.webappserviceloader.loadservices(webappserviceloader.java:192) @ org.apache.catalina.startup.webappserviceloader.load(webappserviceloader.java:157) @ org.apache.catalina.startup.contextconfig.processservletcontainerinitializers(contextconfig.java:1577) @ org.apache.catalina.startup.contextconfig.webconfig(contextconfig.java:1281) @ org.apache.catalina.startup.contextconfig.configurestart(contextconfig.java:889) @ org.apache.catalina.startup.contextconfig.lifecycleevent(contextconfig.java:386) @ org.apache.catalina.util.lifecyclesupport.firelifecycleevent(lifecyclesupport.java:117) @ org.apache.catalina.util.lifecyclebase.firelifecycleevent(lifecyclebase.java:90) @ org.apache.catalina.core.standardcontext.startinternal(standardcontext.java:5416) @ org.apache.catalina.util.lifecyclebase.start(lifecyclebase.java:150) ... 7 more jun 10, 2015 12:56:28 pm org.apache.catalina.core.containerbase startinternal severe: child container failed during start throwable occurred: java.util.concurrent.executionexception: org.apache.catalina.lifecycleexception: failed start component [standardengine[catalina].standardhost[localhost].standardcontext[/resthello]] @ java.util.concurrent.futuretask$sync.innerget(futuretask.java:233) @ java.util.concurrent.futuretask.get(futuretask.java:94) @ org.apache.catalina.core.containerbase.startinternal(containerbase.java:1123) @ org.apache.catalina.core.standardhost.startinternal(standardhost.java:819) @ org.apache.catalina.util.lifecyclebase.start(lifecyclebase.java:150) @ org.apache.catalina.core.containerbase$startchild.call(containerbase.java:1575) @ org.apache.catalina.core.containerbase$startchild.call(containerbase.java:1565) @ java.util.concurrent.futuretask$sync.innerrun(futuretask.java:314) @ java.util.concurrent.futuretask.run(futuretask.java:149) @ java.util.concurrent.threadpoolexecutor$worker.runtask(threadpoolexecutor.java:897) @ java.util.concurrent.threadpoolexecutor$worker.run(threadpoolexecutor.java:919) @ java.lang.thread.run(thread.java:736) caused by: org.apache.catalina.lifecycleexception: failed start component [standardengine[catalina].standardhost[localhost].standardcontext[/resthello]] @ org.apache.catalina.util.lifecyclebase.start(lifecyclebase.java:154) ... 7 more caused by: java.lang.unsupportedclassversionerror: jvmcfre003 bad major version; class=org/glassfish/jersey/servlet/init/jerseyservletcontainerinitializer, offset=6 (unable load class org.glassfish.jersey.servlet.init.jerseyservletcontainerinitializer) @ org.apache.catalina.loader.webappclassloader.findclassinternal(webappclassloader.java:2961) @ org.apache.catalina.loader.webappclassloader.findclass(webappclassloader.java:1210) @ org.apache.catalina.loader.webappclassloader.loadclass(webappclassloader.java:1690) @ org.apache.catalina.loader.webappclassloader.loadclass(webappclassloader.java:1571) @ java.lang.class.fornameimpl(native method) @ java.lang.class.forname(class.java:172) @ org.apache.catalina.startup.webappserviceloader.loadservices(webappserviceloader.java:192) @ org.apache.catalina.startup.webappserviceloader.load(webappserviceloader.java:157) @ org.apache.catalina.startup.contextconfig.processservletcontainerinitializers(contextconfig.java:1577) @ org.apache.catalina.startup.contextconfig.webconfig(contextconfig.java:1281) @ org.apache.catalina.startup.contextconfig.configurestart(contextconfig.java:889) @ org.apache.catalina.startup.contextconfig.lifecycleevent(contextconfig.java:386) @ org.apache.catalina.util.lifecyclesupport.firelifecycleevent(lifecyclesupport.java:117) @ org.apache.catalina.util.lifecyclebase.firelifecycleevent(lifecyclebase.java:90) @ org.apache.catalina.core.standardcontext.startinternal(standardcontext.java:5416) @ org.apache.catalina.util.lifecyclebase.start(lifecyclebase.java:150) ... 7 more jun 10, 2015 12:56:28 pm org.apache.catalina.core.containerbase startinternal severe: child container failed during start throwable occurred: java.util.concurrent.executionexception: org.apache.catalina.lifecycleexception: failed start component [standardengine[catalina].standardhost[localhost]] @ java.util.concurrent.futuretask$sync.innerget(futuretask.java:233) @ java.util.concurrent.futuretask.get(futuretask.java:94) @ org.apache.catalina.core.containerbase.startinternal(containerbase.java:1123) @ org.apache.catalina.core.standardengine.startinternal(standardengine.java:300) @ org.apache.catalina.util.lifecyclebase.start(lifecyclebase.java:150) @ org.apache.catalina.core.standardservice.startinternal(standardservice.java:443) @ org.apache.catalina.util.lifecyclebase.start(lifecyclebase.java:150) @ org.apache.catalina.core.standardserver.startinternal(standardserver.java:739) @ org.apache.catalina.util.lifecyclebase.start(lifecyclebase.java:150) @ org.apache.catalina.startup.catalina.start(catalina.java:689) @ sun.reflect.nativemethodaccessorimpl.invoke0(native method) @ sun.reflect.nativemethodaccessorimpl.invoke(nativemethodaccessorimpl.java:60) @ sun.reflect.delegatingmethodaccessorimpl.invoke(delegatingmethodaccessorimpl.java:37) @ java.lang.reflect.method.invoke(method.java:611) @ org.apache.catalina.startup.bootstrap.start(bootstrap.java:321) @ org.apache.catalina.startup.bootstrap.main(bootstrap.java:455) caused by: org.apache.catalina.lifecycleexception: failed start component [standardengine[catalina].standardhost[localhost]] @ org.apache.catalina.util.lifecyclebase.start(lifecyclebase.java:154) @ org.apache.catalina.core.containerbase$startchild.call(containerbase.java:1575) @ org.apache.catalina.core.containerbase$startchild.call(containerbase.java:1565) @ java.util.concurrent.futuretask$sync.innerrun(futuretask.java:314) @ java.util.concurrent.futuretask.run(futuretask.java:149) @ java.util.concurrent.threadpoolexecutor$worker.runtask(threadpoolexecutor.java:897) @ java.util.concurrent.threadpoolexecutor$worker.run(threadpoolexecutor.java:919) @ java.lang.thread.run(thread.java:736) caused by: org.apache.catalina.lifecycleexception: child container failed during start @ org.apache.catalina.core.containerbase.startinternal(containerbase.java:1131) @ org.apache.catalina.core.standardhost.startinternal(standardhost.java:819) @ org.apache.catalina.util.lifecyclebase.start(lifecyclebase.java:150) ... 7 more jun 10, 2015 12:56:28 pm org.apache.catalina.startup.catalina start severe: required server component failed start tomcat unable start. throwable occurred: org.apache.catalina.lifecycleexception: failed start component [standardserver[8005]] @ org.apache.catalina.util.lifecyclebase.start(lifecyclebase.java:154) @ org.apache.catalina.startup.catalina.start(catalina.java:689) @ sun.reflect.nativemethodaccessorimpl.invoke0(native method) @ sun.reflect.nativemethodaccessorimpl.invoke(nativemethodaccessorimpl.java:60) @ sun.reflect.delegatingmethodaccessorimpl.invoke(delegatingmethodaccessorimpl.java:37) @ java.lang.reflect.method.invoke(method.java:611) @ org.apache.catalina.startup.bootstrap.start(bootstrap.java:321) @ org.apache.catalina.startup.bootstrap.main(bootstrap.java:455) caused by: org.apache.catalina.lifecycleexception: failed start component [standardservice[catalina]] @ org.apache.catalina.util.lifecyclebase.start(lifecyclebase.java:154) @ org.apache.catalina.core.standardserver.startinternal(standardserver.java:739) @ org.apache.catalina.util.lifecyclebase.start(lifecyclebase.java:150) ... 7 more caused by: org.apache.catalina.lifecycleexception: failed start component [standardengine[catalina]] @ org.apache.catalina.util.lifecyclebase.start(lifecyclebase.java:154) @ org.apache.catalina.core.standardservice.startinternal(standardservice.java:443) @ org.apache.catalina.util.lifecyclebase.start(lifecyclebase.java:150) ... 9 more caused by: org.apache.catalina.lifecycleexception: child container failed during start @ org.apache.catalina.core.containerbase.startinternal(containerbase.java:1131) @ org.apache.catalina.core.standardengine.startinternal(standardengine.java:300) @ org.apache.catalina.util.lifecyclebase.start(lifecyclebase.java:150) ... 11 more jun 10, 2015 12:56:28 pm org.apache.coyote.abstractprotocol pause info: pausing protocolhandler ["http-bio-8080"] jun 10, 2015 12:56:28 pm org.apache.coyote.abstractprotocol pause info: pausing protocolhandler ["ajp-bio-8009"] jun 10, 2015 12:56:28 pm org.apache.catalina.core.standardservice stopinternal info: stopping service catalina jun 10, 2015 12:56:28 pm org.apache.coyote.abstractprotocol destroy info: destroying protocolhandler ["http-bio-8080"] jun 10, 2015 12:56:28 pm org.apache.coyote.abstractprotocol destroy info: destroying protocolhandler ["ajp-bio-8009"]
my code:
package resthello; import javax.ws.rs.get; import javax.ws.rs.path; import javax.ws.rs.produces; import javax.ws.rs.core.mediatype; @path ("/hello") public class hello { @get @produces(mediatype.text_plain) public string sayhello() { return "hello"; } }
and web.xml is:
<?xml version="1.0" encoding="utf-8"?> <web-app xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xsi:schemalocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd" id="webapp_id" version="3.0"> <display-name>resthello</display-name> <servlet> <servlet-name>jersey rest service</servlet-name> <servlet-class>org.glassfish.jersey.servlet.servletcontainer</servlet-class> <!-- register resources , providers under com.vogella.jersey.first package. --> <init-param> <param-name>jersey.config.server.provider.packages</param-name> <param-value>resthello</param-value> </init-param> <load-on-startup>1</load-on-startup> </servlet> <servlet-mapping> <servlet-name>jersey rest service</servlet-name> <url-pattern>/rest/*</url-pattern> </servlet-mapping> </web-app>
the unsupported class version error suggests using newer version of jersey supported tomcat installation. because of jre version mismatch - jersey library using requires newer jre have older version
Comments
Post a Comment