-
Feb 17th, 2008, 07:38 AM
#1
<context:annotation-config /> and JPA
Hi,
I wanted to use Spring to manage by JSF backing beans and so that, I used the @Controller and @Scope annotations to annotate my backing beans. It worked fine on my first project which was using JPA.
Now, I want to use the same for another project which does not use JPA, but uses classic Hibernate XML Config files.
However, when I wrote the Spring Bean Definition XML files, Eclipse shows an error at the line where <context:annotation-config /> appears, saying that:
"Build path is incomplete. Cannot find class file for javax/persistence/EntityManagerFactory"
When I added the Hibernate-JPA files, the error goes away. But I dont want to add those files into my project.
I saw a JIRA issue about a dependency of this annotation with JPA classes, but it says that it was fixed at Spring 2.5 RC1.
Is there anyway to fix this ?
Version Details :
--------------
Spring v2.5.1
JSF 1.2
Hibernate 3.2.5
Eclipse v3.3.1 Europa JEE Distro with Spring IDE v2.0.2
Last edited by yohan; Feb 17th, 2008 at 07:41 AM.
Reason: added Eclipse version / Spring IDE version
-
Feb 17th, 2008, 11:56 AM
#2
This is not a real problem, just add persistence.jar to the buid path
-
Feb 19th, 2008, 06:49 AM
#3
Thanks for the reply.
I know that it works when I add the persistence jar files. But the problem is, why does it have a dependency on it? Since my project does not use the JPA, I don't want to add the persistence jar files into it.
Can someone explain the dependency of JPA in detail?
Thanks.
-
Feb 19th, 2008, 07:41 PM
#4
maybe you are using a class from persistence API for an anottation
-
Feb 19th, 2008, 11:45 PM
#5
No, I am not using any class from JPA. The two classes I use for annotation are
org.springframework.context.annotation.Scope;
org.springframework.stereotype.Controller;
The requirement for persistence jar files come only when I put the <context:annotation-config /> to my Spring Bean Definition file.
I am wondering if this is a dependency of the <context:annotation-config />.
Thanks.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules