webspherewebsphere-7perf4j

Perf4j on Websphere 7?


I'm trying to deploy an EAR to our Websphere Application Server version 7 (exactly 7.0.0.17). The previous version worked fine, I'm just trying to add some profiling details in our logs using Perf4j.

It fails to install, with the following exception in its log:

com.ibm.ws.exception.RuntimeWarning: java.lang.TypeNotPresentException: Type org.perf4j.log4j.aop.EjbTimingAspect not present
    at com.ibm.ws.metadata.ejb.EJBMDOrchestrator.processBean(EJBMDOrchestrator.java:1357)
    at com.ibm.ws.runtime.component.EJBContainerImpl.startModule(EJBContainerImpl.java:2618)
    at com.ibm.ws.runtime.component.EJBContainerImpl.start(EJBContainerImpl.java:3826)
    [....snip...snip...]
Caused by: java.lang.TypeNotPresentException: Type org.perf4j.log4j.aop.EjbTimingAspect not present
    at com.ibm.oti.reflect.AnnotationHelper$AnnotationInvocationHandler.invoke(AnnotationHelper.java:131)
    at $Proxy27.value(Unknown Source)
    at com.ibm.ws.metadata.ejb.InterceptorMetaDataFactory.addMethodLevelInterceptors(InterceptorMetaDataFactory.java:1263)
    at com.ibm.ws.metadata.ejb.InterceptorMetaDataFactory.updateEJBMethodInfoInterceptorProxies(InterceptorMetaDataFactory.java:1384)
    at com.ibm.ws.metadata.ejb.InterceptorMetaDataFactory.createInterceptorMetaData(InterceptorMetaDataFactory.java:410)
    at com.ibm.ws.metadata.ejb.EJBMDOrchestrator.initializeInterceptorMD(EJBMDOrchestrator.java:6924)
    at com.ibm.ws.metadata.ejb.EJBMDOrchestrator.finishBMDInit(EJBMDOrchestrator.java:1761)
    at com.ibm.ws.metadata.ejb.EJBMDOrchestrator.processBean(EJBMDOrchestrator.java:1346)
    ... 48 more
Caused by: java.lang.ClassNotFoundException: org.perf4j.log4j.aop.EjbTimingAspect
    at com.ibm.oti.reflect.AnnotationHelper.getReturnValueForEntry(Native Method)
    at com.ibm.oti.reflect.AnnotationHelper.access$000(AnnotationHelper.java:16)
    at com.ibm.oti.reflect.AnnotationHelper$AnnotationInvocationHandler.invoke(AnnotationHelper.java:129)
    ... 55 more

The class org.perf4j.log4j.aop.EjbTimingAspect is part of the Perf4j jar, and it is added to the EAR (checked and confirmed).

Of course, as usual with Websphere, I suspect a classloading problem (our application uses parent first, and changing that is not an option as it caused several problems in the past), but can't find anything on forums or Google.

Does anyone have any idea what might be wrong? Noone? Come on, I'm sure I'm not the only one to have this problem!


Solution

  • Ok, finally found an answer to that. It looks like adding the dependencies on the EJB layer POM was not enough, they also need to be in the internal application (WAR file), although I'm using the class only in the EJB layer...

    Oh well, Websphere internal magic again.