openjpa-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Lars Vogel" <>
Subject Could not locate metadata (orm.xml)
Date Sun, 30 Mar 2008 18:29:32 GMT

Can anyone point me to a working standalone example there a a orm.xml file
is used instead of Annotations?

I'm able to build a small example with annotations but if I try the same
with orm.xml I receive the following error:

Exception in thread "main" <openjpa-1.0.2-r420667:627158 fatal user error>
org.apache.openjpa.persistence.ArgumentException: Could not locate metadata
for the class using alias "MYAPPLICATION.PEOPLETABLE". This could mean that
the OpenJPA enhancer or load-time weaver was not run on the type whose alias
is "MYAPPLICATION.PEOPLETABLE". Registered alias mappings: "{
MYAPPLICATION.PEOPLETABLE=null, Person=[class datamodel.Person]}"

I have the following orm.xml

<entity-mappings xmlns=""
    <entity class="datamodel.Person">
            <id name="id" />
            <basic name="firstName" />
            <basic name="lastName" />
            <transient name="nonsenseField" />

I have the following persistence.xml

<?xml version="1.0" encoding="UTF-8"?>
    Licensed to the Apache Software Foundation (ASF) under one
    or more contributor license agreements.  See the NOTICE file
    distributed with this work for additional information
    regarding copyright ownership.  The ASF licenses this file
    to you under the Apache License, Version 2.0 (the
    "License"); you may not use this file except in compliance
    with the License.  You may obtain a copy of the License at

    Unless required by applicable law or agreed to in writing,
    software distributed under the License is distributed on an
    KIND, either express or implied.  See the License for the
    specific language governing permissions and limitations
    under the License.
<persistence xmlns=""
    xmlns:xsi="" version="1.0">

        A persistence unit is a set of listed persistent entities as well
        the configuration of an EntityManagerFactory. We configure each
        example in a separate persistence-unit.
    <persistence-unit name="people" transaction-type="RESOURCE_LOCAL">

            The default provider can be OpenJPA, or some other product.
            This element is optional if OpenJPA is the only JPA provider
            in the current classloading environment, but can be specified
            in cases where there are multiple JPA implementations available.


        <!-- We must enumerate each entity in the persistence unit -->

            <property name="openjpa.ConnectionURL"

value="jdbc:derby:C:/DerbyDatabases/hellojpa-database9;create=true" />
            <property name="openjpa.ConnectionDriverName"
                value="org.apache.derby.jdbc.EmbeddedDriver" />
            <property name="openjpa.ConnectionUserName" value="" />
            <property name="openjpa.ConnectionPassword" value="" />

                Tell OpenJPA to automatically create tables in the database
                for entities. Note that this should be disabled when
                running against a production database, since you probably
                don't want to be altering the schema at runtime.
            <property name="openjpa.jdbc.SynchronizeMappings"
                value="buildSchema" />



Best regards, Lars

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