Creating a Table with JPA on wildfly using Hibernate fails

Im using JPA to create a table on the built in H2 database of Wildfly 8.0 installation using hibernate, but it fails with the following error message:

> Caused by: javax.persistence.PersistenceException: > org.hibernate.exception.SQLGrammarException: could not prepare > statement at > org.hibernate.jpa.spi.AbstractEntityManagerImpl.convert(AbstractEntityManagerImpl.java:1763) > at > org.hibernate.jpa.spi.AbstractEntityManagerImpl.convert(AbstractEntityManagerImpl.java:1677) > at > org.hibernate.jpa.spi.AbstractEntityManagerImpl.convert(AbstractEntityManagerImpl.java:1683) > at > org.hibernate.jpa.spi.AbstractEntityManagerImpl.persist(AbstractEntityManagerImpl.java:1187) > at > org.jboss.as.jpa.container.AbstractEntityManager.persist(AbstractEntityManager.java:581) > at test.mdb.MessageDRivenBean.onMessage(MessageDRivenBean.java:41) > at sun.reflect.GeneratedMethodAccessor2.invoke(Unknown Source) > [:1.7.0_67] at > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) > [rt.jar:1.7.0_67] at 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) > at > org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309) > at > org.jboss.invocation.WeavedInterceptor.processInvocation(WeavedInterceptor.java:53) > at > org.jboss.as.ee.component.interceptors.UserInterceptorFactory$1.processInvocation(UserInterceptorFactory.java:63) > at > org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309) > at > org.jboss.invocation.WeavedInterceptor.processInvocation(WeavedInterceptor.java:53) > at > org.jboss.as.ee.component.interceptors.UserInterceptorFactory$1.processInvocation(UserInterceptorFactory.java:63) > at > org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309) > at > org.jboss.as.ejb3.component.invocationmetrics.ExecutionTimeInterceptor.processInvocation(ExecutionTimeInterceptor.java:43) > at > org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309) > at > org.jboss.as.ee.concurrent.ConcurrentContextInterceptor.processInvocation(ConcurrentContextInterceptor.java:45) > at > org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309) > at > org.jboss.invocation.InitialInterceptor.processInvocation(InitialInterceptor.java:21) > at > org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309) > at > org.jboss.invocation.ChainedInterceptor.processInvocation(ChainedInterceptor.java:61) > at > org.jboss.as.ee.component.interceptors.ComponentDispatcherInterceptor.processInvocation(ComponentDispatcherInterceptor.java:53) > at > org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309) > at > org.jboss.as.ejb3.component.pool.PooledInstanceInterceptor.processInvocation(PooledInstanceInterceptor.java:51) > at > org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309) > at > org.jboss.as.ejb3.tx.CMTTxInterceptor.invokeInCallerTx(CMTTxInterceptor.java:251) > ... 49 more Caused by: org.hibernate.exception.SQLGrammarException: > could not prepare statement at > org.hibernate.exception.internal.SQLStateConversionDelegate.convert(SQLStateConversionDelegate.java:123) > at > org.hibernate.exception.internal.StandardSQLExceptionConverter.convert(StandardSQLExceptionConverter.java:49) > at > org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(SqlExceptionHelper.java:126) > at > org.hibernate.engine.jdbc.internal.StatementPreparerImpl$StatementPreparationTemplate.prepareStatement(StatementPreparerImpl.java:196) > at > org.hibernate.engine.jdbc.internal.StatementPreparerImpl.prepareStatement(StatementPreparerImpl.java:122) > at > org.hibernate.id.IdentityGenerator$GetGeneratedKeysDelegate.prepare(IdentityGenerator.java:89) > at > org.hibernate.id.insert.AbstractReturningDelegate.performInsert(AbstractReturningDelegate.java:55) > at > org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:3032) > at > org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:3558) > at > org.hibernate.action.internal.EntityIdentityInsertAction.execute(EntityIdentityInsertAction.java:98) > at org.hibernate.engine.spi.ActionQueue.execute(ActionQueue.java:490) > at > org.hibernate.engine.spi.ActionQueue.addResolvedEntityInsertAction(ActionQueue.java:195) > at > org.hibernate.engine.spi.ActionQueue.addInsertAction(ActionQueue.java:179) > at > org.hibernate.engine.spi.ActionQueue.addAction(ActionQueue.java:214) > at > org.hibernate.event.internal.AbstractSaveEventListener.addInsertAction(AbstractSaveEventListener.java:324) > at > org.hibernate.event.internal.AbstractSaveEventListener.performSaveOrReplicate(AbstractSaveEventListener.java:288) > at > org.hibernate.event.internal.AbstractSaveEventListener.performSave(AbstractSaveEventListener.java:194) > at > org.hibernate.event.internal.AbstractSaveEventListener.saveWithGeneratedId(AbstractSaveEventListener.java:125) > at > org.hibernate.jpa.event.internal.core.JpaPersistEventListener.saveWithGeneratedId(JpaPersistEventListener.java:84) > at > org.hibernate.event.internal.DefaultPersistEventListener.entityIsTransient(DefaultPersistEventListener.java:206) > at > org.hibernate.event.internal.DefaultPersistEventListener.onPersist(DefaultPersistEventListener.java:149) > at > org.hibernate.event.internal.DefaultPersistEventListener.onPersist(DefaultPersistEventListener.java:75) > at > org.hibernate.internal.SessionImpl.firePersist(SessionImpl.java:811) > at org.hibernate.internal.SessionImpl.persist(SessionImpl.java:784) > at org.hibernate.internal.SessionImpl.persist(SessionImpl.java:789) > at > org.hibernate.jpa.spi.AbstractEntityManagerImpl.persist(AbstractEntityManagerImpl.java:1181) > ... 74 more Caused by: org.h2.jdbc.JdbcSQLException: Tabelle > "JPA_USER" nicht gefunden Table "JPA_USER" not found; SQL statement: > insert into JPA_User (employeeId, first_name, last_name, salary) > values (null, ?, ?, ?) [42102-173] at > org.h2.message.DbException.getJdbcSQLException(DbException.java:331) > at org.h2.message.DbException.get(DbException.java:171) at > org.h2.message.DbException.get(DbException.java:148) at > org.h2.command.Parser.readTableOrView(Parser.java:4864) at > org.h2.command.Parser.readTableOrView(Parser.java:4842) at > org.h2.command.Parser.parseInsert(Parser.java:974) at > org.h2.command.Parser.parsePrepared(Parser.java:375) at > org.h2.command.Parser.parse(Parser.java:279) at > org.h2.command.Parser.parse(Parser.java:251) at > org.h2.command.Parser.prepareCommand(Parser.java:218) at > org.h2.engine.Session.prepareLocal(Session.java:428) at > org.h2.engine.Session.prepareCommand(Session.java:377) at > org.h2.jdbc.JdbcConnection.prepareCommand(JdbcConnection.java:1138) > at > org.h2.jdbc.JdbcPreparedStatement.<init>(JdbcPreparedStatement.java:70) > at > org.h2.jdbc.JdbcConnection.prepareStatement(JdbcConnection.java:267) > at > org.h2.jdbc.JdbcConnection.prepareStatement(JdbcConnection.java:1076) > at > org.jboss.jca.adapters.jdbc.WrappedConnection.prepareStatement(WrappedConnection.java:500) > at > org.hibernate.engine.jdbc.internal.StatementPreparerImpl$2.doPrepare(StatementPreparerImpl.java:124) > at > org.hibernate.engine.jdbc.internal.StatementPreparerImpl$StatementPreparationTemplate.prepareStatement(StatementPreparerImpl.java:186) > ... 96 more > > 19:15:33,694 WARN [org.hornetq.core.server] (Thread-18 > (HornetQ-server-HornetQServerImpl::serverUUID=61b6684a-d6bb-11e4-926e-d9ecaa9f5457-1830325086)) > HQ222149: Message > Reference[55834575461]:RELIABLE:ServerMessage[messageID=55834575461,durable=true,userID=885a963a-dc80-11e4-be97-a7b41dae907c,priority=4, > bodySize=256,expiration=0, durable=true, > address=jms.queue.demoQueue,properties=TypedProperties[__HQ_CID=8842c877-dc80-11e4-be97-a7b41dae907c]]@400257444 > has reached maximum delivery attempts, sending it to Dead Letter > Address jms.queue.DLQ from jms.queue.demoQueue

