0

Eclipse IDE を Helios から Juno にアップグレードしました。Juno に付属の EclipseLink の最新バージョンである 2.4 Nightly を使用するようにプロジェクトを更新しました (Persistance プロパティに表示されます)。別の JPA プロジェクト (ProjectB) に依存する JPA プロジェクト (ProjectA) である 1 つのプロジェクトがあります。事実上、私は2つの別々のデータベースと話しているプロジェクトを持っています。Tomcat で実行されている ProjectA を起動しようとすると、以下に示す例外が発生します。例外で参照されているエンティティはすべて、依存プロジェクト - ProjectB にあります。両方のプロジェクトを再構築し、再展開しました。

2.4 が 2.1.3 からの直接のアップグレードではないかどうか疑問に思っています。また、JPA プロジェクトの構成に加える必要がある変更を詳述しているアップグレード ドキュメントをどこかで見逃していました。

ProjectA と ProjectB の両方を EclipseLink 2.1.3 に戻すと、すべてが正しく機能します

スペースを節約するためにエンティティの 1 つだけの例外の一部をリストしましたが、プロジェクト 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 を単独で展開すると、期待どおりに機能します。この問題は、問題が発生する ProjectB に依存する JPA Project A をデプロイするときにのみ発生します。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>

4

1 に答える 1

0

編み方の問題のようです。オブジェクトにウィービングが発生していないようです。ウィービングが正しく有効になっていることを確認してください。静的ウィービングを使用している場合は、2.4 を使用してクラスを静的にウィービングしてください。

問題を確認するためにウィービングを無効にしてみてください。また、persistence.xml も含めます。

于 2013-02-04T14:42:20.307 に答える