<html><head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  </head>
  <body>
    <p>I've been using environment variables to set many of my
      configuration elements for an installation using the embedded
      Tomcat. See if any of these might help
      <a class="moz-txt-link-freetext" href="https://wiki.evolveum.com/display/midPoint/External+repository+demo">https://wiki.evolveum.com/display/midPoint/External+repository+demo</a></p>
    <p><br>
    </p>
    <p>Ethan</p>
    <p><br>
    </p>
    <div class="moz-cite-prefix">On 5/14/20 12:28 PM, Keith Hazelton
      wrote:<br>
    </div>
    <blockquote type="cite" cite="mid:DM6PR08MB5308CAA3BE3270F71C30437586BC0@DM6PR08MB5308.namprd08.prod.outlook.com">
      
      <style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
      <div style="font-family: Calibri, Arial, Helvetica, sans-serif;
        font-size: 12pt; color: rgb(0, 0, 0);">
        This email is a followup on how we could potentially improve
        documentation on datasource configuration for embedded Tomcat
        versions of midPoint.
        <br>
      </div>
      <div style="font-family: Calibri, Arial, Helvetica, sans-serif;
        font-size: 12pt; color: rgb(0, 0, 0);">
        <br>
      </div>
      <div style="font-family: Calibri, Arial, Helvetica, sans-serif;
        font-size: 12pt; color: rgb(0, 0, 0);">
        First, note that the Evolveum documentation on "Using midPoint
        with Embedded Tomcat",  includes the following under
        "Configuration"
        <a href="https://wiki.evolveum.com/display/midPoint/Using+MidPoint+with+embedded+Tomcat" id="LPlnk733190" moz-do-not-send="true">
https://wiki.evolveum.com/display/midPoint/Using+MidPoint+with+embedded+Tomcat</a>,"</div>
      <div style="font-family: Calibri, Arial, Helvetica, sans-serif;
        font-size: 12pt; color: rgb(0, 0, 0);">
        <br>
      </div>
      <div style="font-family: Calibri, Arial, Helvetica, sans-serif;
        font-size: 12pt; color: rgb(0, 0, 0);">
        "MidPoint configuration is done as usual in config.xml file
        located in <code>midpoint.home</code>.
        <u>Configuration for embedded tomcat can be done in two places.
          Default configuration file name <code>application.yml</code>
          is located on classpath (admin-gui/src/main/resources folder).
          Custom configuration file
          <code>application.yml</code> can be placed to <code>midpoint.home</code>
          folder</u>.
        <br>
      </div>
      <div style="font-family: Calibri, Arial, Helvetica, sans-serif;
        font-size: 12pt; color: rgb(0, 0, 0);">
        ...<br>
      </div>
      <div style="font-family: Calibri, Arial, Helvetica, sans-serif;
        font-size: 12pt; color: rgb(0, 0, 0);">
        "Following table shows list of available properties that can be
        used to configure tomcat (e.g. http/https ports, session
        timeouts, logging, max-post-size, etc.)."</div>
      <div style="font-family: Calibri, Arial, Helvetica, sans-serif;
        font-size: 12pt; color: rgb(0, 0, 0);">
        <br>
      </div>
      <div style="font-family: Calibri, Arial, Helvetica, sans-serif;
        font-size: 12pt; color: rgb(0, 0, 0);">
        The mentioned table does <u>not</u> mention datasource in its
        example of "available properties":<br>
      </div>
      <div style="font-family: Calibri, Arial, Helvetica, sans-serif;
        font-size: 12pt; color: rgb(0, 0, 0);">
        <br>
      </div>
      <div style="font-family: Calibri, Arial, Helvetica, sans-serif;
        font-size: 12pt; color: rgb(0, 0, 0);">
        It looks like the datasource settings in question are discussed
        <u>only</u> in Spring documentation on "Common Application
        properties",
        <a href="https://docs.spring.io/spring-boot/docs/current/reference/html/appendix-application-properties.html" moz-do-not-send="true">
