阅读背景:

Jersey JAX-RS和AWS SDK:Tomcat无法启动

来源:互联网 

I'm working on a java web application that utilizes the Jersey JAX-RS implementation for building RESTful Services. All has been well until I added the Amazon Web Services jars to my WEB-INF/lib folder. I'd like to store some data in Amazon S3, but it seems the AWS SDK and Jersey don't play nicely together. With both sets of jars in my lib folder Tomcat won't start. If I remove the jersey-servlet.jar, Tomcat starts, but of course leaves my services broken. I'm using Jersey v1.2 and AWS SDK 1.3.20.

我正在开发一个java Web应用程序,它利用Jersey JAX-RS实现来构建RESTful服务。在我将Amazon Web Services jar添加到WEB-INF / lib文件夹之前,一直都很顺利。我想在Amazon S3中存储一些数据,但似乎AWS SDK和Jersey不能很好地协同工作。在我的lib文件夹中有两组jar,Tomcat将无法启动。如果我删除了jersey-servlet.jar,Tomcat会启动,但当然会让我的服务崩溃。我正在使用Jersey v1.2和AWS SDK 1.3.20。

Has anybody else seen this same behavior?

有没有人看到过同样的行为?

Thanks

SEVERE: A child container failed during start
java.util.concurrent.ExecutionException: java.lang.OutOfMemoryError: Java heap space
at java.util.concurrent.FutureTask$Sync.innerGet(FutureTask.java:222)
at java.util.concurrent.FutureTask.get(FutureTask.java:83)
at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:1123)
at org.apache.catalina.core.StandardHost.startInternal(StandardHost.java:785)
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(FutureTask.java:303)
at java.util.concurrent.FutureTask.run(FutureTask.java:138)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:680)
Caused by: java.lang.OutOfMemoryError: Java heap space
at org.apache.tomcat.util.bcel.classfile.ClassParser.readFields(ClassParser.java:223)
at org.apache.tomcat.util.bcel.classfile.ClassParser.parse(ClassParser.java:126)
at org.apache.catalina.startup.ContextConfig.processAnnotationsStream(ContextConfig.java:2066)
at org.apache.catalina.startup.ContextConfig.processAnnotationsJar(ContextConfig.java:1942)
at org.apache.catalina.startup.ContextConfig.processAnnotationsUrl(ContextConfig.java:1908)
at org.apache.catalina.startup.ContextConfig.processAnnotations(ContextConfig.java:1893)
at org.apache.catalina.startup.ContextConfig.webConfig(ContextConfig.java:1296)
at org.apache.catalina.startup.ContextConfig.configureStart(ContextConfig.java:855)
at org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:346)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:90)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5173)
... 8 more
Oct 2, 2012 12:36:04 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(FutureTask.java:222)
at java.util.concurrent.FutureTask.get(FutureTask.java:83)
at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:1123)
at org.apache.catalina.core.StandardEngine.startInternal(StandardEngine.java:302)
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:732)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.startup.Catalina.start(Catalina.java:675)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:322)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:451)

1 个解决方案

#1


0  

Was able to resolve this. Turns out it was as simple as allocating more space to the JVM.

能够解决这个问题。事实证明,这就像为JVM分配更多空间一样简单。


分享到: