从EclipseLink 2.1.3升级到EclipseLink 2.4 Nightly之后,应用程序将无法启动

时间:2013-02-04 09:24:23

标签: jpa eclipselink

我已将Eclipse IDE从Helios升级到Juno。我已经更新了我的项目,以使用Juno附带的EclipseLink的最新版本,每晚2.4(显示在Persistance属性中)。我有一个项目本身就是一个JPA项目(ProjectA),它依赖于另一个JPA项目(ProjectB)。所以实际上,我有一个与2个单独数据库交谈的项目。当我尝试启动在Tomcat下运行的ProjectA时,我得到下面列出的异常。例外中引用的实体都位于依赖项目 - ProjectB中。我重建了两个项目并重新部署。

我想知道2.4是不是2.1.3的直接升级而且我错过了一些升级文档,详细说明了我需要对我的JPA项目配置所做的更改。

将ProjectA和ProjectB恢复为EclipseLink 2.1.3,一切正常

我已经列出了仅有一个实体可以节省空间的部分例外情况,但是对于项目B中定义的每个实体都会重复。

Local Exception Stack: 
Exception [EclipseLink-60] (Eclipse Persistence Services - 2.4.0.v20110816-r9894):   org.eclipse.persistence.exceptions.DescriptorException
Exception Description: The method [_persistence_set_platform_vh] or [_persistence_get_platform_vh] is not defined in the object [com.blackbox.entities.db.PEcuAcronym].
Internal Exception: java.lang.NoSuchMethodException: com.blackbox.entities.db.PEcuAcronym._persistence_get_platform_vh()
Mapping: org.eclipse.persistence.mappings.ManyToOneMapping[platform]
Descriptor: RelationalDescriptor(com.blackbox.entities.db.PEcuAcronym --> [DatabaseTable(pecuacronym)])
at org.eclipse.persistence.exceptions.DescriptorException.noSuchMethodWhileInitializingAttributesInMethodAccessor(DescriptorException.java:1170)
at org.eclipse.persistence.internal.descriptors.MethodAttributeAccessor.initializeAttributes(MethodAttributeAccessor.java:200)
at org.eclipse.persistence.internal.descriptors.MethodAttributeAccessor.initializeAttributes(MethodAttributeAccessor.java:181)
at org.eclipse.persistence.mappings.DatabaseMapping.preInitialize(DatabaseMapping.java:1276)
at org.eclipse.persistence.mappings.ForeignReferenceMapping.preInitialize(ForeignReferenceMapping.java:1127)
at org.eclipse.persistence.mappings.ObjectReferenceMapping.preInitialize(ObjectReferenceMapping.java:1054)
at org.eclipse.persistence.descriptors.ClassDescriptor.preInitialize(ClassDescriptor.java:3571)
at org.eclipse.persistence.internal.sessions.DatabaseSessionImpl.initializeDescriptors(DatabaseSessionImpl.java:493)
at org.eclipse.persistence.internal.sessions.DatabaseSessionImpl.initializeDescriptors(DatabaseSessionImpl.java:476)
at org.eclipse.persistence.internal.sessions.DatabaseSessionImpl.initializeDescriptors(DatabaseSessionImpl.java:435)
at org.eclipse.persistence.internal.sessions.DatabaseSessionImpl.postConnectDatasource(DatabaseSessionImpl.java:673)
at org.eclipse.persistence.internal.sessions.DatabaseSessionImpl.loginAndDetectDatasource(DatabaseSessionImpl.java:618)
at org.eclipse.persistence.internal.jpa.EntityManagerFactoryProvider.login(EntityManagerFactoryProvider.java:206)
at org.eclipse.persistence.internal.jpa.EntityManagerSetupImpl.deploy(EntityManagerSetupImpl.java:474)
at org.eclipse.persistence.internal.jpa.EntityManagerFactoryDelegate.getDatabaseSession(EntityManagerFactoryDelegate.java:188)
at org.eclipse.persistence.internal.jpa.EntityManagerFactoryDelegate.createEntityManagerImpl(EntityManagerFactoryDelegate.java:277)
at org.eclipse.persistence.internal.jpa.EntityManagerFactoryImpl.createEntityManagerImpl(EntityManagerFactoryImpl.java:290)
at org.eclipse.persistence.internal.jpa.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:268)
at com.blackbox.dao.JpaBaseDao.findAll(JpaBaseDao.java:50)
at com.blackbox.services.Services.listAllPlatforms(Services.java:70)
at com.blackbox.services.Services.listAllPublishedPlatforms(Services.java:355)
at com.blackbox.x.actions.diagnostics.IdentifyVehicle.prepare(IdentifyVehicle.java:42)
at com.opensymphony.xwork2.interceptor.PrepareInterceptor.doIntercept(PrepareInterceptor.java:162)
at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)
at com.opensymphony.xwork2.interceptor.I18nInterceptor.intercept(I18nInterceptor.java:176)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)
at com.blackbox.x.interceptors.Log4jMDCInterceptor.intercept(Log4jMDCInterceptor.java:51)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)
at org.apache.struts2.interceptor.ServletConfigInterceptor.intercept(ServletConfigInterceptor.java:164)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)
at com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:207)
at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)
at com.opensymphony.xwork2.interceptor.AliasInterceptor.intercept(AliasInterceptor.java:190)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)
at com.opensymphony.xwork2.interceptor.ExceptionMappingInterceptor.intercept(ExceptionMappingInterceptor.java:187)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)
at com.blackbox.x.interceptors.RedirectMessageInterceptor.doIntercept(RedirectMessageInterceptor.java:78)
at com.blackbox.x.interceptors.RedirectMessageInterceptor.intercept(RedirectMessageInterceptor.java:63)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)
at org.apache.struts2.impl.StrutsActionProxy.execute(StrutsActionProxy.java:52)
at org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:485)
at org.apache.struts2.dispatcher.ng.ExecuteOperations.executeAction(ExecuteOperations.java:77)
at org.apache.struts2.dispatcher.ng.filter.StrutsExecuteFilter.doFilter(StrutsExecuteFilter.java:88)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at com.opensymphony.sitemesh.webapp.SiteMeshFilter.obtainContent(SiteMeshFilter.java:129)
at com.opensymphony.sitemesh.webapp.SiteMeshFilter.doFilter(SiteMeshFilter.java:77)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at org.apache.struts2.dispatcher.ng.filter.StrutsPrepareFilter.doFilter(StrutsPrepareFilter.java:82)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:330)
at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:118)
at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:84)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
at org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:113)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
at org.springframework.security.web.session.SessionManagementFilter.doFilter(SessionManagementFilter.java:103)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
at org.springframework.security.web.authentication.AnonymousAuthenticationFilter.doFilter(AnonymousAuthenticationFilter.java:113)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
at org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter.doFilter(SecurityContextHolderAwareRequestFilter.java:54)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
at org.springframework.security.web.savedrequest.RequestCacheAwareFilter.doFilter(RequestCacheAwareFilter.java:45)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
at org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter.doFilter(AbstractAuthenticationProcessingFilter.java:183)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
at org.springframework.security.web.authentication.logout.LogoutFilter.doFilter(LogoutFilter.java:105)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
at org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:87)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
at org.springframework.security.web.session.ConcurrentSessionFilter.doFilter(ConcurrentSessionFilter.java:125)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
at org.springframework.security.web.FilterChainProxy.doFilterInternal(FilterChainProxy.java:192)
at org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:160)
at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:346)
at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:259)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:240)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:164)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:462)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:164)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:100)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:562)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:395)
at org.apache.coyote.http11.Http11AprProcessor.process(Http11AprProcessor.java:306)
at org.apache.coyote.http11.Http11AprProtocol$Http11ConnectionHandler.process(Http11AprProtocol.java:323)
at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.run(AprEndpoint.java:1719)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.NoSuchMethodException: com.blackbox.entities.db.PEcuAcronym._persistence_get_platform_vh()
at java.lang.Class.getDeclaredMethod(Unknown Source)
at org.eclipse.persistence.internal.security.PrivilegedAccessHelper.findMethod(PrivilegedAccessHelper.java:82)
at org.eclipse.persistence.internal.security.PrivilegedAccessHelper.getMethod(PrivilegedAccessHelper.java:283)
at org.eclipse.persistence.internal.helper.Helper.getDeclaredMethod(Helper.java:974)
at org.eclipse.persistence.internal.descriptors.MethodAttributeAccessor.initializeAttributes(MethodAttributeAccessor.java:193)
... 94 more

