Service时出现问题

Service时出现问题

本文介绍了在eclipse中部署REST Web Service时出现问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用JAX-RS在eclipse中使用tomcat作为服务器编写REST Web服务。
我参考以下教程来编写Web服务:



当我运行该项目时,我会收到以下错误:

  2014年4月7日12:01:53 AM org.apache.catalina.core.AprLifecycleListener init 
INFO:基于APR的Apache在java.library.path中没有找到允许生产环境中最佳性能的Tomcat本机库:C:\Program Files\Java\jre6\bin; C:\Windows\Sun\Java\ bin; C:\Windows\system32; C:\Windows; C:\Program文件(x86)\Intel\iCLS Client\; C:\Program Files\Intel\iCLS Client\\ \\; C:\Windows\system32; C:\Windows; C:\Windows\System32\Wbem; C:\Windows\System32\WindowsPowerShell\v1.0\; C: \Program Files\Intel\Intel(R)Managemen t引擎组件\DAL; C:\Program Files\Intel\Intel(R)管理引擎组件\IPT; C:\程序文件(x86)\Intel\Intel(R)管理引擎组件\DAL; C:\Program文件(x86)\Intel\Intel(R)管理引擎组件\IPT; c:\Maven\bin; C:\Program Files\Java\jdk1 .6.0_41\bin; E:\android\adt束 - 窗口x86_64-20130219\sdk\tools; E:\android\adt束 - 窗口x86_64-20130219\sdk\\ \\ platform-tools; C:\strawberry\c\bin; C:\strawberry\perl\site\bin; C:\strawberry\perl\bin; C:\Program文件(x86)\Git\cmd; C:\Python27; C:\MinGW\bin; C:\Python27\Scripts; C:\Program Files\PostgreSQL\9.3\bin; C:\程序文件(x86)\Microsoft SQL Server\100\Tools\Binn\; C:\Program Files\Microsoft SQL Server\100\Tools\Binn \\; C:\Program Files\Microsoft SQL Server\100\DTS\Binn\; C:\Program文件(x86)\Microsoft SQL Server\100\Tools\Binn\ VSShell\Common7\IDE\; C:\Program文件(x86)\Microsoft SQL Server\100\DTS\Binn\ ;.
2014年4月7日12:01:53 AM org.apache.tomcat.util.digester.SetPropertiesRule begin
警告:[SetPropertiesRule] {Server / Service / Engine / Host / Context}设置属性的来源'到'org.eclipse.jst.jee.server:Test'找不到匹配的属性。
2014年4月7日12:01:53 AM org.apache.tomcat.util.digester.SetPropertiesRule begin
警告:[SetPropertiesRule] {Server / Service / Engine / Host / Context}设置属性的来源'到'org.eclipse.jst.jee.server:WebService'没有找到匹配的属性。
2014年4月7日12:01:54 AM org.apache.coyote.AbstractProtocol init
INFO:初始化ProtocolHandler [http-bio-8080]
2014年4月7日12:01 :54 AM org.apache.coyote.AbstractProtocol init
INFO:初始化ProtocolHandler [ajp-bio-8009]
2014年4月7日12:01:54 AM org.apache.catalina.startup。 Catalina加载
INFO:初始化处理在2220毫秒
2014年4月7日12:01:54 AM org.apache.catalina.core.StandardService startInternal
信息:启动服务Catalina
2014年4月7日12:01:54 AM org.apache.catalina.core.StandardEngine startInternal
INFO:启动Servlet引擎:Apache Tomcat / 7.0.52
2014年4月7日12:01:55 AM org.apache.tomcat.websocket.server.WsSci onStartup
信息:在Java 6上运行时,JSR 356 WebSocket(Java WebSocket 1.0)支持不可用。要抑制此消息,请在Java 7上运行Tomcat,删除WebSocket来自$ CATALINA_HOME / lib的JAR,或将WebSocketJAR添加到$ tomcat.util.scan.DefaultJarScanner.jarsToSkip属性中CATALINA_BASE / conf目录/ catalina.properties。请注意,已弃用的Tomcat 7 WebSocket API将可用。
2014年4月7日12:01:56 AM org.apache.catalina.util.SessionIdGenerator createSecureRandom
INFO:使用[SHA1PRNG]创建用于生成会话ID的SecureRandom实例花费[486]毫秒。
2014年4月7日12:01:56 AM org.apache.catalina.core.ContainerBase startInternal
SEVERE:启动期间子容器失败
java.util.concurrent.ExecutionException:org。 apache.catalina.LifecycleException:无法启动组件[StandardEngine [Catalina] .StandardHost [localhost] .StandardContext [/ WebService]]
在java.util.concurrent.FutureTask $ Sync.innerGet(未知来源)
at java.util.concurrent.FutureTask.get(Unknown Source)
在org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:1123)
在org.apache.catalina.core .StandardHost.startInternal(StandardHost.java:799)
在org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
在org.apache.catalina.core.ContainerBase $ StartChild .call(ContainerBase.java:1559)
在org.apache.catalina.core.ContainerBase $ StartChild.call(ContainerBase.java:1549)
在java.util.concurrent.FutureTask $ Sync.innerRun (未知来源)
在java.util .concurrent.FutureTask.run(未知源)
在java.util.concurrent.ThreadPoolExecutor $ Worker.runTask(未知源)
在java.util.concurrent.ThreadPoolExecutor $ Worker.run(未知来源)
在java.lang.Thread.run(未知源)
导致:org.apache.catalina.LifecycleException:无法启动组件[StandardEngine [Catalina] .StandardHost [localhost] .StandardContext [/ WebService ]]
在org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:154)
... 7更多
导致:java.lang.UnsupportedClassVersionError:org / glassfish / jersey / servlet / init / JerseyServletContainerInitializer:不支持的major.minor版本51.0(无法加载类org.glassfish.jersey.servlet.init.JerseyServletContainerInitializer)
在org.apache.catalina.loader.WebappClassLoader.findClassInternal(WebappClassLoader .java:2948)
在org.apache.catalina.loader.WebappClassLoader.findClass(WebappClassLoader.java:1208)
在org.apache.catali na.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1688)
在org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1569)
在java.lang.Class.forName0( Native方法)
在java.lang.Class.forName(未知源)
在org.apache.catalina.startup.WebappServiceLoader.loadServices(WebappServiceLoader.java:187)
在org.apache .catalina.startup.WebappServiceLoader.load(WebappServiceLoader.java:152)
在org.apache.catalina.startup.ContextConfig.processServletContainerInitializers(ContextConfig.java:1543)
在org.apache.catalina.startup .ContextConfig.webConfig(ContextConfig.java:1265)
在org.apache.catalina.startup.ContextConfig.configureStart(ContextConfig.java:873)
在org.apache.catalina.startup.ContextConfig.lifecycleEvent (ContextConfig.java:371)
在org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117)
在org.apache.catalina.util.Lifecycl eBase.fireLifecycleEvent(LifecycleBase.java:90)
在org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5355)
在org.apache.catalina.util.LifecycleBase.start( LifecycleBase.java:150)
... 7更多
2014年4月7日12:01:56 AM org.apache.catalina.core.ContainerBase startInternal
SEVERE:子容器在start
java.util.concurrent.ExecutionException:org.apache.catalina.LifecycleException:无法启动组件[StandardEngine [Catalina] .StandardHost [localhost]]
在java.util.concurrent.FutureTask $ Sync .innerGet(未知源)
在java.util.concurrent.FutureTask.get(未知源)
在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.startInt ernal(StandardService.java:443)
在org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
在org.apache.catalina.core.StandardServer.startInternal(StandardServer。 java:731)
在org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
在org.apache.catalina.startup.Catalina.start(Catalina.java:689)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
在org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:321)
在org.apache.catalina。 startup.Bootstrap.main(Bootstrap.java:455)
导致:org.apache.catalina.LifecycleException:无法启动组件[StandardEngine [Catalina] .StandardHost [localhost]]
在org.apache .catalina.util.LifecycleBase.start(LifecycleBase.java:1在$ org.apache.catalina.core.ContainerBase $ StartChild.call(ContainerBase.java: 1549)
在java.util.concurrent.FutureTask $ Sync.innerRun(未知来源)
在java.util.concurrent.FutureTask.run(未知来源)
在java.util.concurrent .ThreadPoolExecutor $ Worker.runTask(未知源)
在java.util.concurrent.ThreadPoolExecutor $ Worker.run(未知源)
在java.lang.Thread.run(未知源)
引起的:org.apache.catalina.LifecycleException:一个子容器在启动期间失败
在org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:1131)
在org.apache.catalina .core.StandardHost.startInternal(StandardHost.java:799)
在org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
...另外
四月7,2014 12:01:56 AM org.apache.catalina.startup.Catalina start
SEVERE:re所需的服务器组件启动失败,因此Tomcat无法启动。
org.apache.catalina.LifecycleException:无法启动组件[StandardServer [8005]]
在org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:154)
在org.apache.catalina.startup.Catalina.start(Catalina.java:689)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.apache.catalina.startup.Bootstrap.start (Bootstrap.java:321)
在org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:455)
导致:org.apache.catalina.LifecycleException:无法启动组件[ StandardService [Catalina]]
在org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:154)
在org.apache.catalina.core.StandardServer.startInternal(StandardServer.java:731 )
在org.apache.catalina.util.L ifecycleBase.start(LifecycleBase.java:150)
...另外
导致:org.apache.catalina.LifecycleException:无法启动组件[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更多
导致:org.apache.catalina.LifecycleException:在启动期间
时,子容器失败。 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更多
2014年4月7日12:01:56 AM org.apache.coyote.AbstractProtocol pause
信息:暂停ProtocolHandler [http-bio-8080]
2014年4月7日12:01:56 AM org.apache.coyote.Abstra ctProtocol pause
INFO:暂停ProtocolHandler [ajp-bio-8009]
2014年4月7日12:01:56 AM org.apache.catalina.core.StandardService stopInternal
信息:停止服务Catalina
2014年4月7日12:01:56 AM org.apache.coyote.AbstractProtocol destroy
信息:销毁ProtocolHandler [http-bio-8080]
2014年4月7日12 :01:56 AM org.apache.coyote.AbstractProtocol destroy
信息:销毁ProtocolHandler [ajp-bio-8009]


解决方案

错误消息说:

 不支持的专业.minor版本51.0 
(无法加载类org.glassfish.jersey.servlet.init ....)

这意味着您正在使用一个Java 6 VM,并尝试加载一个包含为java 7构建的类的jar。
您应该尝试升级到java7,或者找到/重建一个版本的jersey与java6兼容。



您可以在对于java类的不同的 major.minor 值,具有相应的jdk版本:

  J2SE 8 = 52,
J2SE 7 = 51,
J2SE 6.0 = 50,
J2SE 5.0 = 49,
JDK 1.4 = 48,
JDK 1.3 = 47,
JDK 1.2 = 46,
JDK 1.1 = 45


I am writing a REST web service using JAX-RS in eclipse with tomcat as server .I am referring the following tutorial to write the web service :http://www.vogella.com/tutorials/REST/article.html

When I run the project I get the following error:

Apr 7, 2014 12:01:53 AM org.apache.catalina.core.AprLifecycleListener init
INFO: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: C:\Program Files\Java\jre6\bin;C:\Windows\Sun\Java\bin;C:\Windows\system32;C:\Windows;C:\Program Files (x86)\Intel\iCLS Client\;C:\Program Files\Intel\iCLS Client\;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\IPT;c:\Maven\bin;C:\Program Files\Java\jdk1.6.0_41\bin;E:\android\adt-bundle-windows-x86_64-20130219\sdk\tools;E:\android\adt-bundle-windows-x86_64-20130219\sdk\platform-tools;C:\strawberry\c\bin;C:\strawberry\perl\site\bin;C:\strawberry\perl\bin;C:\Program Files (x86)\Git\cmd;C:\Python27;C:\MinGW\bin;C:\Python27\Scripts;C:\Program Files\PostgreSQL\9.3\bin;C:\Program Files (x86)\Microsoft SQL Server\100\Tools\Binn\;C:\Program Files\Microsoft SQL Server\100\Tools\Binn\;C:\Program Files\Microsoft SQL Server\100\DTS\Binn\;C:\Program Files (x86)\Microsoft SQL Server\100\Tools\Binn\VSShell\Common7\IDE\;C:\Program Files (x86)\Microsoft SQL Server\100\DTS\Binn\;.
Apr 7, 2014 12:01:53 AM org.apache.tomcat.util.digester.SetPropertiesRule begin
WARNING: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to 'org.eclipse.jst.jee.server:Test' did not find a matching property.
Apr 7, 2014 12:01:53 AM org.apache.tomcat.util.digester.SetPropertiesRule begin
WARNING: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to 'org.eclipse.jst.jee.server:WebService' did not find a matching property.
Apr 7, 2014 12:01:54 AM org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["http-bio-8080"]
Apr 7, 2014 12:01:54 AM org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["ajp-bio-8009"]
Apr 7, 2014 12:01:54 AM org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 2220 ms
Apr 7, 2014 12:01:54 AM org.apache.catalina.core.StandardService startInternal
INFO: Starting service Catalina
Apr 7, 2014 12:01:54 AM org.apache.catalina.core.StandardEngine startInternal
INFO: Starting Servlet Engine: Apache Tomcat/7.0.52
Apr 7, 2014 12:01:55 AM org.apache.tomcat.websocket.server.WsSci onStartup
INFO: JSR 356 WebSocket (Java WebSocket 1.0) support is not available when running on Java 6. To suppress this message, run Tomcat on Java 7, remove the WebSocket JARs from $CATALINA_HOME/lib or add the WebSocketJARs to the tomcat.util.scan.DefaultJarScanner.jarsToSkip property in $CATALINA_BASE/conf/catalina.properties. Note that the deprecated Tomcat 7 WebSocket API will be available.
Apr 7, 2014 12:01:56 AM org.apache.catalina.util.SessionIdGenerator createSecureRandom
INFO: Creation of SecureRandom instance for session ID generation using [SHA1PRNG] took [486] milliseconds.
Apr 7, 2014 12:01:56 AM org.apache.catalina.core.ContainerBase startInternal
SEVERE: A child container failed during start
java.util.concurrent.ExecutionException: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/WebService]]
    at java.util.concurrent.FutureTask$Sync.innerGet(Unknown Source)
    at java.util.concurrent.FutureTask.get(Unknown Source)
    at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:1123)
    at org.apache.catalina.core.StandardHost.startInternal(StandardHost.java:799)
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
    at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1559)
    at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1549)
    at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
    at java.util.concurrent.FutureTask.run(Unknown Source)
    at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
    at java.lang.Thread.run(Unknown Source)
