geronimo-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Garth Keesler <gar...@gdcjk.com>
Subject Re: Bank Sample App Mod to use Postgres]
Date Fri, 28 Dec 2007 18:49:47 GMT
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Garth Keesler wrote:
<blockquote cite="mid:47754074.8090506@gdcjk.com" type="cite">Resending
due to network probs...
  <br>
  <br>
  <hr size="4" width="90%"><br>
  <table class="header-part1" border="0" cellpadding="0" cellspacing="0"
 width="100%">
    <tbody>
      <tr>
        <td>
        <div class="headerdisplayname" style="display: inline;">Subject:
        </div>
Re: Bank Sample App Mod to use Postgres</td>
      </tr>
      <tr>
        <td>
        <div class="headerdisplayname" style="display: inline;">From: </div>
Garth Keesler <a class="moz-txt-link-rfc2396E" href="mailto:garthk@gdcjk.com">&lt;garthk@gdcjk.com&gt;</a></td>
      </tr>
      <tr>
        <td>
        <div class="headerdisplayname" style="display: inline;">Date: </div>
Fri, 28 Dec 2007 11:07:53 -0600</td>
      </tr>
      <tr>
        <td>
        <div class="headerdisplayname" style="display: inline;">To: </div>
<a class="moz-txt-link-abbreviated" href="mailto:user@geronimo.apache.org">user@geronimo.apache.org</a></td>
      </tr>
    </tbody>
  </table>
  <table class="header-part2" border="0" cellpadding="0" cellspacing="0"
 width="100%">
    <tbody>
      <tr>
        <td>
        <div class="headerdisplayname" style="display: inline;">To: </div>
<a class="moz-txt-link-abbreviated" href="mailto:user@geronimo.apache.org">user@geronimo.apache.org</a></td>
      </tr>
    </tbody>
  </table>
  <br>
  <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
  <title></title>
Jacek Laskowski wrote:
  <blockquote
 cite="mid:1b5bfeb50712280823j322a30fdt8d53476a7d3e1abc@mail.gmail.com"
 type="cite">
    <pre wrap="">On Dec 28, 2007 4:11 PM, Garth Keesler <a
 moz-do-not-send="true" class="moz-txt-link-rfc2396E"
 href="mailto:garthk@gdcjk.com">&lt;garthk@gdcjk.com&gt;</a> wrote:
  </pre>
    <blockquote type="cite">
      <pre wrap="">I am new to Geronimo coming from VS2005 and C#. I have a Postgres
DB
configured in the pool as OES and working correctly using the dbtester
sample app. I want to change the persistance of the Bank app from Derby
to Postgres and have not yet figured out the magic to make it happen.
The tables are correctly loaded in the OES database. Below is the
BankPool.xml I modified (obviously incorrectly) and I could use some
pointers. It mavens and installs okay but I get a "lifecycle operation
failed" when attempting to start in the console.
    </pre>
    </blockquote>
    <pre wrap=""><!---->
Hi Garth,

I think the file misses

&lt;config-property-setting
name="DatabaseName"&gt;SystemDatabase&lt;/config-property-setting&gt;

and that's why the resource cannot be deployed and either can the app.
On the other hand, you mentioned it had worked fine using the dbtester
so it was indeed deployed already via the Geronimo console, wasn't it?
If so, the resource is global so your app should merely declare
dependency to the BankPool and be fine with it.

Could you tell us more about how you access the db? Is it JPA
application? What's persistence.xml? Are there any stack traces on the
Geronimo console (on the command line not in the Geronimo web
console)? Describe the steps you used to make
it...cough...cough...fail ;-)
  </pre>
  </blockquote>
Well, first when I said "new to Geronimo", I meant *really* new to
Geronimo. <span class="moz-smiley-s1"><span> :-)&nbsp;&nbsp;&nbsp;
</span></span>Second,
I use the O'Reilly EJB 3.0 book which is excellent but has a bit of a
JBoss slant (for obvious reasons).<br>
  <br>
Second, the Bank sample app is located at
  <a moz-do-not-send="true" class="moz-txt-link-freetext"
 href="http://cwiki.apache.org/GMOxDOC20/ejb-sample-application.html">http://cwiki.apache.org/GMOxDOC20/ejb-sample-application.html</a>
and to
make it work initially, I just follow the instructions to the letter.
This includes creating and loading a Derby database. After that, a
maven command followed by a Geronimo console deploy and it works like a
champ.<br>
  <br>
Third, I have a postgres database already created and loaded with the
same tables/data req'd by the Bank app. It has been added to the DB
pool and works correctly, having been tested using the "dbtester" app
in the same site as the Bank app.<br>
  <br>
The persistence.xml file gets downloaded when the Bank app is extracted
for building so it comes with the kit. It is an "important" file
according to the EJB3.0 book and is used to describe the persistence
mappings to be used by the app server when running the app (best I can
do on this).<br>
  <br>
I've gotten to the point in playing with the files that I have to
remove/redeploy GMO every time since it seems to install correctly but
then won't display the ear as being deployed. I can't deploy the sample
app again because it conflicts with an already-installed app even tho
it doesn't show up in the GMO console.<br>
  <blockquote
 cite="mid:1b5bfeb50712280823j322a30fdt8d53476a7d3e1abc@mail.gmail.com"
 type="cite">
    <pre wrap="">You can find some pointers in Running JBoss Seam 2.0.0.GA on Geronimo
