You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@openjpa.apache.org by armad <ar...@linuxindex.pl> on 2007/04/12 15:43:43 UTC

(No)existing table in SQL server

Hi,

I have a problem with exception like :
org.apache.openjpa.persistence.ArgumentException: No table was given for
persistent type...


...but the table is in the database !


I have copied all jar files and openjpa incubating file to
$GLASSFISH_HOME/domains/domain1/lib/ . 

Do You know how can I fix this problem ?

I use the Glassfish v2 and try to use OpenJPA ( v0.9.6 and 0.9.7) 


regards,
-- 
View this message in context: http://www.nabble.com/%28No%29existing-table-in-SQL-server-tf3565587.html#a9959715
Sent from the open-jpa-dev mailing list archive at Nabble.com.

Re: (No)existing table in SQL server

Posted by Jacek Laskowski <ja...@laskowski.net.pl>.
On 4/15/07, armad <ar...@linuxindex.pl> wrote:

> I resolve my problem :)
...
> Thanks for your help Jacek :)

You're welcome! I'm really glad you've sorted it out. I'm learning JPA
and being able to help others ensures good understanding of the spec.

Jacek

-- 
Jacek Laskowski
http://www.JacekLaskowski.pl

Re: (No)existing table in SQL server

Posted by Marina Vatkina <Ma...@Sun.COM>.
Armad,

Are you using GlassFish with OpenJPA? If yes, there is a special integration 
with the Toplink code to be able to drop and create tables at deployment time. 
No other JPA provider has this support. I was looking at adding the same level 
of support for OpenJPA but the existing options available via persistence.xml 
properties are very limited and do not map exactly to the behavior available for 
the Toplink code. I plan to return to this work a bit later.

regards,
-marina

armad wrote:
> Thanks,
> 
> I resolve my problem :) 
> I had a problem, because  I didn't list my entities. When I wrote all entity
> classes to persistence.xml file, everything was ok. Apart from this the
> really important thing is, that OpenJPA create db schema not in deploy
> moment, but in first call to entity. Another approach is in Hibernate and
> TopLink.
> 
> regards,
> Thanks for your help Jacek :)
> 
> 

Re: (No)existing table in SQL server

Posted by armad <ar...@linuxindex.pl>.
Thanks,

I resolve my problem :) 
I had a problem, because  I didn't list my entities. When I wrote all entity
classes to persistence.xml file, everything was ok. Apart from this the
really important thing is, that OpenJPA create db schema not in deploy
moment, but in first call to entity. Another approach is in Hibernate and
TopLink.

regards,
Thanks for your help Jacek :)


-- 
View this message in context: http://www.nabble.com/%28No%29existing-table-in-SQL-server-tf3565587.html#a10002305
Sent from the open-jpa-dev mailing list archive at Nabble.com.


Re: (No)existing table in SQL server

Posted by Jacek Laskowski <ja...@laskowski.net.pl>.
> I look at my application once again, and I saw that OpenJPA really doesn't
> create tables in my database !
> In my persistence.xml file I have following entry :
> ...
> <property name="openjpa.jdbc.SynchronizeMappings" value="buildSchema"/>
...
> Do You know how can I configure OpenJPA to recreate tables ?

Sure. It works with OpenJPA 0.9.7-SNAPSHOT and 0.9.8-SNAPSHOT:

<property name="openjpa.jdbc.SynchronizeMappings"
value="buildSchema(SchemaAction='add,deleteTableContents')" />

It won't work with 0.9.6-incubating.

Jacek

-- 
Jacek Laskowski
http://www.JacekLaskowski.pl

Re: (No)existing table in SQL server

Posted by armad <ar...@linuxindex.pl>.
Hi Jacek,

I look at my application once again, and I saw that OpenJPA really doesn't
create tables in my database !
In my persistence.xml file I have following entry :
...
<property name="openjpa.jdbc.SynchronizeMappings" value="buildSchema"/>
...

When I deploy my appliction, then OpenJPA delete all tables from database
and then It doesn't create it.
Do You know how can I configure OpenJPA to recreate tables ?

