openjpa-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Kevin Sutter" <kwsut...@gmail.com>
Subject Re: (No)existing table in SQL server
Date Thu, 12 Apr 2007 17:04:35 GMT
Armad,
Your error seems to have shifted.  The original posting indicated that the
exception text was concerning the table metadata:

org.apache.openjpa.persistence.ArgumentException: No table was given for
persistent type...

But, your latest append indicates that the actual database table does not
exist:

Caused by: <0.9.7-incubating-SNAPSHOT nonfatal general error>
org.apache.openjpa.persistence.PersistenceException: Table 'test.Operator'
doesn't exist {prepstmnt 4201797 DELETE FROM Operator} [code=1146,
state=42S02]

These are two separate problems.  The second problem indicates that we are
receiving a SQL error when attempting to access table "test.Operator".  This
would indicate that the table does not exist.  You will have to validate
with your database as to whether this particular database exists or not.  My
guess is the schema name is not matching up.  Are you creating your own
database and tables, or are you relying on the SynchronizeMappings property
to do it automatically?  We did have a recent problem raised that the global
property setting for a schema name was not being properly recognized and
processed.  Not sure if that has been resolved yet or if that is even your
problem.  But, it sounds like you have an annotation/xml metadata mismatch.

Kevin

On 4/12/07, armad <armad@linuxindex.pl> wrote:
>
>
> Hi,
>
> Jacek:
> Sometimes I do not have access to newsgroup :)
>
> My persistence.xml file :
>
> <?xml version="1.0" encoding="UTF-8"?>
> <persistence version="1.0" xmlns="http://java.sun.com/xml/ns/persistence"
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> xsi:schemaLocation="http://java.sun.com/xml/ns/persistence
> http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd">
>     <persistence-unit name="testPU" transaction-type="JTA">
>
> <provider>org.apache.openjpa.persistence.PersistenceProviderImpl
> </provider>
>         <jta-data-source>jdbc/Mysql</jta-data-source>
>         <properties>
>             <property name="openjpa.jdbc.SynchronizeMappings"
>
> value="buildSchema(SchemaAction='add,deleteTableContents')" />
>             <property name="openjpa.Log"
> value="DefaultLevel=TRACE,SQL=TRACE" />
>         </properties>
>
>     </persistence-unit>
> </persistence>
>
>
> Exception :
>
> [#|2007-04-14T14:43:
> 36.077+0200|INFO|sun-appserver9.1|javax.enterprise.system.container.ejb|_ThreadID=29
> ;_ThreadName=p:
> thread-pool-1; w: 126;|
> javax.ejb.EJBException
>         at
> com.sun.ejb.containers.BaseContainer.processSystemException(
> BaseContainer.java:3813)
>         at
> com.sun.ejb.containers.BaseContainer.completeNewTx(BaseContainer.java
> :3713)
>         at
> com.sun.ejb.containers.BaseContainer.postInvokeTx(BaseContainer.java:3515)
>         at
> com.sun.ejb.containers.BaseContainer.postInvoke(BaseContainer.java:1305)
>         at
> com.sun.ejb.containers.BaseContainer.postInvoke(BaseContainer.java:1267)
>         at
> com.sun.ejb.containers.EJBObjectInvocationHandler.invoke(
> EJBObjectInvocationHandler.java:197)
>         at
> com.sun.ejb.containers.EJBObjectInvocationHandlerDelegate.invoke(
> EJBObjectInvocationHandlerDelegate.java:64)
>         at $Proxy112.deleteAllStart(Unknown Source)
>         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
> com.sun.corba.ee.impl.presentation.rmi.ReflectiveTie._invoke(
> ReflectiveTie.java:125)
>         at
>
> com.sun.corba.ee.impl.protocol.CorbaServerRequestDispatcherImpl.dispatchToServant
> (CorbaServerRequestDispatcherImpl.java:658)
>         at
> com.sun.corba.ee.impl.protocol.CorbaServerRequestDispatcherImpl.dispatch(
> CorbaServerRequestDispatcherImpl.java:198)
>         at
>
> com.sun.corba.ee.impl.protocol.CorbaMessageMediatorImpl.handleRequestRequest
> (CorbaMessageMediatorImpl.java:1722)
>         at
> com.sun.corba.ee.impl.protocol.CorbaMessageMediatorImpl.handleRequest(
> CorbaMessageMediatorImpl.java:1582)
>         at
> com.sun.corba.ee.impl.protocol.CorbaMessageMediatorImpl.handleInput(
> CorbaMessageMediatorImpl.java:964)
>         at
> com.sun.corba.ee.impl.protocol.giopmsgheaders.RequestMessage_1_2.callback
> (RequestMessage_1_2.java:179)
>         at
> com.sun.corba.ee.impl.protocol.CorbaMessageMediatorImpl.handleRequest(
> CorbaMessageMediatorImpl.java:734)
>         at
> com.sun.corba.ee.impl.transport.SocketOrChannelConnectionImpl.dispatch(
> SocketOrChannelConnectionImpl.java:478)
>         at
> com.sun.corba.ee.impl.transport.SocketOrChannelConnectionImpl.doWork(
> SocketOrChannelConnectionImpl.java:1360)
>         at
> com.sun.corba.ee.impl.orbutil.threadpool.ThreadPoolImpl$WorkerThread.run(
> ThreadPoolImpl.java:509)
> Caused by: <0.9.7-incubating-SNAPSHOT nonfatal general error>
> org.apache.openjpa.persistence.PersistenceException: Table 'test.Operator'
> doesn't exist {p
> repstmnt 4201797 DELETE FROM Operator} [code=1146, state=42S02]
> FailedObject: org.apache.openjpa.jdbc.kernel.exps.ExpContext@980a8d
>         at
> org.apache.openjpa.jdbc.sql.DBDictionary.newStoreException(
> DBDictionary.java:3781)
>         at
> org.apache.openjpa.jdbc.sql.SQLExceptions.getStore(SQLExceptions.java:94)
>         at
> org.apache.openjpa.jdbc.sql.SQLExceptions.getStore(SQLExceptions.java:64)
>         at
> org.apache.openjpa.jdbc.kernel.JDBCStoreQuery.executeBulkOperation(
> JDBCStoreQuery.java:505)
>         at
> org.apache.openjpa.jdbc.kernel.JDBCStoreQuery.executeDelete(
> JDBCStoreQuery.java:420)
>         at
>
> org.apache.openjpa.kernel.ExpressionStoreQuery$DataStoreExecutor.executeDelete
> (ExpressionStoreQuery.java:679)
>         at org.apache.openjpa.kernel.QueryImpl.delete(QueryImpl.java:1000)
>         at org.apache.openjpa.kernel.QueryImpl.execute(QueryImpl.java:793)
>         at org.apache.openjpa.kernel.QueryImpl.deleteAll(QueryImpl.java
> :858)
>         at org.apache.openjpa.kernel.QueryImpl.deleteAll(QueryImpl.java
> :854)
>         at
> org.apache.openjpa.kernel.DelegatingQuery.deleteAll(DelegatingQuery.java
> :538)
>         at
> org.apache.openjpa.persistence.QueryImpl.executeUpdate(QueryImpl.java:301)
>         at
> pl.jee.start.OperationFacadeBean.deleteEntities(OperationFacadeBean.java
> :159)
>         at
> pl.jee.start.OperationFacadeBean.deleteAllStart(OperationFacadeBean.java
> :165)
>         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
> com.sun.enterprise.security.application.EJBSecurityManager.runMethod(
> EJBSecurityManager.java:1051)
>         at
> com.sun.enterprise.security.SecurityUtil.invoke(SecurityUtil.java:165)
>         at
> com.sun.ejb.containers.BaseContainer.invokeTargetBeanMethod(
> BaseContainer.java:2846)
>         at
> com.sun.ejb.containers.BaseContainer.intercept(BaseContainer.java:3930)
>         at
> com.sun.ejb.containers.EJBObjectInvocationHandler.invoke(
> EJBObjectInvocationHandler.java:190)
>         ... 17 more
> Caused by: org.apache.openjpa.lib.jdbc.ReportingSQLException: Table
> 'test.Operator' doesn't exist {prepstmnt 4201797 DELETE FROM Operator}
> [code=1146, st
> ate=42S02]
>         at
> org.apache.openjpa.lib.jdbc.LoggingConnectionDecorator.wrap(
> LoggingConnectionDecorator.java:188)
>         at
> org.apache.openjpa.lib.jdbc.LoggingConnectionDecorator.access$800(
> LoggingConnectionDecorator.java:53)
>         at
>
> org.apache.openjpa.lib.jdbc.LoggingConnectionDecorator$LoggingConnection$LoggingPreparedStatement.executeUpdate
> (LoggingConnectionDecorator.java:85
> 4)
>         at
> org.apache.openjpa.lib.jdbc.DelegatingPreparedStatement.executeUpdate(
> DelegatingPreparedStatement.java:266)
>         at
>
> org.apache.openjpa.jdbc.kernel.JDBCStoreManager$CancelPreparedStatement.executeUpdate
> (JDBCStoreManager.java:1360)
>         at
> org.apache.openjpa.jdbc.kernel.JDBCStoreQuery.executeBulkOperation(
> JDBCStoreQuery.java:498)
>         ... 36 more
> |#]
>
>
> Thanks for your help.
>
> regards
> --
> View this message in context:
> http://www.nabble.com/%28No%29existing-table-in-SQL-server-tf3565587.html#a9962231
> Sent from the open-jpa-dev mailing list archive at Nabble.com.
>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message