在 glassfish 上使用 SLF4J、logback 和本机休眠的 Maven EAR 项目

发布于 2024-11-24 02:45:57 字数 232 浏览 7 评论 0原文

我的项目非常简单。我想要一个标准的ear项目,它支持slf4j并以logback作为实现。我的主要问题是,配置文件未使用,并且我从 xerces 打印到控制台的调试信息。 我认为 Ear 文件存在一个主要的类路径问题,因为作为 war 的项目运行良好。我已经将 logback.xml 放入每个根目录,但它不起作用。我还遇到了找不到 hibernate.cfg.xml 文件的问题。谁能给我一些提示,甚至提供一个耳朵样本吗? 我用的是GF 3.1.1

My project is pretty simple. i want a standard ear-project which supports slf4j with logback as implementation. my main problem is, that the config file is not used and i get debug info printed out to the console from xerces.
There is a major classpath problem with ear files i think, because the project as war runs fine. i have already put the logback.xml to every root dir, but it does not work. I had also had the problem that the hibernate.cfg.xml file could not be found. could anyone give me a tip or even provide a sample ear?
I am using GF 3.1.1

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

尤怨 2024-12-01 02:45:57

我相信对于 WAR 和 EJB,如果您不需要更轻松地访问它们,配置文件应该位于各自 jar 的 META-INF 中。

如果您需要更轻松地访问它们,解决方案是依赖于应用程序服务器的。对于您的情况,请查看 GlassFish 类加载器层次结构文档。我不是玻璃渔民,所以我只能向您指出文档。

I believe that for both WAR and EJB, config files should be in META-INF of their respective jar, if you don't need easier access to them.

If you need easier access to them, the solution is app-server-dependent. In your case, look at the "application" entry in the table in the GlassFish classloader hierarchy doc. I'm not a glassfisherman, so I can only point you at the docs.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文