Webscript, Sping, iBatis e Context Initialization Failed

cancel
Showing results for 
Search instead for 
Did you mean: 
exel88
Member II

Webscript, Sping, iBatis e Context Initialization Failed

Buongiorno a tutti,
sono nuovo in questo forum e direi che sono nuovo anche nello sviluppo per Alfresco. Smiley Happy

In questi giorni ho cercato di risolvere vari problemi riguardanti lo sviluppo di un webscript in Java per Alfresco che non riesco, dopo numerosi tentativi, correzione, eccetera, a deployare completamente nel server.
Ho commentato varie porzioni del codice fino a raggiungere un punto in cui posso dire con quasi certezza di aver individuato cosa non funziona, ma non riesco comunque a sistemarlo.

Vi incollo codice, eccezione, e struttura delle directory di seguito.
Uso Alfresco Community Edition 3.4 installata su server Tomcat (ho utilizzato comunque l'installazione completa di Alfresco dall'eseguibile).


10:49:07,159  INFO  [alfresco.config.FixedPropertyPlaceholderConfigurer] Loading properties file from URL [file:/C:/Users/andrea/Lavoro/Alfresco/tomcat/shared/classes/alfresco/extension/custom-vti.properties]
10:49:07,194  ERROR [web.context.ContextLoader] Context initialization failed
org.springframework.beans.factory.BeanInitializationException: Could not load properties; nested exception is java.io.FileNotFoundException: Could not open ServletContext resource [/classpath*:/db.properties]
    at org.springframework.beans.factory.config.PropertyResourceConfigurer.postProcessBeanFactory(PropertyResourceConfigurer.java:78)
    at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:624)
    at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:599)
    at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:398)
    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.alfresco.web.app.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:63)
    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.deployDescriptor(HostConfig.java:637)
    at org.apache.catalina.startup.HostConfig.deployDescriptors(HostConfig.java:563)
    at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:498)
    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.io.FileNotFoundException: Could not open ServletContext resource [/classpath*:/db.properties]
    at org.springframework.web.context.support.ServletContextResource.getInputStream(ServletContextResource.java:118)
    at org.springframework.core.io.support.PropertiesLoaderSupport.loadProperties(PropertiesLoaderSupport.java:181)
    at org.springframework.core.io.support.PropertiesLoaderSupport.mergeProperties(PropertiesLoaderSupport.java:161)
    at org.springframework.beans.factory.config.PropertyResourceConfigurer.postProcessBeanFactory(PropertyResourceConfigurer.java:69)
    … 31 more
log4j:ERROR LogMananger.repositorySelector was null likely due to error in class reloading, using NOPLoggerRepository.
10:49:33,492  INFO  [extensions.webscripts.DeclarativeRegistry] Registered 309 Web Scripts (+0 failed), 319 URLs


La struttura delle directory nel JAR (che copio in WEB-INF/lib per eseguire il deploy) è la seguente:

. alfresco/
     . extension/
           . module-context-xml
           . module.properties
           . nomeDelWS.post.desc.xml
           . nomeDelWS.post.html.ftl
. it/
   . a/
       . b/
           . nomeDelWS/
                  . dao (contiene .class)
                          . maps (contiene gli xml di ibatis)
                  . domain (contiene .class)
                  . support (contiene .class)
                  . util (contiene .class)
                  . webscript
                        . ProtocolloFileUpload.class
. META-INF
. db.properties
. log4j.properties
. sql-map-config.xml



Questo è il MANIFEST-MF:
Manifest-Version: 1.0
Ant-Version: Apache Ant 1.7.1
Created-By: 17.1-b03 (Sun Microsystems Inc.)

… e infine questo è il file incriminato  Smiley Very Happy (ho messo degli * per evidenziarvi una porzioncina del codice, che se commentata sembra non dare problemi) : module-context.xml