regards,
armad 


-- 
View this message in context: http://www.nabble.com/%28No%29existing-table-in-SQL-server-tf3565587.html#a10001573
Sent from the open-jpa-dev mailing list archive at Nabble.com.


Re: (No)existing table in SQL server

Posted by armad <ar...@linuxindex.pl>.

Jacek Laskowski-4 wrote:
> 
> On 4/13/07, armad <ar...@linuxindex.pl> wrote:
> 
>> I can't send you the application :(
> 
> Is there a way to trim the application so that the issue still exists,
> but you don't need to share the whole app? It would be of great help
> if we reproduced the issue.
> 
> 

Ok, below is my Operator class :


---
...
@Entity
public class Operator implements Serializable {
    
    static final long serialVersionUID = 0L;
    
    @Id
    @GeneratedValue(strategy = GenerationType.AUTO)
    private long id;
    
    private String firstName;
    private String secondName;
    private String surname;
    private String pesel;
    @Temporal(value = TemporalType.DATE)
    private Date beginDate;
    @Temporal(value = TemporalType.DATE)
    private Date endDate;
    @Temporal(value = TemporalType.DATE)
    private Date entryDate;
...
---


If You would like to see other files please inform me.

regards,
armad
-- 
View this message in context: http://www.nabble.com/%28No%29existing-table-in-SQL-server-tf3565587.html#a9987621
Sent from the open-jpa-dev mailing list archive at Nabble.com.


Re: (No)existing table in SQL server

Posted by Jacek Laskowski <ja...@laskowski.net.pl>.
On 4/13/07, armad <ar...@linuxindex.pl> wrote:

> I can't send you the application :(

Is there a way to trim the application so that the issue still exists,
but you don't need to share the whole app? It would be of great help
if we reproduced the issue.

Jacek

-- 
Jacek Laskowski
http://www.JacekLaskowski.pl

Re: (No)existing table in SQL server

Posted by armad <ar...@linuxindex.pl>.

Jacek Laskowski-4 wrote:
> 
> If it's possible, send the application to me so I could take a look at it.
> 

Hi,

I can't send you the application :(


Jacek Laskowski-4 wrote:
> 
> BTW, I wouldn't call your application ok for it's running smoothly
> with TopLink and Hibernate. They're quite a few differences between
> these JPA providers yet they (are to) support the same spec.
> 

Yes, I know it :) 
I will try use OpenJPA with other database. If I will find a answer for my
question, I will post it on this list and polish mailing list too.

regards and thanks,
armad



-- 
View this message in context: http://www.nabble.com/%28No%29existing-table-in-SQL-server-tf3565587.html#a9986199
Sent from the open-jpa-dev mailing list archive at Nabble.com.


Re: (No)existing table in SQL server

Posted by Jacek Laskowski <ja...@laskowski.net.pl>.
On 4/12/07, armad <ar...@linuxindex.pl> wrote:

> First, when I use TopLink or Hibernate everything is ok.
> So the entities are good.
> Deploy and test process:
> I create a .jar file with entities and EJB components, then I deploy it to
> the glassfish. Up to this moment everything is ok.  But when I run my client
> application, which connect to some beans which operates on entities, then I
> receive the exception.

If it's possible, send the application to me so I could take a look at it.

BTW, I wouldn't call your application ok for it's running smoothly
with TopLink and Hibernate. They're quite a few differences between
these JPA providers yet they (are to) support the same spec.

Jacek

-- 
Jacek Laskowski
http://www.JacekLaskowski.pl

Re: (No)existing table in SQL server

Posted by armad <ar...@linuxindex.pl>.

Jacek Laskowski-4 wrote:
> 
> Do some of your entities work at all? Show the entity in question or
> describe how you run the application in GlassFish. I'll try to
> reproduce the issue in the environment of mine.
> 

First, when I use TopLink or Hibernate everything is ok.
So the entities are good. 
Deploy and test process:
I create a .jar file with entities and EJB components, then I deploy it to
the glassfish. Up to this moment everything is ok.  But when I run my client
application, which connect to some beans which operates on entities, then I
receive the exception.

