How to deploy EAR application twice on WebLogic server?

天大地大妈咪最大 提交于 2019-12-08 11:13:08

问题


What I have to do in order to deploy the same EAR application twice on single WebLogic server?

What I have in my application:

  • EJB layer (EJB 2.0)
  • WEB layer (Struts, jsp)
  • logging layer (log4j)
  • DB layer (Oracle, data source created in WLS)
  • WLS 10.3.0

What I need:

  • two instances of the same application on WLS (unique URL (context-root) per application), each instance should use other data source and should have different configuration

What is my problem? I don't know which things I will have to change in my application to achieve my goals:

  • configuration of the application bases on many properties files, these files are in one directory which is added to WLS classpath (they are not in EAR file)
  • many classes are static (all methods in class are static)
  • static logger instance in each class
  • what about JNDI object - should I have different names for data sources, session/entity beans, etc?
  • what about context-root and hyperlinks in jsp files?

EDIT

I need to have two different EAR files with unique names and unique context-roots. Each application will be connected to unique data source and will have unique configuration.

I have some questions regarding changes in my application:

  • what about static methods in my classes? WLS documentation says that each application receives its own classloader hierarchy. Should I be afraid of conflicts? I have statics in client part and in server (EJB) part.
  • what about EJB names? Should I have unique names per each application? Should I be afraid of conflicts in JNDI tree? I use lookup methods.
  • what about static loggers in my classes? Can I use prefer-application-packages tag in weblogic-application.xml to avoid conflicts?

Really thanks for help.


回答1:


I have same problem, first thing to do is to define new context root in application.xml and/or weblogic.xml file.

According to this answer: https://stackoverflow.com/a/9869744/3841109 you'll have to change persistence unit name also.

If I succeed with my problem I'll repost additional info...

Best regards.



来源:https://stackoverflow.com/questions/22694673/how-to-deploy-ear-application-twice-on-weblogic-server

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