<html>
  <head>
    <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    Hi Deepak,<br>
    <br>
    my working configuration for Repository (Task Manager/cluster not
    working yet) and Postgresql (I don't have mysql handy now):<br>
    <br>
    1. postgresql JDBC driver is in <tomcat>/lib directory for
    datasource to work<br>
    2. <tomcat>/conf/context.xml:<br>
    . . .<br>
    <Context><br>
    <br>
        <!-- Default set of monitored resources --><br>
        <WatchedResource>WEB-INF/web.xml</WatchedResource><br>
        <ResourceLink name="<b>jdbc/midpointDS</b>"<br>
                      global="<b>jdbc/midpointDS</b>"<br>
                      type="javax.sql.DataSource"/><br>
    <br>
    . . .<br>
    <br>
    3. <tomcat>/conf/server.xml:<br>
    . . .<br>
      <GlobalNamingResources><br>
    . . .<br>
        <Resource name="<b>jdbc/midpointDS</b>" auth="Container"
    type="javax.sql.DataSource"<br>
            username="username" password="password"<br>
            url="jdbc:postgresql://localhost/midpoint"<br>
            driverClassName="org.postgresql.Driver"<br>
            accessToUnderlyingConnectionAllowed="true"<br>
            initialSize="5" maxWait="5000"<br>
            maxActive="30" maxIdle="5"<br>
            validationQuery="select 1"<br>
            poolPreparedStatements="true"/><br>
      </GlobalNamingResources><br>
    . . .<br>
    <br>
    4. midpoint's config.xml:<br>
    <br>
        <repository><br>
          <embedded>false</embedded><br>
         
<repositoryServiceFactoryClass>com.evolveum.midpoint.repo.sql.SqlRepositoryFactory</repositoryServiceF<br>
         
<hibernateDialect>com.evolveum.midpoint.repo.sql.util.MidPointPostgreSQLDialect</hibernateDialect><br>
          <hibernateHbm2ddl>validate</hibernateHbm2ddl><br>
          <b><dataSource>java:comp/env/jdbc/midpointDS</dataSource></b><br>
        </repository><br>
    <br>
    After starting, Configuration - About shows:<br>
    Additional details<br>
    dataSource     java:comp/env/jdbc/midpointDS<br>
    <br>
    so the Datasource is being used.<br>
    <br>
    I will still have to configure Task Manager, but this is a quick
    report so you can test it (with MySQL).<br>
    I will update the wiki page after that.<br>
    <br>
    Best regards,<br>
    Ivan<br>
    <br>
    <div class="moz-cite-prefix">On 08/26/2014 05:49 PM, Deepak
      Natarajan wrote:<br>
    </div>
    <blockquote cite="mid:53FCAC8E.4060200@trilobytesystems.com"
      type="cite">
      <pre wrap="">
Hi Ivan -

I'm sorry, in my reply I pasted from the wiki, to make my point (i.e I
am using the configuration as described).

The one in my file is (and which is working correctly now that I added
in the additional fields of username, password, url and driverclass:

        <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/midpointDS</dataSource>
            <jdbcUrl>jdbc:mysql://localhost:3306/midpoint</jdbcUrl>
            <driverClassName>com.mysql.jdbc.Driver</driverClassName>
            <jdbcUsername>x</jdbcUsername>
            <jdbcPassword>x</jdbcPassword>
            <!-- <asServer>true</asServer> -->
            <!--
            <baseDir>${midpoint.home}</baseDir>
            -->
        </repository>

So yes, it is the same DS as I have configured in my Tomcat instance :

  <GlobalNamingResources>
    <!-- Editable user database that can also be used by
         UserDatabaseRealm to authenticate users
    -->
    <Resource name="UserDatabase" auth="Container"
              type="org.apache.catalina.UserDatabase"
              description="User database that can be updated and saved"
              factory="org.apache.catalina.users.MemoryUserDatabaseFactory"
              pathname="conf/tomcat-users.xml" />

    <Resource name="jdbc/midpointDS" 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 1"
        poolPreparedStatements="true"/>

  </GlobalNamingResources>

which is the same in the context.xml

-deepak

Ivan Noris wrote:
</pre>
      <blockquote type="cite">
        <pre wrap="">Hi Deepak,

it seems you are referencing bad datasource.

Shouldn't it be "jdbc/mysql" based on your configuration pasted earlier
in this thread?
Anyway it must be the same as in the datasource configuration in Tomcat.

Regards,
Ivan

On 08/26/2014 05:07 PM, Deepak Natarajan wrote:
</pre>
        <blockquote type="cite">
          <pre wrap="">Argh - I should have noticed this, sorry. Didn't spot this change in
Vilo's email. This got rid of that error - however, I subsequently get
these :

Caused by: com.evolveum.midpoint.util.exception.SystemException: JDBC
driver must be specified (either explicitly or in SQL repository
configuration)

Caused by: com.evolveum.midpoint.util.exception.SystemException: JDBC
URL must be specified (either explicitly or in SQL repository
configuration).

Caused by: com.evolveum.midpoint.util.exception.SystemException: JDBC
user name must be specified (either explicitly or in SQL repository
configuration).

So the configuration prescribed here :

<configuration>
    <midpoint>
        <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>
    </midpoint>
</configuration>

does not work, I had to pretty much add in the rest of it (essentially
what I had before moving to the DS configuration -
<a class="moz-txt-link-freetext" href="https://wiki.evolveum.com/display/midPoint/MySQL">https://wiki.evolveum.com/display/midPoint/MySQL</a>). So I'm not sure if
the DS is really being used, if you know what I mean...?

Thanks
-deepak



_______________________________________________
midPoint mailing list
<a class="moz-txt-link-abbreviated" href="mailto:midPoint@lists.evolveum.com">midPoint@lists.evolveum.com</a>
<a class="moz-txt-link-freetext" href="http://lists.evolveum.com/mailman/listinfo/midpoint">http://lists.evolveum.com/mailman/listinfo/midpoint</a>
</pre>
        </blockquote>
        <pre wrap="">
</pre>
      </blockquote>
      <pre wrap="">
</pre>
    </blockquote>
    <br>
    <pre class="moz-signature" cols="72">-- 
  Ing. Ivan Noris
  Senior Identity Management Engineer
  evolveum.com
  ___________________________________________
           "Idem per idem - semper idem Vix."
</pre>
  </body>
</html>