5 Replies Latest reply on Nov 14, 2004 10:03 AM by komone

    jboss 4 and PostgreSQL

    jotsetung

      hello,
      i want to use a postgres backend for my EJBs but am not able to make this running in jboss-4. with jboss 3.2.2 i had no problems configuring that, but what is different now in the jboss4? what files do i have to edit? i configured the standardjaws.xml and standardjbosscmp-jdbc.xml in the conf directory. i added the drivers jar to the lib directory, defined the the data source in the deploy directory, but the server is not able to boot.
      the error message that i get says something about a SQLError, no datatype "other" defined. this is what is defined in the ejb-deployer.xml file in the deploy directory. i have no clue what to do with this file....
      does anyone know how to configure jboss4 with postgres?
      thanks

        • 1. Re: jboss 4 and PostgreSQL
          beyarecords

          Hi,
          the very issue you mention I had the same problem, still un-resolved yet, but here is a work around. The error is telling you that there is no datatype definition for psotgresql in the standardjbosscmp-jdbc.xml file, which there is not! Every other database but not postgresql. What I did is this:

          standardjbosscmp-jdbc.xml:

          java:/PostgreSQL
          <datasource-mapping>postgreSQL</datasource-mapping>

          ..............

          <type-mappings>
          <type-mapping>
          postgreSQL

          </type-mapping>

          So you are pointing to a postgresql datatype definition, which itself has no definition (until postgresql users are provided with one). Do the same for standardjaws.xml as well.


          Andrew

          • 2. Re: jboss 4 and PostgreSQL
            jotsetung

            but in the standardjbosscmp-jdbc.xml there is a type mapping for PostgreSQLand in the standardjaws too. i changed the java:DefaultDS to java:PostgresDS ... but what is this strange data type "other"?
            in the ejb-deployer.xml is written:

             <attribute name="CreateTableDDL">
             create table TIMERS (
             TIMERID varchar(50) not null,
             TARGETID varchar(50) not null,
             INITIALDATE timestamp not null,
             INTERVAL bigint,
             INSTANCEPK other,
             INFO other,
             constraint timers_pk primary key (TIMERID)
             )
             </attribute>
            


            this file is the only new thing that changed from jboss 3.2 (i suppose) and therefore i think this is the problem... (bacause in jboss 3.2 everithing worked fine)


            • 3. Re: jboss 4 and PostgreSQL

              FAQ http://www.jboss.org/wiki/Wiki.jsp?page=ChangeTheDatabase
              I just modified it, to hopefully make it more clear.

              There is also an FAQ on JBoss4 http://www.jboss.org/wiki/Wiki.jsp?page=JBoss4FAQ

              OFF TOPIC:
              You also need to learn to post relevent information
              (changed config files, error messages, etc.), otherwise your questions will continually
              go unanswered.

              "I deployed postgres in 4.0 just like I did in 3.2.2 and it doesn't work"
              is unrevealing since we don't know how you did it in 3.2.2

              "It says something like SQLError"
              post the full exception for insert-explitive-here's sake.

              There is also an FAQ on how to post questions that can be answered
              by non-psychic people.

              • 4. Re: jboss 4 and PostgreSQL
                jotsetung

                thanks a lot!
                in the future i will describe my problems better, promised! ;)

                • 5. Re: jboss 4 and PostgreSQL
                  komone

                  With Postgres you need to change "other" to "oid".

                  If you have no need for persistent ejb timers then the noop is ok, but if you do need them, then unfortunately, the default setting will throw a SQL exception on second boot complaining that the table "timers" already exists.

                  /k1