https://docs.spring.io/spring-boot/docs/current/reference/html/appendix-application-properties.html</a><br>
      </div>
      <div style="font-family: Calibri, Arial, Helvetica, sans-serif;
        font-size: 12pt; color: rgb(0, 0, 0);">
        <br>
      </div>
      <div style="font-family: Calibri, Arial, Helvetica, sans-serif;
        font-size: 12pt; color: rgb(0, 0, 0);">
        That site includes page after page of datasource settings, under
        the "Data Properties" section.
        <br>
      </div>
      <div style="font-family: Calibri, Arial, Helvetica, sans-serif;
        font-size: 12pt; color: rgb(0, 0, 0);">
        <br>
      </div>
      <div style="font-family: Calibri, Arial, Helvetica, sans-serif;
        font-size: 12pt; color: rgb(0, 0, 0);">
        QUESTION: Do we know which of these properties need to be set,
        and to what values, to solve the problem under discussion? If we
        do, that could be the basis for improved documentation.<br>
      </div>
      <div style="font-family: Calibri, Arial, Helvetica, sans-serif;
        font-size: 12pt; color: rgb(0, 0, 0);">
        <br>
      </div>
      <div style="font-family: Calibri, Arial, Helvetica, sans-serif;
        font-size: 12pt; color: rgb(0, 0, 0);">
                   --Keith<br>
      </div>
      <hr style="display:inline-block;width:98%" tabindex="-1">
      <div id="divRplyFwdMsg" dir="ltr"><font style="font-size:11pt" face="Calibri, sans-serif" color="#000000"><b>From:</b>
          midPoint <a class="moz-txt-link-rfc2396E" href="mailto:midpoint-bounces@lists.evolveum.com"><midpoint-bounces@lists.evolveum.com></a> on behalf
          of Petr Gašparík - AMI Praha a.s. <a class="moz-txt-link-rfc2396E" href="mailto:petr.gasparik@ami.cz"><petr.gasparik@ami.cz></a><br>
          <b>Sent:</b> Thursday, May 14, 2020 4:15 AM<br>
          <b>To:</b> midPoint General Discussion
          <a class="moz-txt-link-rfc2396E" href="mailto:midpoint@lists.evolveum.com"><midpoint@lists.evolveum.com></a><br>
          <b>Subject:</b> Re: [midPoint] Where does one configure
          datasources in midPoint 4.0.2?</font>
        <div> </div>
      </div>
      <div>
        <div dir="ltr">This should be definitely better documented, as
          embedded Tomcat is recommended, and in the near future the
          only one supported option.<br clear="all">
          <div>
            <div dir="ltr" class="x_gmail_signature">
              <div dir="ltr">
                <div>
                  <div dir="ltr">
                    <div>
                      <div dir="ltr">
                        <div>
                          <div dir="ltr">
                            <div dir="ltr">
                              <div dir="ltr">
                                <div dir="ltr">
                                  <div dir="ltr">
                                    <div dir="ltr">
                                      <p><span style="font-family:Arial,sans-serif;
                                          font-size:10pt">--</span></p>
                                      <p><span style="font-family:Arial,sans-serif;
                                          font-size:10pt">s pozdravem</span></p>
                                      <div style="color:rgb(0,0,0);
                                        font-family:Arial,sans-serif;
                                        font-size:13px">
                                        <p><strong>Petr Gašparík</strong><br>
                                          <span style="font-size:11px;
                                            color:rgb(128,128,128)">konzultant
                                            IT bezpečnosti</span></p>
                                      </div>
                                      <p style="color:rgb(0,0,0);
                                        font-family:Arial,sans-serif;
                                        font-size:11px">gsm: [+420] 603
                                        523 860<br>
                                        e‑mail: <a href="mailto:petr.gasparik@ami.cz" target="_blank" moz-do-not-send="true">petr.gasparik@ami.cz</a></p>
                                      <p style="color:rgb(0,0,0);
                                        font-family:Arial,sans-serif;
                                        font-size:11px"><strong>AMI
                                          Praha a.s.</strong><br>
                                        Pláničkova 11, 162 00 Praha 6</p>
                                      <p style="color:rgb(0,0,0);
                                        font-family:Arial,sans-serif;
                                        font-size:11px">tel.: [+420]
                                        274 783 239 | web: <a href="https://www.ami.cz" target="_blank" moz-do-not-send="true">www.ami.cz</a></p>
                                      <p style="color:rgb(0,0,0);
                                        font-family:Verdana,Arial,Helvetica,sans-serif;
                                        font-size:10px; margin-top:20px">
                                        <img alt="AMI Praha a.s." style="border:0px" src="http://www.ami.cz/images/podpis/ami_logo.gif" moz-do-not-send="true"></p>
                                      <p style="font-family:Arial,sans-serif;
                                        font-size:11px;
                                        color:rgb(170,170,170)">Textem
                                        tohoto e‑mailu podepisující
                                        neslibuje uzavřít ani neuzavírá
                                        za společnost AMI Praha a.s.<br>
                                        jakoukoliv smlouvu. Každá
                                        smlouva, pokud bude uzavřena,
                                        musí mít výhradně písemnou
                                        formu.<br>
                                        <span style="font-size:6px"> </span><br>
                                        Tento e‑mail je určen výhradně
                                        pro potřeby jeho adresáta/ů
                                        a může obsahovat důvěrné
                                        nebo osobní<br>
                                        informace. Nejste‑li zamýšleným
                                        příjemcem, je zakázáno jakékoliv
                                        zveřejňování, zprostředkování<br>
                                        nebo jiné použití těchto
                                        informací. Pokud jste obdrželi
                                        e‑mail neoprávněně, informujte
                                        o tom prosím<br>
                                        odesílatele a vymažte neprodleně
                                        všechny kopie tohoto e‑mailu
                                        včetně všech jeho příloh.
                                        Nakládáním<br>
                                        s neoprávněně získanými
                                        informacemi se vystavujete
                                        riziku právního postihu.</p>
                                    </div>
                                  </div>
                                </div>
                              </div>
                            </div>
                          </div>
                        </div>
                      </div>
                    </div>
                  </div>
                </div>
              </div>
            </div>
          </div>
          <br>
        </div>
        <br>
        <div class="x_gmail_quote">
          <div dir="ltr" class="x_gmail_attr">čt 14. 5. 2020 v 11:02
            odesílatel Pavol Mederly <<a href="mailto:mederly@evolveum.com" moz-do-not-send="true">mederly@evolveum.com</a>>
            napsal:<br>
          </div>
          <blockquote class="x_gmail_quote" style="margin:0px 0px 0px
            0.8ex; border-left:1px solid rgb(204,204,204);
            padding-left:1ex">
            <div>
              <p>Richard,<br>
              </p>
              <p>I believe that even for embedded Tomcat (used when
                running in standalone mode) you can configure data
                sources, probably by setting up things in
                application.yml file.</p>
              <p>Best regards,<br>
              </p>
              <pre cols="72">Pavol Mederly
