How do I create a common component in Weblogic?

心已入冬 提交于 2019-12-13 15:29:02

问题


I want to build a common component that can be called from any deployed application. But I do not know how to do this? Is there a pattern for this?

For example,

If I deploy webservice #1, I want it to call a common application that is also deployed on the server. Then I add a new webservice #2, I also want this one to call the common application.

How can I do this? Any Ideas? Thanks


回答1:


You may deploy your shared component as a librarie as mentioned. In this case the other application would need to declare a dependence on this libraries in weblogic.xml . You can find detailed information on this at: http://download.oracle.com/docs/cd/E17904_01/web.1111/e13706/libraries.htm#WLPRG325

To use shared libraries you will need to understand classloading so this document will help you understand weblogic classloading and how you can share libraries when using weblogic: http://download.oracle.com/docs/cd/E17904_01/web.1111/e13706/classloading.htm#i1080994

Another option is using a Service approach, you can do this using EJBs or WebServices. EJBs are better for sharing services inside your corporation while WebServices are best suited for internet.




回答2:


Way 1: deploy the common component as a library. This is a vendor-specific way, but it works.

Way 2: drop common component into a classpath of the managed server(s).

Way 3: call common component via remote call, i.e. WS/SOAP.



来源:https://stackoverflow.com/questions/5664189/how-do-i-create-a-common-component-in-weblogic

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!