如何在WebLogic服务器上部署EAR应用程序两次? [英] How to deploy EAR application twice on WebLogic server?

查看:152
本文介绍了如何在WebLogic服务器上部署EAR应用程序两次?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我在我的应用程序中有什么我要做的:为了在单个WebLogic服务器上部署相同的EAR应用程序两次?




  • EJB层(EJB 2.0)

  • WEB层(Struts,jsp)

  • 记录层(log4j)

  • DB层(Oracle,WLS中创建的数据源)

  • WLS 10.3.0



我需要什么:




  • WLS上同一个应用程序的两个实例(每个应用程序的唯一URL(上下文根)),每个实例应该使用其他数据源,应该有不同的配置



问题?我不知道我的应用程序中必须改变哪些东西才能实现我的目标:




  • 应用程序的配置基于许多属性文件,这些文件在一个目录中添加到WLS类路径(它们不在EAR文件中)

  • 许多类是静态的(类中的所有方法都是静态的)

  • 每个类中的静态记录器实例

  • JNDI对象 - 我应该有不同的数据源,会话/实体bean等的名称吗?

  • jsp文件中的上下文根和超链接如何?



编辑



我需要有两个不同的EAR文件,具有独特的名称和独特的上下文根。每个应用程序都将连接到唯一的数据源,并具有独特的配置。



我有一些关于我的应用程序更改的问题:




  • 我的类中的静态方法怎么样? WLS文档说每个应用程序都收到自己的类加载器层次结构。我应该害怕冲突吗?我有客户端和服务器(EJB)部分的静态。

  • EJB名称怎么样?每个应用程序应该有唯一的名称吗?我应该害怕JNDI树中的冲突吗?我使用查找方法。

  • 我的类中的静态记录器怎么样?我可以在 weblogic-application.xml 中使用 prefer-application-packages 标签来避免冲突吗?



真的很感谢您的帮助。

解决方案

同样的问题,首先要做的是在application.xml和/或weblogic.xml文件中定义新的上下文根。



根据这个答案:http://stackoverflow.com/a/9869744/3841109 ,您也必须更改持久性单位名称。



如果我成功与我的问题,我会转发额外的信息...



祝福。


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.

解决方案

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: http://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.

这篇关于如何在WebLogic服务器上部署EAR应用程序两次?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