Eclipse 控制台未显示任何错误/日志输出 [英] Eclipse console not showing any error/log output

查看:52
本文介绍了Eclipse 控制台未显示任何错误/日志输出的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用 Eclipse Kepler 并且我正在 Jboss EAP 6.1 中运行 Java Web 应用程序.今天早上我注意到在部署和运行我的网络应用程序后没有控制台输出.

I am using Eclipse Kepler and i am running Java Web application in Jboss EAP 6.1 . Today morning i noticed after deploying and running my web application no console output is coming.

但是控制台输出显示我何时启动 Jboss 及其显示所有应用程序部署的所有内容等.但之后控制台中没有打印任何内容.

But console output showing when i am starting Jboss and its show everything which all application deployed etc. But after that nothing is printing in console .

有人可以告诉我是什么原因导致我尝试了在 Stackoverflow 中发布的不同 -2 问题中提到的大量内容.

Can someone please guild me what can be cause i tried plenty of thing mentioned in different -2 question posted in Stackoverflow.

更新:-

我试过下面的代码

public class test {

  public static void main(String arg[]){
    System.out.println("hariom");
  }
}

及其在控制台中打印的结果,但是当我部署和运行 Web 应用程序时,它没有显示任何内容.

and its result printing in console but when i am deploying and running web application then only its not showing anything.

推荐答案

问题将通过在您的服务器中添加以下 VM 参数来解决

Issue will fix with adding following VM argument in your server

请转到<代码>Eclipse->服务器选项卡->点击 Open Launch Configuration -> VM arguments

并在VM参数部分添加此参数

And add this argument in VM argument section

-Dorg.jboss.as.logging.per-deployment=false

在此链接中提供有关该问题的更多详细信息

Here in this link more and detail about the issue

在阅读了该线程中所说的内容后,我正在尝试总结每个部署标志的使用:

After reading what has been said in this thread, I'm trying to summarize the use of the per-deployment flag:

1.0 当 per-deployment 为 true(默认)时:

1.0 When per-deployment is true (default):

1.1 AS7.1.2 正在扫描您的部署 (WAR) 中的日志配置文件,如果找到配置文件,则部署将获得自己的日志上下文并通过配置文件.

1.1 AS7.1.2 is scanning for logging configuration files in your deployment (WAR), If a configuration file is found then that deployment will get its own log context and be configured via the configuration file.

1.2 找到属性文件后,将读取该文件并将应用程序日志记录到指定要记录的任何位置(带有相应的处理程序).

1.2 Once the properties file is found, it will be read and the application logging will go to wherever it has been specified to log (with the corresponding handler).

1.3 日志 jar 不需要包含在应用程序中.

1.3 Logging jars don't need to be included with the application.

2.0 将该标志设置为 false 会禁用此功能,并且部署扫描程序将不会查找这些文件.因此:

2.0 Setting the flag to false disables this feature, and the deployment scanner will not look for these files. Therefore:

2.1 您必须使用 jboss-deployment-structure.xml 来排除您正在使用的 AS 服务器的日志依赖项并将它们包含在您的部署.

2.1 You have to use the jboss-deployment-structure.xml to exclude the AS server's logging dependencies you are using and include them into your deployment.

2.2 日志功能由应用程序决定.应用程序应具有所有配置文件和所需的库(这就是为什么必须排除服务器的库)

2.2 Logging functionality is left up to the application. The application should have all the configuration files and required libraries (That's why the server's libraries have to be excluded)

2.3 例如,如果应用程序有一个 log4j.xml 但没有 log4j 依赖项.应用程序将停止记录.

2.3 If the application had, for example, a log4j.xml but no log4j dependency. The application will stop logging.

就个人而言,当我使用 -Dorg.jboss.as.logging.per-deployment=false 时我在部署过程中遇到缺少依赖项错误,以便它在控制台中显示缺失类的堆栈跟踪.否则我们在 AS7 的控制台(和 server.log)中得到的唯一错误是:具有缺失/不可用依赖项的服务这不容易追踪缺失的依赖.

Personally, I'm using -Dorg.jboss.as.logging.per-deployment=false when I get missing dependencies errors at during deployment so that it displays in the console the stack trace for the missing class. Otherwise the only error we get in AS7's console (and server.log) is: Services with missing/unavailable dependencies Which does not make it easy to track down the missing dependency.

这篇关于Eclipse 控制台未显示任何错误/日志输出的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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