Исключение при остановке приложения Weblogic, которое содержит фабрику соединений JCA - PullRequest
0 голосов
/ 09 октября 2018

Я нахожусь на Weblogic 12.2.1.2, где я развернул адаптер JCA и потребительское веб-приложение.

Фабрика соединений JCA внедряется в мой EJB с помощью этого кода:

@ConnectionFactoryDefinition(
    interfaceName   = "myapp.adapter.api.MyConnectionFactory",
    name            = "java:comp/env/eis/MyConnectionFactory",
    resourceAdapter = "my-adapter"
)

@Stateless
public class MyEJBBean extends AbstractEJBBean {


    @Resource(lookup = "java:comp/env/eis/MyConnectionFactory")
    private MyConnectionFactory connectionFactory;

    // My methods...
}

Это работает, как и ожидалось, но когда я останавливаю или отменяю приложение, я получаю следующее исключение:

<Oct 9, 2018, 1:23:30,590 PM CEST> <Error> <Connector> <BEA-190125> <An internal consistency check failed, assertion failed: Resource does not exist DOMAIN|myapp.ws_war_0.0.1-SNAPSHOT#my-app-0.0.1-SNAPSHOT-dev#my-app-0.0.1-SNAPSHOT-dev|java:comp/env/eis/MyConnectionFactory|NONE
java.lang.AssertionError: Internal error occurred, Assertion Failed: Resource does not exist DOMAIN|myapp.ws_war_0.0.1-SNAPSHOT#my-app-0.0.1-SNAPSHOT-dev#my-app-0.0.1-SNAPSHOT-dev|java:comp/env/eis/MyConnectionFactory|NONE
    at weblogic.connector.common.Debug.throwAssertionError(Debug.java:2271)
    at weblogic.connector.common.AppDefinedResourceManager.revokeResource(AppDefinedResourceManager.java:122)
    at weblogic.connector.outbound.RAOutboundManager.revokeAppdefinedConnectionFactory(RAOutboundManager.java:558)
    at weblogic.connector.common.RAInstanceManager.revokeAppdefinedConnectionFactory(RAInstanceManager.java:2072)
    at weblogic.connector.external.RAUtil.revokeConnectionFactory(RAUtil.java:409)
    at weblogic.connector.external.RAUtil$AdministeredObjectUtilityServiceImpl.revokeConnectionFactory(RAUtil.java:526)
    at weblogic.application.naming.EnvironmentBuilder.unbindConnectionFactoryResources(EnvironmentBuilder.java:688)
    at weblogic.application.naming.EnvironmentBuilder.unbindEnvEntries(EnvironmentBuilder.java:2042)
    at weblogic.servlet.internal.CompEnv.destroy(CompEnv.java:307)
    at weblogic.servlet.internal.WebAppServletContext.destroy(WebAppServletContext.java:3191)
    at weblogic.servlet.internal.ServletContextManager.destroyContext(ServletContextManager.java:251)
    at weblogic.servlet.internal.HttpServer.unloadWebApp(HttpServer.java:672)
    at weblogic.servlet.internal.WebAppModule.destroyContexts(WebAppModule.java:1853)
    at weblogic.servlet.internal.WebAppModule.deactivate(WebAppModule.java:909)
    at weblogic.application.internal.ExtensibleModuleWrapper$ActivateStateChange.previous(ExtensibleModuleWrapper.java:328)
    at weblogic.application.internal.ExtensibleModuleWrapper$ActivateStateChange.previous(ExtensibleModuleWrapper.java:313)
    at weblogic.application.utils.StateMachineDriver.previousState(StateMachineDriver.java:207)
    at weblogic.application.utils.StateMachineDriver.previousState(StateMachineDriver.java:193)
    at weblogic.application.internal.ExtensibleModuleWrapper.deactivate(ExtensibleModuleWrapper.java:163)
    at weblogic.application.internal.flow.ModuleListenerInvoker.deactivate(ModuleListenerInvoker.java:131)
    at weblogic.application.internal.flow.ModuleStateDriver$2.previous(ModuleStateDriver.java:216)
    at weblogic.application.internal.flow.ModuleStateDriver$2.previous(ModuleStateDriver.java:207)
    at weblogic.application.utils.StateMachineDriver.previousState(StateMachineDriver.java:207)
    at weblogic.application.utils.StateMachineDriver.previousState(StateMachineDriver.java:193)
    at weblogic.application.internal.flow.ModuleStateDriver.deactivate(ModuleStateDriver.java:101)
    at weblogic.application.internal.flow.DeploymentCallbackFlow.deactivate(DeploymentCallbackFlow.java:120)
    at weblogic.application.internal.BaseDeployment$2.previous(BaseDeployment.java:756)
    at weblogic.application.utils.StateMachineDriver.previousState(StateMachineDriver.java:207)
    at weblogic.application.utils.StateMachineDriver.previousState(StateMachineDriver.java:193)
    at weblogic.application.internal.BaseDeployment.deactivate(BaseDeployment.java:283)
    at weblogic.application.internal.SingleModuleDeployment.deactivate(SingleModuleDeployment.java:52)
    at weblogic.application.internal.DeploymentStateChecker.deactivate(DeploymentStateChecker.java:202)
    at weblogic.deploy.internal.targetserver.AppContainerInvoker.deactivate(AppContainerInvoker.java:114)
    at weblogic.deploy.internal.targetserver.operations.DeactivateOperation.deactivate(DeactivateOperation.java:78)
    at weblogic.deploy.internal.targetserver.operations.RemoveOperation.removeDeployment(RemoveOperation.java:348)
    at weblogic.deploy.internal.targetserver.operations.RemoveOperation.doCommit(RemoveOperation.java:134)
    at weblogic.deploy.internal.targetserver.operations.AbstractOperation.commit(AbstractOperation.java:347)
    at weblogic.deploy.internal.targetserver.DeploymentManager.handleDeploymentCommit(DeploymentManager.java:901)
    at weblogic.deploy.internal.targetserver.DeploymentManager.activateDeploymentList(DeploymentManager.java:1456)
    at weblogic.deploy.internal.targetserver.DeploymentManager.handleCommit(DeploymentManager.java:456)
    at weblogic.deploy.internal.targetserver.DeploymentServiceDispatcher.commit(DeploymentServiceDispatcher.java:181)
    at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer.doCommitCallback(DeploymentReceiverCallbackDeliverer.java:217)
    at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer.access$100(DeploymentReceiverCallbackDeliverer.java:14)
    at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer$2.run(DeploymentReceiverCallbackDeliverer.java:69)
    at weblogic.work.SelfTuningWorkManagerImpl$WorkAdapterImpl.run(SelfTuningWorkManagerImpl.java:666)
    at weblogic.invocation.ComponentInvocationContextManager._runAs(ComponentInvocationContextManager.java:348)
    at weblogic.invocation.ComponentInvocationContextManager.runAs(ComponentInvocationContextManager.java:333)
    at weblogic.work.LivePartitionUtility.doRunWorkUnderContext(LivePartitionUtility.java:54)
    at weblogic.work.PartitionUtility.runWorkUnderContext(PartitionUtility.java:41)
    at weblogic.work.SelfTuningWorkManagerImpl.runWorkUnderContext(SelfTuningWorkManagerImpl.java:640)
    at weblogic.work.ExecuteThread.execute(ExecuteThread.java:406)
    at weblogic.work.ExecuteThread.run(ExecuteThread.java:346)

Я пробовал много обходных путей, но получаю это исключение каждый раз, когда я останавливаю приложение.

Что не так?

Большое спасибо, Антонио

1 Ответ

0 голосов
/ 09 октября 2018

Проблема решена: я удалил ConnectionFactoryDefinition и определил имя JNDI фабрики внутри weblogic-ra.xml следующим образом:

        <wls:connection-definition-group>
            <wls:connection-factory-interface>myapp.adapter.api.MyConnectionFactory</wls:connection-factory-interface>
            <wls:connection-instance>
                <wls:jndi-name>eis/MyConnectionFactory</wls:jndi-name>
            </wls:connection-instance>
        </wls:connection-definition-group>
...