websphere系统错误日志记录不包含堆栈跟踪

时间:2015-06-19 14:36:50

标签: hibernate jpa logging websphere

系统错误日志不包含堆栈跟踪

[19.06.15 18:21:11:887 MSK] 00000381 InjectionBind E   CWNEN0030E: В фабрике @PersistenceUnit возникла ошибка при получении объекта привязки primary для экземпляра объекта.  Сообщение об исключительной ситуации: [PersistenceUnit: primary] Unable to build EntityManagerFactory
[19.06.15 18:21:11:887 MSK] 00000381 ResourceInjec E   CWOWB0102E: Ошибка JCDI: Unable to obtain an instance for primary: javax.persistence.PersistenceException: [PersistenceUnit: primary] Unable to build EntityManagerFactory
[19.06.15 18:21:11:887 MSK] 00000381 ResourceInjec E   CWOWB0102E: Ошибка JCDI: Unable to obtain an instance for primary: javax.persistence.PersistenceException: [PersistenceUnit: primary] Unable to build EntityManagerFactory

非系统错误记录正常。我该如何解决? 使用WAS 8.5.5,JDK1.7,JPA 2.0,Hibernate 4.2.5 使用eclipse控制台观察日志。

log4j.properties:

#Default log level to ERROR. Other levels are INFO and DEBUG.
log4j.rootLogger=INFO, FILE, CONSOLE

#CONSOLE
log4j.appender.CONSOLE=org.apache.log4j.ConsoleAppender
log4j.appender.CONSOLE.layout=org.apache.log4j.PatternLayout
log4j.appender.CONSOLE.layout.ConversionPattern=%d{HH:mm:ss,SSS} %5p [%t.%F] - %m%n

#FILE
log4j.appender.FILE=org.apache.log4j.RollingFileAppender
log4j.appender.FILE.File=logs/moch.log
log4j.appender.FILE.MaxFileSize=1000KB
#Keep 5 old files around.
log4j.appender.FILE.MaxBackupIndex=5
log4j.appender.FILE.layout=org.apache.log4j.PatternLayout
#Format almost same as WebSphere's common log format.
log4j.appender.FILE.layout.ConversionPattern=[%d] %t %c %-5p - %m%n

#Optionally override log level of individual packages or classes
log4j.logger.ru.my=TRACE
log4j.logger.ru.my.snuil.moch=INFO
log4j.logger.org.hibernate=INFO

2 个答案:

答案 0 :(得分:2)

此错误由WebSphere Application Server本身打印,因此您的log4j设置不相关。错误消息似乎是一个可用性问题,因此您应该在使用IBM打开PMR时遇到问题,但您可以尝试使用must gather for CDI problems中的跟踪设置来查看是否提供了任何提示。如果没有,您可能需要从IBM获得帮助。

答案 1 :(得分:0)

WAS使用Java Util Logging进行内部日志记录,因此您的log4j配置不适用于此处。您可以启用详细的跟踪日志记录,并可能获得有关该问题的更多信息 - 请参阅Setting up a trace in WebSphere Application Server