2016-11-11 57 views
0

我ENV: 的WebLogic 12C無法獲取CDI中的Weblogic 12C工作,休眠5.2.4,休眠驗證器/ CDI 5.3.1

與jpa2.1補丁設置:設置PRE_CLASSPATH =%MW_HOME%\ oracle_common \ modules \ javax.persistence_2.1.jar;%MW_HOME%\ wlserver \ modules \ com.oracle.weblogic.jpa21support_1.0.0.0_2-1.jar

my-ear/APP-INF/lib包含:

hibernate-release-5.2.4.Final/lib/required/*.jar 
hibernate-validator-5.3.1/dist/*.jar and hibernate-validator-5.3.1/dist/lib/required/* 

我的persistence.xml:

<persistence xmlns="http://xmlns.jcp.org/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
    xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/persistence 
    http://xmlns.jcp.org/xml/ns/persistence/persistence_2_1.xsd" 
    version="2.1"> 
<persistence-unit name="myPersistenceUnit" transaction-type="JTA"> 
<provider>org.hibernate.jpa.HibernatePersistenceProvider</provider> 
<jta-data-source>myDataSource</jta-data-source> 

我能夠使用persistence.xml和entityManager注入我的會話bean沒有任何問題。但是當我添加的beans.xml(使用CDI)在EJB-JAR/META-INF之一,我得到:

org.jboss.weld.exceptions.UnproxyableResolutionException: WELD-001435 Normal scoped bean class org.hibernate.validator.internal.engine.ValidatorImpl is not proxyable because it has no no-args constructor - ValidatorBean [id=org.hibernate.validator.internal.cdi.ValidatorBean_default]. 

我的weblogic-application.xml中包含:

<prefer-application-packages>  
<package-name>antlr.*</package-name> 
<package-name>org.hibernate.*</package-name> 
<package-name>org.hibernate.validator.*</package-name> 
<package-name>org.hibernate.validator.internal.cdi.*</package-name>   
<package-name>javax.validation.*</package-name> 
<package-name>javax.validation.spi.*</package-name> 
<package-name>javax.validation.bootstrap.*</package-name> 

完成stacktrace:

Exception 0 : 
org.jboss.weld.exceptions.UnproxyableResolutionException: WELD-001435 Normal scoped bean class org.hibernate.validator.internal.engine.ValidatorImpl is not proxyable because it has no no-args constructor - ValidatorBean [id=org.hibernate.validator.internal.cdi.ValidatorBean_default]. 
    at org.jboss.weld.util.Proxies.getUnproxyableClassException(Proxies.java:214) 
    at org.jboss.weld.util.Proxies.getUnproxyableTypeException(Proxies.java:180) 
    at org.jboss.weld.util.Proxies.getUnproxyableTypesExceptionInt(Proxies.java:195) 
    at org.jboss.weld.util.Proxies.getUnproxyableTypesException(Proxies.java:169) 
    at org.jboss.weld.bootstrap.Validator.validateBean(Validator.java:151) 
    at org.jboss.weld.bootstrap.Validator.validateBeans(Validator.java:388) 
    at org.jboss.weld.bootstrap.Validator.validateDeployment(Validator.java:371) 
    at org.jboss.weld.bootstrap.WeldBootstrap.validateBeans(WeldBootstrap.java:379) 
    at com.oracle.injection.provider.weld.WeldInjectionContainer.start(WeldInjectionContainer.java:110) 
    at com.oracle.injection.integration.CDIAppDeploymentExtension.initCdi(CDIAppDeploymentExtension.java:76) 
    at com.oracle.injection.integration.CDIAppDeploymentExtension.activate(CDIAppDeploymentExtension.java:49) 
    at weblogic.application.internal.flow.AppDeploymentExtensionFlow.activate(AppDeploymentExtensionFlow.java:37) 
    at weblogic.application.internal.BaseDeployment$2.next(BaseDeployment.java:729) 
    at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:42) 
    at weblogic.application.internal.BaseDeployment.activate(BaseDeployment.java:258) 
    at weblogic.application.internal.EarDeployment.activate(EarDeployment.java:61) 
    at weblogic.application.internal.DeploymentStateChecker.activate(DeploymentStateChecker.java:165) 
    at weblogic.deploy.internal.targetserver.AppContainerInvoker.activate(AppContainerInvoker.java:80) 
    at weblogic.deploy.internal.targetserver.operations.AbstractOperation.activate(AbstractOperation.java:587) 
    at weblogic.deploy.internal.targetserver.operations.ActivateOperation.activateDeployment(ActivateOperation.java:150) 
    at weblogic.deploy.internal.targetserver.operations.ActivateOperation.doCommit(ActivateOperation.java:116) 
    at weblogic.deploy.internal.targetserver.operations.AbstractOperation.commit(AbstractOperation.java:339) 
    at weblogic.deploy.internal.targetserver.DeploymentManager.handleDeploymentCommit(DeploymentManager.java:846) 
    at weblogic.deploy.internal.targetserver.DeploymentManager.activateDeploymentList(DeploymentManager.java:1275) 
    at weblogic.deploy.internal.targetserver.DeploymentManager.handleCommit(DeploymentManager.java:442) 
    at weblogic.deploy.internal.targetserver.DeploymentServiceDispatcher.commit(DeploymentServiceDispatcher.java:176) 
    at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer.doCommitCallback(DeploymentReceiverCallbackDeliverer.java:195) 
    at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer.access$100(DeploymentReceiverCallbackDeliverer.java:13) 
    at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer$2.run(DeploymentReceiverCallbackDeliverer.java:68) 
    at weblogic.work.SelfTuningWorkManagerImpl$WorkAdapterImpl.run(SelfTuningWorkManagerImpl.java:548) 
    at weblogic.work.ExecuteThread.execute(ExecuteThread.java:311) 
    at weblogic.work.ExecuteThread.run(ExecuteThread.java:263) 

    at org.jboss.weld.bootstrap.Validator.validateBeans(Validator.java:398) 
    at org.jboss.weld.bootstrap.Validator.validateDeployment(Validator.java:371) 
    at org.jboss.weld.bootstrap.WeldBootstrap.validateBeans(WeldBootstrap.java:379) 
    at com.oracle.injection.provider.weld.WeldInjectionContainer.start(WeldInjectionContainer.java:110) 
    at com.oracle.injection.integration.CDIAppDeploymentExtension.initCdi(CDIAppDeploymentExtension.java:76) 
    at com.oracle.injection.integration.CDIAppDeploymentExtension.activate(CDIAppDeploymentExtension.java:49) 
    at weblogic.application.internal.flow.AppDeploymentExtensionFlow.activate(AppDeploymentExtensionFlow.java:37) 
    at weblogic.application.internal.BaseDeployment$2.next(BaseDeployment.java:729) 
    at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:42) 
    at weblogic.application.internal.BaseDeployment.activate(BaseDeployment.java:258) 
    at weblogic.application.internal.EarDeployment.activate(EarDeployment.java:61) 
    at weblogic.application.internal.DeploymentStateChecker.activate(DeploymentStateChecker.java:165) 
    at weblogic.deploy.internal.targetserver.AppContainerInvoker.activate(AppContainerInvoker.java:80) 
    at weblogic.deploy.internal.targetserver.operations.AbstractOperation.activate(AbstractOperation.java:587) 
    at weblogic.deploy.internal.targetserver.operations.ActivateOperation.activateDeployment(ActivateOperation.java:150) 
    at weblogic.deploy.internal.targetserver.operations.ActivateOperation.doCommit(ActivateOperation.java:116) 
    at weblogic.deploy.internal.targetserver.operations.AbstractOperation.commit(AbstractOperation.java:339) 
    at weblogic.deploy.internal.targetserver.DeploymentManager.handleDeploymentCommit(DeploymentManager.java:846) 
    at weblogic.deploy.internal.targetserver.DeploymentManager.activateDeploymentList(DeploymentManager.java:1275) 
    at weblogic.deploy.internal.targetserver.DeploymentManager.handleCommit(DeploymentManager.java:442) 
    at weblogic.deploy.internal.targetserver.DeploymentServiceDispatcher.commit(DeploymentServiceDispatcher.java:176) 
    at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer.doCommitCallback(DeploymentReceiverCallbackDeliverer.java:195) 
    at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer.access$100(DeploymentReceiverCallbackDeliverer.java:13) 
    at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer$2.run(DeploymentReceiverCallbackDeliverer.java:68) 
    at weblogic.work.SelfTuningWorkManagerImpl$WorkAdapterImpl.run(SelfTuningWorkManagerImpl.java:548) 
    at weblogic.work.ExecuteThread.execute(ExecuteThread.java:311) 
    at weblogic.work.ExecuteThread.run(ExecuteThread.java:263) 

我在想什麼?如何獲取beans.xml/CDI在這種環境下工作?

回答

0

我安裝了Weblogic patches 17754607 and 23744018 (Weblogic Server 12.1.3.0.161018)

並刪除: hibernate-validator-5.3.1/dist/*.jarmy-ear/APP-INF/lib

Oracle提供的驗證jar工作正常 - 我現在可以使用CDI。