[ 
https://issues.apache.org/jira/browse/OPENJPA-318?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Rick Curtis closed OPENJPA-318.
-------------------------------

    Resolution: Not A Problem

Please reopen if this is still an issue.

> Auto-enhancement within a Web Application
> -----------------------------------------
>
>                 Key: OPENJPA-318
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-318
>             Project: OpenJPA
>          Issue Type: Bug
>          Components: jdbc, jpa, sql
>    Affects Versions: 0.9.7
>         Environment: Java JRE 1.5
> OpenJPA 0.9.7
> IDE Eclipse
> Tomcat 5.0
> MySQL 4.1.9 DataBase (EasyPhp 1.8.0.1)
>            Reporter: Frederic Jeanneau
>
> Hello.
> I'm still french, so excuse my english again.
> I have a problem while trying to persist a very simple object, within a web 
> application.
> With a web form I create an object, and then the web app try to persist it.
> The EntityManager is loaded for the first object I have to persist, not at 
> the loading of the server, but only when I first try to persist an object. 
> (For the other objects, the EntityManager will be loaded yet).
> I have just a message with a number and a text.
> My Message class is :
> @Entity
> @Inheritance (strategy = InheritanceType.TABLE_PER_CLASS)
> @Table(name = "MESG")
> @Id
> @Column(name = "NUM_MESG", nullable = false, length = 10)
> @Basic
> @Column(name = "TXT_MESG", nullable = false, length = 60)
> The class is listed in the first Persistence Unit of the persistence.xml, and 
> the xml file is in the right repertory, with the right properties to connect 
> the base, and there is a right database access - library. The Entitymanager 
> is created and can access the base.
> The table is created, but when I send an object to the EntityManager, it 
> fails, because :
> Attempt to cast instance "2 [mesobjets.Message]" to PersistenceCapable 
> failed.  Ensure that it has been enhanced.
> I tried to launch the server whith -the javaagent argument, but the launching 
> fail, because :
> java.lang.reflect.InvocationTargetException
>       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>       at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
>       at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
>       at java.lang.reflect.Method.invoke(Unknown Source)
>       at sun.instrument.InstrumentationImpl.loadClassAndCallPremain(Unknown 
> Source)
> Caused by: java.lang.NoClassDefFoundError: 
> org/apache/commons/lang/exception/NestableRuntimeException
>       at java.lang.ClassLoader.defineClass1(Native Method)
>       at java.lang.ClassLoader.defineClass(Unknown Source)
>       at java.security.SecureClassLoader.defineClass(Unknown Source)
>       at java.net.URLClassLoader.defineClass(Unknown Source)
>       at java.net.URLClassLoader.access$100(Unknown Source)
>       at java.net.URLClassLoader$1.run(Unknown Source)
>       at java.security.AccessController.doPrivileged(Native Method)
>       at java.net.URLClassLoader.findClass(Unknown Source)
>       at java.lang.ClassLoader.loadClass(Unknown Source)
>       at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
>       at java.lang.ClassLoader.loadClass(Unknown Source)
>       at java.lang.ClassLoader.loadClassInternal(Unknown Source)
>       at 
> org.apache.openjpa.enhance.PCEnhancerAgent.premain(PCEnhancerAgent.java:47)
>       ... 5 more
> FATAL ERROR in native method: processing of -javaagent failed
> Is there a system property to set in order to the server find the openjpa 
> library to enhance the classes ?
> So, if someone know how to auto-enhance on a server, I'm waiting for their 
> ideas, and i'm still trying to solve the problem. Thanks for your help

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to