要清楚 - 如果我自己部署ProjectB,那么它会按预期工作。只有当我部署JPA项目A时才会出现问题,该项目对ProjectB具有依赖性,从而发生问题。 ProjectA正确地打开了它自己的持久化上下文,但不是ProjectB的。

我已按要求附加了persistance.xml。

项目A;

<?xml version="1.0" encoding="UTF-8"?>
<persistence version="1.0" xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd">
<persistence-unit name="Genesis" transaction-type="RESOURCE_LOCAL">
    <class>com.blackbox.x.entities.SecurityKey</class>
    <class>com.blackbox.x.entities.QualifiedSecurityKey</class>
    <class>com.blackbox.x.entities.User</class>
    <class>com.blackbox.x.entities.Password</class>
    <class>com.blackbox.x.entities.ServiceDefinition</class>
    <class>com.blackbox.x.entities.IdsFunction</class>
    <class>com.blackbox.x.entities.FaultCodeType</class>
    <class>com.blackbox.x.entities.FaultCodeDescription</class>
    <class>com.blackbox.x.entities.VehicleActivityLogEntry</class>
    <class>com.blackbox.x.entities.Recovery</class>
    <class>com.blackbox.x.entities.SingleVehicleLicense</class>
    <class>com.blackbox.x.entities.MultiVehicleLicense</class>
    <class>com.blackbox.x.entities.License</class>
    <class>com.blackbox.x.entities.LicenseGroupMaster</class>
    <class>com.blackbox.x.entities.LicenseGroup</class>
    <class>com.blackbox.x.entities.FunctionGroup</class>
    <class>com.blackbox.x.entities.McodeText</class>
    <class>com.blackbox.x.entities.CCFParameterMaster</class>
    <class>com.blackbox.x.entities.CCFFunctionGroup</class>
    <class>com.blackbox.x.entities.CCFParameterOptionUsage</class>
    <class>com.blackbox.x.entities.CCFAsBuiltIndex</class>
    <class>com.blackbox.x.entities.CCFEditLog</class>
    <class>com.blackbox.x.entities.AsBuiltAnalyzerFileTracker</class>
    <class>com.blackbox.x.entities.CCFParameterOption</class>
    <class>com.blackbox.x.entities.JlrVersionControl</class>


