8 Replies Latest reply on Apr 30, 2002 7:55 AM by Chris Evans

    How to know if PostgreSQL loaded ok?

    Chris Evans Newbie

      In the Database ... forum, David Jencks wrote:

      >To tell if your datasource loaded ok, ...
      >check in jndiview to see it the datasource got bound.

      Can you please elaborate a bit--how do I do that, or where is it documented?

      >[And] look at the mbeans for it in the jmx viewer (port 8082)

      Here's what's there that appears relevant. Does this look right? Is it a problem that hsqldbDS still appears? Should I have deleted references to Hypersonic? If so, where?

      Finally, is there a good example that I could run that would actually modify the PostgreSQL contents in a way I could observe?

      Thanks.
      Chris Evans

      -------------------------------------
      * jboss.jca

      * service=CachedConnectionManager
      * service=JmsXACM
      * service=JmsXADS
      * service=JmsXAPool
      * service=LocalTxCM,name=PostgresDS
      * service=LocalTxCM,name=hsqldbDS
      * service=LocalTxDS,name=PostgresDS
      * service=LocalTxDS,name=hsqldbDS
      * service=LocalTxPool,name=PostgresDS
      * service=LocalTxPool,name=hsqldbDS
      * service=RARDeployer
      * service=RARDeployment,name=JMS Adapter
      * service=RARDeployment,name=Minerva JDBC LocalTransaction ResourceAdapter
      * service=RARDeployment,name=Minerva JDBC XATransaction ResourceAdapter
      -------------------------------------------------
      *



        • 1. Re: How to know if PostgreSQL loaded ok?
          David Jencks Master

          Your set of mbeans looks fine. You can click on the LocalTxCM one for Postgres and check it is started. (state=3, statestring=STARTED)

          JndiView is another mbean, I think under jboss:service=jndiview. Click on it, then press the list button.

          What I do to see if a datasource is really working is run the testsuite. First, get rid of hypersonic and change the jndiname for your desired db config to DefaultDS. Change the type mapping in standardjaws.xml and standardjbosscmp-jdbc.xml to the correct type mapping, then run the testsuite. You may need to get it from cvs.: then change to testsuite directory and run ./build.sh tests. Some tests may fail due to type mismatches, keys too long, etc etc, but you will clearly see if you are talking to the db.

          We could use a simple test app, apparently. Anyone want to write it? maybe a servlet that you give the jndi name to and it looks at db metadata.

          • 2. Re: How to know if PostgreSQL loaded ok?
            Chris Evans Newbie

            > Your set of mbeans looks fine. You can click on the
            > LocalTxCM one for Postgres and check it is started.
            > (state=3, statestring=STARTED)

            Yes, that looks ok.

            > JndiView is another mbean, I think under
            > jboss:service=jndiview. Click on it, then press the
            > list button.

            That shows a Postgres service, which seems right. But there is a diagnostic "Failed to lookup: timedCacheFactory ...". I am not sure if that is an actual problem, or something expected.

            > What I do to see if a datasource is really working is
            > run the testsuite.

            Will do, if the following stuff comes out right:

            > First, get rid of hypersonic

            By this I inferred:
            1. Delete hsqldb-service.xml from the $JBOSS_DIST/server/default/deploy.
            2. In server/default/conf/login-conf.xml, comment out <application-policy name="HsqlDbRealm"> element.
            3. There is a reference to Hypersonic in jbossmq-service.xml, but I do not know whether anything needs to be changed there

            > and change the jndiname for your desired db config to
            > DefaultDS.

            This would be in postgres-service.xml. Done.

            > Change the type mapping in
            > standardjaws.xml and standardjbosscmp-jdbc.xml to the
            > correct type mapping,

            Well, I am not sure what the "correct" type mapping is. I changed the name to, for lack of something more original, "PostgreSQL" in both places. Is a "correct" mapping available tuned for PostgreSQL?

            At this point I rebooted and restarted JBoss. I do not find any mention of hypersonic now, but otherwise it came up with no errors and the other tests above still seem ok--have I done this right so far?

            > then run the testsuite. You
            > may need to get it from cvs.: then change to
            > testsuite directory and run ./build.sh tests. Some
            > tests may fail due to type mismatches, keys too long,
            > etc etc, but you will clearly see if you are talking
            > to the db.

            I will try this in a bit.

            > We could use a simple test app, apparently. Anyone
            > want to write it? maybe a servlet that you give the
            > jndi name to and it looks at db metadata.

            If they don't already exist somewhere I have not found, it would be most helpful to have 5 test very simple apps, not at all realistic, that could serve as templates for creating and testing the 5 types of EJBs with servlet front-ends: entity (CMP and BMP); session (stateless and stateful); and message-driven. I would be willing to help out in defining these if someone who knows something about JBoss is willing to work with me. I will be slow because of other commitments, and ask so many questions that even I will be able to understand. Thoughts?

            Thanks again.

            Chris

            • 3. Re: How to know if PostgreSQL loaded ok?
              Chris Evans Newbie

              I downloaded something from CVS that calls itself JBossTest-1.0.tgz, but it does not correspond to what you describe.

              • 4. Re: How to know if PostgreSQL loaded ok?
                David Jencks Master

                I think that jbosstest thingy is an antique. what I'm talking about is checking out jboss-all, which will get you all of jboss 3. There is probably a way to check out less, but I don't know what it is. Just the jbosstest module is not enough.

                Start your jboss, go to the downloaded testsuite directory, and type ./build.sh tests

                Anyway... this is probably overkill From what you've shown you are on the right track.

                As far as the type-mappings-- most of StandardJaws and StandardJBossCmp-jdbc are taken up with named type mappings for different databases. Just make sure the spellings match

                • 5. Re: How to know if PostgreSQL loaded ok?
                  Chris Evans Newbie

                  David Jencks wrote:
                  > [W]hat I'm talking about is checking out jboss-all,
                  > which will get you all of jboss 3. There is probably a
                  > way to check out less, but I don't know what it is.
                  > Just the jbosstest module is not enough.

                  For the record, I am going to describe what I did to try to use the test suite, and the results. But first, my questions:
                  1. There are lots of errors in both the database log and the test suite report--some details below. How do I know whether they are significant? The Quickstart tutorial says that interpretation of the testsuite results are beyond its scope.
                  2. The jboss-all CVS download is a daily snapshot, which does not correspond to the current JBoss3-Tomcat4 binary version. Consequently, serialized objects do not correspond. How can I get the complete source corresponding to the binary distribution?
                  2. Do simple examples exist for the 5 EJB types, that I can use as templates for creating new ones?
                  3. Is there an example that goes servlet->entity EJB->database, and back?
                  4. Are there any of the report files in particular from the testsuite that I could post that might indicate whether my JBoss is configured ok?

                  -------------------------------------------------------
                  DETAILS:
                  -------------------------------------------------------
                  > Start your jboss, go to the downloaded testsuite
                  > directory, and type ./build.sh tests

                  The procedure for CVS download of a daily snapshot is described in the "Quickstart" tutorial in the "For Developers" page on the website.

                  There were errors for classes not found from the package
                  javax.ejb. I downloaded the J2EE from Sun
                  to get the apparently missing jar files, but then found that all of these classes are already in jboss-j2ee.jar.
                  So, in the local shell, I added $JBOSS_DIST/lib/jboss-j2ee.jar to the CLASSPATH. Now I notice unsatisfied externals from javax.management, and other packages. I decided to do a build from the root of the download. This will obviously produce all the needed jars. However, when I run the test suite, I get more than 200 errors. I find that my jboss is no longer running, and that it will not restart. The new installation has affected the existing one.

                  Building jboss-all from the root turned out to be a mistake because it clobbered my own version of JBoss, probably because it used the JBOSS_DIST environment variable that had been set globally. Since I had not backed up the old directory tree, I just reinstalled, then moved the modified files from my old version to my newly installed one.

                  I did make one change in the process. In standardjaws.xml, I changed the entry in the element to java:/DefaultDS from java:/PostgresDS. Correct?
                  Since the testsuite was already built, I could now do what David Jencks had suggested in the first place--navigate down to the testsuite directory, and run ./build.sh tests.

                  > Some tests may fail due to type mismatches, keys too
                  > long, etc etc, but you will clearly see if you are
                  > talking to the db.

                  From $PGSQL_HOME/data/serverlog, it is clear that the database has been used by the test suite. There are errors, however, of two types:
                  (1) certain relations--entityexc and bmp_bean_tbl--do
                  not exist; and
                  (2) errors involving java.rmi.MarshalledObject.

                  testsuite/output/reports/text/TESTS-TestSuites.txt reports: number of tests run: 585; successful tests: 455; errors: 116; failures: 14. One kind of problem--there are others, too--in the stderr produced by the run is mismatches in the IDs of serialized objects. These are probably due the difference between my running JBoss instance and the classes from the build for the test.

                  • 6. Re: How to know if PostgreSQL loaded ok?
                    Chris Evans Newbie

                    FYI--The interest session bean example described in the documentation does not work with my current configuration.

                    • 7. Re: How to know if PostgreSQL loaded ok?
                      Chris Evans Newbie

                      > FYI--The interest session bean example described in
                      > the documentation does not work with my current
                      > configuration.

                      Hmm... The interest session bean example does not work, at least as described in the volunteer documentation, even with the RC1 JBoss/Tomcat distrib out of the box (except for fixing the catalina.home entry in tomcat4-service.xml, which is necessary to get the Tomcat examples to work).

                      Anyone know how to get the example going? Might this be an EJB 2.0 versus 1.1 problem?

                      • 8. Re: How to know if PostgreSQL loaded ok?
                        Chris Evans Newbie

                        My last two posts to this thread are answered in
                        http://www.jboss.org/modules/bb/index.html?module=bb&op=viewtopic&t=forums/ Both the "out-of-the-box" JBoss3 and my custom PostgreSQL version successfully run the Interest session bean example with the modifications described there.

                        However, the one previous to those, which describes more than 100 errors running the testsuite, still has me baffled.

                        Chris Evans