cancel
Showing results for 
Search instead for 
Did you mean: 

Error with Mysql 5.0

ejml
Champ in-the-making
Champ in-the-making
Hello folks

Sometime I get the next error:



09:45:17,193 ERROR [org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/alfresco]] Excepción enviando evento inicializado de contexto a instancia de escuchador de clase org.springframework.web.context.ContextLoaderListener
org.alfresco.error.AlfrescoRuntimeException: Schema auto-update failed
   at org.alfresco.repo.domain.schema.SchemaBootstrap.onBootstrap(SchemaBootstrap.java:613)
   at org.alfresco.util.AbstractLifecycleBean.onApplicationEvent(AbstractLifecycleBean.java:54)
   at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:45)
   at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:225)
   at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:323)
   at org.springframework.web.context.support.AbstractRefreshableWebApplicationContext.refresh(AbstractRefreshableWebApplicationContext.java:134)
   at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:246)
   at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:184)
   at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:49)
   at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3692)
   at org.apache.catalina.core.StandardContext.start(StandardContext.java:4127)
   at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:759)
   at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:739)
   at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:524)
   at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:804)
   at org.apache.catalina.startup.HostConfig.deployWARs(HostConfig.java:693)
   at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:472)
   at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1118)
   at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:310)
   at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
   at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1020)
   at org.apache.catalina.core.StandardHost.start(StandardHost.java:718)
   at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1012)
   at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:442)
   at org.apache.catalina.core.StandardService.start(StandardService.java:450)
   at org.apache.catalina.core.StandardServer.start(StandardServer.java:680)
   at org.apache.catalina.startup.Catalina.start(Catalina.java:536)
   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:585)
   at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:275)
   at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)
Caused by: org.hibernate.exception.GenericJDBCException: could not get table metadata: JBPM_TOKENVARIABLEMAP
   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.tool.hbm2ddl.DatabaseMetadata.getTableMetadata(DatabaseMetadata.java:100)
   at org.hibernate.cfg.Configuration.generateSchemaUpdateScript(Configuration.java:838)
   at org.alfresco.repo.domain.schema.SchemaBootstrap.updateSchema(SchemaBootstrap.java:335)
   at org.alfresco.repo.domain.schema.SchemaBootstrap.onBootstrap(SchemaBootstrap.java:598)
   … 32 more
Caused by: java.sql.SQLException: Table 'COLUMNS' is read only
   at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:946)
   at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:2870)
   at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1573)
   at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:1665)
   at com.mysql.jdbc.Connection.execSQL(Connection.java:3118)
   at com.mysql.jdbc.Connection.execSQL(Connection.java:3047)
   at com.mysql.jdbc.Statement.executeQuery(Statement.java:1166)
   at com.mysql.jdbc.DatabaseMetaData$2.forEach(DatabaseMetaData.java:2046)
   at com.mysql.jdbc.DatabaseMetaData$IterateBlock.doForAll(DatabaseMetaData.java:76)
   at com.mysql.jdbc.DatabaseMetaData.getColumns(DatabaseMetaData.java:1920)
   at org.hibernate.tool.hbm2ddl.TableMetadata.initColumns(TableMetadata.java:185)
   at org.hibernate.tool.hbm2ddl.TableMetadata.<init>(TableMetadata.java:33)
   at org.hibernate.tool.hbm2ddl.DatabaseMetadata.getTableMetadata(DatabaseMetadata.java:85)
   … 35 more
09:45:17,209 ERROR [org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/alfresco]] Excepción enviando evento inicializado de contexto a instancia de escuchador de clase org.alfresco.web.app.ContextListener
org.alfresco.error.AlfrescoRuntimeException: Schema auto-update failed
   at org.alfresco.repo.domain.schema.SchemaBootstrap.onBootstrap(SchemaBootstrap.java:613)
   at org.alfresco.util.AbstractLifecycleBean.onApplicationEvent(AbstractLifecycleBean.java:54)
   at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:45)
   at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:225)
   at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:323)
   at org.springframework.web.context.support.AbstractRefreshableWebApplicationContext.refresh(AbstractRefreshableWebApplicationContext.java:134)
   at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:246)
   at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:184)
   at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:49)
   at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3692)
   at org.apache.catalina.core.StandardContext.start(StandardContext.java:4127)
   at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:759)
   at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:739)
   at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:524)
   at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:804)
   at org.apache.catalina.startup.HostConfig.deployWARs(HostConfig.java:693)
   at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:472)
   at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1118)
   at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:310)
   at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
   at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1020)
   at org.apache.catalina.core.StandardHost.start(StandardHost.java:718)
   at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1012)
   at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:442)
   at org.apache.catalina.core.StandardService.start(StandardService.java:450)
   at org.apache.catalina.core.StandardServer.start(StandardServer.java:680)
   at org.apache.catalina.startup.Catalina.start(Catalina.java:536)
   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:585)
   at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:275)
   at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)
