OW2 Consortium
Search OW2 Mail Archive: 

Advanced Search - Powered by Google


Mail Archive Home | exoplatform List | January 2008 Index

<--  Date Index  --> <--  Thread Index  -->

Re: [exoplatform] problems with MySQL


Hi, Kito!

2008/1/28, Vitaliy Obmanyuk <vetalok@xxxxxxxxx>:
Hello Kito,
you wrote:
...
<property name="driverClassName" value="org.hsqldb.jdbcDriver"/>

<property name="url" value="jdbc:mysql://localhost:3307/exo2?relaxAutoCommit=true&amp;autoReconnect=true&amp;useUnicode=true&amp;characterEncoding=utf8"/>

you should use mysql DB driver instead of
<property name="driverClassName" value="org.hsqldb.jdbcDriver"/>

yes, seems you forget to change the driver to com.mysql.jdbc.Driver for datasource jdbcexo in org.exoplatform.services

.naming.InitialContextInitializer component config.


please look into workspace configuration, there should be mysql dialect:

<property name="dialect" value="mysql" />

right, you may find this property in repository-configuration.xml, fix it for each workspace you use.

Regards,
Peter Nedonosko,
eXo Platform SAS

HTH

2008/1/28, Kito D. Mann <kmann@xxxxxxxxxx>:

Hello,

 

I'm working with eXo 2 r2329 on Windows XP and when I tried to switch from Hypersonic to  MySQL 5.0.24a, I got the following exception:

 

ERROR: cannot create portal container. ServletContext: org.apache.catalina.core.ApplicationContextFacade@423da9

java.lang.RuntimeException: Cannot instantiate component class org.exoplatform.services.jcr.impl.RepositoryServiceImpl

        at org.exoplatform.container.jmx.MX4JComponentAdapter.getComponentInstance(MX4JComponentAdapter.java:76)

        at org.picocontainer.defaults.DefaultPicoContainer.getInstance(DefaultPicoContainer.java:322)

        at org.picocontainer.defaults.DefaultPicoContainer.getComponentInstancesOfType(DefaultPicoContainer.java:281)

        at org.exoplatform.container.PortalContainer.getComponentInstancesOfType(PortalContainer.java:112)

        at org.picocontainer.defaults.LifecycleVisitor.visitContainer(LifecycleVisitor.java:97)

        at org.picocontainer.defaults.DefaultPicoContainer.accept(DefaultPicoContainer.java:416)

        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.picocontainer.defaults.AbstractPicoVisitor.traverse(AbstractPicoVisitor.java:32)

        at org.picocontainer.defaults.LifecycleVisitor.traverse(LifecycleVisitor.java:63)

        at org.picocontainer.defaults.LifecycleVisitor.start(LifecycleVisitor.java:113)

        at org.picocontainer.defaults.DefaultPicoContainer.start(DefaultPicoContainer.java:369)

        at org.exoplatform.container.PortalContainer.start(PortalContainer.java:84)

        at org.exoplatform.container.RootContainer.createPortalContainer(RootContainer.java:103)

        at org.exoplatform.portal.application.PortalController.init(PortalController.java:65)

        at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1161)

        at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:981)

        at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:4044)

        at org.apache.catalina.core.StandardContext.start(StandardContext.java:4350)

        at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:761)

        at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:741)

        at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:525)

        at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:626)

        at org.apache.catalina.startup.HostConfig.deployDescriptors(HostConfig.java:553)

        at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:488)

        at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1138)

        at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:311)

        at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:120)

        at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1023)

        at org.apache.catalina.core.StandardHost.start(StandardHost.java:719)

        at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1015)

        at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)

        at org.apache.catalina.core.StandardService.start(StandardService.java:448)

        at org.apache.catalina.core.StandardServer.start(StandardServer.java:710)

        at org.apache.catalina.startup.Catalina.start(Catalina.java:552)

        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:288)

        at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)

Caused by: java.lang.RuntimeException: Cannot instantiate component class org.exoplatform.services.jcr.impl.config.RepositoryServiceConfigurationImpl

        at org.exoplatform.container.jmx.MX4JComponentAdapter.getComponentInstance(MX4JComponentAdapter.java:76)

        at org.picocontainer.defaults.DefaultPicoContainer.getInstance(DefaultPicoContainer.java:322)

        at org.picocontainer.defaults.DefaultPicoContainer.getComponentInstanceOfType(DefaultPicoContainer.java:313)

        at org.exoplatform.container.ExoContainer.createComponent(ExoContainer.java:123)

        at org.exoplatform.container.jmx.MX4JComponentAdapter.getComponentInstance(MX4JComponentAdapter.java:57)

        ... 42 more

Caused by: java.lang.reflect.InvocationTargetException

        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)

        at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)

        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)

        at java.lang.reflect.Constructor.newInstance(Constructor.java:494)

        at org.exoplatform.container.ExoContainer.createComponent(ExoContainer.java:131)

        at org.exoplatform.container.jmx.MX4JComponentAdapter.getComponentInstance(MX4JComponentAdapter.java:57)

        ... 46 more

Caused by: org.exoplatform.services.jcr.config.RepositoryConfigurationException: Fail to init from xml! Reason: org.exoplatform.services.jcr.config.RepositoryConfigurationException: Database exception. java.sql.SQLException: Column length too big for colu

mn 'CONFIG' (max = 65535); use BLOB or TEXT instead. SQL: CREATE TABLE JCR_CONFIG (NAME VARCHAR(64) NOT NULL, CONFIG VARBINARY(102400) NOT NULL, CONSTRAINT JCR_CONFIG_PK PRIMARY KEY(NAME))

        at org.exoplatform.services.jcr.impl.config.RepositoryServiceConfigurationImpl.<init>(RepositoryServiceConfigurationImpl.java:98)

        ... 52 more

