Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
379 views
in Technique[技术] by (71.8m points)

java - 由以下原因引起:java.lang.NoClassDefFoundError:XPages中的org / apache / log4j / Logger(Caused by: java.lang.NoClassDefFoundError: org/apache/log4j/Logger in XPages)

In our XPages project now we have to use Quartz Scheduler.

(现在,在我们的XPages项目中,我们必须使用Quartz Scheduler。)

I've tried to import all necessary jars which includes the following:

(我尝试导入所有必需的jar,其中包括以下内容:)

  • c3p0-0.9.5.2

    (c3p0-0.9.5.2)

  • log4j-1.2.16.jar

    (log4j-1.2.16.jar)

  • quartz-2.3.0-SNAPSHOT.jar

    (石英2.3.0-SNAPSHOT.jar)

  • quartz-jobs-2.3.0-SNAPSHOT.jar

    (石英作业2.3.0-SNAPSHOT.jar)

  • slf4j-api-1.7.7.jar

    (slf4j-api-1.7.7.jar)

  • slf4j-log4j12-1.7.7.jar

    (slf4j-log4j12-1.7.7.jar)

I've imported all the jars to our project but when loading a page (which doesn't even call quartz or anything) I get the following exception:

(我已将所有罐子导入到我们的项目中,但是在加载页面(甚至不调用石英或任何东西)时,出现以下异常:)

Error 500
HTTP Web Server: Command Not Handled Exception

In a log I see:

(在日志中,我看到:)

01.12.19 2:04: Exception Thrown
java.lang.RuntimeException: com.ibm.xsp.FacesExceptionEx: org.apache.commons.logging.LogConfigurationException: java.lang.reflect.InvocationTargetException
    at com.ibm.designer.runtime.domino.adapter.ComponentModule.initModule(ComponentModule.java:473)
    at com.ibm.domino.xsp.module.nsf.NSFComponentModule.initModule(NSFComponentModule.java:498)
    at com.ibm.domino.xsp.module.nsf.NSFService.createNSFModule(NSFService.java:752)
    at com.ibm.domino.xsp.module.nsf.NSFService.loadModule(NSFService.java:735)
    at com.ibm.domino.xsp.module.nsf.NSFService.doServiceInternal(NSFService.java:588)
    at com.ibm.domino.xsp.module.nsf.NSFService.doService(NSFService.java:482)
    at com.ibm.designer.runtime.domino.adapter.LCDEnvironment.doService(LCDEnvironment.java:357)
    at com.ibm.designer.runtime.domino.adapter.LCDEnvironment.service(LCDEnvironment.java:313)
    at com.ibm.domino.xsp.bridge.http.engine.XspCmdManager.service(XspCmdManager.java:272)
Caused by: com.ibm.xsp.FacesExceptionEx: org.apache.commons.logging.LogConfigurationException: java.lang.reflect.InvocationTargetException
    at com.ibm.xsp.config.CLBootStrap.initContext(CLBootStrap.java:89)
    at com.ibm.xsp.config.BootStrap.init(BootStrap.java:82)
    at com.ibm.xsp.config.ConfigureCoreListener.contextInitialized(ConfigureCoreListener.java:39)
    at com.ibm.designer.runtime.domino.adapter.ComponentModule.initModule(ComponentModule.java:465)
    ... 8 more
Caused by: org.apache.commons.logging.LogConfigurationException: java.lang.reflect.InvocationTargetException
    at org.apache.commons.logging.impl.LogFactoryImpl.newInstance(LogFactoryImpl.java:532)
    at org.apache.commons.logging.impl.LogFactoryImpl.getInstance(LogFactoryImpl.java:272)
    at org.apache.commons.logging.LogFactory.getLog(LogFactory.java:414)
    at org.apache.commons.digester.Digester.<init>(Digester.java:346)
    at com.sun.faces.config.ConfigureListener.digester(ConfigureListener.java:1005)
    at com.sun.faces.config.ConfigureListener.contextInitialized(ConfigureListener.java:383)
    at com.ibm.xsp.config.CLBootStrap.initContext(CLBootStrap.java:81)
    ... 11 more
Caused by: java.lang.reflect.InvocationTargetException
    at sun.reflect.GeneratedConstructorAccessor1791.newInstance(Unknown Source)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:57)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:437)
    at org.apache.commons.logging.impl.LogFactoryImpl.newInstance(LogFactoryImpl.java:525)
    ... 17 more
Caused by: java.lang.NoClassDefFoundError: org/apache/log4j/Logger
    at org.apache.commons.logging.impl.Log4JLogger.<init>(Log4JLogger.java:102)
    ... 21 more

I suspect that this problem is related to Axis 1.4 log4j-1.2.8.jar incompatible with XPages?

(我怀疑此问题与与XPages不兼容的Axis 1.4 log4j-1.2.8.jar有关吗?)

I've tried to follow the advice and added the following to java.policy (section grant codeBase):

(我尝试遵循建议,并将以下内容添加到java.policy (部分授予codeBase):)

permission java.lang.RuntimePermission "setContextClassLoader";
permission java.lang.reflect.ReflectPermission "suppressAccessChecks";

But still with no luck.

(但是仍然没有运气。)

What's the problem?

(有什么问题?)

Thanks in advance

(提前致谢)

  ask by Rus9Mus9 translate from so

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

I've resolved the issue by adding all logging libraries:

(我通过添加所有日志记录库解决了该问题:)

  • log4j-1.2.16.jar

    (log4j-1.2.16.jar)

  • slf4j-api-1.7.7.jar

    (slf4j-api-1.7.7.jar)

  • slf4j-log4j12-1.7.7.jar

    (slf4j-log4j12-1.7.7.jar)

to lib/ext

(到lib / ext)


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...