From dev-return-4650-apmail-openjpa-dev-archive=openjpa.apache.org@openjpa.apache.org Tue Jun 26 05:26:08 2007 Return-Path: Delivered-To: apmail-openjpa-dev-archive@www.apache.org Received: (qmail 47988 invoked from network); 26 Jun 2007 05:26:05 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 26 Jun 2007 05:26:05 -0000 Received: (qmail 83561 invoked by uid 500); 26 Jun 2007 05:26:08 -0000 Delivered-To: apmail-openjpa-dev-archive@openjpa.apache.org Received: (qmail 83536 invoked by uid 500); 26 Jun 2007 05:26:08 -0000 Mailing-List: contact dev-help@openjpa.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@openjpa.apache.org Delivered-To: mailing list dev@openjpa.apache.org Received: (qmail 83521 invoked by uid 99); 26 Jun 2007 05:26:07 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 25 Jun 2007 22:26:07 -0700 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (herse.apache.org: domain of ducknight@gmail.com designates 209.85.146.181 as permitted sender) Received: from [209.85.146.181] (HELO wa-out-1112.google.com) (209.85.146.181) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 25 Jun 2007 22:25:57 -0700 Received: by wa-out-1112.google.com with SMTP id m28so2221733wag for ; Mon, 25 Jun 2007 22:25:31 -0700 (PDT) DKIM-Signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:user-agent:mime-version:to:subject:references:in-reply-to:content-type:content-transfer-encoding; b=e91iUzChPFq5ExBas58772UuAnrMUukh16h+E2fWXuGX6vQKaq6Xf2lbAsF7ABBkbTqD8nVwU+rYCaIrdU5zbmFS9rydSYH22VHDqW5cRbQ67iU4OkyS0HCqbgtI4b7eI8pJdqdThLwguEQHKIiXS6o/QkpJpmMAFeEQSdQs7d4= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:user-agent:mime-version:to:subject:references:in-reply-to:content-type:content-transfer-encoding; b=aIxvco6QxcQcwR4GNH7wjkRaEJ6P6+H+FLGtnhkDkE+YSCB1hZmWDb4B/iMSReR7t++t47pmUE2c1rS/N8ynDjrE3eIbPbQv+6K8v3vNKcCdypP0SGyMrpBGF1vxiGOk6WHislEE4zTjuGRh3yyahxdm2ZqQQ7q7KbeUA5tS1QY= Received: by 10.114.210.2 with SMTP id i2mr6102473wag.1182835531769; Mon, 25 Jun 2007 22:25:31 -0700 (PDT) Received: from ?192.168.1.93? ( [202.146.77.122]) by mx.google.com with ESMTP id z20sm13536647pod.2007.06.25.22.25.29 (version=TLSv1/SSLv3 cipher=RC4-MD5); Mon, 25 Jun 2007 22:25:30 -0700 (PDT) Message-ID: <4680A34A.6050708@gmail.com> Date: Tue, 26 Jun 2007 13:25:30 +0800 From: Makas Tzavellas User-Agent: Thunderbird 2.0.0.4 (Windows/20070604) MIME-Version: 1.0 To: dev@openjpa.apache.org Subject: Re: Using ant task mappingtool to generate tables References: <467FDE21.2050701@gmail.com> <3992B07C0590B548BB294D31768A1DA22BF1AD@repbex01.amer.bea.com> In-Reply-To: <3992B07C0590B548BB294D31768A1DA22BF1AD@repbex01.amer.bea.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org Hi Pinaki, Thank you for your response. I am running the ant task from maven's ant plugin. Here is the following snippet Here's the log and stacktrace of the error [INFO] Executing tasks 16 subway TRACE [main] openjpa.Runtime - Setting the following properties from "file:/C:/dev/softbrands/broker/subway/db/target/classes/META-INF/persistence.xml" into configuration: {openjpa.ConnectionUserName=sa, openjpa.ConnectionPassword=, openjpa.Log=DefaultLevel=TRACE, Tool=INFO, openjpa.ConnectionURL=jdbc:derby:subway-test;create=true, openjpa.ConnectionDriverName=org.apache.derby.jdbc.EmbeddedDriver, openjpa.Id=subway} 422 subway TRACE [main] openjpa.MetaData - Using metadata factory "org.apache.openjpa.persistence.jdbc.PersistenceMappingFactory@6833f2". 453 subway INFO [main] openjpa.jdbc.JDBC - Using dictionary class "org.apache.openjpa.jdbc.sql.DerbyDictionary". 484 subway INFO [main] openjpa.Tool - Mapping tool running on type "class com.softbrands.subway.core.db.data.MessageEntity" with action "buildSchema". 484 subway TRACE [main] openjpa.MetaData - Using metadata factory "org.apache.openjpa.persistence.jdbc.PersistenceMappingFactory@717d91". 500 subway TRACE [main] openjpa.MetaData - Loading metadata for "class com.softbrands.subway.core.db.data.MessageEntity" under mode "[META][QUERY]". 500 subway TRACE [main] openjpa.MetaData - Scanning resource "META-INF/orm.xml" for persistent types. 500 subway TRACE [main] openjpa.MetaData - parsePersistentTypeNames() found []. 500 subway TRACE [main] openjpa.MetaData - Found 0 classes with metadata in 0 milliseconds. 641 subway TRACE [main] openjpa.MetaData - Parsing class "com.softbrands.subway.core.db.data.MessageEntity". <0.9.7-incubating fatal user error> org.apache.openjpa.util.MetaDataException: Type "class com.softbrands.subway.core.db.data.MessageEntity" does not have persistence metadata. at org.apache.openjpa.jdbc.meta.MappingTool.getMapping(MappingTool.java:676) at org.apache.openjpa.jdbc.meta.MappingTool.buildSchema(MappingTool.java:742) at org.apache.openjpa.jdbc.meta.MappingTool.run(MappingTool.java:640) at org.apache.openjpa.jdbc.meta.MappingTool.run(MappingTool.java:1063) at org.apache.openjpa.jdbc.ant.MappingToolTask.executeOn(MappingToolTask.java:190) at org.apache.openjpa.lib.ant.AbstractTask.execute(AbstractTask.java:169) at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:275) at org.apache.tools.ant.Task.perform(Task.java:364) at org.apache.tools.ant.Target.execute(Target.java:341) at org.apache.maven.plugin.antrun.AbstractAntMojo.executeTasks(AbstractAntMojo.java:108) at org.apache.maven.plugin.antrun.AntRunMojo.execute(AntRunMojo.java:83) at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:420) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:539) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:480) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:459) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:311) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:278) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:143) at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:330) at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:123) at org.apache.maven.cli.MavenCli.main(MavenCli.java:272) 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 org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315) at org.codehaus.classworlds.Launcher.launch(Launcher.java:255) at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430) at org.codehaus.classworlds.Launcher.main(Launcher.java:375) 688 subway TRACE [main] openjpa.MetaData - Clearing metadata repository "org.apache.openjpa.jdbc.meta.MappingRepository@38fff7". *However* it does work if I invoke it as a java task Could this really be a classpath problem? Pinaki Poddar wrote: > Hi, > >> Is it actually possible to generate tables using only the annotations >> > in the entity class? > Yes. > > Please post the log and stack trace with value="DefaultLevel=TRACE"/> > Also the snippet of the Ant target you are invoking for mappingtool. > Please note that alternatively > can be used > to invoke MappingTool from Ant > And I find that somewhat easier to debug build/classpath problems. > > > > Pinaki Poddar > 972.834.2865 > > -----Original Message----- > From: Makas Tzavellas [mailto:ducknight@gmail.com] > Sent: Monday, June 25, 2007 10:24 AM > To: dev@openjpa.apache.org > Subject: Using ant task mappingtool to generate tables > > Hi everyone, > > I'm trying to use mappingtool's ant task to generate tables for my > entity classes. Problem is that it keeps complaining that my entity > class does not have persistance metadata. The metadata is available as > annotations in the entity class. Is it actually possible to generate > tables using only the annotations in the entity class? Another thing is > that I would like to avoid specifying the element in the > persistence.xml file as there are plans to dynamically drop new > persistence classes while the application is running. Please advice! > > This is the following error that I am getting. > Embedded error: <0.9.7-incubating fatal user error> > org.apache.openjpa.util.MetaDataException: Type "class > com.softbrands.subway.core.db.data.MessageEntity" does not have > persistence metadata. > > This is the entity class > @Entity > @Table(name="MESSAGES", schema="MESSAGES") public class MessageEntity { > @Id @GeneratedValue(strategy=GenerationType.SEQUENCE) > @Column(name="ID") > private long m_Id; > > @Version > @Column(name="OPTLOCK") > private int m_Version; // This is used by JPA implementation to > carry out optimistic locking. > > @Column(name="SIBLING_ID") > private MessageEntity m_Sibling; > > @Column(name="STATUS") > private String m_Status; > } > > > > Sincerely, > Makas > > Notice: This email message, together with any attachments, may contain information of BEA Systems, Inc., its subsidiaries and affiliated entities, that may be confidential, proprietary, copyrighted and/or legally privileged, and is intended solely for the use of the individual or entity named in this message. If you are not the intended recipient, and have received this message in error, please immediately return this by email and then delete it. > >