openjpa-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Naomi-...@gmx.de
Subject Re: Runtime Enhancement: Problems with Ant Task in Eclipse
Date Tue, 19 May 2009 09:29:40 GMT
Hello everybody,

I spent the whole morning to create a new small project and could not make it work, too. Also
here I get the error message.

I send you the project with this mail (hopefully this works with this mailing list).

I removed the libraries from the lib folder to not make the file that big. You need the following
libraries in your classpath:

OpenJPA 
(libraries have to be in the lib/OpenJPA_1.2.1 folder for the Ant script)
Spring
Commons Logging
Mysql Driver
JUnit / DbUnit / SLF4J
(I implemented a simple JUnit test with dbUnit Flatfile for testing, you also can implement
your own tests without these three libraries)

I created the following model:
An Owner can own certain Kiosks. Documents can be sold by certain Kiosks and Kiosks can sell
certain Documents. Available Documents are Newspapers or Magazines.

You need a MySQL database (myisam), which has the name "kioskdb" (do not forget to update
the db settings in db.xml, persistence.xml and test.junit.AbstractTest). I think you can generate
the DDL from the entities.

I implemented a simple JUnit test in package test.junit.KioskTest.



Today, I also tested the nightly build for enhancement and for application testing instead
of the version 1.2.1 and there was also the error message, but additionally some messages
for each of my entities of that type:

openjpa.Enhance - Type "class ..." is already persistence capable; skipping.

Strange, isn't it? O.o"

-Naomi


-------- Original-Nachricht --------
> Datum: Mon, 18 May 2009 13:31:10 -0700 (PDT)
> Von: Rick Curtis <curtisr7@gmail.com>
> An: users@openjpa.apache.org
> Betreff: Re: Runtime Enhancement: Problems with Ant Task in Eclipse