Caused by: org.exoplatform.services.jcr.config.RepositoryConfigurationException: Database exception. java.sql.SQLException: Column length too big for column 'CONFIG' (max = 65535); use BLOB or TEXT instead. SQL: CREATE TABLE JCR_CONFIG (NAME VARCHAR(64) N

OT NULL, CONFIG VARBINARY(102400) NOT NULL, CONSTRAINT JCR_CONFIG_PK PRIMARY KEY(NAME))

        at org.exoplatform.services.jcr.impl.config.JDBCConfigurationPersister.write(JDBCConfigurationPersister.java:271)

        at org.exoplatform.services.jcr.impl.config.RepositoryServiceConfigurationImpl.<init>(RepositoryServiceConfigurationImpl.java:90)

        ... 52 more

Caused by: java.sql.SQLException: Column length too big for column 'CONFIG' (max = 65535); use BLOB or TEXT instead

        at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:2928)

        at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1571)

        at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:1666)

        at com.mysql.jdbc.Connection.execSQL(Connection.java:2988)

        at com.mysql.jdbc.Statement.executeUpdate(Statement.java:935)

        at com.mysql.jdbc.Statement.executeUpdate(Statement.java:873)

        at org.apache.commons.dbcp.DelegatingStatement.executeUpdate(DelegatingStatement.java:225)

        at org.exoplatform.services.jcr.impl.config.JDBCConfigurationPersister.write(JDBCConfigurationPersister.java:226)

        ... 53 more

 

I have modified database-configuration.xml in the porta/WEB-INF/conf/database directory:

 

<?xml version="1.0" encoding="ISO-8859-1"?>

<configuration>

  <component>

    <key>org.exoplatform.services.database.impl.ExoCacheProvider</key>

    <type>org.exoplatform.services.database.impl.ExoCacheProvider</type>

  </component>

 

  <component>

    <key>org.exoplatform.services.database.HibernateService</key>

    <jmx-name>database:type=HibernateService</jmx-name>

    <type>org.exoplatform.services.database.impl.HibernateServiceImpl</type>

    <init-params>

      <properties-param>

        <name>hibernate.properties</name>

        <description>Default Hibernate Service</description>

        <property name="hibernate.show_sql" value="false"/>

        <property name="hibernate.cglib.use_reflection_optimizer" value="true"/>

        <property name="hibernate.connection.url" value="jdbc:mysql://localhost:3307/exo2?relaxAutoCommit=true&amp;autoReconnect=true&amp;useUnicode=true&amp;characterEncoding=utf8"/>

        <property name="hibernate.connection.driver_class" value="com.mysql.jdbc.Driver"/>

        <property name="hibernate.connection.autocommit" value="true"/>

        <property name="hibernate.connection.username" value="name"/>

        <property name="hibernate.connection.password" value="password"/>

        <property name="hibernate.dialect" value="org.hibernate.dialect.MySQLDialect"/>

        <property name="hibernate.c3p0.min_size" value="5"/>

        <property name="hibernate.c3p0.max_size" value="20"/>

        <property name="hibernate.c3p0.timeout" value="1800"/>

        <property name="hibernate.c3p0.max_statements" value="50"/>

      </properties-param>

    </init-params>

  </component>

 

  <external-component-plugins>

    <target-component>org.exoplatform.services.naming.InitialContextInitializer</target-component>

    <component-plugin>

      <name>bind.datasource</name>

      <set-method>addPlugin</set-method>

      <type>org.exoplatform.services.naming.BindReferencePlugin</type>

      <init-params>

        <value-param>

          <name>bind-name</name>

          <value>jdbcexo</value>

        </value-param>

        <value-param>

          <name>class-name</name>

          <value>javax.sql.DataSource</value>

        </value-param>

        <value-param>

          <name>factory</name>

          <value>org.apache.commons.dbcp.BasicDataSourceFactory</value>

        </value-param>

        <properties-param>

          <name>ref-addresses</name>

          <description>ref-addresses</description>

          <property name="driverClassName" value="org.hsqldb.jdbcDriver"/>

          <property name="url" value="jdbc:mysql://localhost:3307/exo2?relaxAutoCommit=true&amp;autoReconnect=true&amp;useUnicode=true&amp;characterEncoding=utf8"/>

          <property name="username" value="name"/>

          <property name="password" value="password"/>

        </properties-param>

      </init-params>

    </component-plugin>

  </external-component-plugins>

</configuration>

</configuration>

 

And, of course, everything was fine before I changed this file to point to MySQL instead of Hypersonic. The database does actually exist, and the user has the proper rights. However, no tables have been created.

 

Any ideas?

 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Kito D. Mann - Author, JavaServer Faces in Action
http://www.virtua.com - JSF/Java EE consulting, training, and mentoring
http://www.JSFCentral.com - JavaServer Faces FAQ, news, and info
phone: +1 203-653-2989
fax: +1 203-653-2988

 



--
You receive this message as a subscriber of the exoplatform@xxxxxxx mailing list.
To unsubscribe: mailto:exoplatform-unsubscribe@xxxxxxx
For general help: mailto:sympa@xxxxxxx?subject=help
OW2 mailing lists service home page: http://www.ow2.org/wws




--
Best regards,
Vitaliy

--
You receive this message as a subscriber of the exoplatform@xxxxxxx mailing list.
To unsubscribe: mailto:exoplatform-unsubscribe@xxxxxxx
For general help: mailto:sympa@xxxxxxx?subject=help
OW2 mailing lists service home page: http://www.ow2.org/wws




<--  Date Index  --> <--  Thread Index  -->

Reply via email to:

Powered by MHonArc.

Copyright © 2006-2007, OW2 Consortium | contact | webmaster.