The problem seems to be associated with the line Table "JPA_USER" not found; SQL statement:

insert into JPA_User (employeeId, first_name, last_name, salary) values (null, ?, ?, ?) [42102-173]

but i want jPA to create the table for me My persistence.xml looks as follows:

<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>

im using the default datasource, which is associated with the h2 database.

Does anyone know what the problem here might be?

Thanks! Best regards Martin

--------------Solutions-------------

You're property name is incorrect. It's ddl not dll.

<property name="hibernate.hbm2ddl.auto" value="create"/>

Category:hibernate Time:2017-12-06 Views:1

Related post

  • How to create a table with lines and columns using Ireport? 2011-08-02

    I'am using JasperReport and ireport 4.0 , I want to know If their the possibility to create a table that can I fix lines and columns? Because the only the table that I have found allowed me just to fix columns !! And For the charts I have just an int

  • create a table with php and mysql using SHOW CREATE TABLE 2011-11-24

    I'm trying to create an exact duplicate of another table via php by using SHOW CREATE TABLE. I only want to change the table name, but I haven't figured out how to do that yet. If the old table's name is table_1, I want the new one to be table_2. Thi

  • Creating a Table with Rounded Corners 2011-05-17

    I'm interested in creating a table with rounded corners without using images. How can this be accomplished? My idea was that I could wrap the table with a div and to set the rounded corners to the div. By taking a glance at this fiddle you can see th

  • xslt: How could I use xslt to create a table with multiple columns and rows? 2009-04-20

    How would I take this xml and create a table with a column for each "section" element and then display all the "document" elements in that column using xslt? <Documents> <Section> <SectionName>Green</SectionName> <Document

  • Is it possible to create a table with a variable name in PostgreSQL? 2009-06-02

    Using PL/pgSQL or (some other mechanism), is it possible to create a table with a variable name? I would like to create multiple tables named table_1, table_2, table_3, etc... and it would be simpler if I could use a loop to create them, instead of e

  • Is there any demo to insert a new record into a table with identity primary key using Subsonic 3? 2009-07-07

    Is there any demo to insert a new record into a table with identity primary key using Subsonic 3? --------------Solutions------------- Create DAL object Assign values to all properties except primary key property Call Save() Subsonic takes care of th

  • Mysql: How do you create a table with multiple primary keys? 2009-10-19

    I have this situation: http://stackoverflow.com/questions/1590033/mysql-newbie-question-which-are-the-pk-and-the-fk-for-this-tables (take a look at the table Salaries) How do you create a table with multiple primary keys? create table salaries ( dep_

  • creating multiple tables with single sql command 2010-01-23

    I searched for this here and on google and surprisingly couldn't find an answer. I tried to create syntax to submit to mysql that would create multiple tables with the same columns, but it returned an error. Can you point out what is wrong with my sy

  • How to create a table with the same dimensions as a previous one 2010-03-02

    I would want to create a table with the same widths (table and its cells) then a previous one created dynamically 1st __________________ |_____|___|_______| |_____|___|_______| |_____|___|_______| 2nd __________________ |_____|___|_______| |_____|___

  • Easiest way to create a table with Zend_Pdf 2010-07-19

    What's the easyiest way to create a table with Zend_Pdf? Until now, i realized tables with horizontal and vertical lines. Is there no other solution for tables? Thank you. --------------Solutions------------- There's this project in SF: http://zendpd

  • ORA-00907 while trying to create a table with automatic column 2010-08-21

    I'm attempting to create a table with an automatic column, the value of which is computed using a function I've defined. However, when I try to create the table I keep getting ora-00907: Missing right parenthesis. Can anyone help? Here is the CREATE

  • How to create a table with a row for each day of a given year? 2011-06-06

    I need to develop a calendar which tells you if a given day is of type A, B, C or D. So basically, users requests info for a given day, and the website tells them if that day is of type A, B, C or D. So I will create a PHP function that checks for th

  • How to replace dynamically created HTML tables with GridView controls 2012-03-30

    There is a web application developed using .Net 3.5. It has a particular aspx web page which contains grids. Here we get a list of accounts and according to the number of items (we get in the list), we have to generate grids. E.g. If there are 5 list

  • Syntax Error Creating a table with TEXT columns 2012-04-09

    I can never seem to be able to create MySQL tables with columns of the type TEXT. Here's my MySQL: CREATE TABLE factions(id INT NOT NULL AUTO_INCREMENT, PRIMARY KEY(id), name VARCHAR(16) NOT NULL, desc TEXT NOT NULL, admins TEXT NOT NULL, mods TEXT,

  • I have created a table with 4 columns. 2012-04-06

    I have created a table with 4 columns. The fourth column will have values like Open, Close. I want to count the number of cells having the value Open in it. this would have been very simple if it was done in excel by using the countif function. -----

  • Add a new Pivot Table with an Existing Connection using VBA 2013-02-12

    I'm trying to create a new Pivot Table that has a connection to an Existing External Data connection. I've tried using the Macro Recorder, but running the sub doesn't work it just errors with Run-time error '1004': [Microsoft][ODBC Excel Driver] The

  • I created a table with five columns and rows that were great before but are now suddenly all different sizes. What happened and how can I fix it??? Thanks 2013-10-07

    I created a table with five columns and rows that were great before but are now suddenly all different sizes. What happened and how can I fix it??? Thanks --------------Solutions------------- What happened is that you edited the table. There is a hug

  • Is there any way to create a table with the same layout as a view in SQL Server 2005? 2009-04-29

    I can't really think of the best way to phrase this question, so I'll just give an example. Suppose I have a table that is created like this: CREATE VIEW People AS SELECT id, --int name, --varchar(20) birthdate --datetime FROM SomeTable If I wanted t

  • How can I replace a table with a new one using jQuery? 2010-02-17

    Whats the best way to replace a <table> with a new one using jQuery? I'm using ajax on the page to get the new data. --------------Solutions------------- If you don't want to add a wrapper element, something like this should work: $.ajax({ url:

Copyright (C) pcaskme.com, All Rights Reserved.

processed in 0.981 (s). 13 q(s)