Software developer
<a href="http://evolveum.com" target="_blank" moz-do-not-send="true">evolveum.com</a>
</pre>
              <div>On 13/05/2020 19:22, Jason Everling wrote:<br>
              </div>
              <blockquote type="cite">
                <div>
                  <p class="x_MsoNormal"><span>Yeah that was kind of
                      what I meant by container, I believe its using
                      Tomcat as the backend, or Jetty? In any case, you
                      should still be able to create them, we don’t use
                      that method so someone else would have to chime in
                      on configuring them.</span></p>
                  <p class="x_MsoNormal"><span> </span></p>
                  <div style="border-right:none; border-bottom:none;
                    border-left:none; border-top:1pt solid
                    rgb(225,225,225); padding:3pt 0in 0in">
                    <p class="x_MsoNormal" style="border:none;
                      padding:0in"><b>From: </b><a href="mailto:richard.frovarp@ndsu.edu" target="_blank" moz-do-not-send="true">Richard
                        Frovarp</a><br>
                      <b>Sent: </b>Tuesday, May 12, 2020 12:07 PM<br>
                      <b>To: </b><a href="mailto:midpoint@lists.evolveum.com" target="_blank" moz-do-not-send="true">midpoint@lists.evolveum.com</a><br>
                      <b>Subject: </b>Re: [midPoint] Where does one
                      configure datasources in midPoint 4.0.2?</p>
                  </div>
                  <p class="x_MsoNormal"><span> </span></p>
                  <p class="x_MsoNormal">Not running in a container.
                    Just did the download and run using the</p>
                  <p class="x_MsoNormal">start.sh script in the tarball.</p>
                  <p class="x_MsoNormal"> </p>
                  <p class="x_MsoNormal">On Tue, 2020-05-12 at 11:51
                    -0500, Jason Everling wrote:</p>
                  <p class="x_MsoNormal">> Are you running container?
                    I thought there was settings for them if</p>
                  <p class="x_MsoNormal">> using container, maybe
                    someone here has examples for containers. We</p>
                  <p class="x_MsoNormal">> still use tomcat with
                    global datasources so I cant speak to</p>
                  <p class="x_MsoNormal">> container’d deployment</p>
                  <p class="x_MsoNormal">>  </p>
                  <p class="x_MsoNormal">> From: Richard Frovarp</p>
                  <p class="x_MsoNormal">> Sent: Tuesday, May 12,
                    2020 11:18 AM</p>
                  <p class="x_MsoNormal">> To: <a href="mailto:midpoint@lists.evolveum.com" target="_blank" moz-do-not-send="true">
                      midpoint@lists.evolveum.com</a></p>
                  <p class="x_MsoNormal">> Subject: Re: [midPoint]
                    Where does one configure datasources in</p>
                  <p class="x_MsoNormal">> midPoint 4.0.2?</p>
                  <p class="x_MsoNormal">>  </p>
                  <p class="x_MsoNormal">> So unless I'm running this
                    directly through Tomcat I can't do</p>
                  <p class="x_MsoNormal">> datasource how it comes
                    normally?</p>
                  <p class="x_MsoNormal">>  </p>
                  <p class="x_MsoNormal">> I'm getting these:</p>
                  <p class="x_MsoNormal">>  </p>
                  <p class="x_MsoNormal">> 2020-05-12 11:11:52,084
                    [REPOSITORY] [midPointScheduler_Worker-3]</p>
                  <p class="x_MsoNormal">> WARN
                    (com.zaxxer.hikari.pool.PoolBase): HikariPool-1 -
                    Failed to</p>
                  <p class="x_MsoNormal">> validate connection
                    com.mysql.jdbc.JDBC4Connection@5bce37af (No</p>
                  <p class="x_MsoNormal">> operations allowed after
                    connection closed.). Possibly consider using</p>
                  <p class="x_MsoNormal">> a shorter maxLifetime
                    value.</p>
                  <p class="x_MsoNormal">>  </p>
                  <p class="x_MsoNormal">> Which I don't see a
                    setting on how to address that via config.xml. I</p>
                  <p class="x_MsoNormal">> know that 4.1 deprecates
                    MariaDB and I'll need to change to</p>
                  <p class="x_MsoNormal">> PostgreSQL. I was kind of
                    hoping to use datasource so that I can skip</p>
                  <p class="x_MsoNormal">> providing passwords to a
                    lot of resources that will be reading data</p>
                  <p class="x_MsoNormal">> in from the same DB.</p>
                  <p class="x_MsoNormal">>  </p>
                  <p class="x_MsoNormal">> On Tue, 2020-05-12 at
                    11:04 -0500, Jason Everling wrote:</p>
                  <p class="x_MsoNormal">> > Those examples are
                    for tomcat native datasource configuration,</p>
                  <p class="x_MsoNormal">> > standard
                    configuration is done in config.xml in midpoint.home</p>
                  <p class="x_MsoNormal">> > directory,</p>
                  <p class="x_MsoNormal">> >  </p>
                  <p class="x_MsoNormal">> >    
                    <repository></p>
                  <p class="x_MsoNormal">> >      </p>
                  <p class="x_MsoNormal">> >