Caused by: org.hibernate.exception.GenericJDBCException: could not get table metadata: JBPM_TOKENVARIABLEMAP
   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.tool.hbm2ddl.DatabaseMetadata.getTableMetadata(DatabaseMetadata.java:100)
   at org.hibernate.cfg.Configuration.generateSchemaUpdateScript(Configuration.java:838)
   at org.alfresco.repo.domain.schema.SchemaBootstrap.updateSchema(SchemaBootstrap.java:335)
   at org.alfresco.repo.domain.schema.SchemaBootstrap.onBootstrap(SchemaBootstrap.java:598)
   … 32 more
Caused by: java.sql.SQLException: Table 'COLUMNS' is read only
   at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:946)
   at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:2870)
   at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1573)
   at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:1665)
   at com.mysql.jdbc.Connection.execSQL(Connection.java:3118)
   at com.mysql.jdbc.Connection.execSQL(Connection.java:3047)
   at com.mysql.jdbc.Statement.executeQuery(Statement.java:1166)
   at com.mysql.jdbc.DatabaseMetaData$2.forEach(DatabaseMetaData.java:2046)
   at com.mysql.jdbc.DatabaseMetaData$IterateBlock.doForAll(DatabaseMetaData.java:76)
   at com.mysql.jdbc.DatabaseMetaData.getColumns(DatabaseMetaData.java:1920)
   at org.hibernate.tool.hbm2ddl.TableMetadata.initColumns(TableMetadata.java:185)
   at org.hibernate.tool.hbm2ddl.TableMetadata.<init>(TableMetadata.java:33)
   at org.hibernate.tool.hbm2ddl.DatabaseMetadata.getTableMetadata(DatabaseMetadata.java:85)
   … 35 more

Then I restart the server and it can work or not. Can somebody help me?

I have installed:

Windows 2003 Server
Alfresco 1.4
Mysql 5.0

Thanks in advance!
17 REPLIES 17

derek
Star Contributor
Star Contributor
Hi,

The JDBC Driver metadata queries are running into trouble.

Have you granted the alfresco user the correct privileges for the database?
Try connecting to the database as alfresco using the mysql command line client and creating a table.  Try executing a describe statement against your new table.
If that works, then check the permissions on the mysql directories and ensure that the mysql server or service has the correct permissions to operate on the tables.
Check that you have the correct JDBC driver.

If you are still having issues, put SQL logging into the JDBC driver URL and see which statements are failing and try to reproduce it directly.

Regards

ejml
Champ in-the-making
Champ in-the-making
This work fine:
Try connecting to the database as alfresco using the mysql command line client and creating a table. Try executing a describe statement against your new table.

You say:

heck the permissions on the mysql directories and ensure that the mysql server or service has the correct permissions to operate on the tables.

What permission must have the mysql directory?

Thanks

derek
Star Contributor
Star Contributor
Did you execute the table creation as the alfresco user?
What version of the JDBC driver are you using?
Have you managed to run Alfresco against HSQL or another database?

Regards

ejml
Champ in-the-making
Champ in-the-making
Did you execute the table creation as the alfresco user?
yes, it works fine.

What version of the JDBC driver are you using?

Where can i see this?

Have you managed to run Alfresco against HSQL or another database?

Mysql 5.0

ejml
Champ in-the-making
Champ in-the-making
in the repository.properties:
db.driver = org.gjt.mm.mysql.Driver

derek
Star Contributor
Star Contributor
What exact version of MySQL are you using:
mysql –version
If you are using a standard Alfresco install, then the JDBC driver is in tomcat/common/lib.  You should be using mysql-connector-java-5.0.3-bin.jar.

Try the latest MySQL with the 5.0.3 driver.  We use 5.0.x (5.0.20 for me) during development and for our benchmarks.  We've not seen anything like this in Windows or Linux.

Are you running a 32bit or 64bit machine?
Perhaps you might want to check with MySQL to see if they have any known issues or incompatibilities with your particular setup, especially since the error doesn't always occur.

ejml
Champ in-the-making
Champ in-the-making
Hi Derek

This is my mysql version:

Ver 14.12 Distrib 5.0.27, for Win32 (ia32)

Yes I use standard Alfresco install and it's mysql-connector-java-5.0.3-bin.jar

It's running on a 32 bit machine.

derek
Star Contributor
Star Contributor
Hi,

See the bugs on the MySQL site raised against ConnectorJ 5.0.x.  Try upgrading your driver to 5.0.4 as well as the last nightly build.  If the problem persists, raise a bug on our JIRA, detailing the versions of everything so that we can reproduce it exactly.

Regards

ejml
Champ in-the-making
Champ in-the-making
ok, thanks.