当前位置: 首页 > 知识库问答 >
问题:

WebLogic中的JEE共享库

江飞章
2023-03-14

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

我为这两个选择了一个耳朵包装,比如Lib1。ear和Lib2。ear包含APP-INF/lib目录,两个目录中都有100个JAR。我还更新了清单。两者的MF包含规范版本和实现版本。两者都已成功部署并可供使用。

现在,我更新了包含EJB和MDB的ear,并在weblogic应用程序中添加了以下内容。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等)时,它在第一步就失败了,抱怨它没有找到一个接口,该接口是在Lib1.ear共享库中定义和打包的,因为我的一个EJB实现了这一点。我已经启用了调试日志,但是我无法从WebLogic中找到任何信息来引导我到正确的路径。我所有的EJB都使用远程名称etc初始化,但是我的日志中出现了一行错误,然后是ClassNotes Exception

<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个答案

杨飞飙
2023-03-14

只是为了替别人负责,这样他们就能很快完成这件事。如果将共享库打包为WAR,则只能由其他WAR而不是EAR引用。所以我把我的软件包升级为EAR。如上所述,我想分享我的LIB,这是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)
 类似资料:
  • 我有十几个ear文件,它们为部署为weblogic中的企业应用程序的每个组件加载相同的JAR集。。。我想将这些依赖项移动到“共享库”(可选包)jar文件。我已经完成了将这些工件移动到jar文件的后续工作,并添加了清单。MF,扩展名为 http://docs.oracle.com/cd/E12840_01/wls/docs103/programming/libraries.html 现在我需要将这个

  • 问题内容: 我正在从python脚本中调用一个so文件。据我了解,我真的不需要释放使用ctypes在python中打开的共享库。但是,在我的so文件代码中,它dlopen另一个so文件并且不执行dlclose()。在这种情况下,从python端使用安全吗?我不必释放在ctypes内部加载的共享库soe文件吗? 问题答案: 始终遵循 “自己清洁后清理 ”的规则(尽管现代技术会为您提供清洁方面的帮助)

  • 问题内容: 是否可以使用Go创建共享库(.so)? 更新 :为此创建了一个“ 问题 ”。 问题答案: 现在可以使用标志 您需要做的是首先运行以下命令: (以上代码使所有通用软件包都可共享!)然后 最后,在编译代码时,您需要运行: 上面这些就是什么,而不是静态链接所有内容而仅动态链接它们,您最终将获得更小的编译文件。为了让您了解我的带有静态链接的“ hello.go”文件为2.3MB,而使用动态链接

  • 库用于将相似函数打包在一个单元中。然后这些单元就可为其他开发人员所共享,并因此有了模块化编程这种说法— 即,从模块中构建程序。Linux支持两种类型的库,每一种库都有各自的优缺点。静态库包含在编译时静态绑定到一个程序的函数。动态库则不同,它是在加载应用程序时被加载的,而且它与应用程序是在运行时绑定的。 使用共享库的方法有两种:您既可以在运行时动态链接库,也可以动态加载库并在程序控制之下使用它们。本

  • } 在另一边我有一个听众 类TrafficListener{ public static void watchNewTraffic() {//在出现新流量时执行某些操作}} 我发现有Observer和Observable,但我需要实现Observer的方法,我发现Propertychangelistener在我的情况下是没用的,因为我有静态方法

  • 我只是简单地从网络获取数据包,并在一个线程中将它们排队,然后在另一个线程中使用此数据包(取消排队)。 所以我决定使用boost库来创建一个基于https://www.quantnet.com/cplusplus-multithreading-boost/ 问题是,虽然没有得到任何数据,但Dequeue()方法会阻塞我的使用者线程,当我想终止使用者线程时,有时我无法结束或停止它。 结束Dequeue