<repositoryServiceFactoryClass>com.evolveum.midpoint.repo.sql.SqlRe</p>
                  <p class="x_MsoNormal">> >
                    positoryFactory</repositoryServiceFactoryClass></p>
                  <p class="x_MsoNormal">> >      
                    <database>sqlserver</database></p>
                  <p class="x_MsoNormal">> >      
                    <jdbcUsername>midpoint</jdbcUsername></p>
                  <p class="x_MsoNormal">> >      
                    <jdbcPassword>password</jdbcPassword></p>
                  <p class="x_MsoNormal">> >      </p>
                  <p class="x_MsoNormal">> >
<jdbcUrl>jdbc:sqlserver://localhost:1433;database=midpoint</jdbcUrl</p>
                  <p class="x_MsoNormal">> > ></p>
                  <p class="x_MsoNormal">> >    
                    </repository></p>
                  <p class="x_MsoNormal">> >  </p>
                  <p class="x_MsoNormal">> > From: Richard Frovarp</p>
                  <p class="x_MsoNormal">> > Sent: Tuesday, May
                    12, 2020 9:40 AM</p>
                  <p class="x_MsoNormal">> > To: <a href="mailto:midpoint@lists.evolveum.com" target="_blank" moz-do-not-send="true">
                      midpoint@lists.evolveum.com</a></p>
                  <p class="x_MsoNormal">> > Subject: [midPoint]
                    Where does one configure datasources in</p>
                  <p class="x_MsoNormal">> > midPoint 4.0.2?</p>
                  <p class="x_MsoNormal">> >  </p>
                  <p class="x_MsoNormal">> > I've read the
                    documentation here:</p>
                  <p class="x_MsoNormal">> >  </p>
                  <p class="x_MsoNormal">> > <a href="https://wiki.evolveum.com/display/midPoint/Repository+Configuration" target="_blank" moz-do-not-send="true">
