cancel
Showing results for 
Search instead for 
Did you mean: 

Export func - Error creating 'dictionaryRepositoryBootstrap'

unknown-user
Champ on-the-rise
Champ on-the-rise
Hello everybody,

again I need some help with my Alfresco Installation. Actually I'm working on a backup script, which should at the end perform a server and database stop, make a backup of both and then restart server and db.

Everything, but the Alfresco full repository export works fine. When I start my export script, I get the following error.


Alfresco Repository Exporter
The following error has occurred:
Error creating bean with name 'dictionaryRepositoryBootstrap' defined in class path resource [alfresco/core-services-context.xml]: Initialization of bean 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
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dictionaryRepositoryBootstrap' defined in class path resource [alfresco/core-services-context.xml]: Initialization of bean 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
org.springframework.transaction.CannotCreateTransactionException: Could not open Hibernate Session for transaction; nested exception is org.hibernate.exception.GenericJDBCException: Cannot open connection
org.hibernate.exception.GenericJDBCException: Cannot open connection
        at org.hibernate.exception.SQLStateConverter.handledNonSpecificException(SQLStateConverter.java:103)
        at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:91)
        at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43)
        at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:29)
        at org.hibernate.jdbc.ConnectionManager.openConnection(ConnectionManager.java:420)
        at org.hibernate.jdbc.ConnectionManager.getConnection(ConnectionManager.java:144)
        at org.hibernate.jdbc.JDBCContext.connection(JDBCContext.java:129)
        at org.hibernate.transaction.JDBCTransaction.begin(JDBCTransaction.java:57)
        at org.hibernate.impl.SessionImpl.beginTransaction(SessionImpl.java:1290)
        at org.springframework.orm.hibernate3.HibernateTransactionManager.doBegin(HibernateTransactionManager.java:520)
        at org.springframework.transaction.support.AbstractPlatformTransactionManager.getTransaction(AbstractPlatformTransactionManager.java:282)
        at org.springframework.transaction.interceptor.TransactionAspectSupport.createTransactionIfNecessary(TransactionAspectSupport.java:225)
        at org.alfresco.util.transaction.SpringAwareUserTransaction.begin(SpringAwareUserTransaction.java:356)
        at org.alfresco.repo.transaction.TransactionUtil.executeInTransaction(TransactionUtil.java:175)
        at org.alfresco.repo.transaction.TransactionUtil.executeInUserTransaction(TransactionUtil.java:82)
        at org.alfresco.repo.dictionary.DictionaryRepositoryBootstrap.bootstrap(DictionaryRepositoryBootstrap.java:134)
        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.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeCustomInitMethod(AbstractAutowireCapableBeanFactory.java:1093)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1063)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:363)
        at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:226)
        at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:147)
        at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:275)
        at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:320)
        at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:87)
        at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:72)
        at org.alfresco.util.ApplicationContextHelper.getApplicationContext(ApplicationContextHelper.java:48)
        at org.alfresco.tools.Tool.initialiseRepository(Tool.java:246)
        at org.alfresco.tools.Tool.start(Tool.java:212)
        at org.alfresco.tools.Export.main(Export.java:65)
Caused by: org.apache.commons.dbcp.SQLNestedException: Cannot load JDBC driver class 'org.gjt.mm.mysql.Driver'
        at org.apache.commons.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:766)
        at org.apache.commons.dbcp.BasicDataSource.getConnection(BasicDataSource.java:540)
        at org.springframework.orm.hibernate3.LocalDataSourceConnectionProvider.getConnection(LocalDataSourceConnectionProvider.java:80)
        at org.hibernate.jdbc.ConnectionManager.openConnection(ConnectionManager.java:417)
        … 28 more
Caused by: java.lang.ClassNotFoundException: org.gjt.mm.mysql.Driver
        at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
        at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:276)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
        at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
        at java.lang.Class.forName0(Native Method)
        at java.lang.Class.forName(Class.java:169)
        at org.apache.commons.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:760)
        … 31 more

Right now I'm testing my script in a virtual machine running an Ubuntu OS with Alfresco 2.0 Community Ed. (Tomcat) and Oracle XE database. This is my script:

#!/bin/sh
export TOMCAT_HOME=/opt/alfresco/tomcat

cd $TOMCAT_HOME

export PATH=${PATH}:${TOMCAT_HOME}
export IMPORT_LIB=/webapps/alfresco/WEB-INF/lib
export IMPORT_COMMON=/common/lib
export JAVA_CLASSPATH=/webapps/alfresco/WEB-INF/lib
export IMPORT_CLASSES=/shared/classes:./webapps/alfresco/WEB-INF/classes
echo $IMPORT_CLASSES

