AnsweredAssumed Answered

Problems with Tomcat ant tasks & Alfresco

Question asked by agatap on Jun 12, 2008
Latest reply on Jun 13, 2008 by rivetlogic
I have been playing with ant lately, and learned how to use Tomcats start/stop/reload tasks for a "standard" web-app.
It is nice to use especially the reload task directly from your buildscript, because you don't have to stop/start the tomcat server manually.

My application is built as an .amp that is added to the alfresco.war.
After updating the alfresco.war, when I execute the reload task I end with an OutOfMemoryError :-(
Similar problem arises when I try to use the stop - update-war -start ant tasks.
So - has anybody successfully managed to autodeploy alfresco to tomcat, by auto-deploy I mean push one button?


        at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpo
int.java:528)
        at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFol
lowerWorkerThread.java:81)
        at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadP
ool.java:685)
        at java.lang.Thread.run(Thread.java:619)
Caused by: java.lang.OutOfMemoryError: PermGen space
        at java.lang.ClassLoader.defineClass1(Native Method)
        at java.lang.ClassLoader.defineClass(ClassLoader.java:620)
        at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:12
4)
        at org.apache.catalina.loader.WebappClassLoader.findClassInternal(Webapp
ClassLoader.java:1847)
        at org.apache.catalina.loader.WebappClassLoader.findClass(WebappClassLoa
der.java:873)
        at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoa
der.java:1326)
        at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoa
der.java:1205)
        at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
        at java.lang.ClassLoader.defineClass1(Native Method)
        at java.lang.ClassLoader.defineClass(ClassLoader.java:620)
        at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:12
4)
        at org.apache.catalina.loader.WebappClassLoader.findClassInternal(Webapp
ClassLoader.java:1847)
        at org.apache.catalina.loader.WebappClassLoader.findClass(WebappClassLoa
der.java:873)
        at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoa
der.java:1326)
        at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoa
der.java:1205)
        at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
        at org.hibernate.type.MapType.instantiate(MapType.java:30)
        at org.hibernate.type.CollectionType.getCollection(CollectionType.java:5
37)
        at org.hibernate.type.CollectionType.resolveKey(CollectionType.java:346)

        at org.hibernate.type.CollectionType.resolve(CollectionType.java:340)
        at org.hibernate.engine.TwoPhaseLoad.initializeEntity(TwoPhaseLoad.java:
116)
        at org.hibernate.loader.Loader.initializeEntitiesAndCollections(Loader.j
ava:842)
        at org.hibernate.loader.Loader.doQuery(Loader.java:717)
        at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Lo
ader.java:224)
        at org.hibernate.loader.Loader.doList(Loader.java:2211)
        at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2095)
        at org.hibernate.loader.Loader.list(Loader.java:2090)
        at org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:388)
        at org.hibernate.hql.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.ja
va:338)
        at org.hibernate.engine.query.HQLQueryPlan.performList(HQLQueryPlan.java
:172)
        at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1121)
        at org.hibernate.impl.QueryImpl.list(QueryImpl.java:79)
14:43:59,195 ERROR [[Catalina].[localhost].[/alfresco]] Exception sending contex
t initialized event to listener instance of class org.springframework.web.contex
t.ContextLoaderListener
org.alfresco.error.AlfrescoRuntimeException: Workflow deployment failed
        at org.alfresco.repo.workflow.WorkflowDeployer.deploy(WorkflowDeployer.j
ava:224)
        at org.alfresco.repo.workflow.WorkflowDeployer.onBootstrap(WorkflowDeplo
yer.java:235)
        at org.alfresco.util.AbstractLifecycleBean.onApplicationEvent(AbstractLi
fecycleBean.java:62)
        at org.springframework.context.event.SimpleApplicationEventMulticaster$1
.run(SimpleApplicationEventMulticaster.java:77)
        at org.springframework.core.task.SyncTaskExecutor.execute(SyncTaskExecut
or.java:49)
        at org.springframework.context.event.SimpleApplicationEventMulticaster.m
ulticastEvent(SimpleApplicationEventMulticaster.java:75)
        at org.springframework.context.support.AbstractApplicationContext.publis
hEvent(AbstractApplicationContext.java:241)
        at org.springframework.context.support.AbstractApplicationContext.refres
h(AbstractApplicationContext.java:349)
        at org.springframework.web.context.support.AbstractRefreshableWebApplica
tionContext.refresh(AbstractRefreshableWebApplicationContext.java:156)
        at org.springframework.web.context.ContextLoader.createWebApplicationCon
