I upgraded my java app to Open JPA 2.4.1 & Java 8 & im getting the error below. Previously I was on Open JPA 2.2.2 & Java 7. Note, the error text "target does not exist in table" is not true, that field is in the table.
Any thoughts?
<openjpa-2.4.1-r422266:1730418 fatal user error> org.apache.openjpa.util.MetaDataException: "com.test.app.persistence.TblfeeFeeDtl.tblfeeFee" defines a target of "pay_id" for column "pay_id", but that target does not exist in table "dbo.tbl_sfee_fee".
org.apache.openjpa.jdbc.meta.MappingInfo.mergeJoinColumn(MappingInfo.java:1543)
org.apache.openjpa.jdbc.meta.MappingInfo.createJoins(MappingInfo.java:1323)
org.apache.openjpa.jdbc.meta.MappingInfo.createForeignKey(MappingInfo.java:1085)
org.apache.openjpa.jdbc.meta.ValueMappingInfo.getTypeJoin(ValueMappingInfo.java:115)
org.apache.openjpa.jdbc.meta.ValueMappingInfo.getTypeJoin(ValueMappingInfo.java:92)
org.apache.openjpa.jdbc.meta.strats.RelationFieldStrategy.map(RelationFieldStrategy.java:166)
org.apache.openjpa.jdbc.meta.FieldMapping.setStrategy(FieldMapping.java:148)
org.apache.openjpa.jdbc.meta.RuntimeStrategyInstaller.installStrategy(RuntimeStrategyInstaller.java:81)
org.apache.openjpa.jdbc.meta.FieldMapping.resolveMapping(FieldMapping.java:498)
org.apache.openjpa.jdbc.meta.FieldMapping.resolve(FieldMapping.java:463)
org.apache.openjpa.jdbc.meta.strats.RelationToManyInverseKeyFieldStrategy.map(RelationToManyInverseKeyFieldStrategy.java:135)
org.apache.openjpa.jdbc.meta.strats.RelationCollectionInverseKeyFieldStrategy.map(RelationCollectionInverseKeyFieldStrategy.java:94)
org.apache.openjpa.jdbc.meta.FieldMapping.setStrategy(FieldMapping.java:148)
org.apache.openjpa.jdbc.meta.RuntimeStrategyInstaller.installStrategy(RuntimeStrategyInstaller.java:81)
org.apache.openjpa.jdbc.meta.FieldMapping.resolveMapping(FieldMapping.java:498)
org.apache.openjpa.jdbc.meta.FieldMapping.resolve(FieldMapping.java:463)
org.apache.openjpa.jdbc.meta.ClassMapping.resolveMapping(ClassMapping.java:854)
org.apache.openjpa.meta.ClassMetaData.resolve(ClassMetaData.java:1813)
org.apache.openjpa.meta.MetaDataRepository.processBuffer(MetaDataRepository.java:829)
org.apache.openjpa.meta.MetaDataRepository.resolveMapping(MetaDataRepository.java:784)
org.apache.openjpa.meta.MetaDataRepository.resolve(MetaDataRepository.java:664)
org.apache.openjpa.meta.MetaDataRepository.getMetaDataInternal(MetaDataRepository.java:418)
org.apache.openjpa.meta.MetaDataRepository.getMetaData(MetaDataRepository.java:389)
org.apache.openjpa.persistence.meta.MetamodelImpl.<init>(MetamodelImpl.java:86)
org.apache.openjpa.persistence.EntityManagerFactoryImpl.getMetamodel(EntityManagerFactoryImpl.java:348)
org.apache.openjpa.persistence.EntityManagerFactoryImpl.getCriteriaBuilder(EntityManagerFactoryImpl.java:332)
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
java.lang.reflect.Method.invoke(Method.java:498)
org.springframework.orm.jpa.AbstractEntityManagerFactoryBean.invokeProxyMethod(AbstractEntityManagerFactoryBean.java:462)
org.springframework.orm.jpa.AbstractEntityManagerFactoryBean$ManagedEntityManagerFactoryInvocationHandler.invoke(AbstractEntityManagerFactoryBean.java:633)
com.sun.proxy.$Proxy63.getCriteriaBuilder(Unknown Source)
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
java.lang.reflect.Method.invoke(Method.java:498)
org.springframework.orm.jpa.SharedEntityManagerCreator$SharedEntityManagerInvocationHandler.invoke(SharedEntityManagerCreator.java:226)
com.sun.proxy.$Proxy88.getCriteriaBuilder(Unknown Source)
com.test.app.DataBCImpl.getTblPpwsUserGroupDtls(PricingDataBCImpl.java:3078)
com.test.app.DataBCImpl$$FastClassBySpringCGLIB$$99f8efb3.invoke(<generated>)
org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:204)
org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:720)
org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157)
org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:99)
org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:280)
org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:96)
org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
org.springframework.aop.framework.adapter.MethodBeforeAdviceInterceptor.invoke(MethodBeforeAdviceInterceptor.java:52)
org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
org.springframework.cache.interceptor.CacheInterceptor$1.invoke(CacheInterceptor.java:52)
org.springframework.cache.interceptor.CacheAspectSupport.invokeOperation(CacheAspectSupport.java:345)
org.springframework.cache.interceptor.CacheAspectSupport.execute(CacheAspectSupport.java:414)
org.springframework.cache.interceptor.CacheAspectSupport.execute(CacheAspectSupport.java:327)
org.springframework.cache.interceptor.CacheInterceptor.invoke(CacheInterceptor.java:61)
org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:92)
org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:655)
com.test.app.DataBCImpl$$EnhancerBySpringCGLIB$$1735a68a.getTblPpwsUserGroupDtls(<generated>)
com.test.app.common.RoleMapperGrantedAuthorityFactory.createGrantedAuthority(RoleMapperGrantedAuthorityFactory.java:36)
waffle.spring.WindowsAuthenticationToken.<init>(WindowsAuthenticationToken.java:84)
waffle.spring.NegotiateSecurityFilter.doFilter(NegotiateSecurityFilter.java:108)
org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331)
org.springframework.security.web.csrf.CsrfFilter.doFilterInternal(CsrfFilter.java:100)
org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331)
org.springframework.security.web.header.HeaderWriterFilter.doFilterInternal(HeaderWriterFilter.java:66)
org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331)
org.springframework.security.web.context.request.async.WebAsyncManagerIntegrationFilter.doFilterInternal(WebAsyncManagerIntegrationFilter.java:56)
org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331)
org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:105)
org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331)
org.springframework.security.web.FilterChainProxy.doFilterInternal(FilterChainProxy.java:214)
org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:177)
org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:346)
org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:262)
I solved this issue. The mapping for the "tblfeeFee" table listed below was the issue. The field in question is part of an multi-column FK relationship & for some reason Open JPA 2.4.1 is pickier about this than prior versions. I needed to explicitly define the field in question in the mapping for this table.
com.test.app.persistence.TblfeeFeeDtl.tblfeeFee defines a target of "pay_id" for column "pay_id", but that target does not exist in table "dbo.tbl_sfee_fee".