> 
> Naomi -
> I'm stumped as well... I'd say start over with a new small project and see
> if you can get that working. If you are unable to get the small project
> working, you can post a zip for us and someone will look at it. I'm still
> leaning toward an environment problem.
> 
> -Rick
> 
> 
> Craig L Russell wrote:
> > 
> > Hi Naomi,
> > 
> > On May 18, 2009, at 1:11 PM, Naomi-san@gmx.de wrote:
> > 
> >> Hi,
> >>
> >> so far, I just worked with one binary folder and did not create jars  
> >> from the project, too. I checked the whole workspace and the eclipse  
> >> classpath but did not find any double classes or imports. I even  
> >> removed all classes from the binary folder and rebuilt them.
> >>
> >> I debugged my application and had a look at the entity classes. They  
> >> contain an pcDetachedState and a pcStateManager field. Is this a  
> >> sign that the classes have been enhanced or do these fields also  
> >> occur in unenhanced classes?
> > 
> > These are a sign that the classes have been enhanced. I'm stumped.  
> > Perhaps someone could give you the location of the code inside openjpa  
> > that checks to see if the classes have been enhanced. There might be a  
> > bug there.
> > 
> > Craig
> >>
> >>
> >> -Naomi
> >>
> >> -------- Original-Nachricht --------
> >>> Datum: Mon, 18 May 2009 09:17:33 -0700
> >>> Von: Craig L Russell <Craig.Russell@Sun.COM>
> >>> An: users@openjpa.apache.org
> >>> Betreff: Re: Runtime Enhancement: Problems with Ant Task in Eclipse
> >>
> >>> Hi Naomi,
> >>>
> >>> On May 18, 2009, at 8:34 AM, Naomi-san@gmx.de wrote:
> >>>
> >>>> Hey David,
> >>>>
> >>>> thank you for the tip!
> >>>>
> >>>> I checked one of my entities with javap:
> >>>>
> >>>> 1. After a clean and manually invoking the enhance task
> >>>> 2. After execution of my application
> >>>>
> >>>> Both times the class has pc* methods, so it seems that they are
> >>>> enhanced and not overwritten by Eclipse.
> >>>> So why the error message? :(
> >>>
> >>> Perhaps there is a packaging issue. Is it possible that there are
> >>> multiple versions of the classes in your classpath when you run your
> >>> project?
> >>>
> >>> Regards,
> >>>
> >>> Craig
> >>>>
> >>>>
> >>>> -Naomi
> >>>>
> >>>> -------- Original-Nachricht --------
> >>>>> Datum: Mon, 18 May 2009 11:13:02 -0400
> >>>>> Von: David Ezzio <dezzio@apache.org>
> >>>>> An: users@openjpa.apache.org
> >>>>> Betreff: Re: Runtime Enhancement: Problems with Ant Task in Eclipse
> >>>>
> >>>>> Hi Naomi,
> >>>>>
> >>>>> Three easy ways to verify that your classes have been enhanced.
> >>>>>
> >>>>> One install DJ Decompiler (Windows) or another decompiler and  
> >>>>> verify
> >>>>> that the class file is enhanced.
> >>>>>
> >>>>> Two, run the JDK command:
> >>>>> javap -c <classname-without-dot-class>
> >>>>> and look for a bunch of methods with names that start with "pc".
> >>>>>
> >>>>> Three, do a clean (unenhanced compile) and note file sizes.
> >>>>> Then do the enhancement step and expect to see a 4+ KB gain in file
> >>>>> sizes for enhanced files.
> >>>>>
> >>>>> Once you can tell unequivocally whether a file is enhanced, I'm
 
> >>>>> sure
> >>>>> you'll have luck troubleshooting the issue.
> >>>>>
> >>>>> Cheers,
> >>>>>
> >>>>> David
> >>>>>
> >>>>> Naomi-san@gmx.de wrote:
> >>>>>> Hi Rick,
> >>>>>>
> >>>>>> I also had that thought, but the message lists all of my entities,
> >>>>>> so I
> >>>>> think they all have not been enhanced.
> >>>>>>
> >>>>>> I oriented on the following tutorial for creating and invoking
the
> >>>>>> build
> >>>>> script:
> >>>>>>
> >>>>>>
> >>>>>
> >>>
> http://webspherepersistence.blogspot.com/2009/04/openjpa-enhancement-eclipse-builder.html
> >>>>>>
> >>>>>> I edited the XML to avoid setting and checking the arguments
and
> >>>>> additionally added my entities to the build path.
> >>>>>>
> >>>>>> I also invoked the script on Eclipse's "Clean" process (does
not
> >>>>>> make
> >>>>> sense, I think, does it?) and I started it "manually" (right click
> >>>>> on the
> >>>>> enhance task and choosing "run as" - "Ant build").
> >>>>>>
> >>>>>> -Naomi
> >>>>>>
> >>>>>> -------- Original-Nachricht --------
> >>>>>>> Datum: Mon, 18 May 2009 07:06:16 -0700 (PDT)
> >>>>>>> Von: Rick Curtis <curtisr7@gmail.com>
> >>>>>>> An: users@openjpa.apache.org
> >>>>>>> Betreff: Re: Runtime Enhancement: Problems with Ant Task
in  
> >>>>>>> Eclipse
> >>>>>>
> >>>>>>> Is it possible that only a portion of your Entities are
being
> >>>>>>> enhanced
> >>>>> by
> >>>>>>> the
> >>>>>>> build script? How are you invoking the ant build script?
> >>>>>>>
> >>>>>>> -Rick
> >>>>>>> -- 
> >>>>>>> View this message in context:
> >>>>>>>
> >>>>>
> >>>
> http://n2.nabble.com/Runtime-Enhancement%3A-Problems-with-Ant-Task-in-Eclipse-tp2932839p2933295.html
> >>>>>>> Sent from the OpenJPA Users mailing list archive at Nabble.com.
> >>>>>>
> >>>>
> >>>> -- 
> >>>> Neu: GMX FreeDSL Komplettanschluss mit DSL 6.000 Flatrate +
> >>>> Telefonanschluss für nur 17,95 Euro/mtl.!*
> >>> http://dslspecial.gmx.de/freedsl-surfflat/?ac=OM.AD.PD003K11308T4569a
> >>>
> >>> Craig L Russell
> >>> Architect, Sun Java Enterprise System http://db.apache.org/jdo
> >>> 408 276-5638 mailto:Craig.Russell@sun.com
> >>> P.S. A good JDO? O, Gasp!
> >>>
> >>
> >> -- 
> >> Neu: GMX FreeDSL Komplettanschluss mit DSL 6.000 Flatrate +  
> >> Telefonanschluss für nur 17,95 Euro/mtl.!*
> >> http://dslspecial.gmx.de/freedsl-surfflat/?ac=OM.AD.PD003K11308T4569a
> > 
> > Craig L Russell
> > Architect, Sun Java Enterprise System http://db.apache.org/jdo
> > 408 276-5638 mailto:Craig.Russell@sun.com
> > P.S. A good JDO? O, Gasp!
> > 
> > 
> >  
> > 
> 
> -- 
> View this message in context:
> http://n2.nabble.com/Runtime-Enhancement%3A-Problems-with-Ant-Task-in-Eclipse-tp2932839p2935498.html
> Sent from the OpenJPA Users mailing list archive at Nabble.com.

-- 
Neu: GMX FreeDSL Komplettanschluss mit DSL 6.000 Flatrate + Telefonanschluss für nur 17,95
Euro/mtl.!* http://dslspecial.gmx.de/freedsl-surfflat/?ac=OM.AD.PD003K11308T4569a

Mime
View raw message