users@jersey.java.net

[Jersey] Re: Problems using Jersey and Hbase

From: Glen Mazza <gmazza_at_talend.com>
Date: Thu, 16 Aug 2012 17:05:33 -0400

Looks like you need to set aside more memory for Tomcat, I use this
environment variable in my Ubuntu Linux .bashrc file:
export CATALINA_OPTS="-Xms128m -Xmx1024m -XX:MaxPermSize=256m"

I'm unsure (actually doubt) Eclipse would read that (the above works
when you activate Tomcat from the command-line), you may need to Google
a bit to determine where to put those params within Eclipse IDE so it
will use them for Tomcat.

HTH,
Glen

On 08/16/2012 03:01 PM, Issam Maamria wrote:
> The issue appear with Tomcat 7 but NOT tomcat 6.
>
> Thanks
>
> Issam
>
> On 16 August 2012 15:55, Issam Maamria <maamria_at_gmail.com
> <mailto:maamria_at_gmail.com>> wrote:
>
> Hi all,
>
> I have a Jersey webapp run from within Tomcat. In the webapp, I
> have a handler that, as part of handling requests, stores and
> retrieves data from Hbase. In the WEB_INF/lib folder of the Jersey
> project, I included the three necessary libraries to use Hbase
> from within the app, namely: hbase, hadoop and zookeeper. However,
> when running the webapp (from within eclipse), tomcat does not
> launch, and exceptions are thrown:
>
> java.util.concurrent.ExecutionException:
> java.lang.OutOfMemoryError: Java heap space
> --
> SEVERE: Catalina.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: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)
> 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:732)
> 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:302)
> at
> org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
> ... 11 more
> Aug 16, 2012 3:33:29 PM org.apache.catalina.startup.Catalina start
> INFO: Server startup in 15551 ms
> Exception in thread "Poller SunPKCS11-Darwin"
> java.lang.OutOfMemoryError: Java heap space
> at sun.security.pkcs11.wrapper.PKCS11.C_GetSlotInfo(Native Method)
> at sun.security.pkcs11.SunPKCS11.initToken(SunPKCS11.java:767)
> at sun.security.pkcs11.SunPKCS11.access$100(SunPKCS11.java:42)
> at
> sun.security.pkcs11.SunPKCS11$TokenPoller.run(SunPKCS11.java:700)
> at java.lang.Thread.run(Thread.java:680)
>
> The exception does not happen if hadoop.***.jar is not included.
> Note that the same issue happens with a deployed webapp.
>
> Any hints will be majorly appreciated!
>
> Thanks
>
> Issam
>
>