jar文件位置-耳文件或服务器lib文件夹? [英] jar file location - ear file or server lib folder?

查看:134
本文介绍了jar文件位置-耳文件或服务器lib文件夹?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在将应用程序部署到JBoss服务器时,对于像ojdbc14.jar(Oracle JDBC)这样的JAR,最好将这个jar包含在部署的耳文件中,还是应该将其部署到JBoss的服务器/default/lib中文件夹?

When deploying an application to JBoss server, for a JAR like ojdbc14.jar (Oracle JDBC), is it better to include this jar in the ear file of the deployment, or should it be deployed to JBoss's server/default/lib folder?

我得到的论据是应用程序需要支持全局事务,因此必须在应用程序服务器级别定义数据源(例如,复制到服务器/default/lib文件夹),以便可以与其他应用程序服务器进行通信,为此,您需要应用服务器级别的驱动程序.

The argument I've been given is that the application needs to support global transactions, hence the datasource must be defined at the application server level (e.g. copied to server/default/lib folder) so it can talk to other app servers, and for that to happen you need the drivers at the app server level.

我想听听什么是正确的方法.谢谢.

I'd like to hear what is the correct approach here. Thanks.

推荐答案

我相信这是正确的方法.

I believe this is the correct approach.

通常,您将根据使用的应用程序服务器,使用适当的配置文件在应用程序外部(EAR/WAR外部)定义数据源.在JBoss上,通常将配置添加到XML文件中,而使用WebLogic,则可以直接使用管理控制台创建数据源.

You will typically define your datasource outside of your application (outside of your EAR/WAR) using the appropriate configuration files depending upon the application server you are using. Whereas on JBoss, you usually add your configuration to XML files, with WebLogic, you can create a datasource directly using the Admin console.

鉴于此数据源将在服务器启动时创建,因此必需的库(在您的情况下为ojdbc14.jar)必须在应用程序服务器的类路径上可用.

Given that this datasource will be created on server startup, the necessary libraries (in your case, ojdbc14.jar) must be available on the classpath of the application server.

我还遇到了许可问题,使用第三方库阻止您将其捆绑在应用程序中.

I have also come across licensing issues where the use of a 3rd party library prevents you from bundling it within your application.

此外,在应用程序外部定义数据源意味着在需要更改数据源配置时不必执行重建.

Also, defining your datasource outside of your application means you do not have to perform a rebuild when the datasource configuration needs to change.

这篇关于jar文件位置-耳文件或服务器lib文件夹?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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