<?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="webscript.it.a.b.nomeDelWS.webscript.ProtocolloFileUpload.post" class="it.a.b.nomeDelWS.webscript.ProtocolloFileUpload"
      parent="webscript">

      <property name="authenticationService" ref="authenticationService" />
      <property name="nodeService" ref="nodeService" />
      <property name="namespaceService" ref="namespaceService" />
      <property name="fileFolderService" ref="fileFolderService" />
      <property name="contentService" ref="contentService" />
      <property name="searchService" ref="searchService" />
      <property name="authorityService" ref="authorityService" />
      <property name="transactionService" ref="transactionService" />
      <property name="permissionService" ref="permissionService" />
      <property name="categoryService" ref="categoryService" />
   </bean>

*   <bean id="propertyConfigurer" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
*            <property name="location">
*         <value>classpath*:/db.properties</value>
*      </property>
*   </bean>
   
   <bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close">
      <property name="driverClassName" value="${jdbc.driverClassName}" />
      <property name="url" value="${jdbc.url}" />
      <property name="username" value="${jdbc.username}" />
      <property name="password" value="${jdbc.password}" />
   </bean>

   <bean id="transactionManager" class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
      <property name="dataSource" ref="dataSource" />
   </bean>

   <bean id="sqlMapClient" class="org.springframework.orm.ibatis.SqlMapClientFactoryBean">
      <property name="configLocation" value="classpath:/sql-map-config.xml" />
      <property name="dataSource" ref="dataSource" />
   </bean>

   <bean id="daoSupport" class="it.insiel.archprot.protocolloAlfrescoInsiel.dao.DAOUtils">
      <property name="sqlMapClient" ref="sqlMapClient" />
   </bean>

   <bean id="interactionsDAO" class="it.insiel.archprot.protocolloAlfrescoInsiel.dao.InteractionsDAO">
      <property name="support" ref="daoSupport" />
   </bean>
   
</beans>

Ho provato a sostituire la porzione:
   
<bean id="propertyConfigurer" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
      <property name="location">
         <value>classpath*:/db.properties</value>
      </property>
</bean>
con:

   <bean id="propertyConfigurer" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
      <property name="location">
         <value>classpath:/db.properties</value>
      </property>
   </bean>

In questo caso l'eccezione è la seguente:

11:13:21,599  INFO  [alfresco.config.FixedPropertyPlaceholderConfigurer] Loading properties file from class path resource [alfresco/domain/cache-strategies.properties]
11:13:21,683  INFO  [alfresco.config.FixedPropertyPlaceholderConfigurer] Loading properties file from class path resource [alfresco/module/org.alfresco.module.vti/context/vti.properties]
11:13:21,686  INFO  [alfresco.config.FixedPropertyPlaceholderConfigurer] Loading properties file from URL [file:/C:/Users/andrea/Lavoro/Alfresco/tomcat/shared/classes/alfresco/extension/custom-vti.properties]
11:13:21,804  ERROR [web.context.ContextLoader] Context initialization failed
org.springframework.beans.factory.BeanDefinitionStoreException: Invalid bean definition with name 'clusterPropertySetter' defined in class path resource [alfresco/core-services-context.xml]: Could not resolve placeholder 'alfresco.tcp.start_port'
    at org.springframework.beans.factory.config.PropertyPlaceholderConfigurer.processProperties(PropertyPlaceholderConfigurer.java:272)
    at org.springframework.beans.factory.config.PropertyResourceConfigurer.postProcessBeanFactory(PropertyResourceConfigurer.java:75)
    at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:624)
    at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:599)
    at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:398)
    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.alfresco.web.app.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:63)
    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.deployDescriptor(HostConfig.java:637)
    at org.apache.catalina.startup.HostConfig.deployDescriptors(HostConfig.java:563)
    at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:498)
    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)
log4j:ERROR LogMananger.repositorySelector was null likely due to error in class reloading, using NOPLoggerRepository..

