cancel
Showing results for 
Search instead for 
Did you mean: 

ERROR Deploying web application archive share.war

devondan
Champ in-the-making
Champ in-the-making
Thanks for taking the time to read my post. I am experiencing some problems with the deployment of Share.

The server had been running and stable for several weeks but had to be restarted by the hosting company. Now, while the main Alfresco service starts absolutely fine, share.war wont, reporting "Context initialization failed". Here is the extract from catalina.out:


INFO: Deploying configuration descriptor host-manager.xml
Dec 10, 2010 2:44:54 PM org.apache.catalina.startup.HostConfig deployWAR
INFO: Deploying web application archive share.war
14:44:56,570  ERROR [web.context.ContextLoader] Context initialization failed
org.springframework.beans.factory.CannotLoadBeanClassException: Cannot find class [org.alfresco.web.scripts.PresentationScriptProcessor] for bean with name 'webframework.webscripts.scriptprocessor' defined in URL [file:/opt/Alfresco/tomcat/shared/classes/alfresco/web-extension/custom-web-framework-application-context.xml]; nested exception is java.lang.ClassNotFoundException: org.alfresco.web.scripts.PresentationScriptProcessor
   at org.springframework.beans.factory.support.AbstractBeanFactory.resolveBeanClass(AbstractBeanFactory.java:1208)
   at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.predictBeanType(AbstractAutowireCapableBeanFactory.java:568)
   at org.springframework.beans.factory.support.AbstractBeanFactory.isFactoryBean(AbstractBeanFactory.java:1277)
   at org.springframework.beans.factory.support.AbstractBeanFactory.isFactoryBean(AbstractBeanFactory.java:844)
   at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:539)
   at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:842)
   at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:416)
   at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:261)
   at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:192)
   at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:47)
   at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3972)
   at org.apache.catalina.core.StandardContext.start(StandardContext.java:4467)
   at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:791)
   at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:771)
   at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:546)
   at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:905)
   at org.apache.catalina.startup.HostConfig.deployWARs(HostConfig.java:740)
   at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:500)
   at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1277)
   at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:321)
   at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
   at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1053)
   at org.apache.catalina.core.StandardHost.start(StandardHost.java:785)
   at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
   at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
   at org.apache.catalina.core.StandardService.start(StandardService.java:519)
   at org.apache.catalina.core.StandardServer.start(StandardServer.java:710)
   at org.apache.catalina.startup.Catalina.start(Catalina.java:581)
   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:289)
   at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414)
Caused by: java.lang.ClassNotFoundException: org.alfresco.web.scripts.PresentationScriptProcessor
   at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1516)
   at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1361)
   at org.springframework.util.ClassUtils.forName(ClassUtils.java:258)
   at org.springframework.beans.factory.support.AbstractBeanDefinition.resolveBeanClass(AbstractBeanDefinition.java:408)
   at org.springframework.beans.factory.support.AbstractBeanFactory.doResolveBeanClass(AbstractBeanFactory.java:1229)
   at org.springframework.beans.factory.support.AbstractBeanFactory.resolveBeanClass(AbstractBeanFactory.java:1200)
   … 33 more
Dec 10, 2010 2:44:56 PM org.apache.catalina.core.StandardContext start
SEVERE: Error listenerStart
Dec 10, 2010 2:44:56 PM org.apache.catalina.core.StandardContext start
SEVERE: Context [/share] startup failed due to previous errors
log4j:ERROR LogMananger.repositorySelector was null likely due to error in class reloading, using NOPLoggerRepository.
Dec 10, 2010 2:44:57 PM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory examples
Dec 10, 2010 2:44:57 PM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory docs
Dec 10, 2010 2:44:57 PM org.apache.coyote.http11.Http11Protocol start
INFO: Starting Coyote HTTP/1.1 on http-8080
Dec 10, 2010 2:44:57 PM org.apache.catalina.startup.Catalina start
INFO: Server startup in 70450 ms
Nothing had changed between stopping and restarting the server so I am very much at a loss. Can anyone hint on a possible cause for this? Possibly the server not closing Alfresco correctly when it rebooted?

