Error al importar usando ANT

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

Error al importar usando ANT

Hola Foro,
A ver, me han planteado un problema que no sé si tiene fácil solución. Estoy en un proyecto donde el cliente prioriza mucho el tema de seguridad. En el entorno de desarrollo los programadores hacen los programas y los despliegan mediante ANT. Ellos (los programadores) necesitan de vez en cuando importar y/o exportar contenidos mediante ACP’s. Como he dicho antes, la seguridad es muy estricta y ellos tienen en el servidor su propio home (máquina linux) y permisos para escribir sólo en los directorios que pertenecen al home de desarrollo. Tampoco pueden usar el cliente web. La cuestión es que para poder importar y/o exportar un ACP, la orden de línea de comandos que ejecuta el build.xml de ANT debe de ejecutarse dentro del directorio WEB-INF y no desde un directorio del home de desarrollo porque si no da error.

Os paso la traza del error.


[b]ant import_acp_alfresco -Dargument_import="-user admin -pwd admin -s workspace://SpacesStore/ -path /companyhome -verbose -d /aplic/w24i/dist w24WebScriptsACP.acp"[/b]
Buildfile: build.xml

import_acp_alfresco:
import_acp_alfresco_:
[java] Alfresco Repository Importer
[java] The following error has occurred:
[java] Error creating bean with name 'luceneIndexBackupComponent' defined in class path resource [alfresco/core-services-context.xml]: Invocation of init method failed; nested exception is org.springframework.transaction.CannotCreateTransactionException: Could not open Hibernate Session for transaction; nested exception is org.hibernate.exception.GenericJDBCException: Cannot open connection
[java] org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'luceneIndexBackupComponent' defined in class path resource [alfresco/core-services-context.xml]: Invocation of init method failed; nested exception is org.springframework.transaction.CannotCreateTransactionException: Could not open Hibernate Session for transaction; nested exception is org.hibernate.exception.GenericJDBCException: Cannot open connection
[java] Caused by: org.springframework.transaction.CannotCreateTransactionException: Could not open Hibernate Session for transaction; nested exception is org.hibernate.exception.GenericJDBCException: Cannot open connection
[java] Caused by: org.hibernate.exception.GenericJDBCException: Cannot open connection
[java]     at org.hibernate.exception.SQLStateConverter.handledNonSpecificException(SQLStateConverter.java:103)
[java]     at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:91)
[java]     at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43)
[java]     at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:29)
[java]     at org.hibernate.jdbc.ConnectionManager.openConnection(ConnectionManager.java:426)
[java]     at org.hibernate.jdbc.ConnectionManager.getConnection(ConnectionManager.java:144)
[java]     at org.hibernate.jdbc.JDBCContext.connection(JDBCContext.java:119)
[java]     at org.hibernate.transaction.JDBCTransaction.begin(JDBCTransaction.java:57)
[java]     at org.hibernate.impl.SessionImpl.beginTransaction(SessionImpl.java:1326)
[java]     at org.springframework.orm.hibernate3.HibernateTransactionManager.doBegin HibernateTransactionManager.java:510)
[java]     at org.springframework.transaction.support.AbstractPlatformTransactionManager.getTransaction(AbstractPlatformTransactionManager.java:350)
[java]     at org.springframework.transaction.interceptor.TransactionAspectSupport.createTransactionIfNecessary(TransactionAspectSupport.java:262)
[java]     at org.springframework.transaction.interceptor.TransactionAspectSupport.createTransactionIfNecessary TransactionAspectSupport.java:219)
[java]     at org.alfresco.util.transaction.SpringAwareUserTransaction.begin(SpringAwareUserTransaction.java:415)
[java]     at org.alfresco.repo.transaction.RetryingTransactionHelper.doInTransaction(RetryingTransactionHelper.java:311)
[java]     at org.alfresco.repo.transaction.RetryingTransactionHelper.doInTransaction(RetryingTransactionHelper.java:248)
[java]     at org.alfresco.repo.search.impl.lucene.AbstractLuceneIndexerAndSearcherFactory$LuceneIndexBackupComponent.afterPropertiesSet(AbstractLuceneIndexerAndSearcherFactory.java:1513)
[java]     at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1203)
[java]     at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1172)
[java]     at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:427)
[java]     at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:249)
[java]     at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:155)
[java]     at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:246)
[java]     at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:160)
[java]     at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:291)
[java]     at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:352)
[java]     at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:122)
[java]     at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:76)
[java]     at org.alfresco.util.ApplicationContextHelper.getApplicationContext(ApplicationContextHelper.java:55)
[java]     at org.alfresco.tools.Tool.initialiseRepository(Tool.java:246)
[java]     at org.alfresco.tools.Tool.start(Tool.java:212)
[java]     at org.alfresco.tools.Import.main(Import.java:66)
[java] Caused by: org.apache.commons.dbcp.SQLNestedException: Cannot create PoolableConnectionFactory (Io exception: Unknown host specified )
[java]     at org.apache.commons.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:855)
[java]     at org.apache.commons.dbcp.BasicDataSource.getConnection(BasicDataSource.java:540)
[java]     at org.springframework.orm.hibernate3.LocalDataSourceConnectionProvider.getConnection(LocalDataSourceConnectionProvider.java:81)
[java]     at org.hibernate.jdbc.ConnectionManager.openConnection(ConnectionManager.java:423)
[java]     … 27 more
[java] Caused by: java.sql.SQLException: Io exception: Unknown host specified
[java]     at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:112)
[java]     at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:146)
[java]     at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:255)
[java]     at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:387)
[java]     at oracle.jdbc.driver.PhysicalConnection.<init>(PhysicalConnection.java:441)
[java]     at oracle.jdbc.driver.T4CConnection.<init>(T4CConnection.java:165)
[java]     at oracle.jdbc.driver.T4CDriverExtension.getConnection(T4CDriverExtension.java:35)
[java]     at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:801)
[java]     at org.apache.commons.dbcp.DriverConnectionFactory.createConnection(DriverConnectionFactory.java:37)
[java]     at org.apache.commons.dbcp.PoolableConnectionFactory.makeObject(PoolableConnectionFactory.java:290)
[java]     at org.apache.commons.dbcp.BasicDataSource.validateConnectionFactory(BasicDataSource.java:877)
[java]     at org.apache.commons.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:851)
[java]     … 30 more
[java]
[java] Java Result: 255
BUILD SUCCESSFUL
Total time: 43 seconds


¿A alguien se le ocurre algo?
Muchas gracias y saludos.
1 Reply
cristinamr
Advanced

Re: Error al importar usando ANT

Buenas.

Caused by: org.springframework.transaction.CannotCreateTransactionException: Could not open Hibernate Session for transaction; nested exception is org.hibernate.exception.GenericJDBCException: Cannot open connection

Según eso, todo pinta a que no realiza con éxito la conexión con la BBDD. ¿Podrías comprobar en los archivos de conexión a tu BBDD está todo correcto?
--
VenziaIT: helping companies since 2005! Our ECM products: AQuA & Seidoc