[midPoint] MySQL configuration for 3.0

Deepak Natarajan dnataraj at trilobytesystems.com
Tue Aug 26 10:39:42 CEST 2014


Hi -

I have been trying to update my MySQL configuration from 2.3 to fit with
3.0 since I noticed that the relevant documentation has changed as well.

Question : Is the MySQL configuration not relying on the new data source
defined in Tomcat?

https://wiki.evolveum.com/display/midPoint/Repository+Configuration

I have the Resource defined as shown :

    <Resource name="jdbc/mysql" auth="Container" type="javax.sql.DataSource"
        username="x" password="x"
        url="jdbc:mysql://localhost:3306/midpoint"
        driverClassName="com.mysql.jdbc.Driver"
        accessToUnderlyingConnectionAllowed="true"
        initialSize="5" maxWait="5000"
        maxActive="30" maxIdle="5"
        validationQuery="select id from m_system_configuration"
        poolPreparedStatements="true"/>

And the corresponding configuration in config.xml :

        <repository>
           
<repositoryServiceFactoryClass>com.evolveum.midpoint.repo.sql.SqlRepositoryFactory</repositoryServiceFactoryClass>
            <embedded>false</embedded>
           
<hibernateDialect>com.evolveum.midpoint.repo.sql.util.MidPointMySQLDialect</hibernateDialect>
            <hibernateHbm2ddl>validate</hibernateHbm2ddl>
            <dataSource>java:comp/env/jdbc/mysql</dataSource>
        </repository>

But this is failing.


014-08-26 08:27:43,408 [RMI TCP Connection(2)-127.0.0.1] ERROR
(org.springframework.web.context.ContextLoader): Context initialization
failed
org.springframework.beans.factory.BeanCreationException: Error creating
bean with name 'repositoryService' defined in class path resource
[ctx-configuration.xml]: Initialization of bean failed; nested exception
is org.springframework.beans.factory.BeanCreationException: Error
creating bean with name 'sessionFactory' defined in URL
[jar:file:/Users/dnataraj/dev/midpoint/gui/admin-gui/target/midpoint/WEB-INF/lib/repo-sql-impl-3.0.jar!/ctx-repository-session.xml]:
Initialization of bean failed; nested exception is
org.springframework.beans.factory.BeanExpressionException: Expression
parsing failed; nested exception is
org.springframework.expression.spel.SpelEvaluationException:
EL1021E:(pos 14): A problem occurred whilst attempting to access the
property 'dataSource': 'Unable to access property 'dataSource' through
getter'
        ... 73 common frames omitted
Caused by: java.lang.reflect.InvocationTargetException: null
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
~[na:1.7.0_45]
        at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
~[na:1.7.0_45]
        at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
~[na:1.7.0_45]
        at java.lang.reflect.Method.invoke(Method.java:606) ~[na:1.7.0_45]
        at
org.springframework.expression.spel.support.ReflectivePropertyAccessor$OptimalPropertyAccessor.read(ReflectivePropertyAccessor.java:495)
~[spring-expression-3.1.0.RELEASE.jar:3.1.0.RELEASE]
        ... 74 common frames omitted
Caused by: org.springframework.beans.factory.BeanCreationException:
Error creating bean with name 'jndiDataSource' defined in URL
[jar:file:/Users/dnataraj/dev/midpoint/gui/admin-gui/target/midpoint/WEB-INF/lib/repo-sql-impl-3.0.jar!/ctx-repository-session.xml]:
Invocation of init method failed; nested exception is
javax.naming.NameNotFoundException: Name [jdbc/mysql] is not bound in
this Context. Unable to find [jdbc].

However, I see that the MySQL configuration looks different here :

https://wiki.evolveum.com/display/midPoint/MySQL

Which does not use the new DS - and this is what I had earlier and it works.

-- 
Deepak Natarajan






More information about the midPoint mailing list