https://wiki.evolveum.com/display/midPoint/Repository+Configuration</a></p>
                  <p class="x_MsoNormal">> > #Rep</p>
                  <p class="x_MsoNormal">> >
                    ositoryConfiguration-Datasourceconfiguration</p>
                  <p class="x_MsoNormal">> >  </p>
                  <p class="x_MsoNormal">> > But that doesn't give
                    a current answer. Grepping through everything</p>
                  <p class="x_MsoNormal">> > looking for the bits
                    I think might exist in files doesn't give me a</p>
                  <p class="x_MsoNormal">> > result.</p>
                  <p class="x_MsoNormal">> >  </p>
                  <p class="x_MsoNormal">> > I'm getting a variety
                    of connection problems, likely due to</p>
                  <p class="x_MsoNormal">> > timeouts,</p>
                  <p class="x_MsoNormal">> > and it looks like the
                    only way to set those is via a datasource.</p>
                  <p class="x_MsoNormal">> >  </p>
                  <p class="x_MsoNormal">> > Thanks,</p>
                  <p class="x_MsoNormal">> > Richard</p>
                  <p class="x_MsoNormal">> >
                    _______________________________________________</p>
                  <p class="x_MsoNormal">> > midPoint mailing list</p>
                  <p class="x_MsoNormal">> > <a href="mailto:midPoint@lists.evolveum.com" target="_blank" moz-do-not-send="true">
                      midPoint@lists.evolveum.com</a></p>
                  <p class="x_MsoNormal">> > <a href="https://lists.evolveum.com/mailman/listinfo/midpoint" target="_blank" moz-do-not-send="true">
https://lists.evolveum.com/mailman/listinfo/midpoint</a></p>
                  <p class="x_MsoNormal">> >  </p>
                  <p class="x_MsoNormal">> >
                    _______________________________________________</p>
                  <p class="x_MsoNormal">> > midPoint mailing list</p>
                  <p class="x_MsoNormal">> > <a href="mailto:midPoint@lists.evolveum.com" target="_blank" moz-do-not-send="true">
                      midPoint@lists.evolveum.com</a></p>
                  <p class="x_MsoNormal">> > <a href="https://lists.evolveum.com/mailman/listinfo/midpoint" target="_blank" moz-do-not-send="true">
https://lists.evolveum.com/mailman/listinfo/midpoint</a></p>
                  <p class="x_MsoNormal">> </p>
                  <p class="x_MsoNormal">>  </p>
                  <p class="x_MsoNormal">>  </p>
                  <p class="x_MsoNormal">>
                    _______________________________________________</p>
                  <p class="x_MsoNormal">> midPoint mailing list</p>
                  <p class="x_MsoNormal">> <a href="mailto:midPoint@lists.evolveum.com" target="_blank" moz-do-not-send="true">
                      midPoint@lists.evolveum.com</a></p>
                  <p class="x_MsoNormal">> <a href="https://lists.evolveum.com/mailman/listinfo/midpoint" target="_blank" moz-do-not-send="true">
https://lists.evolveum.com/mailman/listinfo/midpoint</a></p>
                  <p class="x_MsoNormal">_______________________________________________</p>
                  <p class="x_MsoNormal">midPoint mailing list</p>
                  <p class="x_MsoNormal"><a href="mailto:midPoint@lists.evolveum.com" target="_blank" moz-do-not-send="true">midPoint@lists.evolveum.com</a></p>
                  <p class="x_MsoNormal"><a href="https://lists.evolveum.com/mailman/listinfo/midpoint" target="_blank" moz-do-not-send="true">https://lists.evolveum.com/mailman/listinfo/midpoint</a></p>
                  <p class="x_MsoNormal"><span> </span></p>
                </div>
                <br>
                <fieldset></fieldset>
                <pre>_______________________________________________
midPoint mailing list
<a href="mailto:midPoint@lists.evolveum.com" target="_blank" moz-do-not-send="true">midPoint@lists.evolveum.com</a>
<a href="https://lists.evolveum.com/mailman/listinfo/midpoint" target="_blank" moz-do-not-send="true">https://lists.evolveum.com/mailman/listinfo/midpoint</a>
</pre>
              </blockquote>
            </div>
            _______________________________________________<br>
            midPoint mailing list<br>
            <a href="mailto:midPoint@lists.evolveum.com" target="_blank" moz-do-not-send="true">midPoint@lists.evolveum.com</a><br>
            <a href="https://lists.evolveum.com/mailman/listinfo/midpoint" rel="noreferrer" target="_blank" moz-do-not-send="true">https://lists.evolveum.com/mailman/listinfo/midpoint</a><br>
          </blockquote>
        </div>
      </div>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <pre class="moz-quote-pre" wrap="">_______________________________________________
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="https://lists.evolveum.com/mailman/listinfo/midpoint">https://lists.evolveum.com/mailman/listinfo/midpoint</a>
</pre>
    </blockquote>
  </body>
</html>