Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[eclipselink-users] The Java type [null] is not a valid database type -- any clues?

I've gotten this error while marking up some Entities and running them through unit tests.  Both Hibernate and OpenJPA deal with my setup just fine, but it looks like at EntityManagerFactory creation time, EclipseLink barfs with this error.  I've reproduced the stack below.

This appears to happen as a side effect of relying on EclipseLink's DDL-generation; I have that property set to drop-and-create-tables.

Exception Description: The Java type [null] is not a valid database type.
    at org.eclipse.persistence.exceptions.ValidationException.javaTypeIsNotAValidDatabaseType(ValidationException.java:1172)
    at org.eclipse.persistence.tools.schemaframework.FieldDefinition.appendDBString(FieldDefinition.java:137)
    at org.eclipse.persistence.tools.schemaframework.TableDefinition.buildCreationWriter(TableDefinition.java:306)
    at org.eclipse.persistence.tools.schemaframework.DatabaseObjectDefinition.createOnDatabase(DatabaseObjectDefinition.java:81)
    at org.eclipse.persistence.tools.schemaframework.SchemaManager.createObject(SchemaManager.java:187)
    at org.eclipse.persistence.tools.schemaframework.SchemaManager.replaceObject(SchemaManager.java:882)
    at org.eclipse.persistence.tools.schemaframework.TableCreator.replaceTablesAndConstraints(TableCreator.java:297)
    at org.eclipse.persistence.tools.schemaframework.TableCreator.replaceTables(TableCreator.java:260)
    at org.eclipse.persistence.tools.schemaframework.SchemaManager.replaceDefaultTables(SchemaManager.java:944)
    at org.eclipse.persistence.internal.jpa.EntityManagerFactoryProvider.createOrReplaceDefaultTables(EntityManagerFactoryProvider.java:78)
    at org.eclipse.persistence.internal.jpa.EntityManagerFactoryProvider.writeDDLToDatabase(EntityManagerFactoryProvider.java:286)
    at org.eclipse.persistence.internal.jpa.EntityManagerFactoryProvider.generateDDL(EntityManagerFactoryProvider.java:115)
    at org.eclipse.persistence.internal.jpa.EntityManagerSetupImpl.deploy(EntityManagerSetupImpl.java:260)

I've turned logging up to FINEST, and here is all I get (stand back; I've trimmed some of the "connecting"-type messages for some degree of brevity):

[EL Finest]: 2009-06-29 12:02:40.796--ServerSession(14738709)--Thread(Thread[main,5,main])--Begin predeploying Persistence Unit test-EclipseLink; state Predeployed; factoryCount 0
[EL Finest]: 2009-06-29 12:02:40.796--ServerSession(14738709)--Thread(Thread[main,5,main])--End predeploying Persistence Unit test-EclipseLink; state Predeployed; factoryCount 1
[EL Finest]: 2009-06-29 12:02:40.796--ServerSession(14738709)--Thread(Thread[main,5,main])--Begin deploying Persistence Unit test-EclipseLink; state Predeployed; factoryCount 1
[EL Finest]: 2009-06-29 12:02:40.828--ServerSession(14738709)--Thread(Thread[main,5,main])--property=eclipselink.logging.level; value=FINEST; translated value=FINEST
[EL Finest]: 2009-06-29 12:02:40.828--ServerSession(14738709)--Thread(Thread[main,5,main])--property=eclipselink.logging.level; value=FINEST; translated value=FINEST
[EL Finest]: 2009-06-29 12:02:40.828--ServerSession(14738709)--Thread(Thread[main,5,main])--property=eclipselink.jdbc.user; value=sa
[EL Finest]: 2009-06-29 12:02:40.828--ServerSession(14738709)--Thread(Thread[main,5,main])--property=eclipselink.jdbc.password; value=xxxxxx
[EL Finest]: 2009-06-29 12:02:41.578--ServerSession(14738709)--Thread(Thread[main,5,main])--property=eclipselink.target-database; value=org.eclipse.persistence.platform.database.H2Platform
[EL Finest]: 2009-06-29 12:02:41.578--ServerSession(14738709)--Thread(Thread[main,5,main])--property=eclipselink.jdbc.driver; value=org.h2.Driver
[EL Finest]: 2009-06-29 12:02:41.578--ServerSession(14738709)--Thread(Thread[main,5,main])--property=eclipselink.jdbc.url; value=jdbc:h2:mem:test;DB_CLOSE_DELAY=-1
[EL Finest]: 2009-06-29 12:02:41.578--ServerSession(14738709)--Thread(Thread[main,5,main])--property=eclipselink.jdbc.native-sql; value=true
[EL Info]: 2009-06-29 12:02:41.593--ServerSession(14738709)--Thread(Thread[main,5,main])--EclipseLink, version: Eclipse Persistence Services - 1.1.2.v20090612-r4475
[EL Config]: 2009-06-29 12:02:41.609--ServerSession(14738709)--Connection(25150543)--Thread(Thread[main,5,main])--connecting(DatabaseLogin(
    platform=>H2Platform
    user name=> "sa"
    datasource URL="" "jdbc:h2:mem:test;DB_CLOSE_DELAY=-1"
))
[EL Config]: 2009-06-29 12:02:41.609--ServerSession(14738709)--Connection(20002533)--Thread(Thread[main,5,main])--Connected: jdbc:h2:mem:test
    User: SA
    Database: H2  Version: 1.1.114 (2009-06-01)
    Driver: H2 JDBC Driver  Version: 1.1.114 (2009-06-01)

