IllegalAccessException in Atlassian Confluence Apache Tomcat 9.0.58
search cancel

IllegalAccessException in Atlassian Confluence Apache Tomcat 9.0.58

book

Article ID: 245826

calendar_today

Updated On:

Products

CA Application Performance Management (APM / Wily / Introscope)

Issue/Introduction

When trying to monitor Atlassian Confluence Apache Tomcat 9.0.58, we are receiving the below error when enabling the Agent:

SEVERE [Caesium-1-4] com.sun.jersey.core.spi.component.ProviderFactory.__getComponentProvider The provider class, class com.sun.jersey.json.impl.provider.entity.JSONArrayProvider, could not be instantiated. Processing will continue but the class will not be utilized
    java.lang.IllegalAccessException: Class com.sun.jersey.core.spi.component.ComponentConstructor can not access a member of class com.sun.jersey.json.impl.provider.entity.JSONArrayProvider with modifiers ""
        at sun.reflect.Reflection.ensureMemberAccess(Reflection.java:102)
        at java.lang.Class.newInstance(Class.java:436)
        at com.sun.jersey.core.spi.component.ComponentConstructor._getInstance(ComponentConstructor.java:193)
        at com.sun.jersey.core.spi.component.ComponentConstructor.getInstance(ComponentConstructor.java:180)
        at com.sun.jersey.core.spi.component.ProviderFactory.__getComponentProvider(ProviderFactory.java:166)
        at com.sun.jersey.core.spi.component.ProviderFactory.getComponentProvider(ProviderFactory.java:137)
        at com.sun.jersey.core.spi.component.ProviderServices.getComponent(ProviderServices.java:283)
        at com.sun.jersey.core.spi.component.ProviderServices.getServices(ProviderServices.java:163)
        at com.sun.jersey.core.spi.factory.MessageBodyFactory.initReaders(MessageBodyFactory.java:176)
        at com.sun.jersey.core.spi.factory.MessageBodyFactory.init(MessageBodyFactory.java:162)
        at com.atlassian.plugins.rest.module.jersey.JerseyEntityHandler.lambda$new$0(JerseyEntityHandler.java:134)
        at com.sun.jersey.spi.inject.Errors.processWithErrors(Errors.java:193)
        at com.atlassian.plugins.rest.module.jersey.JerseyEntityHandler.<init>(JerseyEntityHandler.java:56)
        at com.atlassian.plugins.rest.module.jersey.JerseyRequestFactory.createHandler(JerseyRequestFactory.java:56)
        at com.atlassian.plugins.rest.module.jersey.JerseyRequestFactory.ensureInitalised(JerseyRequestFactory.java:47)
        at com.atlassian.plugins.rest.module.jersey.JerseyRequestFactory.createRequest(JerseyRequestFactory.java:30)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:344)
        at org.eclipse.gemini.blueprint.service.importer.support.internal.aop.ServiceInvoker.doInvoke(ServiceInvoker.java:56)
        at org.eclipse.gemini.blueprint.service.importer.support.internal.aop.ServiceInvoker.invoke(ServiceInvoker.java:60)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
        at org.springframework.aop.support.DelegatingIntroductionInterceptor.doProceed(DelegatingIntroductionInterceptor.java:137)
        at org.springframework.aop.support.DelegatingIntroductionInterceptor.invoke(DelegatingIntroductionInterceptor.java:124)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
        at org.eclipse.gemini.blueprint.service.util.internal.aop.ServiceTCCLInterceptor.invokeUnprivileged(ServiceTCCLInterceptor.java:70)
        at org.eclipse.gemini.blueprint.service.util.internal.aop.ServiceTCCLInterceptor.invoke(ServiceTCCLInterceptor.java:53)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
        at org.eclipse.gemini.blueprint.service.importer.support.LocalBundleContextAdvice.invoke(LocalBundleContextAdvice.java:57)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
        at org.springframework.aop.support.DelegatingIntroductionInterceptor.doProceed(DelegatingIntroductionInterceptor.java:137)
        at org.springframework.aop.support.DelegatingIntroductionInterceptor.invoke(DelegatingIntroductionInterceptor.java:124)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
        at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:215)
        at com.sun.proxy.$Proxy1646.createRequest(Unknown Source)
        at com.atlassian.applinks.core.manifest.AppLinksManifestDownloader.doDownload(AppLinksManifestDownloader.java:170)
        at com.atlassian.applinks.core.manifest.AppLinksManifestDownloader.downloadInternal(AppLinksManifestDownloader.java:109)
        at com.atlassian.applinks.core.manifest.AppLinksManifestDownloader.downloadNoEvent(AppLinksManifestDownloader.java:102)
        at com.atlassian.applinks.internal.capabilities.DefaultRemoteCapabilitiesService.updateAndGet(DefaultRemoteCapabilitiesService.java:290)
        at com.atlassian.applinks.internal.capabilities.DefaultRemoteCapabilitiesService.getCapabilities(DefaultRemoteCapabilitiesService.java:175)
        at com.atlassian.applinks.internal.status.support.DefaultApplinkStatusValidationService.getCapabilities(DefaultApplinkStatusValidationService.java:157)
        at com.atlassian.applinks.internal.status.support.DefaultApplinkStatusValidationService.checkVersionCompatibility(DefaultApplinkStatusValidationService.java:60)
        at com.atlassian.applinks.core.DefaultApplinkStatusService.getApplinkStatus(DefaultApplinkStatusService.java:96)
        at com.atlassian.applinks.analytics.ApplinkStatusEventBuilderFactory$Builder.lambda$addApplink$0(ApplinkStatusEventBuilderFactory.java:138)
        at com.atlassian.applinks.core.ElevatedPermissionsServiceImpl.executeAs(ElevatedPermissionsServiceImpl.java:32)
        at com.atlassian.applinks.analytics.ApplinkStatusEventBuilderFactory$Builder.addApplink(ApplinkStatusEventBuilderFactory.java:138)
        at com.google.common.collect.ImmutableList.forEach(ImmutableList.java:407)
        at com.atlassian.applinks.analytics.ApplinkStatusPublisher.publishApplinkStatus(ApplinkStatusPublisher.java:31)
        at com.atlassian.applinks.analytics.ApplinkStatusJob.runJob(ApplinkStatusJob.java:56)
        at com.atlassian.confluence.impl.schedule.caesium.JobRunnerWrapper.doRunJob(JobRunnerWrapper.java:117)
        at com.atlassian.confluence.impl.schedule.caesium.JobRunnerWrapper.lambda$runJob$0(JobRunnerWrapper.java:87)
        at com.atlassian.confluence.impl.vcache.VCacheRequestContextManager.doInRequestContextInternal(VCacheRequestContextManager.java:84)
        at com.atlassian.confluence.impl.vcache.VCacheRequestContextManager.doInRequestContext(VCacheRequestContextManager.java:68)
        at com.atlassian.confluence.impl.schedule.caesium.JobRunnerWrapper.runJob(JobRunnerWrapper.java:87)
        at com.atlassian.scheduler.core.JobLauncher.runJob(JobLauncher.java:134)
        at com.atlassian.scheduler.core.JobLauncher.launchAndBuildResponse(JobLauncher.java:106)
        at com.atlassian.scheduler.core.JobLauncher.launch(JobLauncher.java:90)
        at com.atlassian.scheduler.caesium.impl.CaesiumSchedulerService.launchJob(CaesiumSchedulerService.java:464)
        at com.atlassian.scheduler.caesium.impl.CaesiumSchedulerService.executeLocalJob(CaesiumSchedulerService.java:431)
        at com.atlassian.scheduler.caesium.impl.CaesiumSchedulerService.executeQueuedJob(CaesiumSchedulerService.java:409)
        at com.atlassian.scheduler.caesium.impl.SchedulerQueueWorker.executeJob(SchedulerQueueWorker.java:66)
        at com.atlassian.scheduler.caesium.impl.SchedulerQueueWorker.executeNextJob(SchedulerQueueWorker.java:60)
        at com.atlassian.scheduler.caesium.impl.SchedulerQueueWorker.run(SchedulerQueueWorker.java:35)
        at java.lang.Thread.run(Thread.java:750)

Environment

APM 10.7 
Java Agent
OpenJDK 64-Bit Server VM 1.8.0_332
Atlassian Confluence Apache Tomcat 9.0.58 

Resolution

Make sure that the boot delegation argument is not declared, otherwise it will cause the class load order issue.

Tomcat configurations should go into a file called setenv.sh, do not need to add a boot delegation to tomcat, Eg:


[root@lvntest011707 docker]# cat setenv.sh
WILY_APPN="MyTomcatAgent"
WILY_PROC="MyTomcatProc"
WILY_OPTS="-javaagent:/usr/local/wily/Agent.jar -Dcom.wily.introscope.agent.customProcessName=${WILY_PROC} -Dcom.wily.introscope.agent.agentName=${WILY_APPN} -Dintroscope.agent.hostName=${WILY_HOST}"
JAVA_HOME="/opt/java/openjdk"
JAVA_OPTS="$JAVA_OPTS $WILY_OPTS "

You should never edit any official files from apache to integrate our agent (edited) setenv.bat for windows.