users@glassfish.java.net

Problem with Postgresql on v1b14

From: <glassfish_at_javadesktop.org>
Date: Sat, 07 Apr 2007 22:41:11 PDT

I'm having a strange problem.

I'm running v1b14 on my Mac and deploying to a Solaris 10 Zone instance.

Both machines are running Postgres 8.1.4. Both domains are running the same JDBC jar.

Both machines are running similar versions of Java:

Sun: java version "1.5.0_07"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_07-b03)
Java HotSpot(TM) Server VM (build 1.5.0_07-b03, mixed mode)

Mac: java version "1.5.0_07"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_07-164)
Java HotSpot(TM) Client VM (build 1.5.0_07-87, mixed mode, sharing)

Both machines are running the same schema from the database -- I used pg_dump for the DB on the mac and loaded it on the Solaris box.

However, I'm getting this on the Sun box:

Caused by: java.lang.NullPointerException
        at oracle.toplink.essentials.platform.database.PostgreSQLPlatform.platformSpecificSequencingInitialization(PostgreSQLPlatform.java:413)

Now I dug around a little bit, and there was this bug:

https://glassfish.dev.java.net/issues/show_bug.cgi?id=283

But it's talking about SERIAL fields and SEQUENCEs. I'm using the AUTO type:

    @Id
    @Column(name = "id", nullable = false)
    @GeneratedValue(strategy=GenerationType.AUTO)
    private Integer id;

Which, as I understand it, uses a TABLE (coincedently NAMED "SEQUENCE") to manage its keys.

The truly frustrating thing about this is simply that I'm running pretty much as identical software on the two systems as is practical -- heck, they're even both Intel machines, but what works fine on my Mac is failing on the Sun.

I saw a suggestion to change my fields from AUTO to SEQUENCE. Will that work? Is there anything else I need to do to my DB to get this to work? I thought SEQUENCEs were problematic in general on Postgres (which is why I avoided them in the first place).

Should I change to TABLE specfically rather than having it default via AUTO?

As you can imagine, I'm trying to roll this out so we can get this thing in to production, so this happens at a spectacularly bad time (as is their nature in general).

Any tips are appreciated.
[Message sent by forum member 'whartung' (whartung)]

http://forums.java.net/jive/thread.jspa?messageID=211475