Caused by: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/WebService]]
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:154)
    ... 7 more
Caused by: java.lang.UnsupportedClassVersionError: org/glassfish/jersey/servlet/init/JerseyServletContainerInitializer : Unsupported major.minor version 51.0 (unable to load class org.glassfish.jersey.servlet.init.JerseyServletContainerInitializer)
    at org.apache.catalina.loader.WebappClassLoader.findClassInternal(WebappClassLoader.java:2948)
    at org.apache.catalina.loader.WebappClassLoader.findClass(WebappClassLoader.java:1208)
    at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1688)
    at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1569)
    at java.lang.Class.forName0(Native Method)
    at java.lang.Class.forName(Unknown Source)
    at org.apache.catalina.startup.WebappServiceLoader.loadServices(WebappServiceLoader.java:187)
    at org.apache.catalina.startup.WebappServiceLoader.load(WebappServiceLoader.java:152)
    at org.apache.catalina.startup.ContextConfig.processServletContainerInitializers(ContextConfig.java:1543)
    at org.apache.catalina.startup.ContextConfig.webConfig(ContextConfig.java:1265)
    at org.apache.catalina.startup.ContextConfig.configureStart(ContextConfig.java:873)
    at org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:371)
    at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117)
    at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:90)
    at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5355)
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
    ... 7 more
