The Java EE Container needs to support EJB3. Tomcat by itself probably does not support this. You need something like WebSphere's EJB3 support or Geronimo's OpenEJB support to be able to plug the JPA provider into. Both of these options (WebSphere and Geronimo) have OpenJPA as their default JPA provider. But, EJB3 contracts require the ability to plug in alternate providers, if desired.
So, from the information you have provided thus far, it doesn't sound like your environment would support the JPA provider plugin capability. As far as passing in the -javaagent parameter, on the Run.. panel, there is a tab for specifying program arguments and jvm arguments. The -javaagent parameter would go into the jvm argument section. Hope this helps. Kevin On Tue, Sep 30, 2008 at 8:04 PM, Angel Vera <[EMAIL PROTECTED]> wrote: > HI Kevin, > > I am running inside of the JEE container, I am running "Roller" (which has > a a fair amount of JPA objects), but the enhacement is not happening on the > fly. > > Perhaps you can fill me in in option 2. > > I tried to use the -javaagent but I didn't find a way of passing this > argument to the JVM that Eclipse/WTP is using to launch tomcat. > > Here are the first 3 lines of my exception, if that helps: > > > > > > ----- Original Message ---- > From: Kevin Sutter <[EMAIL PROTECTED]> > To: [email protected] > Sent: Tuesday, September 30, 2008 9:12:11 AM > Subject: Re: can I run without enhancements? > > Angel, > There is a "fallback enhancement" process that uses sub-classing, but > previous appends to the forums indicate that this is not a production-ready > process. This is really meant for the simple "out of the box" applications > for demonstration purposes. Real applications should use some type of byte > code enhancement to get the best results. > > Methods of performing the byte code enhancement: > > o If running within a Java EE Container environment, let the OpenJPA > provider tie into the container's classloading mechanism and the > enhancement > will happen on the fly when the entity classes are loaded into memory. > > o Run the PCEnhancer process on your entity classes during your > build/packaging step. Running this within Eclipse is not that difficult -- > I do this quite often. I just setup a separate Run definition to run the > PCEnhancer against the project that contains my entity classes and I pass > in > the persistence.xml file that defines my persistence unit. If you don't > have a large number of classes to enhance, you could also just pass in the > names of the entity classes that you want enhanced. > > o Another alternative is to use the -javaagent option on the JVM > invocation > and pass in the OpenJPA jar file. This ties into the JVM's classloading > mechanism much like the Java EE Container described above. When the entity > classes are loaded into the JVM, they will be enhanced on the fly. I use > this mechanism within Eclipse as well. > > Hope this helps, > Kevin > > On Mon, Sep 29, 2008 at 8:35 PM, Angel Vera <[EMAIL PROTECTED]> wrote: > > > I am trying to debug an roller (a blog application) which I am running > > inside of eclipse, but I have no easy way of running the JPAEnhancer. > > > > > > > > ----- Original Message ---- > > From: Andrei Tchijov <[EMAIL PROTECTED]> > > To: [email protected] > > Sent: Monday, September 29, 2008 8:50:58 PM > > Subject: Re: can I run without enhancements? > > > > Just curious, are you trying to figure out the way to profile JPA > > Application? > > > > I was wondering about the same question when I was trying > > (unsuccessfully) to profile my JPA App. > > > > On Sep 29, 2008, at 20:36 , Angel Vera wrote: > > > > > Is it possible to run a JPA application wihtout the JPA enhancer and > > > wihtout enhancing the classes? > > > > > > > > > > > > > > > __________________________________________________________________ > > > Get the name you've always wanted @ymail.com or @rocketmail.com! Go > > > to http://ca.promos.yahoo.com/jacko/ > > > > > > __________________________________________________________________ > > Looking for the perfect gift? Give the gift of Flickr! > > > > http://www.flickr.com/gift/ > > > > __________________________________________________________________ > Instant Messaging, free SMS, sharing photos and more... Try the new Yahoo! > Canada Messenger at http://ca.beta.messenger.yahoo.com/ >
