在一个爆炸的EJB模块中放置一个.jar文件的位置 [英] Where to put a .jar file in an exploded EJB module

查看:207
本文介绍了在一个爆炸的EJB模块中放置一个.jar文件的位置的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在部署一个JMS模块,与servlet应用程序一起工作。当我在编写(并测试和重写)我的模块时,模块不存储在JAR文件中;它是一个分解目录,加倍为Eclipse项目目录。 (在生产环境中,它将在一个jar中。)

I am deploying a JMS module to work alongside a servlet application. While I am writing (and testing and rewriting) my module, the module is not stored in a JAR file; it is in an exploded directory doubling as an Eclipse project directory. (In the production environment, it will be in a jar.)

我的JMS模块使用log4j进行日志记录。我的问题是:我在哪里放置log4j.jar文件,以便我的EJB可以找到它?我尝试过各种位置,包括名为lib /的目录,但似乎没有任何效果。 (我可以告诉Eclipse在十几个地方找到它)。我最终诉诸于将其放在服务器域的lib目录(domains / my_domain / lib)中,这个目录适用于我的JMS模块,但是搞砸了我的servlet模块访问数据源 - 我不断得到NotSerializableException。

My JMS module does logging with log4j. My question is: where do I put the log4j.jar file so my EJB can find it? I tried various locations, including a directory named lib/, but nothing seemed to work. (I could tell Eclipse to find it in any of half a dozen places.) I eventually resorted to putting it in the server domain lib directory (domains/my_domain/lib), which worked for my JMS module, but messed up my servlet module's access to the data sources - I kept getting a NotSerializableException.

如果有任何区别,我使用Eclipse(Juno)来开发Weblogic 10.3.5来运行并且测试。

If it makes any difference, I'm using Eclipse (Juno) to develop, Weblogic 10.3.5 to run and test.

谢谢。

推荐答案

其实没有无论您的罐子是否爆炸,都有很大的区别。主要的是你需要你的类库中的库。您需要在清单文件中指定jar位置:

In fact there is not so much difference whether your jar is exploded or not. The main thing is that you need your libraries on classpath. You need to specify jar location in your manifest file:

Class-Path: lib/log4j.jar

您可以使用这个 Oracle文档供参考。

You can use this Oracle documentation for reference.

这篇关于在一个爆炸的EJB模块中放置一个.jar文件的位置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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