Apr 7, 2014 12:01:56 AM org.apache.catalina.core.ContainerBase startInternal
SEVERE: A child container failed during start
java.util.concurrent.ExecutionException: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost]]
    at java.util.concurrent.FutureTask$Sync.innerGet(Unknown Source)
    at java.util.concurrent.FutureTask.get(Unknown Source)
    at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:1123)
    at org.apache.catalina.core.StandardEngine.startInternal(StandardEngine.java:300)
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
    at org.apache.catalina.core.StandardService.startInternal(StandardService.java:443)
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
    at org.apache.catalina.core.StandardServer.startInternal(StandardServer.java:731)
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
    at org.apache.catalina.startup.Catalina.start(Catalina.java:689)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:321)
    at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:455)
Caused by: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost]]
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:154)
    at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1559)
    at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1549)
    at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
    at java.util.concurrent.FutureTask.run(Unknown Source)
    at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
    at java.lang.Thread.run(Unknown Source)
Caused by: org.apache.catalina.LifecycleException: A child container failed during start
    at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:1131)
    at org.apache.catalina.core.StandardHost.startInternal(StandardHost.java:799)
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
    ... 7 more
Apr 7, 2014 12:01:56 AM org.apache.catalina.startup.Catalina start
SEVERE: The required Server component failed to start so Tomcat is unable to start.
org.apache.catalina.LifecycleException: Failed to start component [StandardServer[8005]]
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:154)
    at org.apache.catalina.startup.Catalina.start(Catalina.java:689)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:321)
    at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:455)
