Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/jpa/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
使用Hibernate在wildfly上使用JPA创建表失败_Hibernate_Jpa_Persistence.xml - Fatal编程技术网

使用Hibernate在wildfly上使用JPA创建表失败

使用Hibernate在wildfly上使用JPA创建表失败,hibernate,jpa,persistence.xml,Hibernate,Jpa,Persistence.xml,Im使用JPA在使用hibernate安装的Wildfly 8.0的内置H2数据库上创建表,但失败并显示以下错误消息: 原因:javax.persistence.PersistenceException: org.hibernate.exception.sqlgrammareexception:无法准备 声明在 org.hibernate.jpa.spi.AbstractEntityManagerImpl.convert(AbstractEntityManagerImpl.java:1763)

Im使用JPA在使用hibernate安装的Wildfly 8.0的内置H2数据库上创建表,但失败并显示以下错误消息:

原因:javax.persistence.PersistenceException: org.hibernate.exception.sqlgrammareexception:无法准备 声明在 org.hibernate.jpa.spi.AbstractEntityManagerImpl.convert(AbstractEntityManagerImpl.java:1763) 在 org.hibernate.jpa.spi.AbstractEntityManagerImpl.convert(AbstractEntityManagerImpl.java:1677) 在 org.hibernate.jpa.spi.AbstractEntityManagerImpl.convert(AbstractEntityManagerImpl.java:1683) 在 org.hibernate.jpa.spi.AbstractEntityManagerImpl.persist(AbstractEntityManagerImpl.java:1187) 在 org.jboss.as.jpa.container.AbstractEntityManager.persist(AbstractEntityManager.java:581) 在test.mdb.MessageDRivenBean.onMessage(MessageDRivenBean.java:41) 位于sun.reflect.GeneratedMethodAccessor2.invoke(未知源) [:1.7.0_67]at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) [rt.jar:1.7.067]位于java.lang.reflect.Method.invoke(Method.java:606) [rt.jar:1.7.0_67]at org.jboss.as.ee.component.ManagedReferenceMethodInterceptor.processInvocation(ManagedReferenceMethodInterceptor.java:52) 在 org.jboss.invocation.InterceptorContext.procedure(InterceptorContext.java:309) 在 org.jboss.invocation.WeavedInterceptor.processInvocation(WeavedInterceptor.java:53) 在 org.jboss.as.ee.component.interceptors.UserInterceptorFactory$1.processInvocation(UserInterceptorFactory.java:63) 在 org.jboss.invocation.InterceptorContext.procedure(InterceptorContext.java:309) 在 org.jboss.invocation.WeavedInterceptor.processInvocation(WeavedInterceptor.java:53) 在 org.jboss.as.ee.component.interceptors.UserInterceptorFactory$1.processInvocation(UserInterceptorFactory.java:63) 在 org.jboss.invocation.InterceptorContext.procedure(InterceptorContext.java:309) 在 org.jboss.as.ejb3.component.invocationmetrics.ExecutionTimeInterceptor.processInvocation(ExecutionTimeInterceptor.java:43) 在 org.jboss.invocation.InterceptorContext.procedure(InterceptorContext.java:309) 在 org.jboss.as.ee.concurrent.ConcurrentContextInterceptor.processInvocation(ConcurrentContextInterceptor.java:45) 在 org.jboss.invocation.InterceptorContext.procedure(InterceptorContext.java:309) 在 org.jboss.invocation.InitialInterceptor.processInvocation(InitialInterceptor.java:21) 在 org.jboss.invocation.InterceptorContext.procedure(InterceptorContext.java:309) 在 org.jboss.invocation.ChainedInterceptor.processInvocation(ChainedInterceptor.java:61) 在 org.jboss.as.ee.component.interceptors.ComponentDispatcherInterceptor.processInvocation(ComponentDispatcherInterceptor.java:53) 在 org.jboss.invocation.InterceptorContext.procedure(InterceptorContext.java:309) 在 org.jboss.as.ejb3.component.pool.PooledInstanceInterceptor.processInvocation(PooledInstanceInterceptor.java:51) 在 org.jboss.invocation.InterceptorContext.procedure(InterceptorContext.java:309) 在 org.jboss.as.ejb3.tx.CMTTxInterceptor.invokeincalertx(CMTTxInterceptor.java:251) ... 49更多原因:org.hibernate.exception.sqlgrammareexception: 无法在处准备对账单 org.hibernate.exception.internal.SQLStateConversionDelegate.convert(SQLStateConversionDelegate.java:123) 在 org.hibernate.exception.internal.StandardSQLExceptionConverter.convert(StandardSQLExceptionConverter.java:49) 在 org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(SqlExceptionHelper.java:126) 在 org.hibernate.engine.jdbc.internal.StatementPrepareImpl$StatementPreparationTemplate.prepareStatement(statementPrepareImpl.java:196) 在 org.hibernate.engine.jdbc.internal.statementPrepareImpl.prepareStatement(statementPrepareImpl.java:122) 在 org.hibernate.id.IdentityGenerator$GetGeneratedKeysDelegate.prepare(IdentityGenerator.java:89) 在 org.hibernate.id.insert.AbstractReturningDelegate.performInsert(AbstractReturningDelegate.java:55) 在 org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:3032) 在 org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:3558) 在 org.hibernate.action.internal.EntityIdentityInsertAction.execute(EntityIdentityInsertAction.java:98) 位于org.hibernate.engine.spi.ActionQueue.execute(ActionQueue.java:490) 在 org.hibernate.engine.spi.ActionQueue.addResolvedEntityInsertAction(ActionQueue.java:195) 在 org.hibernate.engine.spi.ActionQueue.addInsertAction(ActionQueue.java:179) 在 org.hibernate.engine.spi.ActionQueue.addAction(ActionQueue.java:214) 在 org.hibernate.event.internal.AbstractSaveEventListener.addInsertAction(AbstractSaveEventListener.java:324) 在 org.hibernate.event.internal.AbstractSaveEventListener.performSaveOrReplicate(AbstractSaveEventListener.java:288) 在 org.hibernate.event.internal.AbstractSaveEventListener.performSave(AbstractSaveEventListener.java:194) 在 org.hibernate.event.internal.AbstractSaveEventListener.SaveWithGenerateId(AbstractSaveEventListener.java:125) 在 org.hibernate.jpa.event.internal.core.JpaPersistEventListener.saveWithGeneratedId(JpaPersistEventListener.java:84) 在 org.hibernate.event.internal.DefaultPersistEventListener.entityIsTransient(DefaultPersistEventListener.java:206) 在 org.hibernate.event.internal.DefaultPersistEventListener.onPersist(DefaultPersistEventListener.java:149) 在 org.hibernate.event.internal.DefaultPersistEventListener.onPersist(DefaultPersistEventListener.java:75) 在 org.hibernate.internal.SessionImpl.firePersist(SessionImpl.java:811) 位于org.hibernate.internal.SessionImpl.persist(SessionImpl.java:784) 位于org.hibernate.internal.SessionImpl.persist(SessionImpl.java:789) 在 org.hibernate.jpa.spi.abstract
insert into JPA_User (employeeId, first_name, last_name, salary)
values (null, ?, ?, ?) [42102-173]
<persistence version="2.1"
xmlns="http://xmlns.jcp.org/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/persistence http://xmlns.jcp.org/xml/ns/persistence/persistence_2_1.xsd">
<persistence-unit name="ExampleDS">
<jta-data-source>java:jboss/datasources/ExampleDS</jta-data-source>
<properties>
      <property name="hibernate.hbm2dll.auto" value="create"/>
      <property name="hibernate.connection.username" value="sa"/>
      <property name="hibernate.connection.driver_class" value="org.hsqldb.jdbcDriver"/>
      <property name="hibernate.connection.password" value="sa"/>
      <property name="hibernate.show_sql" value="true"/>
      <property name="hibernate.format_sql" value="true"/>
    </properties>
</persistence-unit>
</persistence>
<property name="hibernate.hbm2ddl.auto" value="create"/>