How to deploy EAR application twice on WebLogic se

2019-06-12 15:12发布

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条回答
Evening l夕情丶
2楼-- · 2019-06-12 15:44

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.

查看更多
登录 后发表回答