AnsweredAssumed Answered

Issue with starting up Share 4.1.a

Question asked by smcardle on Jun 12, 2012
Latest reply on Jun 14, 2012 by smcardle
Hi All/Alfresco techs…

I am having a problem with starting up share, infact I have several problems the first of which is actually to do with the fact that the spring surf 1.0.0 library does not follow the proper XML schema spec.
We use JBoss 6 (would prefer to be using JBoss 6.1 but we won't get the upgrade done for another couple of months) JBoss 6 is pretty strict regarding the WEB xml schema specs and spring surf uses references to "jsp" lower case instead of "JSP" upper case causing JBoss 6 to fail to load the surf jar file.

Anyway, I hand fixed ours and repacked the jar and that works now.

The second problem is also to do with the spring surf library and this one is a little more frustrating as I can't seem to find where the problem is. Here is the relevant stack trace parts:

15:58:18,058 ERROR [[/share]] Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListener: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'webscripts.container' defined in "/app/jboss6/server/cps/deploy/share.war/WEB-INF/lib/spring-surf-1.0.0.jar/org/springframework/extensions/surf/spring-surf-application-context.xml": Cannot resolve reference to bean 'webframework.webscripts.scriptremote' while setting bean property 'scriptObjects' with key [TypedStringValue: value [remote], target type [null]]; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'webframework.webscripts.scriptremote' defined in "/app/jboss6/server/cps/deploy/share.war/WEB-INF/lib/spring-surf-1.0.0.jar/org/springframework/extensions/surf/spring-surf-application-context.xml": Error setting property values; nested exception is org.springframework.beans.NotWritablePropertyException: Invalid property 'configService' of bean class [org.springframework.extensions.webscripts.ScriptRemote]: Bean property 'configService' is not writable or has an invalid setter method. Does the parameter type of the setter match the return type of the getter?
   at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:328) [:3.0.5.RELEASE]
   at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:106) [:3.0.5.RELEASE]
   at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveManagedMap(BeanDefinitionValueResolver.java:378) [:3.0.5.RELEASE]

As can be seen here there is a problem with trying to call a setter on configService of the bean org.springframework.extensions.webscripts.ScriptRemote.
This bean does not have a getter or a setter for configService so it would seem to be a mistake in the spring-surf-1.0.0.jar/org/springframework/extensions/surf/spring-surf-application-context.xml file. BUT IT'S NOT TRUE.

Looking at the spring-surf-1.0.0.jar/org/springframework/extensions/surf/spring-surf-application-context.xml I can see that there is NO call to set this property on that bean !!!!!

Here is the bean definition from the file

   <bean id="webframework.webscripts.scriptremote" class="org.springframework.extensions.webscripts.ScriptRemote">
      <property name="connectorService" ref="connector.service" />
      <property name="connectorProvider" ref="webframework.connector.provider"/>
   </bean>

Look Ma' no configService mentioned anywhere !!!!!

Infact, 2 beans in this file do have a property configService and both of the beans being set have the relevant setter and getter methods with the correct types passed and returned


   <bean id="webframework.rendition.processor.webscript" class="org.springframework.extensions.webscripts.WebScriptProcessor">
      <property name="container"                  ref="webscripts.container" />
      <property name="processorModelHelper"       ref="processor.model.helper"/>
      <property name="configService"              ref="web.config"/>
   </bean>


   <bean id="webscripts.container" parent="webscripts.abstractcontainer" class="org.springframework.extensions.webscripts.LocalWebScriptRuntimeContainer">
      <property name="name"><value>Spring Surf Container</value></property>
      <property name="registry" ref="webscripts.registry" />
      <property name="searchPath" ref="webframework.webscripts.searchpath" />
      <property name="templateProcessorRegistry" ref="webframework.webscripts.registry.templateprocessor" />
      <property name="scriptProcessorRegistry" ref="webframework.webscripts.registry.scriptprocessor" />
      <property name="scriptParameterFactoryRegistry" ref="webscripts.web.scriptparameterfactoryregistry" />
      <property name="configService" ref="web.config" />
      <property name="scriptObjects">
         <map merge="true">
            <entry key="remote" value-ref="webframework.webscripts.scriptremote" />
         </map>
      </property>
      <property name="processorModelHelper" ref="processor.model.helper"/>
      <property name="extensibilityModuleHandler" ref="webscripts.extensibility.handler"/>
      <property name="urlModelFactory" ref="url.model.factory"/>
   </bean>


So my question is WTF is going on here then ??????

The strange thing is…… I use this exact same modified version of spring-surf-1.0.0.jar (to get over the XML schema issues in JBoss6) with my Share 4.0.1 deployment without incident !!!! What gives???

Steve

Outcomes