WebLogic中的JEE共享库

时间:2017-11-28 15:36:33

标签: java-ee shared-libraries weblogic

我将我的应用程序移植到WebLogic作为企业库,以便我的EJB和MDB可以调用其中的代码。

我已经为Lib1.ear和Lib2.ear选择了一个EAR包装,其中包含APP-INF / lib目录并且两者都有100个罐子。我还更新了两者的MANIFEST.MF,其中包含Specification-VersionImplementation-Version。两者都已成功部署并可供使用。

现在我更新了包含我的EJB和MDB的耳朵,并在weblogic-application.xml;

中添加了以下内容
 <wls:library-ref>
    <wls:library-name>Lib1</wls:library-name>
    <wls:specification-version>18</wls:specification-version>
</wls:library-ref>
<wls:library-ref>
    <wls:library-name>Lib2</wls:library-name>
    <wls:specification-version>18</wls:specification-version>
</wls:library-ref>

但是当我部署我的EAR(其中包含EJB等)时,它在第一步失败时抱怨它没有找到interface,它被定义并打包在Lib1.ear共享库中作为我的一个我的EJB实现了这一点。我已启用调试日志,但我无法从WebLogic中找到任何指引我到正确路径的信息。我的所有EJB都使用远程名称等进行初始化,但后来我的日志中出现了单行错误,后跟ClassNotfoundException;