(lots of connecting...connected messages snipped here)

[EL Finest]: 2009-06-29 12:02:41.671--ServerSession(14738709)--Thread(Thread[main,5,main])--sequencing connected, state is NoPreallocation_State
[EL Finest]: 2009-06-29 12:02:41.671--ServerSession(14738709)--Thread(Thread[main,5,main])--sequence SEQ_GEN_IDENTITY: preallocation size 1
[EL Info]: 2009-06-29 12:02:41.781--ServerSession(14738709)--Thread(Thread[main,5,main])--file:/e:/projects/cx-experimental/modules/glaccount/jpa/target/test-classes/-test-EclipseLink login successful
[EL Finest]: 2009-06-29 12:02:41.812--ServerSession(14738709)--Thread(Thread[main,5,main])--Execute query DataModifyQuery(sql="ALTER TABLE doc_table DROP CONSTRAINT FK_doc_table_obj")
[EL Fine]: 2009-06-29 12:02:41.812--ServerSession(14738709)--Connection(26179329)--Thread(Thread[main,5,main])--ALTER TABLE doc_table DROP CONSTRAINT FK_doc_table_obj
[EL Fine]: 2009-06-29 12:02:41.812--ServerSession(14738709)--Thread(Thread[main,5,main])--CALL 42
[EL Warning]: 2009-06-29 12:02:41.812--ServerSession(14738709)--Thread(Thread[main,5,main])--Exception [EclipseLink-4002] (Eclipse Persistence Services - 1.1.2.v20090612-r4475): org.eclipse.persistence.exceptions.DatabaseException
Internal Exception: org.h2.jdbc.JdbcSQLException: Table DOC_TABLE not found; SQL statement:
ALTER TABLE doc_table DROP CONSTRAINT FK_doc_table_obj [42102-114]
Error Code: 42102
Call: ALTER TABLE doc_table DROP CONSTRAINT FK_doc_table_obj
Query: DataModifyQuery(sql="ALTER TABLE doc_table DROP CONSTRAINT FK_doc_table_obj")
[EL Finest]: 2009-06-29 12:02:41.828--ServerSession(14738709)--Thread(Thread[main,5,main])--Execute query DataModifyQuery(sql="DROP TABLE doc_table")
[EL Fine]: 2009-06-29 12:02:41.828--ServerSession(14738709)--Connection(20002533)--Thread(Thread[main,5,main])--DROP TABLE doc_table
[EL Fine]: 2009-06-29 12:02:41.828--ServerSession(14738709)--Thread(Thread[main,5,main])--CALL 42
[EL Warning]: 2009-06-29 12:02:41.828--ServerSession(14738709)--Thread(Thread[main,5,main])--Exception [EclipseLink-4002] (Eclipse Persistence Services - 1.1.2.v20090612-r4475): org.eclipse.persistence.exceptions.DatabaseException
Internal Exception: org.h2.jdbc.JdbcSQLException: Table DOC_TABLE not found; SQL statement:
DROP TABLE doc_table [42102-114]
Error Code: 42102
Call: DROP TABLE doc_table
Query: DataModifyQuery(sql="DROP TABLE doc_table")
[EL Severe]: 2009-06-29 12:02:41.843--ServerSession(14738709)--Thread(Thread[main,5,main])--Local Exception Stack:
Exception [EclipseLink-7008] (Eclipse Persistence Services - 1.1.2.v20090612-r4475): org.eclipse.persistence.exceptions.ValidationException
Exception Description: The Java type [null] is not a valid database type.

There is basically one other report, ever, of this error on the Internet, and it was never resolved.  Does someone know at least where I should begin looking?

Best,
Laird

Back to the top