Glassfish 3 + ear + logback.xml [英] Glassfish 3 + ear + logback.xml

查看:174
本文介绍了Glassfish 3 + ear + logback.xml的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在包含JAR(ejb)和WAR的EAR文件中使用logback。这应该在Glassfish v3服务器上运行。一切正常,除了加载logback.xml。这找不到。
我使用Netbeans构建项目。使用的外部库位于EAR的lib目录中(它们应该没有什么区别)。我已经计划将logback.xml文件放入根目录或EAR中的另一个子目录中。类路径设置在JAR和WAR的Manifest-Files中。但是由于某些原因logback.xml没有找到...(构建耳包含logback.xml;))

我试过了每个位置的logback.xml。即使在WAR或JAR中也是如此。没有任何工作......



如果我使用独立的WAR,那么一切正常,找到logback.xml。 (OK,不是所有的,改变Manifest中的类路径不起作用...)

所以我的问题:是否有人已经让logback.xml运行在耳?



这是我的Manifest(我希望这是正确的语法):

  Manifest-Version:1.0 
Ant-Version:Apache Ant 1.8.2
创建者:1.7.0_147-icedtea-b147(甲骨文公司)
类路径: ./

希望有人能帮助我。



Regards

解决方案

我解决了这个问题,我部署在EAR内部展开(使用Maven和一个分离的模块config.jar)。
实际上,logback.xml被插入到lib / config.jar / logback.xml中。


I'm using logback in an EAR-File which contains a JAR (ejb) and a WAR. This should run on a Glassfish v3 Server. Everything works, except the loading of the logback.xml. This can't be found. I build the Project with Netbeans. The used external libs are in the lib-Directory of the EAR (Which shouldn't make a difference where they are...). I've planed to put the logback.xml-File in the root-Directory or another Subdirectory in the EAR. The Classpath is set in the Manifest-Files of the JAR and WAR. But for some Reasons the logback.xml wasn't found... (The build ear contains the logback.xml ;) )

I've tryied every location of the logback.xml. Even in the WAR or JAR. Nothing worked...

If I use a standalone WAR then everything works fine and the logback.xml was found. (OK. Not everything. Changing the Classpath in the Manifest doesn't work...)

So my Question: Has anybody already get logback.xml to run within an EAR?

Here is my Manifest (I hope, that this ist the correct Syntax):

Manifest-Version: 1.0 
Ant-Version: Apache Ant 1.8.2 
Created-By: 1.7.0_147-icedtea-b147 (Oracle Corporation) 
Class-Path: ./ 

Hope someone can help me.

Regards

解决方案

I solved this problem creating a separated simple jar that I deploy exploded inside the EAR (using Maven and a separated module config.jar). In practice, the logback.xml was inserted in lib/config.jar/logback.xml

这篇关于Glassfish 3 + ear + logback.xml的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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