text(ContextLoader.java:246)
        at org.springframework.web.context.ContextLoader.initWebApplicationConte
xt(ContextLoader.java:184)
        at org.springframework.web.context.ContextLoaderListener.contextInitiali
zed(ContextLoaderListener.java:49)
        at org.apache.catalina.core.StandardContext.listenerStart(StandardContex
t.java:3764)
        at org.apache.catalina.core.StandardContext.start(StandardContext.java:4
216)
        at org.apache.catalina.core.StandardContext.reload(StandardContext.java:
3025)
        at org.apache.catalina.manager.ManagerServlet.reload(ManagerServlet.java
:907)
        at org.apache.catalina.manager.ManagerServlet.doGet(ManagerServlet.java:
354)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:690)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl
icationFilterChain.java:269)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF
ilterChain.java:188)
        at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperV
alve.java:210)
        at org.apache.catalina.core.StandardContextValve.invoke(StandardContextV
alve.java:174)
        at org.apache.catalina.authenticator.AuthenticatorBase.invoke(Authentica
torBase.java:525)
        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.j
ava:127)
        at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.j
ava:117)
        at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineVal
ve.java:108)
        at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.jav
a:151)
        at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java
:870)
        at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.p
rocessConnection(Http11BaseProtocol.java:665)
        at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpo
int.java:528)
        at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFol
lowerWorkerThread.java:81)
        at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadP
ool.java:685)
        at java.lang.Thread.run(Thread.java:619)
Caused by: java.lang.OutOfMemoryError: PermGen space
        at java.lang.ClassLoader.defineClass1(Native Method)
        at java.lang.ClassLoader.defineClass(ClassLoader.java:620)
        at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:12
4)
        at org.apache.catalina.loader.WebappClassLoader.findClassInternal(Webapp
ClassLoader.java:1847)
        at org.apache.catalina.loader.WebappClassLoader.findClass(WebappClassLoa
der.java:873)
        at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoa
der.java:1326)
        at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoa
der.java:1205)
        at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
        at java.lang.ClassLoader.defineClass1(Native Method)
        at java.lang.ClassLoader.defineClass(ClassLoader.java:620)
        at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:12
4)
        at org.apache.catalina.loader.WebappClassLoader.findClassInternal(Webapp
ClassLoader.java:1847)
        at org.apache.catalina.loader.WebappClassLoader.findClass(WebappClassLoa
der.java:873)
        at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoa
der.java:1326)
        at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoa
der.java:1205)
        at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
        at org.hibernate.type.MapType.instantiate(MapType.java:30)
        at org.hibernate.type.CollectionType.getCollection(CollectionType.java:5
37)
        at org.hibernate.type.CollectionType.resolveKey(CollectionType.java:346)

        at org.hibernate.type.CollectionType.resolve(CollectionType.java:340)
        at org.hibernate.engine.TwoPhaseLoad.initializeEntity(TwoPhaseLoad.java:
116)
        at org.hibernate.loader.Loader.initializeEntitiesAndCollections(Loader.j
ava:842)
        at org.hibernate.loader.Loader.doQuery(Loader.java:717)
        at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Lo
ader.java:224)
        at org.hibernate.loader.Loader.doList(Loader.java:2211)
        at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2095)
        at org.hibernate.loader.Loader.list(Loader.java:2090)
        at org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:388)
        at org.hibernate.hql.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.ja
va:338)
        at org.hibernate.engine.query.HQLQueryPlan.performList(HQLQueryPlan.java
:172)
        at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1121)
        at org.hibernate.impl.QueryImpl.list(QueryImpl.java:79)
14:43:59,242 ERROR [[Catalina].[localhost].[/alfresco]] Exception sending contex
t initialized event to listener instance of class org.alfresco.web.app.ContextLi
stener
org.alfresco.error.AlfrescoRuntimeException: Workflow deployment failed
        at org.alfresco.repo.workflow.WorkflowDeployer.deploy(WorkflowDeployer.j
ava:224)
        at org.alfresco.repo.workflow.WorkflowDeployer.onBootstrap(WorkflowDeplo
yer.java:235)
        at org.alfresco.util.AbstractLifecycleBean.onApplicationEvent(AbstractLi
fecycleBean.java:62)
        at org.springframework.context.event.SimpleApplicationEventMulticaster$1
.run(SimpleApplicationEventMulticaster.java:77)
        at org.springframework.core.task.SyncTaskExecutor.execute(SyncTaskExecut
or.java:49)
        at org.springframework.context.event.SimpleApplicationEventMulticaster.m
