You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@openjpa.apache.org by Gilberto C Andrade <gi...@secad.to.gov.br> on 2007/12/17 18:31:24 UTC

nonfatal general error org.apache.openjpa.persistence.PersistenceException: Schema 'GFI' does not exist

Hi, all!

First time here, I'm using orm.xml file and there I have a schema
definition:
<?xml version="1.0" encoding="UTF-8"?>
<entity-mappings xmlns="http://java.sun.com/xml/ns/persistence/orm"
    	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    	xsi:schemaLocation="http://java.sun.com/xml/ns/persistence/orm
http://java.sun.com/xml/ns/persistence/orm_1_0.xsd
http://incubator.apache.org/openjpa/orm
http://incubator.apache.org/openjpa/xml/ns/persistence/openjpa_orm_1_0.xsd"
    	version="1.0">
	<persistence-unit-metadata>
        <persistence-unit-defaults>
            <schema>gfi</schema>
        </persistence-unit-defaults>
    	</persistence-unit-metadata>
</entity-mappings>

My, persistence.xml:
<?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="gfi-corePU" transaction-type="RESOURCE_LOCAL">

<provider>org.apache.openjpa.persistence.PersistenceProviderImpl</provider>
        <mapping-file>META-INF/orm.xml</mapping-file>
        <class>com.gilbertoca.gfi.model.inventario.UnidadeMedida</class>
        <class>com.gilbertoca.gfi.model.inventario.Produto</class>
        <class>com.gilbertoca.gfi.model.inventario.Categoria</class>
        <class>com.gilbertoca.gfi.model.inventario.Item</class>
        <properties>
            <property name="openjpa.ConnectionDriverName"
value="org.apache.derby.jdbc.EmbeddedDriver"/>
            <property name="openjpa.ConnectionURL"
value="jdbc:derby:gfi_db;create=true"/>
            <property name="openjpa.ConnectionUserName" value="any"/>
            <property name="openjpa.ConnectionPassword" value="value"/>
            <property name="openjpa.jdbc.SynchronizeMappings"
value="buildSchema"/>
            <property name="openjpa.Log" value="DefaultLevel=WARN,
Runtime=INFO, Tool=INFO, SQL=TRACE"/>
        </properties>
    </persistence-unit>
</persistence>

Any tip here?

Gilberto


Re: nonfatal general error org.apache.openjpa.persistence.PersistenceException: Schema 'GFI' does not exist

Posted by Gilberto C Andrade <gi...@secad.to.gov.br>.
klaasjan elzinga wrote:
> I meant try to create the actual schema (sorry for the confusion)
> where the tables will be created in.
> 
> In a database a schema often corresponds with eg an user account. In
> mysql the notion of a schema corresponds with a database, in oracle it
> is an user. Im not sure about derby. 

Yes, it supports schema.

So openjpa generates the tables
> in a schema, and the collection of tables etc is callled "the schema".
> Apparantly, the schema in the database sense was not there so the
> openjpa tables (schema) were generated in the default schema. Which is
> just fine, hence the informational warning.

Sure, but I've setup/tested my project with TopLink and Hibernate and
both didn't complain about the schema (They generate the schema and
create the database without problem).
I'm trying to adapt my project to openjpa.

> 
> Hope this helps.
Thanks, I appreciate you attention!

Gilberto


Re: nonfatal general error org.apache.openjpa.persistence.PersistenceException: Schema 'GFI' does not exist

Posted by klaasjan elzinga <kl...@gmail.com>.
I meant try to create the actual schema (sorry for the confusion)
where the tables will be created in.

In a database a schema often corresponds with eg an user account. In
mysql the notion of a schema corresponds with a database, in oracle it
is an user. Im not sure about derby. So openjpa generates the tables
in a schema, and the collection of tables etc is callled "the schema".
Apparantly, the schema in the database sense was not there so the
openjpa tables (schema) were generated in the default schema. Which is
just fine, hence the informational warning.

Hope this helps.
KlaasJan

On Dec 17, 2007 7:40 PM, Gilberto C Andrade <gi...@secad.to.gov.br> wrote:
> > Maybe try creating the schema before you run the application ?
> But that was the goal! I'm trying to generate my schema through openjpa
>  MappingTool (using openjpa.jdbc.SynchronizeMappings property), as you
> can see in the persistence file.
>
> Thanks on any help!
>
> Gilberto
>
>
>

Re: nonfatal general error org.apache.openjpa.persistence.PersistenceException: Schema 'GFI' does not exist

Posted by Gilberto C Andrade <gi...@secad.to.gov.br>.
> Maybe try creating the schema before you run the application ? 
But that was the goal! I'm trying to generate my schema through openjpa
 MappingTool (using openjpa.jdbc.SynchronizeMappings property), as you
can see in the persistence file.

Thanks on any help!

Gilberto



Re: nonfatal general error org.apache.openjpa.persistence.PersistenceException: Schema 'GFI' does not exist

Posted by klaasjan elzinga <kl...@gmail.com>.
Maybe try creating the schema before you run the application ? Schema
is not generated, so the default is used.

KlaasJan

On Dec 17, 2007 6:31 PM, Gilberto C Andrade <gi...@secad.to.gov.br> wrote:
> Hi, all!
>
> First time here, I'm using orm.xml file and there I have a schema
> definition:
> <?xml version="1.0" encoding="UTF-8"?>
> <entity-mappings xmlns="http://java.sun.com/xml/ns/persistence/orm"
>         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>         xsi:schemaLocation="http://java.sun.com/xml/ns/persistence/orm
> http://java.sun.com/xml/ns/persistence/orm_1_0.xsd
> http://incubator.apache.org/openjpa/orm
> http://incubator.apache.org/openjpa/xml/ns/persistence/openjpa_orm_1_0.xsd"
>         version="1.0">
>         <persistence-unit-metadata>
>         <persistence-unit-defaults>
>             <schema>gfi</schema>
>         </persistence-unit-defaults>
>         </persistence-unit-metadata>
> </entity-mappings>
>
> My, persistence.xml:
> <?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="gfi-corePU" transaction-type="RESOURCE_LOCAL">
>
> <provider>org.apache.openjpa.persistence.PersistenceProviderImpl</provider>
>         <mapping-file>META-INF/orm.xml</mapping-file>
>         <class>com.gilbertoca.gfi.model.inventario.UnidadeMedida</class>
>         <class>com.gilbertoca.gfi.model.inventario.Produto</class>
>         <class>com.gilbertoca.gfi.model.inventario.Categoria</class>
>         <class>com.gilbertoca.gfi.model.inventario.Item</class>
>         <properties>
>             <property name="openjpa.ConnectionDriverName"
> value="org.apache.derby.jdbc.EmbeddedDriver"/>
>             <property name="openjpa.ConnectionURL"
> value="jdbc:derby:gfi_db;create=true"/>
>             <property name="openjpa.ConnectionUserName" value="any"/>
>             <property name="openjpa.ConnectionPassword" value="value"/>
>             <property name="openjpa.jdbc.SynchronizeMappings"
> value="buildSchema"/>
>             <property name="openjpa.Log" value="DefaultLevel=WARN,
> Runtime=INFO, Tool=INFO, SQL=TRACE"/>
>         </properties>
>     </persistence-unit>
> </persistence>
>
> Any tip here?
>
> Gilberto
>
>