我们正在将J2EE应用程序(JSP和EJB 2.0)从WebLogic Service 8.1升级到12c(12.2.1.1.0)。我们正在构建一个爆炸的EAR到域目录中的目录。我们使用管理控制台来部署应用程序,但它失败了weblogic.management.DeploymentException: Application <appname> does not have any Components in it.
日志中显示以下内容:
####<Sep 26, 2016, 6:16:08,62 PM EDT> <Error> <Deployer> <CVG-000216B-010> <BaseServer> <[STANDBY] ExecuteThread: '11' for queue: 'weblogic.kernel.Default (self-tuning)'> <<WLS Kernel>> <> <9b2f9073-e2d2-4c02-915c-4e5de240621e-00000012> <1474928168062> <[severity-value: 8] [rid: 0] [partition-id: 0] [partition-name: DOMAIN] > <BEA-149265> <Failure occurred in the execution of deployment request with ID "25758041366812" for task "0" on [partition-name: DOMAIN]. Error is: "weblogic.management.DeploymentException: Application [MyApp] does not have any Components in it."
weblogic.management.DeploymentException: Application [MyApp] does not have any Components in it.
at weblogic.jdbc.module.JDBCDeployment.createModule(JDBCDeployment.java:40)
at weblogic.jdbc.module.JDBCDeployment.<init>(JDBCDeployment.java:25)
at weblogic.jdbc.module.JDBCDeploymentFactory.createDeployment(JDBCDeploymentFactory.java:79)
at weblogic.application.internal.DeploymentManagerImpl.createDeployment(DeploymentManagerImpl.java:186)
at weblogic.application.internal.DeploymentManagerImpl.access$700(DeploymentManagerImpl.java:52)
at weblogic.application.internal.DeploymentManagerImpl$DeploymentCreatorImpl.createDeployment(DeploymentManagerImpl.java:583)
at weblogic.deploy.internal.targetserver.BasicDeployment.createDeployment(BasicDeployment.java:231)
at weblogic.deploy.internal.targetserver.operations.ActivateOperation.createAndPrepareContainer(ActivateOperation.java:223)
at weblogic.deploy.internal.targetserver.operations.ActivateOperation.doPrepare(ActivateOperation.java:103)
at weblogic.deploy.internal.targetserver.operations.AbstractOperation.prepare(AbstractOperation.java:241)
at weblogic.deploy.internal.targetserver.DeploymentManager.handleDeploymentPrepare(DeploymentManager.java:794)
at weblogic.deploy.internal.targetserver.DeploymentManager.prepareDeploymentList(DeploymentManager.java:1340)
at weblogic.deploy.internal.targetserver.DeploymentManager.handlePrepare(DeploymentManager.java:267)
at weblogic.deploy.internal.targetserver.DeploymentServiceDispatcher.prepare(DeploymentServiceDispatcher.java:177)
at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer.doPrepareCallback(DeploymentReceiverCallbackDeliverer.java:186)
at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer.access$000(DeploymentReceiverCallbackDeliverer.java:14)
at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer$1.run(DeploymentReceiverCallbackDeliverer.java:47)
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)
>
该应用确实安装(State =“Installed”),但无法启动。如果我们删除它并重新安装它,不会发生错误,其状态为“活动”,我们可以测试应用程序。但是,当服务器重新启动时,上述异常将显示在日志中,并且应用程序处于“ADMIN”状态。它无法启动,因此我们删除它并通过管理控制台重新安装它,它运行允许我们测试它。
应用程序中确实包含J2EE组件,至少是Web应用程序,因为这正是我们正在测试的内容。删除应用程序并从管理控制台重新安装后,我们会在“部署摘要”页面的“模块和组件”部分中看到Web应用程序,所有EJB和EJB模块。
我们查看了WebLogic代码并找到了生成错误的位置。看来没有为应用程序生成组件MBean。这来自weblogic.jdbc.module.JDBCDeployment
类:
private static Module createModule(AppDeploymentMBean mbean) throws DeploymentException {
ComponentMBean[] c = mbean.getAppMBean().getComponents();
if ((c == null) || (c.length == 0)) {
throw new DeploymentException("Application " + ApplicationVersionUtils.getDisplayName(mbean) + " does not have any Components in it.");
}
--[snipped]--
我们需要做什么来部署爆炸的EAR,以便WebLogic 12c在最初加载应用程序时识别组件?
提前感谢您提供的任何帮助或见解。
答案 0 :(得分:4)
感谢Emmanuel Collin的建议,通过重命名与应用程序同名的数据源解决了这个问题。
应用程序安装时没有错误,一旦服务器启动就可以使用。