<28-Nov-2017 15:26:18,005 o'clock GMT> <Error> <J2EE> <BEA-160228> <AppMerge failed to merge your application. If you are running AppMerge on the command-line, merge again with the -verbose option for more details. See the error message(s) below.>
weblogic.utils.compiler.ToolFailureException: com.xyz.abc.runtime.debugger.DebuggerListener
        at weblogic.application.compiler.FlowDriver.handleStateChangeException(FlowDriver.java:55)
        at weblogic.application.compiler.FlowDriver.nextState(FlowDriver.java:38)
        at weblogic.application.compiler.AppMerge.runBody(AppMerge.java:168)
        at weblogic.utils.compiler.Tool.run(Tool.java:159)
        at weblogic.utils.compiler.Tool.run(Tool.java:116)
        at weblogic.application.compiler.AppMerge.merge(AppMerge.java:198)
        at weblogic.deploy.api.internal.utils.AppMerger.merge(AppMerger.java:94)
        at weblogic.deploy.api.internal.utils.AppMerger.getMergedApp(AppMerger.java:58)
        at weblogic.deploy.api.model.internal.WebLogicDeployableObjectFactoryImpl.createDeployableObject(WebLogicDeployableObjectFactoryImpl.java:186)
        at weblogic.deploy.api.model.internal.WebLogicDeployableObjectFactoryImpl.createLazyDeployableObject(WebLogicDeployableObjectFactoryImpl.java:160)
        at weblogic.deploy.api.tools.SessionHelper.inspect(SessionHelper.java:781)
        at com.bea.console.actions.app.install.Flow$2.execute(Flow.java:530)
        at com.bea.console.utils.DeploymentUtils.runDeploymentAction(DeploymentUtils.java:5690)
        at com.bea.console.actions.app.install.Flow.appSelected(Flow.java:528)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at org.apache.beehive.netui.pageflow.FlowController.invokeActionMethod(FlowController.java:870)
        at org.apache.beehive.netui.pageflow.FlowController.getActionMethodForward(FlowController.java:809)
        at org.apache.beehive.netui.pageflow.FlowController.internalExecute(FlowController.java:478)
        at org.apache.beehive.netui.pageflow.PageFlowController.internalExecute(PageFlowController.java:306)
        at org.apache.beehive.netui.pageflow.FlowController.execute(FlowController.java:336)
        at org.apache.beehive.netui.pageflow.internal.FlowControllerAction.execute(FlowControllerAction.java:52)
        at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:431)
        at org.apache.beehive.netui.pageflow.PageFlowRequestProcessor.access$201(PageFlowRequestProcessor.java:97)
        at org.apache.beehive.netui.pageflow.PageFlowRequestProcessor$ActionRunner.execute(PageFlowRequestProcessor.java:2044)
        at org.apache.beehive.netui.pageflow.interceptor.action.internal.ActionInterceptors$WrapActionInterceptorChain.continueChain(ActionInterceptors.java:64)
        at org.apache.beehive.netui.pageflow.interceptor.action.ActionInterceptor.wrapAction(ActionInterceptor.java:184)
        at org.apache.beehive.netui.pageflow.interceptor.action.internal.ActionInterceptors$WrapActionInterceptorChain.invoke(ActionInterceptors.java:50)
        at org.apache.beehive.netui.pageflow.interceptor.action.internal.ActionInterceptors$WrapActionInterceptorChain.continueChain(ActionInterceptors.java:58)
        at org.apache.beehive.netui.pageflow.interceptor.action.internal.ActionInterceptors.wrapAction(ActionInterceptors.java:87)
        at org.apache.beehive.netui.pageflow.PageFlowRequestProcessor.processActionPerform(PageFlowRequestProcessor.java:2116)
        at com.bea.console.internal.ConsolePageFlowRequestProcessor.processActionPerform(ConsolePageFlowRequestProcessor.java:265)
        at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:236)
        at org.apache.beehive.netui.pageflow.PageFlowRequestProcessor.processInternal(PageFlowRequestProcessor.java:556)
        at org.apache.beehive.netui.pageflow.PageFlowRequestProcessor.process(PageFlowRequestProcessor.java:853)
        at org.apache.beehive.netui.pageflow.AutoRegisterActionServlet.process(AutoRegisterActionServlet.java:631)
        at org.apache.beehive.netui.pageflow.PageFlowActionServlet.process(PageFlowActionServlet.java:158)
        at com.bea.console.internal.ConsoleActionServlet.process(ConsoleActionServlet.java:262)
        at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:414)
        at com.bea.console.internal.ConsoleActionServlet.doGet(ConsoleActionServlet.java:134)
        at org.apache.beehive.netui.pageflow.PageFlowUtils.strutsLookup(PageFlowUtils.java:1199)
        at org.apache.beehive.netui.pageflow.PageFlowUtils.strutsLookup(PageFlowUtils.java:1129)
        at com.bea.portlet.adapter.scopedcontent.framework.internal.PageFlowUtilsBeehiveDelegate.strutsLookupInternal(PageFlowUtilsBeehiveDelegate.java:43)
        at com.bea.portlet.adapter.scopedcontent.framework.PageFlowUtils.strutsLookup(PageFlowUtils.java:108)
        at com.bea.portlet.adapter.scopedcontent.ScopedContentCommonSupport.executeAction(ScopedContentCommonSupport.java:707)
        at com.bea.portlet.adapter.scopedcontent.ScopedContentCommonSupport.processActionInternal(ScopedContentCommonSupport.java:141)
        at com.bea.portlet.adapter.scopedcontent.PageFlowStubImpl.processAction(PageFlowStubImpl.java:108)
        at com.bea.portlet.adapter.NetuiActionHandler.raiseScopedAction(NetuiActionHandler.java:111)
        at com.bea.netuix.servlets.controls.content.NetuiContent.raiseScopedAction(NetuiContent.java:181)
        at com.bea.netuix.servlets.controls.content.NetuiContent.raiseScopedAction(NetuiContent.java:167)
        at com.bea.netuix.servlets.controls.content.NetuiContent.handlePostbackData(NetuiContent.java:225)
        at com.bea.netuix.nf.ControlLifecycle$2.visit(ControlLifecycle.java:180)
        at com.bea.netuix.nf.ControlTreeWalker.walkRecursive(ControlTreeWalker.java:324)
        at com.bea.netuix.nf.ControlTreeWalker.walkRecursive(ControlTreeWalker.java:334)
        at com.bea.netuix.nf.ControlTreeWalker.walkRecursive(ControlTreeWalker.java:334)
        at com.bea.netuix.nf.ControlTreeWalker.walkRecursive(ControlTreeWalker.java:334)
        at com.bea.netuix.nf.ControlTreeWalker.walkRecursive(ControlTreeWalker.java:334)
        at com.bea.netuix.nf.ControlTreeWalker.walkRecursive(ControlTreeWalker.java:334)
        at com.bea.netuix.nf.ControlTreeWalker.walkRecursive(ControlTreeWalker.java:334)
        at com.bea.netuix.nf.ControlTreeWalker.walkRecursive(ControlTreeWalker.java:334)
        at com.bea.netuix.nf.ControlTreeWalker.walkRecursive(ControlTreeWalker.java:334)
        at com.bea.netuix.nf.ControlTreeWalker.walkRecursive(ControlTreeWalker.java:334)
        at com.bea.netuix.nf.ControlTreeWalker.walkRecursive(ControlTreeWalker.java:334)
        at com.bea.netuix.nf.ControlTreeWalker.walkRecursive(ControlTreeWalker.java:334)
        at com.bea.netuix.nf.ControlTreeWalker.walkRecursive(ControlTreeWalker.java:334)
        at com.bea.netuix.nf.ControlTreeWalker.walkRecursive(ControlTreeWalker.java:334)
        at com.bea.netuix.nf.ControlTreeWalker.walkRecursive(ControlTreeWalker.java:334)
        at com.bea.netuix.nf.ControlTreeWalker.walkRecursive(ControlTreeWalker.java:334)
        at com.bea.netuix.nf.ControlTreeWalker.walkRecursive(ControlTreeWalker.java:334)
        at com.bea.netuix.nf.ControlTreeWalker.walkRecursive(ControlTreeWalker.java:334)
        at com.bea.netuix.nf.ControlTreeWalker.walkRecursive(ControlTreeWalker.java:334)
        at com.bea.netuix.nf.ControlTreeWalker.walkRecursive(ControlTreeWalker.java:334)
        at com.bea.netuix.nf.ControlTreeWalker.walkRecursive(ControlTreeWalker.java:334)
        at com.bea.netuix.nf.ControlTreeWalker.walkRecursive(ControlTreeWalker.java:334)
        at com.bea.netuix.nf.ControlTreeWalker.walk(ControlTreeWalker.java:130)
        at com.bea.netuix.nf.Lifecycle.processLifecycles(Lifecycle.java:399)
        at com.bea.netuix.nf.Lifecycle.processLifecycles(Lifecycle.java:361)
        at com.bea.netuix.nf.Lifecycle.processLifecycles(Lifecycle.java:352)
        at com.bea.netuix.nf.Lifecycle.runInbound(Lifecycle.java:184)
        at com.bea.netuix.nf.Lifecycle.run(Lifecycle.java:159)
        at com.bea.netuix.servlets.manager.UIServlet.runLifecycle(UIServlet.java:465)
        at com.bea.netuix.servlets.manager.UIServlet.doPost(UIServlet.java:291)
        at com.bea.netuix.servlets.manager.UIServlet.service(UIServlet.java:219)
        at com.bea.netuix.servlets.manager.SingleFileServlet.service(SingleFileServlet.java:275)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
        at com.bea.console.utils.MBeanUtilsInitSingleFileServlet.service(MBeanUtilsInitSingleFileServlet.java:64)
        at weblogic.servlet.AsyncInitServlet.service(AsyncInitServlet.java:125)
        at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:286)
        at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:260)
        at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:137)
        at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:350)
        at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:25)
        at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:78)
        at com.bea.console.internal.ParamFilter.doFilter(ParamFilter.java:38)
        at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:78)
        at weblogic.servlet.internal.RequestEventsFilter.doFilter(RequestEventsFilter.java:32)
        at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:78)
        at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.wrapRun(WebAppServletContext.java:3701)
        at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3667)
        at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:326)
        at weblogic.security.service.SecurityManager.runAsForUserCode(SecurityManager.java:197)
        at weblogic.servlet.provider.WlsSecurityProvider.runAsForUserCode(WlsSecurityProvider.java:203)
        at weblogic.servlet.provider.WlsSubjectHandle.run(WlsSubjectHandle.java:71)
        at weblogic.servlet.internal.WebAppServletContext.doSecuredExecute(WebAppServletContext.java:2443)
        at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2291)
        at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2269)
        at weblogic.servlet.internal.ServletRequestImpl.runInternal(ServletRequestImpl.java:1703)
        at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1663)
        at weblogic.servlet.provider.ContainerSupportProviderImpl$WlsRequestExecutor.run(ContainerSupportProviderImpl.java:272)
        at weblogic.invocation.ComponentInvocationContextManager._runAs(ComponentInvocationContextManager.java:352)
        at weblogic.invocation.ComponentInvocationContextManager.runAs(ComponentInvocationContextManager.java:337)
        at weblogic.work.LivePartitionUtility.doRunWorkUnderContext(LivePartitionUtility.java:57)
        at weblogic.work.PartitionUtility.runWorkUnderContext(PartitionUtility.java:41)
        at weblogic.work.SelfTuningWorkManagerImpl.runWorkUnderContext(SelfTuningWorkManagerImpl.java:644)
        at weblogic.work.ExecuteThread.execute(ExecuteThread.java:415)
        at weblogic.work.ExecuteThread.run(ExecuteThread.java:355)
