ALERT: Some images may not load properly within the Knowledge Base Article. If you see a broken image, please right-click and select 'Open image in a new tab'. We apologize for this inconvenience.

Java Standalone application not starting due to java.lang.NoClassDefFoundError

book

Article ID: 188714

calendar_today

Updated On:

Products

CA Application Performance Management SaaS

Issue/Introduction

An in house Java application do not start after injecting Application Performance Management Agent and throwing the below exception:

FATAL [SpringOsgiExtenderThread-4] (ServiceDynamicInterceptor.java:252) - Exception during service event handling java.lang.NoClassDefFoundError: com/wily/introscope/agent/AgentShim at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java) at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204) at $Proxy80.getServiceReference(Unknown Source) at org.springframework.osgi.service.importer.support.internal.aop.ServiceProviderTCCLInterceptor$ServiceProviderTCCLListener.bind(ServiceProviderTCCLInterceptor.java:51) at org.springframework.osgi.service.importer.support.internal.util.OsgiServiceBindingUtils.callListenersBind(OsgiServiceBindingUtils.java:50) at org.springframework.osgi.service.importer.support.internal.aop.ServiceDynamicInterceptor$Listener.serviceChanged(ServiceDynamicInterceptor.java:151) at org.springframework.osgi.util.OsgiListenerUtils.dispatchServiceRegistrationEvents(OsgiListenerUtils.java:113) at org.springframework.osgi.util.OsgiListenerUtils.addSingleServiceListener(OsgiListenerUtils.java:172) at org.springframework.osgi.util.OsgiListenerUtils.addSingleServiceListener(OsgiListenerUtils.java:140) at org.springframework.osgi.service.importer.support.internal.aop.ServiceDynamicInterceptor.afterPropertiesSet(ServiceDynamicInterceptor.java:464) at org.springframework.osgi.service.importer.support.OsgiServiceProxyFactoryBean.createProxy(OsgiServiceProxyFactoryBean.java:215) at org.springframework.osgi.service.importer.support.AbstractServiceImporterProxyFactoryBean.getObject(AbstractServiceImporterProxyFactoryBean.java:86) at org.springframework.osgi.service.importer.support.OsgiServiceProxyFactoryBean.getObject(OsgiServiceProxyFactoryBean.java:161) at org.springframework.beans.factory.support.FactoryBeanRegistrySupport$2.run(FactoryBeanRegistrySupport.java:133) at java.security.AccessController.doPrivileged(AccessController.java:314) at org.springframework.beans.factory.support.FactoryBeanRegistrySupport.doGetObjectFromFactoryBean(FactoryBeanRegistrySupport.java:131) at org.springframework.beans.factory.support.FactoryBeanRegistrySupport.getObjectFromFactoryBean(FactoryBeanRegistrySupport.java:102) at org.springframework.beans.factory.support.AbstractBeanFactory.getObjectForBeanInstance(AbstractBeanFactory.java:1454) at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:249) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194) at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:622) at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:932) at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext.access$1600(AbstractDelegatedExecutionApplicationContext.java:69) at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext$4.run(AbstractDelegatedExecutionApplicationContext.java:355) at org.springframework.osgi.util.internal.PrivilegedUtils.executeWithCustomTCCL(PrivilegedUtils.java:85) at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext.completeRefresh(AbstractDelegatedExecutionApplicationContext.java:320) at org.springframework.osgi.extender.internal.dependencies.startup.DependencyWaiterApplicationContextExecutor$CompleteRefreshTask.run(DependencyWaiterApplicationContextExecutor.java:132) at java.lang.Thread.run(Thread.java:770)
FATAL [SpringOsgiExtenderThread-4] (ServiceDynamicInterceptor.java:252) - Exception during service event handling java.lang.NoClassDefFoundError: com/wily/introscope/agent/AgentShim at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java) at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204) at $Proxy82.getServiceReference(Unknown Source) at org.springframework.osgi.service.importer.support.internal.aop.ServiceProviderTCCLInterceptor$ServiceProviderTCCLListener.bind(ServiceProviderTCCLInterceptor.java:51) at org.springframework.osgi.service.importer.support.internal.util.OsgiServiceBindingUtils.callListenersBind(OsgiServiceBindingUtils.java:50) at org.springframework.osgi.service.importer.support.internal.aop.ServiceDynamicInterceptor$Listener.serviceChanged(ServiceDynamicInterceptor.java:151) at org.springframework.osgi.util.OsgiListenerUtils.dispatchServiceRegistrationEvents(OsgiListenerUtils.java:113) at org.springframework.osgi.util.OsgiListenerUtils.addSingleServiceListener(OsgiListenerUtils.java:172) at org.springframework.osgi.util.OsgiListenerUtils.addSingleServiceListener(OsgiListenerUtils.java:140) at org.springframework.osgi.service.importer.support.internal.aop.ServiceDynamicInterceptor.afterPropertiesSet(ServiceDynamicInterceptor.java:464) at org.springframework.osgi.service.importer.support.OsgiServiceProxyFactoryBean.createProxy(OsgiServiceProxyFactoryBean.java:215) at org.springframework.osgi.service.importer.support.AbstractServiceImporterProxyFactoryBean.getObject(AbstractServiceImporterProxyFactoryBean.java:86) at org.springframework.osgi.service.importer.support.OsgiServiceProxyFactoryBean.getObject(OsgiServiceProxyFactoryBean.java:161) at org.springframework.beans.factory.support.FactoryBeanRegistrySupport$2.run(FactoryBeanRegistrySupport.java:133) at java.security.AccessController.doPrivileged(AccessController.java:314) at org.springframework.beans.factory.support.FactoryBeanRegistrySupport.doGetObjectFromFactoryBean(FactoryBeanRegistrySupport.java:131) at org.springframework.beans.factory.support.FactoryBeanRegistrySupport.getObjectFromFactoryBean(FactoryBeanRegistrySupport.java:102) at org.springframework.beans.factory.support.AbstractBeanFactory.getObjectForBeanInstance(AbstractBeanFactory.java:1454) at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:249) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194) at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:622) at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:932) at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext.access$1600(AbstractDelegatedExecutionApplicationContext.java:69) at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext$4.run(AbstractDelegatedExecutionApplicationContext.java:355) at org.springframework.osgi.util.internal.PrivilegedUtils.executeWithCustomTCCL(PrivilegedUtils.java:85) at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext.completeRefresh(AbstractDelegatedExecutionApplicationContext.java:320) at org.springframework.osgi.extender.internal.dependencies.startup.DependencyWaiterApplicationContextExecutor$CompleteRefreshTask.run(DependencyWaiterApplicationContextExecutor.java:132) at java.lang.Thread.run(Thread.java:770)
FATAL [SpringOsgiExtenderThread-4] (ServiceDynamicInterceptor.java:252) - Exception during service event handling java.lang.NoClassDefFoundError: com/wily/introscope/agent/AgentShim at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java) at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204) at $Proxy84.getServiceReference(Unknown Source) at org.springframework.osgi.service.importer.support.internal.aop.ServiceProviderTCCLInterceptor$ServiceProviderTCCLListener.bind(ServiceProviderTCCLInterceptor.java:51) at org.springframework.osgi.service.importer.support.internal.util.OsgiServiceBindingUtils.callListenersBind(OsgiServiceBindingUtils.java:50) at org.springframework.osgi.service.importer.support.internal.aop.ServiceDynamicInterceptor$Listener.serviceChanged(ServiceDynamicInterceptor.java:151) at org.springframework.osgi.util.OsgiListenerUtils.dispatchServiceRegistrationEvents(OsgiListenerUtils.java:113) at org.springframework.osgi.util.OsgiListenerUtils.addSingleServiceListener(OsgiListenerUtils.java:172) at org.springframework.osgi.util.OsgiListenerUtils.addSingleServiceListener(OsgiListenerUtils.java:140) at org.springframework.osgi.service.importer.support.internal.aop.ServiceDynamicInterceptor.afterPropertiesSet(ServiceDynamicInterceptor.java:464) at org.springframework.osgi.service.importer.support.OsgiServiceProxyFactoryBean.createProxy(OsgiServiceProxyFactoryBean.java:215) at org.springframework.osgi.service.importer.support.AbstractServiceImporterProxyFactoryBean.getObject(AbstractServiceImporterProxyFactoryBean.java:86) at org.springframework.osgi.service.importer.support.OsgiServiceProxyFactoryBean.getObject(OsgiServiceProxyFactoryBean.java:161) at org.springframework.beans.factory.support.FactoryBeanRegistrySupport$2.run(FactoryBeanRegistrySupport.java:133) at java.security.AccessController.doPrivileged(AccessController.java:314) at org.springframework.beans.factory.support.FactoryBeanRegistrySupport.doGetObjectFromFactoryBean(FactoryBeanRegistrySupport.java:131) at org.springframework.beans.factory.support.FactoryBeanRegistrySupport.getObjectFromFactoryBean(FactoryBeanRegistrySupport.java:102) at org.springframework.beans.factory.support.AbstractBeanFactory.getObjectForBeanInstance(AbstractBeanFactory.java:1454) at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:249) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194) at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:622) at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:932) at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext.access$1600(AbstractDelegatedExecutionApplicationContext.java:69) at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext$4.run(AbstractDelegatedExecutionApplicationContext.java:355) at org.springframework.osgi.util.internal.PrivilegedUtils.executeWithCustomTCCL(PrivilegedUtils.java:85) at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext.completeRefresh(AbstractDelegatedExecutionApplicationContext.java:320) at org.springframework.osgi.extender.internal.dependencies.startup.DependencyWaiterApplicationContextExecutor$CompleteRefreshTask.run(DependencyWaiterApplicationContextExecutor.java:132) at java.lang.Thread.run(Thread.java:770)
FATAL [SpringOsgiExtenderThread-4] (ServiceDynamicInterceptor.java:252) - Exception during service event handling java.lang.NoClassDefFoundError: com/wily/introscope/agent/AgentShim at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java) at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204) at $Proxy86.getServiceReference(Unknown Source) at org.springframework.osgi.service.importer.support.internal.aop.ServiceProviderTCCLInterceptor$ServiceProviderTCCLListener.bind(ServiceProviderTCCLInterceptor.java:51) at org.springframework.osgi.service.importer.support.internal.util.OsgiServiceBindingUtils.callListenersBind(OsgiServiceBindingUtils.java:50) at org.springframework.osgi.service.importer.support.internal.aop.ServiceDynamicInterceptor$Listener.serviceChanged(ServiceDynamicInterceptor.java:151) at org.springframework.osgi.util.OsgiListenerUtils.dispatchServiceRegistrationEvents(OsgiListenerUtils.java:113) at org.springframework.osgi.util.OsgiListenerUtils.addSingleServiceListener(OsgiListenerUtils.java:172) at org.springframework.osgi.util.OsgiListenerUtils.addSingleServiceListener(OsgiListenerUtils.java:140) at org.springframework.osgi.service.importer.support.internal.aop.ServiceDynamicInterceptor.afterPropertiesSet(ServiceDynamicInterceptor.java:464) at org.springframework.osgi.service.importer.support.OsgiServiceProxyFactoryBean.createProxy(OsgiServiceProxyFactoryBean.java:215) at org.springframework.osgi.service.importer.support.AbstractServiceImporterProxyFactoryBean.getObject(AbstractServiceImporterProxyFactoryBean.java:86) at org.springframework.osgi.service.importer.support.OsgiServiceProxyFactoryBean.getObject(OsgiServiceProxyFactoryBean.java:161) at org.springframework.beans.factory.support.FactoryBeanRegistrySupport$2.run(FactoryBeanRegistrySupport.java:133) at java.security.AccessController.doPrivileged(AccessController.java:314) at org.springframework.beans.factory.support.FactoryBeanRegistrySupport.doGetObjectFromFactoryBean(FactoryBeanRegistrySupport.java:131) at org.springframework.beans.factory.support.FactoryBeanRegistrySupport.getObjectFromFactoryBean(FactoryBeanRegistrySupport.java:102) at org.springframework.beans.factory.support.AbstractBeanFactory.getObjectForBeanInstance(AbstractBeanFactory.java:1454) at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:249) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194) at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:622) at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:932) at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext.access$1600(AbstractDelegatedExecutionApplicationContext.java:69) at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext$4.run(AbstractDelegatedExecutionApplicationContext.java:355) at org.springframework.osgi.util.internal.PrivilegedUtils.executeWithCustomTCCL(PrivilegedUtils.java:85) at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext.completeRefresh(AbstractDelegatedExecutionApplicationContext.java:320) at org.springframework.osgi.extender.internal.dependencies.startup.DependencyWaiterApplicationContextExecutor$CompleteRefreshTask.run(DependencyWaiterApplicationContextExecutor.java:132) at java.lang.Thread.run(Thread.java:770)
DEBUG [SpringOsgiExtenderThread-4] (?:?) - ServiceEvent REGISTERED

Environment

Application Performance Management Agent 10.7

Resolution

Application logs are printing the OSGI framework being utilized by the application, to correct this error on the startup, you must add wily package as boot delegation at the JVM arguments, as below:

-Dorg.osgi.framework.bootdelegation=com.wily,com.wily.*,sun.*

Start the application and the error should be gone.