ulticastEvent(SimpleApplicationEventMulticaster.java:75)
        at org.springframework.context.support.AbstractApplicationContext.publis
hEvent(AbstractApplicationContext.java:241)
        at org.springframework.context.support.AbstractApplicationContext.refres
h(AbstractApplicationContext.java:349)
        at org.springframework.web.context.support.AbstractRefreshableWebApplica
tionContext.refresh(AbstractRefreshableWebApplicationContext.java:156)
        at org.springframework.web.context.ContextLoader.createWebApplicationCon
text(ContextLoader.java:246)
        at org.springframework.web.context.ContextLoader.initWebApplicationConte
xt(ContextLoader.java:184)
        at org.springframework.web.context.ContextLoaderListener.contextInitiali
zed(ContextLoaderListener.java:49)
        at org.apache.catalina.core.StandardContext.listenerStart(StandardContex
t.java:3764)
        at org.apache.catalina.core.StandardContext.start(StandardContext.java:4
216)
        at org.apache.catalina.core.StandardContext.reload(StandardContext.java:
3025)
        at org.apache.catalina.manager.ManagerServlet.reload(ManagerServlet.java
:907)
        at org.apache.catalina.manager.ManagerServlet.doGet(ManagerServlet.java:
354)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:690)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl
icationFilterChain.java:269)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF
ilterChain.java:188)
        at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperV
alve.java:210)
        at org.apache.catalina.core.StandardContextValve.invoke(StandardContextV
alve.java:174)
        at org.apache.catalina.authenticator.AuthenticatorBase.invoke(Authentica
torBase.java:525)
        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.j
ava:127)
        at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.j
ava:117)
        at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineVal
ve.java:108)
        at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.jav
a:151)
        at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java
:870)
        at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.p
rocessConnection(Http11BaseProtocol.java:665)
        at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpo
int.java:528)
        at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFol
lowerWorkerThread.java:81)
        at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadP
ool.java:685)
        at java.lang.Thread.run(Thread.java:619)
Caused by: java.lang.OutOfMemoryError: PermGen space
        at java.lang.ClassLoader.defineClass1(Native Method)
        at java.lang.ClassLoader.defineClass(ClassLoader.java:620)
        at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:12
4)
        at org.apache.catalina.loader.WebappClassLoader.findClassInternal(Webapp
ClassLoader.java:1847)
        at org.apache.catalina.loader.WebappClassLoader.findClass(WebappClassLoa
der.java:873)
        at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoa
der.java:1326)
        at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoa
der.java:1205)
        at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
        at java.lang.ClassLoader.defineClass1(Native Method)
        at java.lang.ClassLoader.defineClass(ClassLoader.java:620)
        at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:12
4)
        at org.apache.catalina.loader.WebappClassLoader.findClassInternal(Webapp
ClassLoader.java:1847)
        at org.apache.catalina.loader.WebappClassLoader.findClass(WebappClassLoa
der.java:873)
        at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoa
der.java:1326)
        at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoa
der.java:1205)
        at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
        at org.hibernate.type.MapType.instantiate(MapType.java:30)
        at org.hibernate.type.CollectionType.getCollection(CollectionType.java:5
37)
        at org.hibernate.type.CollectionType.resolveKey(CollectionType.java:346)

        at org.hibernate.type.CollectionType.resolve(CollectionType.java:340)
        at org.hibernate.engine.TwoPhaseLoad.initializeEntity(TwoPhaseLoad.java:
116)
        at org.hibernate.loader.Loader.initializeEntitiesAndCollections(Loader.j
ava:842)
        at org.hibernate.loader.Loader.doQuery(Loader.java:717)
        at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Lo
ader.java:224)
        at org.hibernate.loader.Loader.doList(Loader.java:2211)
        at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2095)
        at org.hibernate.loader.Loader.list(Loader.java:2090)
        at org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:388)
        at org.hibernate.hql.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.ja
va:338)
        at org.hibernate.engine.query.HQLQueryPlan.performList(HQLQueryPlan.java
:172)
        at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1121)
        at org.hibernate.impl.QueryImpl.list(QueryImpl.java:79)
12-06-2008 14:43:59 org.apache.catalina.core.StandardContext start
SEVERE: Error listenerStart
12-06-2008 14:43:59 org.apache.catalina.core.StandardContext start
SEVERE: Context [/alfresco] startup failed due to previous errors

I am working on 2.1C, with MySQL.

Best regards,
Agata

Outcomes