I got a sample project, copied from somewhere else, when I am trying to run it in netbeans I am getting some error/exceptions in tomcat’s console window.
java.lang.ClassNotFoundException: javax.persistence.Entity
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1711)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1556)
at org.springframework.core.type.classreading.RecursiveAnnotationAttributesVisitor.visitEnd(AnnotationAttributesReadingVisitor.java:167)
at org.springframework.asm.ClassReader.a(Unknown Source)
at org.springframework.asm.ClassReader.accept(Unknown Source)
at org.springframework.asm.ClassReader.accept(Unknown Source)
javax.persistence is already added to my project. I even removed and re-added in netbeans but still same error. This error is when running the web applictation not when compiling.

You need to add following
Jar Filesto your Build Path: –javax.persistence_2.0.3.v201010191057.jarorg.eclipse.persistence.jpa_2.3.0.v20110604-r9504.jarorg.eclipse.persistence.jpa.equinox_2.3.1.v20111018-r10243.jarorg.eclipse.persistence.antlr_2.3.0.v20110604-r9504.jarorg.eclipse.persistence.asm_2.3.0.v20110604-r9504.jarPreferably adding the first one will work, as
javax.persistence.Entityis found in thatJaronly.But you may also need to add the later ones, for working with
JPAGoogle them with the name of JPA Jars. You will get them.