[Apiman-user] Strange exception trying to initialize apiman database with Postgres

Paul Blair pblair at clearme.com
Tue Dec 8 21:09:21 EST 2015


I was able to work around this problem with the auditlog data column and a few other columns using the ALTER TABLE statements below to convert to a VARCHAR of shorter length than the error message demanded. However, I'm now stymied by a subsequent error: "Wrong column type in public.service_defs for column data. Found: oid, expected: blob" -- I tried converting the type to bytea but this doesn't satisfy Hibernate.

I feel like I've got the wrong version of a script here, but I was careful to get the PostgreSQL script for apiman 1.1.9.Final.

ALTER TABLE auditlog
ALTER COLUMN data TYPE varchar(10485760);

ALTER TABLE gateways
ALTER COLUMN configuration TYPE varchar(10485760);

ALTER TABLE policies
ALTER COLUMN configuration TYPE varchar(10485760);



From: "pblair at clearme.com<mailto:pblair at clearme.com>" <pblair at clearme.com<mailto:pblair at clearme.com>>
Date: Wed, 9 Dec 2015 01:53:05 +0000
To: "apiman-user at lists.jboss.org<mailto:apiman-user at lists.jboss.org>" <apiman-user at lists.jboss.org<mailto:apiman-user at lists.jboss.org>>
Subject: [Apiman-user] Strange exception trying to initialize apiman database with Postgres

I'm getting a weird data type exception when issuing a request to the API manager running against a Postgres instance:

I'm using apiman 1.1.9 with the DDL for Postgres found here: https://raw.githubusercontent.com/apiman/apiman/apiman-1.1.9.Final/distro/wildfly8/src/main/resources/overlay/apiman/ddls/apiman_postgresql9.ddl

The DDL does make that into a text column; I'm not sure why Hibernate doesn't like it and instead wants a VARCHAR that is too big for Postgres. This is on PostgreSQL 9.4.4; my driver configuration in the standalone-apiman.xml uses postgresql-9.3-1102-jdbc41.jar and doesn't have any particular validation configuration.

Relevant stack:

UT005023: Exception handling request to /apiman/currentuser/info: org.jboss.resteasy.spi.UnhandledException: org.jboss.weld.exceptions.WeldException: WELD-000049: Unable to invoke public void io.apiman.manager.api.jpa.EntityManagerFactoryAccessor.postConstruct() on io.apiman.manager.api.jpa.EntityManagerFactoryAccessor at 325203f1
...
Caused by: javax.persistence.PersistenceException: Unable to build entity manager factory
...
Caused by: org.hibernate.HibernateException: Wrong column type in public.auditlog for column data. Found: text, expected
: varchar(2147483647)
        at org.hibernate.mapping.Table.validateColumns(Table.java:372) [hibernate-core-4.3.7.Final.jar:4.3.7.Final]
        at org.hibernate.cfg.Configuration.validateSchema(Configuration.java:1338) [hibernate-core-4.3.7.Final.jar:4.3.7
.Final]
...


_______________________________________________ Apiman-user mailing list Apiman-user at lists.jboss.org<mailto:Apiman-user at lists.jboss.org> https://lists.jboss.org/mailman/listinfo/apiman-user
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/apiman-user/attachments/20151209/8f118f03/attachment.html 


More information about the Apiman-user mailing list