for i in $TOMCAT_HOME$IMPORT_LIB/*.jar
do
export JAVA_CLASSPATH=${JAVA_CLASSPATH}:$i
done

for i in $TOMCAT_HOME$IMPORT_COMMON/ojdbc*.jar
do
export JAVA_CLASSPATH=${JAVA_CLASSPATH}:$i
done

export JAVA_CLASSPATH=${JAVA_CLASSPATH}:${IMPORT_CLASSES}
echo $JAVA_CLASSPATH

/../../jdk1.6.0_01/bin/java -cp $JAVA_CLASSPATH org.alfresco.tools.Export -user admin -store workspace://SpacesStore -pwd 12345 -verbose TestExport.acp  "$@"

May somebody help me with fixing the script to make it work properly?

A second question would be: Does this store parameter (workspace://SpacesStore) cover the complete repository with user settings etc., or which one do I need to export instead of it?

I'm grateful for every hint.

Kind regards,
Chris.
11 REPLIES 11

cleseach
Star Contributor
Star Contributor
Your log shows :

Cannot load JDBC driver class 'org.gjt.mm.mysql.Driver'

Are you sure MySQL JDBC Connector is in the Classpath ?

Regarding workspace://SpacesStore you will only find current nodes. You should use the node browser (available in management console) to see what are the available stores and what they contain.

unknown-user
Champ on-the-rise
Champ on-the-rise
Hello cleseach,

thanks a lot for the very helpful hint with the node browser!

Regarding the problem with the MySQL JDBC Connector, I'm rather confused, because I don't use a MySQL database and JDBC connector. After your question, I checked the $JAVA_CLASSPATH entries my script generates and I also found my Oracle JDBC Connector in there.

:/opt/alfresco/tomcat/common/lib/ojdbc14_g.jar:

Chris

cleseach
Star Contributor
Star Contributor
Could you be more precise on the database you are using ? (HSQL ?)

As far as I undesrtand, your Alfresco is configured to use MySQL. You should verify your hibernate-cfg.properties specifies the good connector.

You should also try to add ${TOMCAT_HOME}${IMPORT_CLASSES} to your class path : I'm not sure your personal configuration stored in ${TOMCAT_HOME}/shared/classes/alfresco are read by your script.

unknown-user
Champ on-the-rise
Champ on-the-rise
Hi clesach.

Thanks for your reply again. I described the environment I'm using in my first entry. DB = Oracle 10g XE

[…]
Right now I'm testing my script in a virtual machine running an Ubuntu OS with Alfresco 2.0 Community Ed. (Tomcat) and Oracle XE database. This is my script:
[…]

I'm using the custom-hibernate-dialect.properties file to override the default configuration, which is MySQL in the file you mentioned above, with the corresponding entry for my Oracle db.

Alfresco is already up and running smoothly.

When I use the built-in Export func. within the web interface, I can also export the repository to a chosen space, but the command-line export doesn't work.

Actually the server is shut down, when I'm trying to export its files. Does it make any difference, if I'm trying to export online or offline?

P.S.: Another option may be to "monitor" the commands, which are performed, when starting the export func. through the web interface. Do you people out there know how to do this?

Now I'll add ${TOMCAT_HOME}${IMPORT_CLASSES} to the Classpath and try it again. My next reply is soon to come. ^^

Chris

unknown-user
Champ on-the-rise
Champ on-the-rise
Seems like we're doing some progress. But, now that I got rid of the initial error message, I already have the next error message. Smiley Happy


=====================================
= STARTING ALFRESCO EXPORT FUNCTION =
=====================================
Alfresco Repository Exporter
The following error has occurred:
net.sf.acegisecurity.BadCredentialsException: Bad credentials presented
net.sf.acegisecurity.BadCredentialsException: Bad credentials presented
        at net.sf.acegisecurity.providers.dao.DaoAuthenticationProvider.authenticate(DaoAuthenticationProvider.java:290)
        at net.sf.acegisecurity.providers.ProviderManager.doAuthentication(ProviderManager.java:159)
        at net.sf.acegisecurity.AbstractAuthenticationManager.authenticate(AbstractAuthenticationManager.java:49)
        at org.alfresco.repo.security.authentication.AuthenticationComponentImpl.authenticate(AuthenticationComponentImpl.java:74)
        at org.alfresco.repo.security.authentication.AuthenticationServiceImpl.authenticate(AuthenticationServiceImpl.java:112)
        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.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:335)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:181)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:148)
        at org.springframework.aop.support.DelegatingIntroductionInterceptor.invoke(DelegatingIntroductionInterceptor.java:116)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:170)
        at net.sf.acegisecurity.intercept.method.aopalliance.MethodSecurityInterceptor.invoke(MethodSecurityInterceptor.java:80)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:170)
        at org.alfresco.repo.security.permissions.impl.ExceptionTranslatorMethodInterceptor.invoke(ExceptionTranslatorMethodInterceptor.java:49)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:170)
        at org.alfresco.repo.audit.AuditComponentImpl.auditImpl(AuditComponentImpl.java:219)
        at org.alfresco.repo.audit.AuditComponentImpl.audit(AuditComponentImpl.java:165)
        at org.alfresco.repo.audit.AuditMethodInterceptor.invoke(AuditMethodInterceptor.java:69)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:170)
        at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:96)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:170)
        at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:176)
        at $Proxy20.authenticate(Unknown Source)
        at org.alfresco.tools.Tool.login(Tool.java:237)
        at org.alfresco.tools.Tool.start(Tool.java:213)
        at org.alfresco.tools.Export.main(Export.java:65)

org.alfresco.repo.security.authentication.AuthenticationException: net.sf.acegisecurity.BadCredentialsException: Bad credentials presented
net.sf.acegisecurity.BadCredentialsException: Bad credentials presented
        at net.sf.acegisecurity.providers.dao.DaoAuthenticationProvider.authenticate(DaoAuthenticationProvider.java:290)
        at net.sf.acegisecurity.providers.ProviderManager.doAuthentication(ProviderManager.java:159)
        at net.sf.acegisecurity.AbstractAuthenticationManager.authenticate(AbstractAuthenticationManager.java:49)
        at org.alfresco.repo.security.authentication.AuthenticationComponentImpl.authenticate(AuthenticationComponentImpl.java:74)
        at org.alfresco.repo.security.authentication.AuthenticationServiceImpl.authenticate(AuthenticationServiceImpl.java:112)
        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.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:335)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:181)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:148)
        at org.springframework.aop.support.DelegatingIntroductionInterceptor.invoke(DelegatingIntroductionInterceptor.java:116)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:170)
        at net.sf.acegisecurity.intercept.method.aopalliance.MethodSecurityInterceptor.invoke(MethodSecurityInterceptor.java:80)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:170)
        at org.alfresco.repo.security.permissions.impl.ExceptionTranslatorMethodInterceptor.invoke(ExceptionTranslatorMethodInterceptor.java:49)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:170)
        at org.alfresco.repo.audit.AuditComponentImpl.auditImpl(AuditComponentImpl.java:219)
        at org.alfresco.repo.audit.AuditComponentImpl.audit(AuditComponentImpl.java:165)
        at org.alfresco.repo.audit.AuditMethodInterceptor.invoke(AuditMethodInterceptor.java:69)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:170)
        at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:96)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:170)
        at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:176)
        at $Proxy20.authenticate(Unknown Source)
        at org.alfresco.tools.Tool.login(Tool.java:237)
        at org.alfresco.tools.Tool.start(Tool.java:213)
        at org.alfresco.tools.Export.main(Export.java:65)

        at org.alfresco.repo.security.authentication.AuthenticationComponentImpl.authenticate(AuthenticationComponentImpl.java:88)
        at org.alfresco.repo.security.authentication.AuthenticationServiceImpl.authenticate(AuthenticationServiceImpl.java:112)
        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.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:335)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:181)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:148)
        at org.springframework.aop.support.DelegatingIntroductionInterceptor.invoke(DelegatingIntroductionInterceptor.java:116)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:170)
        at net.sf.acegisecurity.intercept.method.aopalliance.MethodSecurityInterceptor.invoke(MethodSecurityInterceptor.java:80)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:170)
        at org.alfresco.repo.security.permissions.impl.ExceptionTranslatorMethodInterceptor.invoke(ExceptionTranslatorMethodInterceptor.java:49)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:170)
        at org.alfresco.repo.audit.AuditComponentImpl.auditImpl(AuditComponentImpl.java:219)
        at org.alfresco.repo.audit.AuditComponentImpl.audit(AuditComponentImpl.java:165)
        at org.alfresco.repo.audit.AuditMethodInterceptor.invoke(AuditMethodInterceptor.java:69)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:170)
        at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:96)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:170)
        at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:176)
        at $Proxy20.authenticate(Unknown Source)
        at org.alfresco.tools.Tool.login(Tool.java:237)
        at org.alfresco.tools.Tool.start(Tool.java:213)
        at org.alfresco.tools.Export.main(Export.java:65)


May be we are able to get rid of this message, too? I'm going to check, if there are already other topics with this "new" error.

Thanks in advance.

Chris

cleseach
Star Contributor
Star Contributor
Are you sure you are using the right login/password ?

unknown-user
Champ on-the-rise
Champ on-the-rise
FINALLY!


Time to execute 81.67067 seconds
Alfresco Repository Exporter successfully completed.

Wow, you made my day.

If you ever come close to the area of Cologne / Germany. I'll invite you on a couple of beers. Smiley Very Happy

After hours and days, I was so disoriented, that i mixed up the login data of our productional server with the login data on my virtual machine. But more important was the hint with the missing CLASSPATH entries.

Thanks a lot,
Chris.

cleseach
Star Contributor
Star Contributor
Great !!!

Keep the beer cold Smiley Wink

unknown-user
Champ on-the-rise
Champ on-the-rise
Oh, I'll do! But, to be honest,  I already did this before this Alfresco Export trouble came down on me. Smiley Happy

To get that one clear … if I want to export my complete repository, I need to export all the spaces, mentioned in the node browser?

Phew, finally I can start experimenting with the Export / Import func. and their parameters.

Chris
Getting started

Tags


Find what you came for

We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.