Thank you so much in advance for your time and any help,

Best regards,
Dan
5 REPLIES 5

devondan
Champ in-the-making
Champ in-the-making
So I still haven't found a solution to this problem yet. I have tried replacing share.war on the off chance the file had become corrupted but I get exactly the same error:
ERROR [web.context.ContextLoader] Context initialization failed
org.springframework.beans.factory.CannotLoadBeanClassException: Cannot find class [org.alfresco.web.scripts.PresentationScriptProcessor] for bean with name 'webframework.webscripts.scriptprocessor' defined in URL [file:/opt/Alfresco/tomcat/shared/classes/alfresco/web-extension/custom-web-framework-application-context.xml]; nested exception is java.lang.ClassNotFoundException: org.alfresco.web.scripts.PresentationScriptProcessor
So it seems that the whole thing is failing when trying to look for this PresentationScriptProcessor class which can't be found. Looking at share.war, it seems there is not a class called PresentationScriptProcessor present. But I guess that may well be nothing unusual (using jar tvf share.war *PresentationScriptProcessor*).

Can anyone point me in the direction of a possible solution for this? It's really driving me mad now!
Thanks again for your time,
Dan

bcoulson
Champ in-the-making
Champ in-the-making
Dan

I know this post is a few months old but I wanted to know if you ever determined the cause of this error? I am experiencing the same issue, although mine is due to introducing a bean for this class in a spring configuration file based on configuration snippet from "Professional Alfresco: Practical Solutions for ECM" book. Any insight would help.

Thanks
Brenda

mrogers
Star Contributor
Star Contributor
That class used to exist in the "Web Framework" project in Alfresco 3.2.

I can't see it on more recent versions of Alfresco so I presume its part of the changes associated with the move to spring surf.   It would seem that your problem is with using an obsolete configuration file.

bcoulson
Champ in-the-making
Champ in-the-making
Thanks for the quick reply, as always. Question for you then - I was using sample code from the book "Professional Alfresco: Practical Solutions for ECM" book that disables caching of the JSP pages so that they are not interpreted and being able to make dynamic changes to them is allowed (which for development purposes is obviously very useful). What would I use instead to achieve this? The configuration changes outlined in that book are as follows.


<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE beans PUBLIC '-//SPRING//DTD BEAN//EN' 'http://www.springframework.org/dtd/spring-beans.dtd'>
<beans>
<bean id="webframework.webscripts.scriptprocessor" class="org.alfresco.web.scripts.PresentationScriptProcessor">
   <property name="searchPath" ref="webframework.searchpath"/>
   <property name="compile">
      <value>false</value>
   </property>
</bean>
<bean id="webframework.scriptprocessor" class="org.alfresco.web.scripts.PresentationScriptProcessor">
   <property name="searchPath" ref="webframework.templates.searchpath"/>
   <property name="compile">
      <value>false</value>
   </property>
</bean>
</beans>

in file named custom-web-framework-application-context.xml in shared/classes/alfresco/web-extension directory.

Any insight would be greatly appreciated.
Brenda

bcoulson
Champ in-the-making
Champ in-the-making
For anyone interested in how to turn off caching in Alfresco so that you can deploy FreeMarker templates and JSP changes without a server restart, I found my answer in another post. Here is the post:
http://forums.alfresco.com/en/viewtopic.php?f=48&t=28341

The important piece is you need to add this to your share-config-custom.xml file:


<alfresco-config>
   <config evaluator="string-compare" condition="WebFramework">
      <web-framework>
         <!– Autowire Runtime Settings –>
         <autowire>
            <!– Pick the mode: development, preview, production –>
            <mode>development</mode>
         </autowire>
      </web-framework>
   </config>
</alfresco-config>