I'm tryin to generate a EJB 3.0 Entity Bean on the fly, and then add it to an Ejb3Configuration instance using the method addAnnotatedClass(Class clazz), using this steps:
1- Initialize the application (in this point the application initialize a new Ejb3Configuration with no entity beans).
2. The Application generates the source code for a new EntityBean an then compile it.
3. I get the new Entity bean class and create a new Instance.
4. Add the new generated entity bean to the Ejb3Configuration.
When i try to add the generated class a get this:
java.lang.TypeNotPresentException: Type javax.persistence.Entity not present
......
......
the i can see:
Caused by: java.lang.ClassNotFoundException: javax.persistence.Entity
16:53:27,234 ERROR [STDERR] at java.net.URLClassLoader$1.run(Unknown Source)
its really strange, because i have all the nessesary libraries in my classpath, indeed it works ok if the EntityBean is not generated on the fly.
thanks in advance for any reply
|