<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; color: rgb(0, 0, 0); font-size: 14px; font-family: Calibri, sans-serif;">
<div>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.</div>
<div><br>
</div>
<div>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.</div>
<div>
<div><br>
</div>
<div>ALTER TABLE auditlog </div>
<div>ALTER COLUMN data TYPE varchar(10485760);</div>
<div><br>
</div>
<div>ALTER TABLE gateways </div>
<div>ALTER COLUMN configuration TYPE varchar(10485760);</div>
<div><br>
</div>
<div>ALTER TABLE policies </div>
<div>ALTER COLUMN configuration TYPE varchar(10485760);</div>
</div>
<div><br>
</div>
<div><br>
</div>
<div><br>
</div>
<span id="OLK_SRC_BODY_SECTION">
<div style="font-family:Calibri; font-size:11pt; text-align:left; color:black; BORDER-BOTTOM: medium none; BORDER-LEFT: medium none; PADDING-BOTTOM: 0in; PADDING-LEFT: 0in; PADDING-RIGHT: 0in; BORDER-TOP: #b5c4df 1pt solid; BORDER-RIGHT: medium none; PADDING-TOP: 3pt">
<span style="font-weight:bold">From: </span>"<a href="mailto:pblair@clearme.com">pblair@clearme.com</a>" <<a href="mailto:pblair@clearme.com">pblair@clearme.com</a>><br>
<span style="font-weight:bold">Date: </span>Wed, 9 Dec 2015 01:53:05 +0000<br>
<span style="font-weight:bold">To: </span>"<a href="mailto:apiman-user@lists.jboss.org">apiman-user@lists.jboss.org</a>" <<a href="mailto:apiman-user@lists.jboss.org">apiman-user@lists.jboss.org</a>><br>
<span style="font-weight:bold">Subject: </span>[Apiman-user] Strange exception trying to initialize apiman database with Postgres<br>
</div>
<div><br>
</div>
<div>
<div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; color: rgb(0, 0, 0); font-size: 14px; font-family: Calibri, sans-serif;">
<div>I'm getting a weird data type exception when issuing a request to the API manager running against a Postgres instance:</div>
<div>
<div>
<div><br>
</div>
<div>I'm using apiman 1.1.9 with the DDL for Postgres found here: <a href="https://raw.githubusercontent.com/apiman/apiman/apiman-1.1.9.Final/distro/wildfly8/src/main/resources/overlay/apiman/ddls/apiman_postgresql9.ddl">https://raw.githubusercontent.com/apiman/apiman/apiman-1.1.9.Final/distro/wildfly8/src/main/resources/overlay/apiman/ddls/apiman_postgresql9.ddl</a></div>
<div>
<div><br>
</div>
<div>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.</div>
</div>
<div><br>
</div>
<div>Relevant stack:</div>
<div><br>
</div>
<div>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@325203f1</div>
</div>
<div>…</div>
<div>Caused by: javax.persistence.PersistenceException: Unable to build entity manager factory</div>
</div>
<div>…</div>
<div>
<div>Caused by: org.hibernate.HibernateException: Wrong column type in public.auditlog for column data. Found: text, expected</div>
<div>: varchar(2147483647)</div>
</div>
<div>
<div> at org.hibernate.mapping.Table.validateColumns(Table.java:372) [hibernate-core-4.3.7.Final.jar:4.3.7.Final]</div>
<div> at org.hibernate.cfg.Configuration.validateSchema(Configuration.java:1338) [hibernate-core-4.3.7.Final.jar:4.3.7</div>
<div>.Final]</div>
</div>
<div>…</div>
<div><br>
</div>
<div><br>
</div>
</div>
</div>
_______________________________________________ Apiman-user mailing list <a href="mailto:Apiman-user@lists.jboss.org">
Apiman-user@lists.jboss.org</a> <a href="https://lists.jboss.org/mailman/listinfo/apiman-user">
https://lists.jboss.org/mailman/listinfo/apiman-user</a> </span>
</body>
</html>