Caused by: org.apache.catalina.LifecycleException: Failed to start component [StandardService[Catalina]]
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:154)
    at org.apache.catalina.core.StandardServer.startInternal(StandardServer.java:731)
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
    ... 7 more
Caused by: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina]]
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:154)
    at org.apache.catalina.core.StandardService.startInternal(StandardService.java:443)
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
    ... 9 more
Caused by: org.apache.catalina.LifecycleException: A child container failed during start
    at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:1131)
    at org.apache.catalina.core.StandardEngine.startInternal(StandardEngine.java:300)
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
    ... 11 more
Apr 7, 2014 12:01:56 AM org.apache.coyote.AbstractProtocol pause
INFO: Pausing ProtocolHandler ["http-bio-8080"]
Apr 7, 2014 12:01:56 AM org.apache.coyote.AbstractProtocol pause
INFO: Pausing ProtocolHandler ["ajp-bio-8009"]
Apr 7, 2014 12:01:56 AM org.apache.catalina.core.StandardService stopInternal
INFO: Stopping service Catalina
Apr 7, 2014 12:01:56 AM org.apache.coyote.AbstractProtocol destroy
INFO: Destroying ProtocolHandler ["http-bio-8080"]
Apr 7, 2014 12:01:56 AM org.apache.coyote.AbstractProtocol destroy
INFO: Destroying ProtocolHandler ["ajp-bio-8009"]
解决方案

The error message says:

Unsupported major.minor version 51.0
(unable to load class org.glassfish.jersey.servlet.init....)

This means that you are using a java 6 VM, and try to load a jar containing classes built for java 7.You should try to upgrade to java7, or find/rebuild a version of jersey compatible with java6.

You can see at http://en.wikipedia.org/wiki/Java_class_file the different major.minor values for java classes, with the corresponding jdk versions:

J2SE 8 = 52,
J2SE 7 = 51,
J2SE 6.0 = 50,
J2SE 5.0 = 49,
JDK 1.4 = 48,
JDK 1.3 = 47,
JDK 1.2 = 46,
JDK 1.1 = 45

这篇关于在eclipse中部署REST Web Service时出现问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-01 23:59