<properties>
        <property name="eclipselink.ddl-generation" value="create-tables"/>
        <property name="eclipselink.jdbc.batch-writing" value="JDBC"/>
        <property name="eclipselink.jdbc.user" value="userId"/>
        <property name="eclipselink.jdbc.password" value="<elided>"/>
        <property name="eclipselink.jdbc.driver" value="com.mysql.jdbc.Driver"/> -->
    </properties>
</persistence-unit>

和ProjectB;

<?xml version="1.0" encoding="UTF-8"?>
<persistence version="1.0" xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd">
<persistence-unit name="ids2_develop" transaction-type="RESOURCE_LOCAL">

<description>Eclipse</description>
<provider>org.eclipse.persistence.jpa.PersistenceProvider</provider>
<class>com.blackbox.entities.db.Vw_Ecu</class>
<class>com.blackbox.entities.db.SwimPart</class>
<class>com.blackbox.entities.db.SoftwarePK</class>
<class>com.blackbox.entities.db.Software</class>
<class>com.blackbox.entities.db.ServiceData</class>
<class>com.blackbox.entities.db.PlatformData</class>
<class>com.blackbox.entities.db.Platform</class>
<class>com.blackbox.entities.db.PEcuTextPK</class>
<class>com.blackbox.entities.db.PEcuText</class>
<class>com.blackbox.entities.db.PEcuAcronymPK</class>
<class>com.blackbox.entities.db.PEcuAcronym</class>
<class>com.blackbox.entities.db.PEcu</class>
<class>com.blackbox.entities.db.PBusPK</class>
<class>com.blackbox.entities.db.PBus</class>
<class>com.blackbox.entities.db.Manufacturer</class>
<class>com.blackbox.entities.db.HardwarePK</class>
<class>com.blackbox.entities.db.Hardware</class>
<class>com.blackbox.entities.db.CusCom</class>
<class>com.blackbox.entities.db.CCFParameter</class>
<class>com.blackbox.entities.db.CCFGroup</class>
<class>com.blackbox.entities.db.Bus</class>
<class>com.blackbox.entities.db.BBoxCom</class>
<class>com.blackbox.entities.db.AssemblyPK</class>
<class>com.blackbox.entities.db.Assembly</class>
<class>com.blackbox.entities.db.McodeLookupKey</class>

    <properties>
        <property name="eclipselink.jdbc.password" value="<elided>"/>
        <property name="eclipselink.jdbc.driver" value="com.mysql.jdbc.Driver"/>
        <property name="eclipselink.jdbc.user" value="ids2dbuser"/>
        <property name="eclipselink.jdbc.url" value="jdbc:mysql://localhost:3306/ids2"/> 
        <property name="eclipselink.logging.level" value="WARNING"/>
        <property name="eclipselink.jdbc.cache-statements" value="true"/>
        <property name="eclipselink.jdbc.native-sql" value="false"/>
        <property name="eclipselink.cache.type.Vw_Ecu" value="NONE"/>

    </properties>
</persistence-unit>

1 个答案:

答案 0 :(得分:0)

似乎是一个编织问题。看起来对象没有发生编织。确保正确启用编织。如果您使用静态编织,请确保使用2.4静态编织您的类。

尝试禁用编织以确认问题。还包括你的persistence.xml。