Topic
11 replies Latest Post - ‏2012-11-28T12:46:33Z by SystemAdmin
BigBrian
BigBrian
5 Posts
ACCEPTED ANSWER

Pinned topic Using DB2 with PlantsByWebSphere Sample App

‏2009-10-03T18:27:45Z |
Is it possible to use the PlantsByWebSphere (PBW) sample application with DB2? If so, does anybody know the steps I need to take to do this?
Do I need to update the ...\applications\PlantsByWebSphere\sql\tables.ddl file?
Do I need to update the ...\applications\PlantsByWebSphere\PlantsByWebSphereWEB\src\main\webapp\WEB-INF\web.xml file?
Do I need to update the ...\applications\PlantsByWebSphere\PlantsGalleryWEB\src\main\webapp\WEB-INF\web.xml file?
Do I need to update the ...\applications\PlantsByWebSphere\plans\pbw-plan.xml file?

Note, I have already installed and configured DB2 to be a database pool in WASCE 2.1.1.3.
Updated on 2012-11-28T12:46:33Z at 2012-11-28T12:46:33Z by SystemAdmin
  • Ashish_Jain
    Ashish_Jain
    274 Posts
    ACCEPTED ANSWER

    Re: Using DB2 with PlantsByWebSphere Sample App

    ‏2009-10-06T13:06:06Z  in response to BigBrian
    Hello,

    You have to modify the pbw-plan.xml file. You also have to remove the derby related artifacts from persistence.xml.
    For your reference I am attaching the deployment plan.

    Hope this helps!!

    thanks
    Ashihs
    Updated on 2009-10-06T13:06:06Z at 2009-10-06T13:06:06Z by Ashish_Jain
    • BigBrian
      BigBrian
      5 Posts
      ACCEPTED ANSWER

      Re: Using DB2 with PlantsByWebSphere Sample App

      ‏2009-10-06T20:23:02Z  in response to Ashish_Jain
      Ashish, thanks for the reply. When I went to deploy PBW I ran into some problems. Here is what I did:

      (1)Installed DB2 Everywhere
      (1)(a)created a database called PLANTSDB
      (1)(b)copied the contents of the ...\applications\PlantsByWebSphere\sql\tables.ddl file into the DB2 Control Center and ran them as sql statements. Note, they ran successfully and as a result the tables were created.

      (2)Created a datapool via the WAS Admin Console called PlantsByWebSphere
      http://3894659985892330012-a-1802744773732722657-s-sites.googlegroups.com/site/rationalspace/images/PBW_database_poolname.jpg

      (3)Updated the deployment plan
      (3)(a)Replaced the deployment plan (...\applications\PlantsByWebSphere\plans\pbw-plan.xml) with the file you provided (pbw-plan_forDB2.xml).
      (3)(b)I updated the pbw-plan_forDB2.xml file to have the following information:
      <version>2.1.1.2</version>
      <config-property-setting name="ServerName">localhost</config-property-setting>
      I have included the updated deployment plan as an attachment

      (4)Removed the derby related artifacts from persistence.xml
      (4)(a)I updated the persistence.xml file with the following values:
      I changed this:
      <jta-data-source>WASCESampleTxDatasource</jta-data-source>
      <non-jta-data-source>WASCESampleNoTxDatasource</non-jta-data-source>
      to this:
      <jta-data-source>PlantsByWebSphere</jta-data-source>
      <non-jta-data-source>PlantsByWebSphere</non-jta-data-source>

      (4)(b)I deleted the following content from the persistence.xml file
      <!-- use OpenJPA's built-in DataSource for unmanaged connections
      -->
      • <!--
      property name="openjpa.Connection2DriverName" value="org.apache.derby.jdbc.EmbeddedDriver"/>
      <property name="openjpa.Connection2URL" value="jdbc:derby:PLANTSDB"/

      -->
      <property name="openjpa.TransactionMode" value="managed" />
      <property name="openjpa.ConnectionFactoryMode" value="managed" />
      <property name="openjpa.jdbc.DBDictionary" value="derby" />
      <property name="openjpa.jdbc.DBDictionary" value="org.apache.openjpa.jdbc.sql.DerbyDictionary" />
      <property name="openjpa.jdbc.SynchronizeMappings" value="buildSchema(ForeignKeys=false)" />
      <property name="openjpa.Sequence" value="table(Table=OPENJPASEQ, Increment=100)" />
      • <!-- property name="openjpa.Log" value="DefaultLevel=TRACE"/
      -->

      (5)Deploy Plants By WebSphere
      (5)(a)Under "Applications" -> "Deploy new" I navigate to the PlantsByWebsphereEAR-2.1.1.2.ear and the update deployment plan
      (5)(b)When trying to install the application I get the following error:
      Deployment Failed

      Unable to resolve reference "JtaDataSourceWrapper"
      in gbean com.ibm.wasce.samples/pbw/2.1.1.2/car?EJBModule=PlantsByWebSphereEJB3.jar,J2EEApplication=com.ibm.wasce.samples /pbw/2.1.1.2/car,PersistenceUnitModule=PlantsByWebSpherePersistence-2.1.1.2.jar,j2eeType=PersistenceUnit,name=PBW
      to a gbean matching the pattern http://?name=WASCESampleTxDatasource#org.apache.geronimo.naming.ResourceSource
      due to: No matches for referencePatterns: http://?name=WASCESampleTxDatasource#org.apache.geronimo.naming.ResourceSource

      Unable to resolve reference "NonJtaDataSourceWrapper"
      in gbean com.ibm.wasce.samples/pbw/2.1.1.2/car?EJBModule=PlantsByWebSphereEJB3.jar,J2EEApplication=com.ibm.wasce.samples /pbw/2.1.1.2/car,PersistenceUnitModule=PlantsByWebSpherePersistence-2.1.1.2.jar,j2eeType=PersistenceUnit,name=PBW
      to a gbean matching the pattern http://?name=WASCESampleNoTxDatasource#org.apache.geronimo.naming.ResourceSource
      due to: No matches for referencePatterns: http://?name=WASCESampleNoTxDatasource#org.apache.geronimo.naming.ResourceSource

      org.apache.geronimo.common.DeploymentException: Unable to resolve reference "JtaDataSourceWrapper"
      in gbean com.ibm.wasce.samples/pbw/2.1.1.2/car?EJBModule=PlantsByWebSphereEJB3.jar,J2EEApplication=com.ibm.wasce.samples/pbw/2.1.1.2/car,PersistenceUnitModule=PlantsByWebSpherePersistence-2.1.1.2.jar,j2eeType=PersistenceUnit,name=PBW
      to a gbean matching the pattern http://?name=WASCESampleTxDatasource#org.apache.geronimo.naming.ResourceSource
      due to: No matches for referencePatterns: http://?name=WASCESampleTxDatasource#org.apache.geronimo.naming.ResourceSource

      Unable to resolve reference "NonJtaDataSourceWrapper"
      in gbean com.ibm.wasce.samples/pbw/2.1.1.2/car?EJBModule=PlantsByWebSphereEJB3.jar,J2EEApplication=com.ibm.wasce.samples/pbw/2.1.1.2/car,PersistenceUnitModule=PlantsByWebSpherePersistence-2.1.1.2.jar,j2eeType=PersistenceUnit,name=PBW
      to a gbean matching the pattern http://?name=WASCESampleNoTxDatasource#org.apache.geronimo.naming.ResourceSource
      due to: No matches for referencePatterns: http://?name=WASCESampleNoTxDatasource#org.apache.geronimo.naming.ResourceSource
      at org.apache.geronimo.deployment.DeploymentContext.getConfigurationData(DeploymentContext.java:654)
      at org.apache.geronimo.deployment.Deployer.install(Deployer.java:337)
      at org.apache.geronimo.deployment.Deployer.deploy(Deployer.java:261)
      at org.apache.geronimo.deployment.Deployer.deploy(Deployer.java:134)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:79)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at java.lang.reflect.Method.invoke(Method.java:618)
      at org.apache.geronimo.gbean.runtime.ReflectionMethodInvoker.invoke(ReflectionMethodInvoker.java:34)
      at org.apache.geronimo.gbean.runtime.GBeanOperation.invoke(GBeanOperation.java:124)
      at org.apache.geronimo.gbean.runtime.GBeanInstance.invoke(GBeanInstance.java:867)
      at org.apache.geronimo.kernel.basic.BasicKernel.invoke(BasicKernel.java:239)
      at org.apache.geronimo.deployment.plugin.local.AbstractDeployCommand.doDeploy(AbstractDeployCommand.java:116)
      at org.apache.geronimo.deployment.plugin.local.DistributeCommand.run(DistributeCommand.java:61)
      at java.lang.Thread.run(Thread.java:811)
      • Ashish_Jain
        Ashish_Jain
        274 Posts
        ACCEPTED ANSWER

        Re: Using DB2 with PlantsByWebSphere Sample App

        ‏2009-10-07T06:52:52Z  in response to BigBrian
        Hello Brian,

        See comments for each of your steps #1 to #5

        #1 This step is fine.
        #2 This is not required as you are already deploying the pool through the database pool plan. So you can just delete the datasource created by you.
        #3 This step is fine.
        #4 (a) Should be something like this
        <jta-data-source>jdbc/PlantsByWebSphere</jta-data-source>
        <non-jta-data-source>jdbc/PlantsByWebSphere</non-jta-data-source>
        (b) I hope you have removed all the entries as you suggest. There should not be any entry for derby in persistence.xml
        #5 Try again and you will not hit the error any more.

        HTH

        Thanks
        Ashish
        • Ashish_Jain
          Ashish_Jain
          274 Posts
          ACCEPTED ANSWER

          Re: Using DB2 with PlantsByWebSphere Sample App

          ‏2009-10-07T07:00:40Z  in response to Ashish_Jain
          Just a correction to #2...it should be

          #2 This is not required as you are already deploying the pool through the pbw-plan.xml. So you can just delete the datasource created by you.
          • BigBrian
            BigBrian
            5 Posts
            ACCEPTED ANSWER

            Re: Using DB2 with PlantsByWebSphere Sample App

            ‏2009-10-08T10:07:45Z  in response to Ashish_Jain
            I was able to get PBW deployed using DB2. Here are the steps that got me to the happy place, aka PBW up and running and ready to take online orders.

            1. Create the 'PLANTSDB' database in DB2.

            2. Updated the 'persistence.xml' to have the following info, "<property name="openjpa.Connection2URL" value="jdbc:db2://localhost:50000/PLANTSDB"/>". This is what the persistence.xml file looked like in its entirety:
            <?xml version="1.0" encoding="UTF-8" ?>
            • <persistence xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.0" xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd">
            • <persistence-unit name="PBW" transaction-type="JTA">
            <provider>org.apache.openjpa.persistence.PersistenceProviderImpl</provider>
            • <!--
            <jta-data-source>java:comp/env/jdbc/PLANTSDBXA</jta-data-source>
            <non-jta-data-source>java:comp/env/jdbc/PLANTSDB</non-jta-data-source>
            -->
            <jta-data-source>jdbc/PlantsByWebSphereTxDatasource</jta-data-source>
            <non-jta-data-source>jdbc/PlantsByWebSphereNoTxDatasource</non-jta-data-source>
            • <!--
            <jta-data-source>WASCESampleTxDatasource</jta-data-source>
            <non-jta-data-source>WASCESampleNoTxDatasource</non-jta-data-source>
            -->
            <class>com.ibm.websphere.samples.pbwjpa.BackOrder</class>
            <class>com.ibm.websphere.samples.pbwjpa.Customer</class>
            • <!-- class>com.ibm.websphere.samples.pbwjpa.IdGenerator</class -->
            <class>com.ibm.websphere.samples.pbwjpa.Inventory</class>
            <class>com.ibm.websphere.samples.pbwjpa.Order</class>
            <class>com.ibm.websphere.samples.pbwjpa.OrderItem</class>
            <class>com.ibm.websphere.samples.pbwjpa.OrderItem$PK</class>
            <class>com.ibm.websphere.samples.pbwjpa.Supplier</class>
            <exclude-unlisted-classes>true</exclude-unlisted-classes>
            • <properties>
            • <!-- use OpenJPA's built-in DataSource for unmanaged connections -->
            <property name="openjpa.Connection2DriverName" value="com.ibm.db2.jcc.DB2Driver" />
            <property name="openjpa.Connection2URL" value="jdbc:db2://localhost:50000/PLANTSDB" />
            <property name="openjpa.TransactionMode" value="managed" />
            <property name="openjpa.ConnectionFactoryMode" value="managed" />
            • <!-- <property name="openjpa.jdbc.DBDictionary" value="derby"/> -->
            <property name="openjpa.jdbc.DBDictionary" value="org.apache.openjpa.jdbc.sql.DB2Dictionary" />
            <property name="openjpa.jdbc.SynchronizeMappings" value="buildSchema(ForeignKeys=false)" />
            <property name="openjpa.Sequence" value="table(Table=OPENJPASEQ, Increment=100)" />
            <property name="openjpa.Log" value="DefaultLevel=TRACE" />
            </properties>
            </persistence-unit>
            </persistence>

            2a. Replaced the modified 'persistence.xml' with the existing one in PlantsByWebSpherePersistence-2.1.1.2.jar\META-INF of PlantsByWebsphereEAR-2.1.1.2.ear application. Note, the PlantsByWebSpherePersistence-2.1.1.2.jar is located inside the PlantsByWebsphereEAR-2.1.1.2.ear file.

            3. Used the plan - "pbw-plan-for-DB2.xml" to deploy the application. Changed the following properties according based on my DB2 setup,

            <config-property-setting name="DatabaseName">PLANTSDB</config-property-setting>
            <config-property-setting name="Password">db2admin</config-property-setting>
            <config-property-setting name="TraceFile"/>
            <config-property-setting name="UserName">db2admin</config-property-setting>
            <config-property-setting name="ServerName">localhost</config-property-setting>

            The plan will create two datasources, one with xa support transactions and another with no transactions for application. Modified the UserName, Password and ServerName in both the places according to your DB2. I have attached the pbw-plan-for-DB2.xml file.

            4. Deployed the ear - PlantsByWebsphereEAR-2.1.1.2.ear using the above modified plan - pbw-plan-for-DB2.xml.

            5. Accessed the application -> http://localhost:8080/PlantsByWebSphere/

            6. Created the tables and populate the data into the tables by accessing this page -> http://localhost:8080/PlantsByWebSphere/help.jsp and select (Re)Populate DataBase.

            Note, in step 1 we only created the database and not any tables. With step 6 the required tables will create in the database and the data will be populated into the tables.
            • Ashish_Jain
              Ashish_Jain
              274 Posts
              ACCEPTED ANSWER

              Re: Using DB2 with PlantsByWebSphere Sample App

              ‏2009-10-09T07:02:40Z  in response to BigBrian
              Hi Brian,

              Thanks for uploading the steps on the forum. This is surely going to help others who try the same scenario.

              Cheers
              Ashish
            • SystemAdmin
              SystemAdmin
              2233 Posts
              ACCEPTED ANSWER

              Re: Using DB2 with PlantsByWebSphere Sample App

              ‏2012-11-28T12:46:33Z  in response to BigBrian
              Hi BigBrian,

              I am new to WAS environment.
              I am trying to configure PlantsByWebsphere application using DB2 (DB2 9.7 and WAS 8).
              I followed below mentioned steps.

              1. PLANTSDB created in DB2.
              2. Modified the 'persistence.xml' file.
              3. Modified the "pbw-plan-for-DB2.xml" file according to my environment.
              4. Deployed the ear - pbw-ear.ear using the above modified plan - pbw-plan-for-DB2.xml.

              please let me know how to deploy this ear file using modified plan file in WAS 8.

              Thanks in advance for your help
  • SystemAdmin
    SystemAdmin
    2233 Posts
    ACCEPTED ANSWER

    Re: Using DB2 with PlantsByWebSphere Sample App

    ‏2012-04-26T16:14:14Z  in response to BigBrian
    This did definitely help in my own attempts to use DB2 with PlantsByWebSphere. I am doing this in WASCE 3.0 with DB 9.7, so my plan and persistence file looks slightly different. When I try deploying PlantsByWebSphere in WASCE 3.0 using the plan file BigBrian uploaded.

    I am getting a different error then BigBrian, it attempts to deploy the plantsbywebsphere ear using my adjusted plan file below. It seems to be getting stuck due to an issue finding the plan.xml's referenced geronimo mail bean.

    Here is the error

    The application was not deployed.
    org.apache.geronimo.gbean.InvalidConfigurationException: Could not load class org.apache.geronimo.modules.geronimo-mail.SMTPTransportGBean from bundle com.ibm.wasce.samples.pbw-DEPLOYMENT_0.0.0.3_0_0_1 442 at location reference:file:/C:/Program%20Files/IBM/WebSphere/AppServerCommunityEdition/var/temp/geronimo-fileutils5585924832544222809.tmpdir/
    org.apache.geronimo.common.DeploymentException: org.apache.geronimo.gbean.InvalidConfigurationException: Could not load class org.apache.geronimo.modules.geronimo-mail.SMTPTransportGBean from bundle com.ibm.wasce.samples.pbw-DEPLOYMENT_0.0.0.3_0_0_1 442 at location reference:file:/C:/Program%20Files/IBM/WebSphere/AppServerCommunityEdition/var/temp/geronimo-fileutils5585924832544222809.tmpdir/
    at org.apache.geronimo.deployment.Deployer.deploy(Deployer.java:279)
    at org.apache.geronimo.deployment.Deployer.deploy(Deployer.java:140)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source


    When I log into the Administrative Console to look and try to identify what bean container should be used, i see a couple possibilities but 1) im not sure which one needs to be used and 2) not entirely positive on change in the mail section of the plan.xml that i need to make. It might be one of the two below that i need to use.
    org.apache.geronimo.javamail/geronimo-javamail_1.4_mail/1.8.3/jar
    org.apache.geronimo.modules/geronimo-mail/3.0-w20111014/jar
    Below is the contents of my pbw-plan.xml

    <?xml version="1.0" encoding="UTF-8"?>
    <application xmlns="http://geronimo.apache.org/xml/ns/j2ee/application-1.2">
    <environment>
    <moduleId>
    <groupId>com.ibm.wasce.samples</groupId>
    <artifactId>pbw</artifactId>
    <version>3.0.0.1</version>
    <type>car</type>
    </moduleId>
    <dependencies>
    <dependency>
    <groupId>org.apache.geronimo.configs</groupId>
    <artifactId>openjpa</artifactId>
    <type>car</type>
    </dependency>
    <dependency>
    <groupId>org.apache.geronimo.configs</groupId>
    <artifactId>j2ee-corba-yoko</artifactId>
    <type>car</type>
    </dependency>
    <dependency>
    <groupId>org.apache.geronimo.configs</groupId>
    <artifactId>javamail</artifactId>
    <type>car</type>
    </dependency>
    </dependencies>
    </environment>
    <module>
    <web>PlantsByWebSphereWEB.war</web>
    <web-app xmlns="http://geronimo.apache.org/xml/ns/j2ee/web-1.2">
    <context-root>PlantsByWebSphere</context-root>
    <resource-ref>
    <ref-name>plantsby/PlantsByWebSphereDataSource</ref-name>
    <resource-link>jdbc/PlantsByWebSphereNoTxDatasource</resource-link>
    </resource-ref>
    <security-realm-name>geronimo-admin</security-realm-name>
    <security>
    <default-principal>
    <principal name="anonymous" class="org.apache.geronimo.security.realm.providers.GeronimoUserPrincipal"/>
    </default-principal>
    <role-mappings>
    <role role-name="SampAdmin">
    <principal name="admin" class="org.apache.geronimo.security.realm.providers.GeronimoGroupPrincipal"/>
    <principal name="system" class="org.apache.geronimo.security.realm.providers.GeronimoUserPrincipal"/>
    </role>
    </role-mappings>
    </security>
    <!-- <service-ref>
    <service-ref-name>service/FrontGate_SEIService</service-ref-name>
    <port>
    <port-name>FrontGate</port-name>
    <protocol>http</protocol>
    <host>localhost</host>
    <port>9080</port>
    <uri>/OrderProcessorEJB/services/FrontGate</uri>
    </port>
    </service-ref>
    <resource-ref>
    <ref-name>PlantsByWebSphereDS</ref-name>
    <resource-link>jdbc/PlantsByWebSphereNoTxDatasource</resource-link>
    </resource-ref> -->
    </web-app>
    </module>
    <module>
    <ejb>PlantsByWebSphereEJB3.jar</ejb>
    <openejb-jar xmlns="http://www.openejb.org/xml/ns/openejb-jar-2.0">
    <enterprise-beans>
    <session>
    <ejb-name>ResetDBBean</ejb-name>
    <resource-ref>
    <ref-name>plantsby/PlantsByWebSphereDataSource</ref-name>
    <resource-link>jdbc/PlantsByWebSphereNoTxDatasource</resource-link>
    </resource-ref>
    </session>
    </enterprise-beans>
    </openejb-jar>
    </module>
    <ext-module>
    <connector>PBWDataSource</connector>
    <external-path xmlns:dep="http://geronimo.apache.org/xml/ns/deployment-1.2">
    <dep:groupId>org.tranql</dep:groupId>
    <dep:artifactId>tranql-connector-db2-xa</dep:artifactId>
    <dep:type>rar</dep:type>
    </external-path>
    <connector xmlns="http://geronimo.apache.org/xml/ns/j2ee/connector-1.2">
    <dep:environment xmlns:dep="http://geronimo.apache.org/xml/ns/deployment-1.2">
    <dep:moduleId>
    <dep:groupId>console.dbpool</dep:groupId>
    <dep:artifactId>jdbc_PlantsByWebSphere</dep:artifactId>
    <dep:version>1.0</dep:version>
    <dep:type>rar</dep:type>
    </dep:moduleId>
    <dep:dependencies>
    <dep:dependency>
    <dep:groupId>com.ibm.db2</dep:groupId>
    <dep:artifactId>db2jcc4</dep:artifactId>
    <dep:version>9.7</dep:version>
    <dep:type>jar</dep:type>
    </dep:dependency>
    <dep:dependency>
    <dep:groupId>com.ibm.db2</dep:groupId>
    <dep:artifactId>db2jcc_license_cu</dep:artifactId>
    <dep:version>9.7</dep:version>
    <dep:type>jar</dep:type>
    </dep:dependency>
    </dep:dependencies>
    </dep:environment>
    <resourceadapter>
    <outbound-resourceadapter>
    <connection-definition>
    <connectionfactory-interface>javax.sql.DataSource</connectionfactory-interface>
    <connectiondefinition-instance>
    <name>jdbc/PlantsByWebSphereTxDatasource</name>
    <config-property-setting name="DatabaseName">PLANTS</config-property-setting>
    <config-property-setting name="Password">Administrat0r</config-property-setting>
    <config-property-setting name="TraceFile"/>
    <config-property-setting name="UserName">db2admin</config-property-setting>
    <config-property-setting name="ServerName">localhost</config-property-setting>
    <connectionmanager>
    <xa-transaction>
    <transaction-caching/>
    </xa-transaction>
    <single-pool>
    <max-size>10</max-size>
    <min-size>0</min-size>
    <match-one/>
    </single-pool>
    </connectionmanager>
    </connectiondefinition-instance>
    <connectiondefinition-instance>
    <name>jdbc/PlantsByWebSphereNoTxDatasource</name>
    <config-property-setting name="DatabaseName">PLANTS</config-property-setting>
    <config-property-setting name="Password">Administrat0r</config-property-setting>
    <config-property-setting name="TraceFile"/>
    <config-property-setting name="UserName">db2admin</config-property-setting>
    <config-property-setting name="ServerName">localhost</config-property-setting>
    <connectionmanager>
    <no-transaction/>
    <single-pool>
    <max-size>10</max-size>
    <min-size>0</min-size>
    <match-one/>
    </single-pool>
    </connectionmanager>
    </connectiondefinition-instance>
    </connection-definition>
    </outbound-resourceadapter>
    </resourceadapter>
    </connector>
    </ext-module>
    <gbean name="JavaMailProtocol.smtp" class="org.apache.geronimo.modules.geronimo-mail.SMTPTransportGBean">
    <attribute name="host">localhost</attribute>
    <attribute name="port">25</attribute>
    <attribute name="from">pbw@wasce.ibm.com</attribute>
    </gbean>
    <gbean name="mail/PlantsByWebSphere" class="org.apache.geronimo.modules.geronimo-mail.MailGBean">
    <attribute name="transportProtocol">smtp</attribute>
    <attribute name="useDefault">false</attribute>
    <attribute name="jndiName">mail/PlantsByWebSphere</attribute>
    <attribute name="properties">mail.debug=true</attribute>
    <reference name="Protocols">
    <name>JavaMailProtocol.smtp</name>
    </reference>
    </gbean>
    </application>


    Thanks in advance for any advice/pointers/help.
  • SystemAdmin
    SystemAdmin
    2233 Posts
    ACCEPTED ANSWER

    Re: Using DB2 with PlantsByWebSphere Sample App

    ‏2012-04-26T20:09:28Z  in response to BigBrian
    I made progress and believe i have the mail function working now. However im getting a different error now when trying to deploy plants.


    The application was not deployed.
    Unable to resolve reference "NonJtaDataSourceWrapper"
    in gbean com.ibm.wasce.samples/pbw/3.0.0.1/car?EJBModule=PlantsByWebSphereEJB3.jar,J2EEApplication=com.ibm.wasce.samples/pbw/3.0.0.1/car,PersistenceUnitModule=PlantsByWebSpherePersistence-3.0.0.1.jar,j2eeType=PersistenceUnit,name=PBW
    to a gbean matching the pattern http://?name=jdbc/PlantsByWebSphere#org.apache.geronimo.naming.ResourceSource
    due to: No matches for referencePatterns: http://?name=jdbc/PlantsByWebSphere#org.apache.geronimo.naming.ResourceSource (no matches)


    Any ideas/help/pointers appreciated.
    • X75J_Li_Yanli
      X75J_Li_Yanli
      45 Posts
      ACCEPTED ANSWER

      Re: Using DB2 with PlantsByWebSphere Sample App

      ‏2012-05-03T14:01:33Z  in response to SystemAdmin
      Hello,

      Please update the pbw-plan-for-DB2.xml for this section:
      from:
      <dep:dependencies>

      <dep:dependency>

      <dep:groupId>com.ibm.db2</dep:groupId>

      <dep:artifactId>db2jcc</dep:artifactId>

      <dep:version>9.1</dep:version>

      <dep:type>jar</dep:type>

      </dep:dependency>

      <dep:dependency>

      <dep:groupId>com.ibm.db2</dep:groupId>

      <dep:artifactId>db2jcc_license_cu</dep:artifactId>

      <dep:version>9.1</dep:version>

      <dep:type>jar</dep:type>

      </dep:dependency>

      </dep:dependencies>
      to:
      <dep:dependencies>

      <dep:dependency>

      <dep:groupId>com.ibm.db2</dep:groupId>

      <dep:artifactId>db2jcc</dep:artifactId>

      <dep:version>9.5-bundle</dep:version>

      <dep:type>jar</dep:type>

      </dep:dependency>

      <dep:dependency>

      <dep:groupId>com.ibm.db2</dep:groupId>

      <dep:artifactId>db2jcc_license_cu</dep:artifactId>

      <dep:version>9.5-bundle</dep:version>

      <dep:type>jar</dep:type>

      </dep:dependency>

      </dep:dependencies>

      For WAS CE 3.0, if you use db2 9.5 or other low version,you can get the exact info from admin console-->Repository-->com.ibm.db2/db2jcc/9.5-bundle/jar and com.ibm.db2/db2jcc_license_cu/9.5-bundle/jar.
      If using db2 9.7, you need to install the driver first by yourself.
    • X75J_Li_Yanli
      X75J_Li_Yanli
      45 Posts
      ACCEPTED ANSWER

      Re: Using DB2 with PlantsByWebSphere Sample App

      ‏2012-05-04T03:12:13Z  in response to SystemAdmin
      you can also use com.ibm.db2/db2jcc/9.5-bundle/jar and com.ibm.db2/db2jcc_license_cu/9.5-bundle/jar to connect db2 9.7.