在 glassfish 上使用 SLF4J、logback 和本机休眠的 Maven EAR 项目
我的项目非常简单。我想要一个标准的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 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我相信对于 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.