spring open jpa db2 error <p>My spring jpa poc is failing to get repository injected. Throwing an exception </p> <p>java.lang.IllegalArgumentException: Interface must be annotated with @org.springframework.data.repository.RepositoryDefinition!</p> <p>I am giving all my soruce code so that it can be identified by some one who went through this </p> <p>my app-context xml</p> <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt; &lt;beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:p="http://www.springframework.org/schema/p" xmlns:aop="http://www.springframework.org/schema/aop" xmlns:tx="http://www.springframework.org/schema/tx" xmlns:util="http://www.springframework.org/schema/util" xmlns:jdbc="http://www.springframework.org/schema/jdbc" xmlns:context="http://www.springframework.org/schema/context" xmlns:jpa="http://www.springframework.org/schema/data/jpa" xmlns:jee="http://www.springframework.org/schema/jee" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.0.xsd http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.0.xsd http://www.springframework.org/schema/jdbc http://www.springframework.org/schema/jdbc/spring-jdbc-3.0.xsd http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-3.0.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd http://www.springframework.org/schema/data/jpa http://www.springframework.org/schema/data/jpa/spring-jpa.xsd http://www.springframework.org/schema/jee http://www.springframework.org/schema/jee/spring-jee-4.0.xsd"&gt; &lt;bean id="entityManagerFactory" class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean" p:persistenceUnitName="POC" p:packagesToScan="com.poc.accountant.orm" p:dataSource-ref="dataSource" p:jpaVendorAdapter-ref="openJpaVendor" /&gt; &lt;!-- p:persistenceXmlLocation="classpath*:persistence.xml" --&gt; &lt;bean id="openJpaVendor" class="org.springframework.orm.jpa.vendor.OpenJpaVendorAdapter"&gt; &lt;property name="showSql" value="true"/&gt; &lt;property name="databasePlatform" value="org.apache.openjpa.jdbc.sql.DB2Dictionary" /&gt; &lt;/bean&gt; &lt;bean id="jpaDataSource" class="org.springframework.jndi.JndiObjectFactoryBean"&gt; &lt;property name="jndiName" value="jdbc/tepds"/&gt; &lt;/bean&gt; &lt;jee:jndi-lookup id="dataSource" jndi-name="jdbc/tepds" resource-ref="true" cache="true" /&gt; &lt;!-- &lt;context:component-scan base-package="com.poc.accountant.orm"/&gt; --&gt; &lt;!-- &lt;context:component-scan base-package="com.poc.accountant.reposotories" /&gt; --&gt; &lt;jpa:repositories base-package="com.poc.accountant.reposotories"/&gt; &lt;/beans&gt; </code></pre> <p>my Entity class</p> <pre><code>package com.poc.accountant.orm; import java.io.Serializable; import java.util.Date; import javax.persistence.Table; import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.GeneratedValue; import javax.persistence.GenerationType; import javax.persistence.Id; import javax.persistence.Temporal; import javax.persistence.TemporalType; /** * @author Fryder * */ @Entity @Table(name = "POC.PUSHAPPS") public class PushApps implements Serializable { /** * generated serial version ID */ private static final long serialVersionUID = -6763892550710204820L; @Id @Column(name = "appid") @GeneratedValue(strategy = GenerationType.AUTO) private Long appid; @Column(name = "msgid") private String msgid; @Column(name = "severity") private String severity; @Column(name = "application") private String application; @Column(name = "source") private String source; @Column(name = "component") private String component; @Column(name = "enabled") private Boolean enabled; @Column(name = "appgroup") private Long appgroup; @Column(name = "last_err") @Temporal(TemporalType.TIMESTAMP) private Date lastErr; @Column(name = "last_err_sent") @Temporal(TemporalType.TIMESTAMP) private Date lastErrSent; //getters and setters stripped } </code></pre> <p>My repository class</p> <pre><code>package com.poc.accountant.reposotories; import java.util.List; import javax.annotation.Resource; import org.springframework.data.jpa.repository.JpaRepository; import com.poc.accountant.orm.PushApps; /** * @author Fryder * */ public interface PushAppsRepository extends JpaRepository&lt;PushApps, Long&gt; { List&lt;PushApps&gt; findByAppId(long appId); } </code></pre> <p>My error log</p> <pre><code>7 poc WARN [[ACTIVE] ExecuteThread: '8' for queue: 'weblogic.kernel.Default (self-tuning)'] openjpa.Runtime - An error occurred while registering a ClassTransformer with PersistenceUnitInfo: name 'poc', root URL [file:/C:/Development/Src code and Artifacts/accountant-parent/accountant-web/target/classes/]. The error has been consumed. To see it, set your openjpa.Runtime log level to TRACE. Load-time class transformation will not be available. 10 poc INFO [[ACTIVE] ExecuteThread: '8' for queue: 'weblogic.kernel.Default (self-tuning)'] openjpa.Runtime - OpenJPA dynamically loaded a validation provider. 167 poc INFO [[ACTIVE] ExecuteThread: '8' for queue: 'weblogic.kernel.Default (self-tuning)'] openjpa.Runtime - Starting OpenJPA 2.0.1 641 poc TRACE [[ACTIVE] ExecuteThread: '8' for queue: 'weblogic.kernel.Default (self-tuning)'] openjpa.jdbc.SQL - &lt;t 8564204, conn 499&gt; executing stmnt 502 SELECT CURRENT SCHEMA FROM SYSIBM.SYSDUMMY1 651 poc TRACE [[ACTIVE] ExecuteThread: '8' for queue: 'weblogic.kernel.Default (self-tuning)'] openjpa.jdbc.SQL - &lt;t 8564204, conn 499&gt; [10 ms] spent &lt;May 2, 2014 10:12:41 AM EDT&gt; &lt;Warning&gt; &lt;HTTP&gt; &lt;BEA-101162&gt; &lt;User defined listener org.springframework.web.context.ContextLoaderListener failed: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'pushAppsRepository': Invocation of init method failed; nested exception is java.lang.IllegalArgumentException: Interface must be annotated with @org.springframework.data.repository.RepositoryDefinition!. org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'pushAppsRepository': Invocation of init method failed; nested exception is java.lang.IllegalArgumentException: Interface must be annotated with @org.springframework.data.repository.RepositoryDefinition! at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1553) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:539) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:475) at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:304) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:228) Truncated. see log file for complete stacktrace Caused By: java.lang.IllegalArgumentException: Interface must be annotated with @org.springframework.data.repository.RepositoryDefinition! at org.springframework.util.Assert.isTrue(Assert.java:65) at org.springframework.data.repository.core.support.AnnotationRepositoryMetadata.&lt;init&gt;(AnnotationRepositoryMetadata.java:48) at org.springframework.data.repository.core.support.RepositoryFactorySupport.getRepositoryMetadata(RepositoryFactorySupport.java:173) at org.springframework.data.repository.core.support.RepositoryFactoryBeanSupport.afterPropertiesSet(RepositoryFactoryBeanSupport.java:207) at org.springframework.data.jpa.repository.support.JpaRepositoryFactoryBean.afterPropertiesSet(JpaRepositoryFactoryBean.java:84) Truncated. see log file for complete stacktrace </code></pre>