[midPoint] MySQL configuration for 3.0

Viliam Repan vilo.repan at evolveum.com
Tue Aug 26 15:22:10 CEST 2014


Hi Deepak,

this is how tomcat/conf/config.xml looks like in my tomcat:
<?xml version='1.0' encoding='utf-8'?>
<Context>
     <WatchedResource>WEB-INF/web.xml</WatchedResource>
     <ResourceLink name="jdbc/midpointDataSource"
                   global="jdbc/midpointDataSource"
                   type="javax.sql.DataSource"/>

</Context>

tomcat/conf/server.xml contains:
<Resource name="jdbc/midpointDataSource" auth="Container" 
type="javax.sql.DataSource"
      username="midpoint" password="qwe123"
      url="jdbc:mysql://localhost:3306/midpoint"
      driverClassName="com.mysql.jdbc.Driver"
      accessToUnderlyingConnectionAllowed="true"
      initialSize="5" maxWait="5000"
      maxActive="10" maxIdle="5"
      validationQuery="select 1"
      poolPreparedStatements="true"/>

in element GlobalNamingResources

Best regards,

Vilo

On 26.08.2014 13:37, Deepak Natarajan wrote:
> Hi Vilo,
>
>
> Thanks for the reply. I have reverted back to my earlier 
> pre-datasource configuration to get things running.
>
>
> I cannot find a sample <context> for Midpoint on the wiki for my 
> Tomcat configuration. I'm assuming I would add my resource in there?
> On the wiki right now, the Resource definition is added as a global 
> (hence, I assumed, there is no need for a particular application 
> context), but, as you pointed out if a resource link is needed to this 
> Global resource definition, then I will need to create a context for 
> Midpoint in my Tomcat server.xml.
>
> Thanks
> BR/Deepak
>> Viliam Repan <mailto:vilo.repan at evolveum.com>
>> August 26, 2014 at 12:41 PM
>> Hi Deepak,
>>
>> datasource should work, I currently don't have time to test it on my 
>> computer against MySQL, but configuration looks fine to me.
>> From what I can see there is a configuration problem in your 
>> application server.
>>
>> Invocation of init method failed; nested exception is
>> javax.naming.NameNotFoundException: Name [jdbc/mysql] is not bound in
>> this Context. Unable to find [jdbc].
>>
>> If it is tomcat maybe resource link to this datasource is missing in 
>> context.xml or something like that...
>>
>> Best regards,
>>
>> Vilo
>>
>>
>>
>>
>> Deepak Natarajan <mailto:dnataraj at trilobytesystems.com>
>> August 26, 2014 at 10:39 AM
>> 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
> Director
>
> Trilobyte Systems ApS
>
> Falkoner Alle 1, 3            Fredrikinkatu 61A, 6th Floor
> 2000 Frederiksberg         Business Center Papula
> Denmark                          00100 Helsinki
>                                         Finland
>
> Tel : +45 29375068
> http://www.trilobytesystems.com
>
>
>
>
> _______________________________________________
> midPoint mailing list
> midPoint at lists.evolveum.com
> http://lists.evolveum.com/mailman/listinfo/midpoint

-- 
Ing. Viliam Repáň
Evolveum, s.r.o.

tel: +421 910 797978
mail: vilo.repan at evolveum.com

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.evolveum.com/pipermail/midpoint/attachments/20140826/a217d9fa/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: compose-unknown-contact.jpg
Type: image/jpeg
Size: 770 bytes
Desc: not available
URL: <https://lists.evolveum.com/pipermail/midpoint/attachments/20140826/a217d9fa/attachment.jpg>


More information about the midPoint mailing list