cancel
Showing results for 
Search instead for 
Did you mean: 

Issue with starting up Share 4.1.a

smcardle
Champ in-the-making
Champ in-the-making
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-applicat...": 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-applicat...": 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
1 REPLY 1

smcardle
Champ in-the-making
Champ in-the-making
Well this issue seems to be cause by the fact that either or both of the spring-surf-1.0.0.jar and spring-wescripts-1.0.0.jar files are different between Alfresco 4.0 and 4,1

I'm surprised that the version numbers are the same!!!

By using the Share 4.1.a spring-surf-1.0.0.jar and updating the surf.tld file again to have the bodycontent elements containing JSP code be JSP in Upper Case rather than in lower case so it meets the spec for the DTD it now works, which means there is a difference in the context file compared to the version shipped with 4.0

Anyway, one more change was required and that was to remove the jta.jar file shipped in the WEB-INF/lib directory. This clashed with the jta.jar file deployed with JBoss 6 AS and share will not start with this file.

With both of these changes done, share 4.1.a now runs fine with JBoss6.

Notice I am using JBoss 6 AS and NOT JBoss 6.1 AS. I believe these issues are non-issues with the latter but I cannot confirm this as I don't currently have JBoss 6.1 AS deployed.

As a side not…… The Alfresco 4.1.a (and 4.0.d) repo alfresco.war will NOT run on JBoss 6 AS without significant changes so I have deployed this to JBoss 4.2.2.GA for the moment.

Regards

Steve