hbm2ddl fails for build in HSQLDB
jrosskopf Dec 23, 2006 2:35 PMHello,
I have a couple of EJB3 EntityBeans deploying perfectly on a postgresql datasource. But for development purposes I want to deploy them on an hsql datasource. But there goes something wrong.
Here is my datasource.
<local-tx-datasource> <jndi-name>youRuleLocalDs</jndi-name> <connection-url>jdbc:hsqldb:.</connection-url> <driver-class>org.hsqldb.jdbcDriver</driver-class> <user-name>sa</user-name> <password></password> <metadata> <type-mapping>Hypersonic SQL</type-mapping> </metadata> </local-tx-datasource>
When SchemaExport tries to generate the db-schema I get the following exception:
20:23:48,186 INFO [SchemaExport] Running hbm2ddl schema export 20:23:48,186 INFO [SchemaExport] exporting generated schema to database 20:23:48,196 ERROR [SchemaExport] Unsuccessful: create table AccountAttribute (gid int8 not null, name varchar(255), value bytea, primary key (gid)) 20:23:48,196 ERROR [SchemaExport] Wrong data type: INT8 in statement [create table AccountAttribute (gid int8] 20:23:48,196 ERROR [SchemaExport] Unsuccessful: create table Content (gid int8 not null, mime varchar(255), CData oid, primary key (gid)) 20:23:48,196 ERROR [SchemaExport] Wrong data type: INT8 in statement [create table Content (gid int8] 20:23:48,206 ERROR [SchemaExport] Unsuccessful: create table DateAttribute (gid int8 not null, name varchar(255), value timestamp, primary key (gid)) 20:23:48,206 ERROR [SchemaExport] Wrong data type: INT8 in statement [create table DateAttribute (gid int8] 20:23:48,206 ERROR [SchemaExport] Unsuccessful: create table FloatAttribute (gid int8 not null, name varchar(255), floatValue float8, primary key (gid )) 20:23:48,206 ERROR [SchemaExport] Wrong data type: INT8 in statement [create table FloatAttribute (gid int8] 20:23:48,206 ERROR [SchemaExport] Unsuccessful: create table IntAttribute (gid int8 not null, name varchar(255), intValue int4, primary key (gid)) 20:23:48,206 ERROR [SchemaExport] Wrong data type: INT8 in statement [create table IntAttribute (gid int8] 20:23:48,206 ERROR [SchemaExport] Unsuccessful: create table Item (gid int8 not null, pubDate timestamp, description_gid int8, primary key (gid)) 20:23:48,206 ERROR [SchemaExport] Wrong data type: INT8 in statement [create table Item (gid int8] 20:23:48,206 ERROR [SchemaExport] Unsuccessful: create table ItemDescription (gid int8 not null, primary key (gid)) 20:23:48,206 ERROR [SchemaExport] Wrong data type: INT8 in statement [create table ItemDescription (gid int8] 20:23:48,206 ERROR [SchemaExport] Unsuccessful: create table Item_Content (Item_gid int8 not null, contents_gid int8 not null, unique (contents_gid)) 20:23:48,206 ERROR [SchemaExport] Wrong data type: INT8 in statement [create table Item_Content (Item_gid int8] 20:23:48,206 ERROR [SchemaExport] Unsuccessful: create table Item_Tag (items_gid int8 not null, tags_gid int8 not null) 20:23:48,206 ERROR [SchemaExport] Wrong data type: INT8 in statement [create table Item_Tag (items_gid int8] 20:23:48,206 ERROR [SchemaExport] Unsuccessful: create table PlaceMark (gid int8 not null, name varchar(255), range float8, heading float8, latitude f loat8, longitude float8, tilt float8, x float8, y float8, z float8, visibibilty bool not null, primary key (gid)) 20:23:48,206 ERROR [SchemaExport] Wrong data type: INT8 in statement [create table PlaceMark (gid int8] 20:23:48,206 ERROR [SchemaExport] Unsuccessful: create table Tag (gid int8 not null, name varchar(255), primary key (gid)) 20:23:48,206 ERROR [SchemaExport] Wrong data type: INT8 in statement [create table Tag (gid int8] 20:23:48,206 ERROR [SchemaExport] Unsuccessful: create table TextAttribute (gid int8 not null, name varchar(255), textValue varchar(255), primary key (gid)) 20:23:48,206 ERROR [SchemaExport] Wrong data type: INT8 in statement [create table TextAttribute (gid int8] 20:23:48,206 ERROR [SchemaExport] Unsuccessful: alter table Item add constraint FK22EF3384593C43 foreign key (description_gid) references ItemDescript ion 20:23:48,206 ERROR [SchemaExport] Table not found: ITEM in statement [alter table Item] 20:23:48,206 ERROR [SchemaExport] Unsuccessful: alter table Item_Content add constraint FK53E57F4DA5EB5E2E foreign key (Item_gid) references Item 20:23:48,206 ERROR [SchemaExport] Table not found: ITEM_CONTENT in statement [alter table Item_Content] 20:23:48,206 ERROR [SchemaExport] Unsuccessful: alter table Item_Content add constraint FK53E57F4D5222FCF1 foreign key (contents_gid) references Conte nt 20:23:48,206 ERROR [SchemaExport] Table not found: ITEM_CONTENT in statement [alter table Item_Content] 20:23:48,206 ERROR [SchemaExport] Unsuccessful: alter table Item_Tag add constraint FK4A0E946EE127AC5B foreign key (items_gid) references Item 20:23:48,206 ERROR [SchemaExport] Table not found: ITEM_TAG in statement [alter table Item_Tag] 20:23:48,206 INFO [SchemaExport] Executing import script: /import.sql 20:23:48,206 ERROR [SchemaExport] schema export unsuccessful org.hibernate.JDBCException: Error during import script execution at org.hibernate.tool.hbm2ddl.SchemaExport.importScript(SchemaExport.java:258) at org.hibernate.tool.hbm2ddl.SchemaExport.execute(SchemaExport.java:192) at org.hibernate.tool.hbm2ddl.SchemaExport.create(SchemaExport.java:133) at org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:311) at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1218) at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:691) at org.hibernate.ejb.HibernatePersistence.createContainerEntityManagerFactory(HibernatePersistence.java:127) at org.jboss.ejb3.entity.PersistenceUnitDeployment.start(PersistenceUnitDeployment.java:264) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at org.jboss.ejb3.ServiceDelegateWrapper.startService(ServiceDelegateWrapper.java:102) at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:289) at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:245) at sun.reflect.GeneratedMethodAccessor3.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155) at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94) at org.jboss.mx.server.Invocation.invoke(Invocation.java:86) at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264) at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659) at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:978) at $Proxy0.start(Unknown Source) at org.jboss.system.ServiceController.start(ServiceController.java:417) at sun.reflect.GeneratedMethodAccessor5.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155) at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94) at org.jboss.mx.server.Invocation.invoke(Invocation.java:86) at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264) at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659) at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210) at $Proxy240.start(Unknown Source) at org.jboss.ejb3.JmxKernelAbstraction.install(JmxKernelAbstraction.java:96) at org.jboss.ejb3.Ejb3Deployment.startPersistenceUnits(Ejb3Deployment.java:467) at org.jboss.ejb3.Ejb3Deployment.start(Ejb3Deployment.java:317) at org.jboss.ejb3.Ejb3Module.startService(Ejb3Module.java:91) at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:289) at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:245) at sun.reflect.GeneratedMethodAccessor3.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155) at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94) at org.jboss.mx.server.Invocation.invoke(Invocation.java:86) at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264) at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659) at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:978) at $Proxy0.start(Unknown Source) at org.jboss.system.ServiceController.start(ServiceController.java:417) at sun.reflect.GeneratedMethodAccessor5.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155) at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94) at org.jboss.mx.server.Invocation.invoke(Invocation.java:86) at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264) at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659) at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210) at $Proxy28.start(Unknown Source) at org.jboss.ejb3.EJB3Deployer.start(EJB3Deployer.java:449) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155) at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94) at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:133) at org.jboss.mx.server.Invocation.invoke(Invocation.java:88) at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:142) at org.jboss.mx.interceptor.DynamicInterceptor.invoke(DynamicInterceptor.java:97) at org.jboss.system.InterceptorServiceMBeanSupport.invokeNext(InterceptorServiceMBeanSupport.java:238) at org.jboss.ws.integration.jboss.DeployerInterceptor.start(DeployerInterceptor.java:92) at org.jboss.deployment.SubDeployerInterceptorSupport$XMBeanInterceptor.start(SubDeployerInterceptorSupport.java:188) at org.jboss.deployment.SubDeployerInterceptor.invoke(SubDeployerInterceptor.java:95) at org.jboss.mx.server.Invocation.invoke(Invocation.java:88) at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264) at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659) at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210) at $Proxy29.start(Unknown Source) at org.jboss.deployment.MainDeployer.start(MainDeployer.java:1025) at org.jboss.deployment.MainDeployer.start(MainDeployer.java:1015) at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:819) at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:782) at sun.reflect.GeneratedMethodAccessor13.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155) at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94) at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:133) at org.jboss.mx.server.Invocation.invoke(Invocation.java:88) at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:142) at org.jboss.mx.server.Invocation.invoke(Invocation.java:88) at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264) at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659) at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210) at $Proxy6.deploy(Unknown Source) at org.jboss.deployment.scanner.URLDeploymentScanner.deploy(URLDeploymentScanner.java:421) at org.jboss.deployment.scanner.URLDeploymentScanner.scan(URLDeploymentScanner.java:634) at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.doScan(AbstractDeploymentScanner.java:263) at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.loop(AbstractDeploymentScanner.java:274) at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.run(AbstractDeploymentScanner.java:225) Caused by: java.sql.SQLException: Table not found in statement [INSERT INTO public.placemark] at org.hsqldb.jdbc.Util.sqlException(Unknown Source) at org.hsqldb.jdbc.jdbcStatement.fetchResult(Unknown Source) at org.hsqldb.jdbc.jdbcStatement.execute(Unknown Source) at org.jboss.resource.adapter.jdbc.WrappedStatement.execute(WrappedStatement.java:84) at org.hibernate.tool.hbm2ddl.SchemaExport.importScript(SchemaExport.java:254) ... 104 more
Can anybody give me a hint how to fix this issue.
Regards
---
Joachim