Tutte e tre le "versioni" hanno dato lo stesso risultato.

La cartella A e la cartella B ovviamente hanno altri nomi, ma ho mantenuto la struttura così come la utilizzo io. Anche "nomeDelWS" ovviamente è un altro, ma per motivi lavorativi preferisco non scriverlo qui. Smiley Happy

Grazie,


Andrea
2 Replies
exel88
Member II

Re: Webscript, Sping, iBatis e Context Initialization Failed

Ho provato a togliere la porzione di codice che carica il file dp.properties ed integrare direttamente i dati nel resto del codice.
Il risultato è stato un passo in avanti ottenendo un centinaio di eccezioni. XD


<bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close">
      <property name="driverClassName" value="oracle.jdbc.driver.OracleDriver" />
      <property name="url" value="jdbc:oracle:thin:@10.16.1.xx:1521:E3" />
      <property name="username" value="xxx" />
      <property name="password" value="xxx" />
</bean>


12:58:24,188  INFO  [alfresco.config.FixedPropertyPlaceholderConfigurer] Loading properties file from URL [file:/C:/Users/andrea/Lavoro/Alfresco/tomcat/shared/classes/alfresco/extension/custom-vti.properties]
12:58:35,724  ERROR [web.context.ContextLoader] Context initialization failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'messageService' defined in class path resource [alfresco/core-services-context.xml]: Cannot resolve reference to bean 'SearchService' while setting bean property 'searchService'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'SearchService' defined in class path resource [alfresco/public-services-context.xml]: Cannot resolve reference to bean 'searchService' while setting bean property 'target'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'searchService' defined in class path resource [alfresco/core-services-context.xml]: Cannot resolve reference to bean 'indexerAndSearcherFactory' while setting bean property 'indexerAndSearcherFactory'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'indexerAndSearcherFactory' defined in class path resource [alfresco/core-services-context.xml]: Cannot resolve reference to bean 'admLuceneIndexerAndSearcherFactory' while setting bean property 'defaultBinding'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'admLuceneIndexerAndSearcherFactory' defined in class path resource [alfresco/core-services-context.xml]: Cannot resolve reference to bean 'mlAwareNodeService' while setting bean property 'nodeService'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'mlAwareNodeService' defined in class path resource [alfresco/node-services-context.xml]: Cannot resolve reference to bean 'mtAwareNodeService' while setting bean property 'defaultBinding'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'mtAwareNodeService': FactoryBean threw exception on object creation; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dbNodeService' defined in class path resource [alfresco/node-services-context.xml]: Cannot resolve reference to bean 'qnameDAO' while setting bean property 'qnameDAO'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'qnameDAO' defined in class path resource [alfresco/dao/dao-context.xml]: Cannot resolve reference to bean 'repoSqlMapClientTemplate' while setting bean property 'sqlMapClientTemplate'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'repoSqlMapClientTemplate' defined in class path resource [alfresco/ibatis/ibatis-context.xml]: Cannot resolve reference to bean 'alfrescoSqlMapClient' while setting bean property 'sqlMapClient'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'alfrescoSqlMapClient' defined in class path resource [alfresco/ibatis/ibatis-context.xml]: Invocation of init method failed; nested exception is org.springframework.core.NestedIOException: Failed to parse config resource: class path resource [alfresco/ibatis/alfresco-SqlMapConfig.xml]; nested exception is com.ibatis.common.xml.NodeletException: Error parsing XML.  Cause: java.lang.RuntimeException: Error parsing XPath '/sqlMapConfig/sqlMap'.  Cause: com.ibatis.sqlmap.client.SqlMapException: The <sqlMap> resource is missing: alfresco/ibatis/#resource.dialect#/qname-insert-SqlMap.xml
    at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:328)
    at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:106)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1305)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1067)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:511)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:450)
    at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:290)
    at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
    at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:287)
    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:189)
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:557)
    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.alfresco.web.app.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:63)
    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.deployDescriptor(HostConfig.java:637)
    at org.apache.catalina.startup.HostConfig.deployDescriptors(HostConfig.java:563)
    at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:498)
    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: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'SearchService' defined in class path resource [alfresco/public-services-context.xml]: Cannot resolve reference to bean 'searchService' while setting bean property 'target'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'searchService' defined in class path resource [alfresco/core-services-context.xml]: Cannot resolve reference to bean 'indexerAndSearcherFactory' while setting bean property 'indexerAndSearcherFactory'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'indexerAndSearcherFactory' defined in class path resource [alfresco/core-services-context.xml]: Cannot resolve reference to bean 'admLuceneIndexerAndSearcherFactory' while setting bean property 'defaultBinding'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'admLuceneIndexerAndSearcherFactory' defined in class path resource [alfresco/core-services-context.xml]: Cannot resolve reference to bean 'mlAwareNodeService' while setting bean property 'nodeService'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'mlAwareNodeService' defined in class path resource [alfresco/node-services-context.xml]: Cannot resolve reference to bean 'mtAwareNodeService' while setting bean property 'defaultBinding'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'mtAwareNodeService': FactoryBean threw exception on object creation; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dbNodeService' defined in class path resource [alfresco/node-services-context.xml]: Cannot resolve reference to bean 'qnameDAO' while setting bean property 'qnameDAO'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'qnameDAO' defined in class path resource [alfresco/dao/dao-context.xml]: Cannot resolve reference to bean 'repoSqlMapClientTemplate' while setting bean property 'sqlMapClientTemplate'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'repoSqlMapClientTemplate' defined in class path resource [alfresco/ibatis/ibatis-context.xml]: Cannot resolve reference to bean 'alfrescoSqlMapClient' while setting bean property 'sqlMapClient'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'alfrescoSqlMapClient' defined in class path resource [alfresco/ibatis/ibatis-context.xml]: Invocation of init method failed; nested exception is org.springframework.core.NestedIOException: Failed to parse config resource: class path resource [alfresco/ibatis/alfresco-SqlMapConfig.xml]; nested exception is com.ibatis.common.xml.NodeletException: Error parsing XML.  Cause: java.lang.RuntimeException: Error parsing XPath '/sqlMapConfig/sqlMap'.  Cause: com.ibatis.sqlmap.client.SqlMapException: The <sqlMap> resource is missing: alfresco/ibatis/#resource.dialect#/qname-insert-SqlMap.xml
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'SearchService' defined in class path resource [alfresco/public-services-context.xml]: Cannot resolve reference to bean 'searchService' while setting bean property 'target'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'searchService' defined in class path resource [alfresco/core-services-context.xml]: Cannot resolve reference to bean 'indexerAndSearcherFactory' while setting bean property 'indexerAndSearcherFactory'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'indexerAndSearcherFactory' defined in class path resource [alfresco/core-services-context.xml]: Cannot resolve reference to bean 'admLuceneIndexerAndSearcherFactory' while setting bean property 'defaultBinding'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'admLuceneIndexerAndSearcherFactory' defined in class path resource [alfresco/core-services-context.xml]: Cannot resolve reference to bean 'mlAwareNodeService' while setting bean property 'nodeService'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'mlAwareNodeService' defined in class path resource [alfresco/node-services-context.xml]: Cannot resolve reference to bean 'mtAwareNodeService' while setting bean property 'defaultBinding'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'mtAwareNodeService': FactoryBean threw exception on object creation; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dbNodeService' defined in class path resource [alfresco/node-services-context.xml]: Cannot resolve reference to bean 'qnameDAO' while setting bean property 'qnameDAO'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'qnameDAO' defined in class path resource [alfresco/dao/dao-context.xml]: Cannot resolve reference to bean 'repoSqlMapClientTemplate' while setting bean property 'sqlMapClientTemplate'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'repoSqlMapClientTemplate' defined in class path resource [alfresco/ibatis/ibatis-context.xml]: Cannot resolve reference to bean 'alfrescoSqlMapClient' while setting bean property 'sqlMapClient'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'alfrescoSqlMapClient' defined in class path resource [alfresco/ibatis/ibatis-context.xml]: Invocation of init method failed; nested exception is org.springframework.core.NestedIOException: Failed to parse config resource: class path resource [alfresco/ibatis/alfresco-SqlMapConfig.xml]; nested exception is com.ibatis.common.xml.NodeletException: Error parsing XML.  Cause: java.lang.RuntimeException: Error parsing XPath '/sqlMapConfig/sqlMap'.  Cause: com.ibatis.sqlmap.client.SqlMapException: The <sqlMap> resource is missing: alfresco/ibatis/#resource.dialect#/qname-insert-SqlMap.xml
    at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:328)
    at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:106)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1305)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1067)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:511)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:450)
    at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:290)
    at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
    at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:287)
    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:189)
    at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:322)
    … 40 more
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'searchService' defined in class path resource [alfresco/core-services-context.xml]: Cannot resolve reference to bean 'indexerAndSearcherFactory' while setting bean property 'indexerAndSearcherFactory'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'indexerAndSearcherFactory' defined in class path resource [alfresco/core-services-context.xml]: Cannot resolve reference to bean 'admLuceneIndexerAndSearcherFactory' while setting bean property 'defaultBinding'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'admLuceneIndexerAndSearcherFactory' defined in class path resource [alfresco/core-services-context.xml]: Cannot resolve reference to bean 'mlAwareNodeService' while setting bean property 'nodeService'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'mlAwareNodeService' defined in class path resource [alfresco/node-services-context.xml]: Cannot resolve reference to bean 'mtAwareNodeService' while setting bean property 'defaultBinding'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'mtAwareNodeService': FactoryBean threw exception on object creation; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dbNodeService' defined in class path resource [alfresco/node-services-context.xml]: Cannot resolve reference to bean 'qnameDAO' while setting bean property 'qnameDAO'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'qnameDAO' defined in class path resource [alfresco/dao/dao-context.xml]: Cannot resolve reference to bean 'repoSqlMapClientTemplate' while setting bean property 'sqlMapClientTemplate'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'repoSqlMapClientTemplate' defined in class path resource [alfresco/ibatis/ibatis-context.xml]: Cannot resolve reference to bean 'alfrescoSqlMapClient' while setting bean property 'sqlMapClient'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'alfrescoSqlMapClient' defined in class path resource [alfresco/ibatis/ibatis-context.xml]: Invocation of init method failed; nested exception is org.springframework.core.NestedIOException: Failed to parse config resource: class path resource [alfresco/ibatis/alfresco-SqlMapConfig.xml]; nested exception is com.ibatis.common.xml.NodeletException: Error parsing XML.  Cause: java.lang.RuntimeException: Error parsing XPath '/sqlMapConfig/sqlMap'.  Cause: com.ibatis.sqlmap.client.SqlMapException: The <sqlMap> resource is missing: alfresco/ibatis/#resource.dialect#/qname-insert-SqlMap.xml
    at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:328)
    at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:106)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1305)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1067)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:511)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:450)
    at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:290)
    at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
    at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:287)
    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:189)
    at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:322)
    … 50 more
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'indexerAndSearcherFactory' defined in class path resource [alfresco/core-services-context.xml]: Cannot resolve reference to bean 'admLuceneIndexerAndSearcherFactory' while setting bean property 'defaultBinding'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'admLuceneIndexerAndSearcherFactory' defined in class path resource [alfresco/core-services-context.xml]: Cannot resolve reference to bean 'mlAwareNodeService' while setting bean property 'nodeService'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'mlAwareNodeService' defined in class path resource [alfresco/node-services-context.xml]: Cannot resolve reference to bean 'mtAwareNodeService' while setting bean property 'defaultBinding'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'mtAwareNodeService': FactoryBean threw exception on object creation; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dbNodeService' defined in class path resource [alfresco/node-services-context.xml]: Cannot resolve reference to bean 'qnameDAO' while setting bean property 'qnameDAO'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'qnameDAO' defined in class path resource [alfresco/dao/dao-context.xml]: Cannot resolve reference to bean 'repoSqlMapClientTemplate' while setting bean property 'sqlMapClientTemplate'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'repoSqlMapClientTemplate' defined in class path resource [alfresco/ibatis/ibatis-context.xml]: Cannot resolve reference to bean 'alfrescoSqlMapClient' while setting bean property 'sqlMapClient'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'alfrescoSqlMapClient' defined in class path resource [alfresco/ibatis/ibatis-context.xml]: Invocation of init method failed; nested exception is org.springframework.core.NestedIOException: Failed to parse config resource: class path resource [alfresco/ibatis/alfresco-SqlMapConfig.xml]; nested exception is com.ibatis.common.xml.NodeletException: Error parsing XML.  Cause: java.lang.RuntimeException: Error parsing XPath '/sqlMapConfig/sqlMap'.  Cause: com.ibatis.sqlmap.client.SqlMapException: The <sqlMap> resource is missing: alfresco/ibatis/#resource.dialect#/qname-insert-SqlMap.xml
    at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:328)
    at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:106)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1305)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1067)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:511)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:450)
    at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:290)
    at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
    at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:287)
    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:189)
    at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:322)
    … 60 more
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'admLuceneIndexerAndSearcherFactory' defined in class path resource [alfresco/core-services-context.xml]: Cannot resolve reference to bean 'mlAwareNodeService' while setting bean property 'nodeService'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'mlAwareNodeService' defined in class path resource [alfresco/node-services-context.xml]: Cannot resolve reference to bean 'mtAwareNodeService' while setting bean property 'defaultBinding'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'mtAwareNodeService': FactoryBean threw exception on object creation; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dbNodeService' defined in class path resource [alfresco/node-services-context.xml]: Cannot resolve reference to bean 'qnameDAO' while setting bean property 'qnameDAO'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'qnameDAO' defined in class path resource [alfresco/dao/dao-context.xml]: Cannot resolve reference to bean 'repoSqlMapClientTemplate' while setting bean property 'sqlMapClientTemplate'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'repoSqlMapClientTemplate' defined in class path resource [alfresco/ibatis/ibatis-context.xml]: Cannot resolve reference to bean 'alfrescoSqlMapClient' while setting bean property 'sqlMapClient'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'alfrescoSqlMapClient' defined in class path resource [alfresco/ibatis/ibatis-context.xml]: Invocation of init method failed; nested exception is org.springframework.core.NestedIOException: Failed to parse config resource: class path resource [alfresco/ibatis/alfresco-SqlMapConfig.xml]; nested exception is com.ibatis.common.xml.NodeletException: Error parsing XML.  Cause: java.lang.RuntimeException: Error parsing XPath '/sqlMapConfig/sqlMap'.  Cause: com.ibatis.sqlmap.client.SqlMapException: The <sqlMap> resource is missing: alfresco/ibatis/#resource.dialect#/qname-insert-SqlMap.xml
    at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:328)
    at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:106)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1305)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1067)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:511)

[…..]
exel88
Member II

Re: Webscript, Sping, iBatis e Context Initialization Failed

Ho risolto, grazie ad un intervento nel forum internazionale, togliendo di mezzo il file db.properties ed integrando direttamente nel context i parametri di connessione al DB, e modificando tutti gli ID presenti in module-context.xml rendendoli più "parlanti" e soprattutto univoci. Alfresco non riusciva più a determinare quali fossero i suoi parametri.