regards

-- 
View this message in context: http://www.nabble.com/%28No%29existing-table-in-SQL-server-tf3565587.html#a9966442
Sent from the open-jpa-dev mailing list archive at Nabble.com.


Re: (No)existing table in SQL server

Posted by Jacek Laskowski <ja...@laskowski.net.pl>.
On 4/12/07, armad <ar...@linuxindex.pl> wrote:

> The database exists and all tables exists too. Actually I have created the
> database by another JPA implementation - TopLink.  I tried to create it by
> OpenJPA but I didn't success :
>
> <property name="openjpa.jdbc.SynchronizeMappings"   value="buildSchema" />
>
> I think, that problem is in schema name, but I can't resolve it.

Do some of your entities work at all? Show the entity in question or
describe how you run the application in GlassFish. I'll try to
reproduce the issue in the environment of mine.

Jacek

-- 
Jacek Laskowski
http://www.JacekLaskowski.pl

Re: (No)existing table in SQL server

Posted by armad <ar...@linuxindex.pl>.

Kevin Sutter wrote:
> 
> 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
> 
> 

Hi,

The database exists and all tables exists too. Actually I have created the
database by another JPA implementation - TopLink.  I tried to create it by
OpenJPA but I didn't success :

<property name="openjpa.jdbc.SynchronizeMappings"   value="buildSchema" />

I think, that problem is in schema name, but I can't resolve it.

regards,

-- 
View this message in context: http://www.nabble.com/%28No%29existing-table-in-SQL-server-tf3565587.html#a9964559
Sent from the open-jpa-dev mailing list archive at Nabble.com.


Re: (No)existing table in SQL server

Posted by Kevin Sutter <kw...@gmail.com>.
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 <ar...@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.
>
>

Re: (No)existing table in SQL server

Posted by armad <ar...@linuxindex.pl>.
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.


Re: (No)existing table in SQL server

Posted by Jacek Laskowski <ja...@laskowski.net.pl>.
On 4/12/07, Kevin Sutter <kw...@gmail.com> wrote:
> Armad,
> This exception doesn't mean the table doesn't exist in the database, it
> means that the metadata doesn't define a proper table for this persistence
> type.  Either the annotations or the xml are not properly defining the table
> for this persistence type.  It would be good to see the complete exception
> text.  Also, the annotated Entity classes and/or the persistence.xml would
> help with deciphering this problem.

That's almost exactly how I responded to him on the Polish-speaking
newsgroup - pl.comp.lang.java. Nice to see I wasn't mistaken. Thanks
Kevin!

I'd bet that he uses defaults and the class name doesn't correspond to
the table name or worse yet, the application doesn't connect to the
appropriate schema.

Jacek

-- 
Jacek Laskowski
http://www.JacekLaskowski.pl

Re: (No)existing table in SQL server

Posted by Kevin Sutter <kw...@gmail.com>.
Armad,
This exception doesn't mean the table doesn't exist in the database, it
means that the metadata doesn't define a proper table for this persistence
type.  Either the annotations or the xml are not properly defining the table
for this persistence type.  It would be good to see the complete exception
text.  Also, the annotated Entity classes and/or the persistence.xml would
help with deciphering this problem.

Thanks,
Kevin

On 4/12/07, armad <ar...@linuxindex.pl> wrote:
>
>
> Hi,
>
> I have a problem with exception like :
> org.apache.openjpa.persistence.ArgumentException: No table was given for
> persistent type...
>
>
> ...but the table is in the database !
>
>
> I have copied all jar files and openjpa incubating file to
> $GLASSFISH_HOME/domains/domain1/lib/ .
>
> Do You know how can I fix this problem ?
>
> I use the Glassfish v2 and try to use OpenJPA ( v0.9.6 and 0.9.7)
>
>
> regards,
> --
> View this message in context:
> http://www.nabble.com/%28No%29existing-table-in-SQL-server-tf3565587.html#a9959715
> Sent from the open-jpa-dev mailing list archive at Nabble.com.
>