2.1 [1]

[1] <a moz-do-not-send="true" class="moz-txt-link-freetext"
 href="http://cwiki.apache.org/GMOxSAMPLES/running-jboss-seam-200ga-on-geronimo-21.html">http://cwiki.apache.org/GMOxSAMPLES/running-jboss-seam-200ga-on-geronimo-21.html</a>
  </pre>
  </blockquote>
I've heard of JBoss Seam but don't have a clue what it is. :-) I don't
think I'm running it.<br>
  <blockquote
 cite="mid:1b5bfeb50712280823j322a30fdt8d53476a7d3e1abc@mail.gmail.com"
 type="cite">
    <pre wrap="">  </pre>
    <blockquote type="cite">
      <pre wrap="">Any help appreciated...
Thx,
Garth

&lt;?xml version="1.0" encoding="UTF-8"?&gt;
&lt;!--
    Licensed to the Apache Software Foundation (ASF) under one
    or more contributor license agreements.  See the NOTICE file
    distributed with this work for additional information
    regarding copyright ownership.  The ASF licenses this file
    to you under the Apache License, Version 2.0 (the
    "License"); you may not use this file except in compliance
    with the License.  You may obtain a copy of the License at

    <a moz-do-not-send="true" class="moz-txt-link-freetext"
 href="http://www.apache.org/licenses/LICENSE-2.0">http://www.apache.org/licenses/LICENSE-2.0</a>

    Unless required by applicable law or agreed to in writing,
    software distributed under the License is distributed on an
    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
    KIND, either express or implied.  See the License for the
    specific language governing permissions and limitations
    under the License.
--&gt;
&lt;connector xmlns=<a moz-do-not-send="true"
 class="moz-txt-link-rfc2396E"
 href="http://geronimo.apache.org/xml/ns/j2ee/connector-1.1">"http://geronimo.apache.org/xml/ns/j2ee/connector-1.1"</a>&gt;
    &lt;dep:environment
xmlns:dep=<a moz-do-not-send="true" class="moz-txt-link-rfc2396E"
 href="http://geronimo.apache.org/xml/ns/deployment-1.1">"http://geronimo.apache.org/xml/ns/deployment-1.1"</a>&gt;
        &lt;dep:moduleId&gt;
            &lt;dep:groupId&gt;console.dbpool&lt;/dep:groupId&gt;
            &lt;dep:artifactId&gt;OES&lt;/dep:artifactId&gt;
            &lt;dep:version&gt;1.0&lt;/dep:version&gt;
            &lt;dep:type&gt;rar&lt;/dep:type&gt;
        &lt;/dep:moduleId&gt;
        &lt;dep:dependencies&gt;
            &lt;dep:dependency&gt;
                &lt;dep:groupId&gt;org.apache.geronimo.configs&lt;/dep:groupId&gt;
                &lt;dep:artifactId&gt;system-database&lt;/dep:artifactId&gt;
                &lt;dep:type&gt;car&lt;/dep:type&gt;
            &lt;/dep:dependency&gt;
        &lt;/dep:dependencies&gt;
    &lt;/dep:environment&gt;
    &lt;resourceadapter&gt;
        &lt;outbound-resourceadapter&gt;
            &lt;connection-definition&gt;

&lt;connectionfactory-interface&gt;javax.sql.DataSource&lt;/connectionfactory-interface&gt;
                &lt;connectiondefinition-instance&gt;
                    &lt;name&gt;BankPool&lt;/name&gt;
                    &lt;config-property-setting
name="Driver"&gt;org.postgresql.Driver&lt;/config-property-setting&gt;
                    &lt;config-property-setting
name="UserName"&gt;garthk&lt;/config-property-setting&gt;
                    &lt;config-property-setting
name="ConnectionURL"&gt;jdbc:postgresql://pgsrv/oesdb&lt;/config-property-setting&gt;
                    &lt;connectionmanager&gt;
                        &lt;local-transaction/&gt;
                        &lt;single-pool&gt;
                            &lt;max-size&gt;10&lt;/max-size&gt;
                            &lt;min-size&gt;0&lt;/min-size&gt;
                            &lt;match-one/&gt;
                        &lt;/single-pool&gt;
                    &lt;/connectionmanager&gt;
                &lt;/connectiondefinition-instance&gt;
            &lt;/connection-definition&gt;
        &lt;/outbound-resourceadapter&gt;
    &lt;/resourceadapter&gt;
&lt;/connector&gt;

   </pre>
    </blockquote>
  </blockquote>
I'm starting the process over again and I'll capture errors in a file
to attach ASAP.<br>
  <br>
Thx,<br>
Garth<br>
  <blockquote
 cite="mid:1b5bfeb50712280823j322a30fdt8d53476a7d3e1abc@mail.gmail.com"
 type="cite">
    <blockquote type="cite"> </blockquote>
  </blockquote>
  <br>
</blockquote>
It's becoming obvious to me that my previous minimal (spelled
worthless:-) attempts at just changing a couple of literal strings in
selected XML files simply won't cut it since the test db is a Derby db
and not a member of the DB Pool.<br>
<br>
Still working on it...<br>
<br>
Thx,<br>
Garth<br>
</body>
</html>

Mime
View raw message