Caused by: java.lang.ClassNotFoundException: com.xyz.abc.runtime.debugger.DebuggerListener
        at weblogic.utils.classloaders.GenericClassLoader.findLocalClass(GenericClassLoader.java:1029)
        at weblogic.utils.classloaders.GenericClassLoader.findClass(GenericClassLoader.java:990)
        at weblogic.utils.classloaders.GenericClassLoader.doFindClass(GenericClassLoader.java:611)
        at weblogic.utils.classloaders.GenericClassLoader.loadClass(GenericClassLoader.java:543)
        at weblogic.utils.classloaders.GenericClassLoader.loadClass(GenericClassLoader.java:496)
        at weblogic.utils.classloaders.GenericClassLoader.loadClass(GenericClassLoader.java:473)
        at java.lang.ClassLoader.defineClass1(Native Method)
        at java.lang.ClassLoader.defineClass(ClassLoader.java:763)
        at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
        at weblogic.utils.classloaders.GenericClassLoader.defineClassInternal(GenericClassLoader.java:1113)
        at weblogic.utils.classloaders.GenericClassLoader.defineClass(GenericClassLoader.java:1046)
        at weblogic.utils.classloaders.GenericClassLoader.findLocalClass(GenericClassLoader.java:1038)
        at weblogic.utils.classloaders.GenericClassLoader.findClass(GenericClassLoader.java:990)
        at weblogic.utils.classloaders.GenericClassLoader.doFindClass(GenericClassLoader.java:611)
        at weblogic.utils.classloaders.GenericClassLoader.loadClass(GenericClassLoader.java:543)
        at weblogic.utils.classloaders.GenericClassLoader.loadClass(GenericClassLoader.java:496)
        at weblogic.utils.classloaders.GenericClassLoader.loadClass(GenericClassLoader.java:473)
        at java.lang.Class.forName0(Native Method)
        at java.lang.Class.forName(Class.java:348)
        at weblogic.j2ee.wsee.compiler.WSEEModuleHelper.loadAndAppendOtherLinks(WSEEModuleHelper.java:164)
        at weblogic.j2ee.wsee.compiler.WSEEModuleHelper.processAnnotations(WSEEModuleHelper.java:186)
        at weblogic.wsee.tools.WSEEEJBToolsModuleExtension.processAnnotations(WSEEEJBToolsModuleExtension.java:121)
        at weblogic.wsee.tools.WSEEEJBToolsModuleExtension.merge(WSEEEJBToolsModuleExtension.java:87)
        at weblogic.application.compiler.flow.MergeModuleFlow.compile(MergeModuleFlow.java:44)
        at weblogic.application.compiler.FlowDriver$FlowStateChange.next(FlowDriver.java:70)
        at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:45)
        at weblogic.application.compiler.FlowDriver.nextState(FlowDriver.java:37)
        at weblogic.application.compiler.BaseMerger.merge(BaseMerger.java:20)
        at weblogic.application.compiler.flow.AppMergerFlow.mergeInput(AppMergerFlow.java:75)
        at weblogic.application.compiler.flow.AppMergerFlow.compile(AppMergerFlow.java:40)
        at weblogic.application.compiler.FlowDriver$FlowStateChange.next(FlowDriver.java:70)
        at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:45)
        at weblogic.application.compiler.FlowDriver.nextState(FlowDriver.java:37)
        ... 116 more

我错过了什么吗?

1 个答案:

答案 0 :(得分:0)

只是回答其他人,以便他们能够快速完成这项工作。如果打包共享库,则WAR只能被其他WAR引用而不是EAR。所以我将我的包更新为EAR。正如我上面所说的,我想分享我的libs,这些是POJO,我必须使用以下结构,我的EAR能够成功地看到类。

    LIB1.ear
    META-INF
        application.xml
        weblogic-application.xml
        MANIFEST.MF
    APP-INF
        lib
            *.jar (all pojo's here and WebLogic will add these into Application Classpath)
    dummyejb-1.0.0.jar  (just so that I can deploy this ear in server otherwise it won't continue)