wso2 / product-apim

Welcome to the WSO2 API Manager source code! For info on working with the WSO2 API Manager repository and contributing code, click the link below.
http://wso2.github.io/
Apache License 2.0
841 stars 784 forks source link

Throwing errors when starting with -Dprofile=gateway-worker #9548

Open chanakaudaya opened 3 years ago

chanakaudaya commented 3 years ago

Description:

When I'm trying to start the worker profile, it throws the below error. Full error is attached as a file since it was too large for a comment.

java.lang.ClassNotFoundException: org.wso2.carbon.identity.captcha.filter.CaptchaFilter
    at org.wso2.carbon.webapp.mgt.loader.CarbonWebappClassLoader.loadClass(CarbonWebappClassLoader.java:195) ~[org.wso2.carbon.webapp.mgt_4.10.1.jar:?]
    at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1188) ~[tomcat_9.0.31.wso2v1.jar:?]
    at org.apache.catalina.core.DefaultInstanceManager.loadClass(DefaultInstanceManager.java:540) ~[tomcat_9.0.31.wso2v1.jar:?]
    at org.apache.catalina.core.DefaultInstanceManager.loadClassMaybePrivileged(DefaultInstanceManager.java:521) ~[tomcat_9.0.31.wso2v1.jar:?]
    at org.apache.catalina.core.DefaultInstanceManager.newInstance(DefaultInstanceManager.java:150) ~[tomcat_9.0.31.wso2v1.jar:?]
    at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:249) ~[tomcat_9.0.31.wso2v1.jar:?]
    at org.apache.catalina.core.ApplicationFilterConfig.<init>(ApplicationFilterConfig.java:102) ~[tomcat_9.0.31.wso2v1.jar:?]
    at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:4538) [tomcat_9.0.31.wso2v1.jar:?]
    at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5177) [tomcat_9.0.31.wso2v1.jar:?]
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183) [tomcat_9.0.31.wso2v1.jar:?]
    at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:717) [tomcat_9.0.31.wso2v1.jar:?]
    at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:690) [tomcat_9.0.31.wso2v1.jar:?]
    at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:705) [tomcat_9.0.31.wso2v1.jar:?]
    at org.wso2.carbon.tomcat.internal.CarbonTomcat.addWebApp(CarbonTomcat.java:303) [org.wso2.carbon.tomcat_4.6.0.jar:?]
    at org.wso2.carbon.tomcat.internal.CarbonTomcat.addWebApp(CarbonTomcat.java:209) [org.wso2.carbon.tomcat_4.6.0.jar:?]
    at org.wso2.carbon.webapp.mgt.TomcatGenericWebappsDeployer.handleWebappDeployment(TomcatGenericWebappsDeployer.java:255) [org.wso2.carbon.webapp.mgt_4.10.1.jar:?]
    at org.wso2.carbon.webapp.mgt.TomcatGenericWebappsDeployer.handleWarWebappDeployment(TomcatGenericWebappsDeployer.java:206) [org.wso2.carbon.webapp.mgt_4.10.1.jar:?]
    at org.wso2.carbon.webapp.mgt.TomcatGenericWebappsDeployer.handleHotDeployment(TomcatGenericWebappsDeployer.java:175) [org.wso2.carbon.webapp.mgt_4.10.1.jar:?]
    at org.wso2.carbon.webapp.mgt.TomcatGenericWebappsDeployer.deploy(TomcatGenericWebappsDeployer.java:140) [org.wso2.carbon.webapp.mgt_4.10.1.jar:?]
    at org.wso2.carbon.webapp.mgt.AbstractWebappDeployer.deployThisWebApp(AbstractWebappDeployer.java:224) [org.wso2.carbon.webapp.mgt_4.10.1.jar:?]
    at org.wso2.carbon.webapp.mgt.AbstractWebappDeployer.deploy(AbstractWebappDeployer.java:114) [org.wso2.carbon.webapp.mgt_4.10.1.jar:?]
    at org.wso2.carbon.webapp.deployer.WebappDeployer.deploy(WebappDeployer.java:42) [org.wso2.carbon.webapp.deployer_4.10.1.jar:?]
    at org.apache.axis2.deployment.repository.util.DeploymentFileData.deploy(DeploymentFileData.java:136) [axis2_1.6.1.wso2v41.jar:?]
    at org.apache.axis2.deployment.DeploymentEngine.doDeploy(DeploymentEngine.java:807) [axis2_1.6.1.wso2v41.jar:?]
    at org.apache.axis2.deployment.repository.util.WSInfoList.update(WSInfoList.java:144) [axis2_1.6.1.wso2v41.jar:?]
    at org.apache.axis2.deployment.RepositoryListener.update(RepositoryListener.java:377) [axis2_1.6.1.wso2v41.jar:?]
    at org.apache.axis2.deployment.RepositoryListener.checkServices(RepositoryListener.java:254) [axis2_1.6.1.wso2v41.jar:?]
    at org.apache.synapse.Axis2SynapseController.deployMediatorExtensions(Axis2SynapseController.java:783) [synapse-core_2.1.7.wso2v183.jar:2.1.7-wso2v183]
    at org.apache.synapse.Axis2SynapseController.createSynapseEnvironment(Axis2SynapseController.java:407) [synapse-core_2.1.7.wso2v183.jar:2.1.7-wso2v183]
    at org.apache.synapse.ServerManager.start(ServerManager.java:187) [synapse-core_2.1.7.wso2v183.jar:2.1.7-wso2v183]
    at org.wso2.carbon.mediation.initializer.ServiceBusInitializer.initESB(ServiceBusInitializer.java:371) [org.wso2.carbon.mediation.initializer_4.7.61.jar:?]
    at org.wso2.carbon.mediation.initializer.ServiceBusInitializer.activate(ServiceBusInitializer.java:170) [org.wso2.carbon.mediation.initializer_4.7.61.jar:?]
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:?]
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:?]
    at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?]
    at java.lang.reflect.Method.invoke(Method.java:566) ~[?:?]
    at org.eclipse.equinox.internal.ds.model.ServiceComponent.activate(ServiceComponent.java:260) [org.eclipse.equinox.ds_1.4.400.v20160226-2036.jar:?]
    at org.eclipse.equinox.internal.ds.model.ServiceComponentProp.activate(ServiceComponentProp.java:146) [org.eclipse.equinox.ds_1.4.400.v20160226-2036.jar:?]
    at org.eclipse.equinox.internal.ds.model.ServiceComponentProp.build(ServiceComponentProp.java:345) [org.eclipse.equinox.ds_1.4.400.v20160226-2036.jar:?]
    at org.eclipse.equinox.internal.ds.InstanceProcess.buildComponent(InstanceProcess.java:620) [org.eclipse.equinox.ds_1.4.400.v20160226-2036.jar:?]
    at org.eclipse.equinox.internal.ds.InstanceProcess.buildComponents(InstanceProcess.java:197) [org.eclipse.equinox.ds_1.4.400.v20160226-2036.jar:?]
    at org.eclipse.equinox.internal.ds.Resolver.getEligible(Resolver.java:343) [org.eclipse.equinox.ds_1.4.400.v20160226-2036.jar:?]
    at org.eclipse.equinox.internal.ds.SCRManager.serviceChanged(SCRManager.java:222) [org.eclipse.equinox.ds_1.4.400.v20160226-2036.jar:?]
    at org.eclipse.osgi.internal.serviceregistry.FilteredServiceListener.serviceChanged(FilteredServiceListener.java:113) [org.eclipse.osgi_3.14.0.v20190517-1309.jar:?]
    at org.eclipse.osgi.internal.framework.BundleContextImpl.dispatchEvent(BundleContextImpl.java:985) [org.eclipse.osgi_3.14.0.v20190517-1309.jar:?]
    at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:234) [org.eclipse.osgi_3.14.0.v20190517-1309.jar:?]
    at org.eclipse.osgi.framework.eventmgr.ListenerQueue.dispatchEventSynchronous(ListenerQueue.java:151) [org.eclipse.osgi_3.14.0.v20190517-1309.jar:?]
    at org.eclipse.osgi.internal.serviceregistry.ServiceRegistry.publishServiceEventPrivileged(ServiceRegistry.java:866) [org.eclipse.osgi_3.14.0.v20190517-1309.jar:?]
    at org.eclipse.osgi.internal.serviceregistry.ServiceRegistry.publishServiceEvent(ServiceRegistry.java:804) [org.eclipse.osgi_3.14.0.v20190517-1309.jar:?]
    at org.eclipse.osgi.internal.serviceregistry.ServiceRegistrationImpl.register(ServiceRegistrationImpl.java:130) [org.eclipse.osgi_3.14.0.v20190517-1309.jar:?]
    at org.eclipse.osgi.internal.serviceregistry.ServiceRegistry.registerService(ServiceRegistry.java:228) [org.eclipse.osgi_3.14.0.v20190517-1309.jar:?]
    at org.eclipse.osgi.internal.framework.BundleContextImpl.registerService(BundleContextImpl.java:525) [org.eclipse.osgi_3.14.0.v20190517-1309.jar:?]
    at org.eclipse.osgi.internal.framework.BundleContextImpl.registerService(BundleContextImpl.java:544) [org.eclipse.osgi_3.14.0.v20190517-1309.jar:?]
    at org.wso2.carbon.inbound.endpoint.persistence.service.InboundEndpointPersistenceServiceDSComponent.activate(InboundEndpointPersistenceServiceDSComponent.java:50) [org.wso2.carbon.inbound.endpoint.persistence_4.7.61.jar:?]
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:?]
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:?]
    at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?]
    at java.lang.reflect.Method.invoke(Method.java:566) ~[?:?]
    at org.eclipse.equinox.internal.ds.model.ServiceComponent.activate(ServiceComponent.java:260) [org.eclipse.equinox.ds_1.4.400.v20160226-2036.jar:?]
    at org.eclipse.equinox.internal.ds.model.ServiceComponentProp.activate(ServiceComponentProp.java:146) [org.eclipse.equinox.ds_1.4.400.v20160226-2036.jar:?]
    at org.eclipse.equinox.internal.ds.model.ServiceComponentProp.build(ServiceComponentProp.java:345) [org.eclipse.equinox.ds_1.4.400.v20160226-2036.jar:?]
    at org.eclipse.equinox.internal.ds.InstanceProcess.buildComponent(InstanceProcess.java:620) [org.eclipse.equinox.ds_1.4.400.v20160226-2036.jar:?]
    at org.eclipse.equinox.internal.ds.InstanceProcess.buildComponents(InstanceProcess.java:197) [org.eclipse.equinox.ds_1.4.400.v20160226-2036.jar:?]
    at org.eclipse.equinox.internal.ds.Resolver.getEligible(Resolver.java:343) [org.eclipse.equinox.ds_1.4.400.v20160226-2036.jar:?]
    at org.eclipse.equinox.internal.ds.SCRManager.serviceChanged(SCRManager.java:222) [org.eclipse.equinox.ds_1.4.400.v20160226-2036.jar:?]
    at org.eclipse.osgi.internal.serviceregistry.FilteredServiceListener.serviceChanged(FilteredServiceListener.java:113) [org.eclipse.osgi_3.14.0.v20190517-1309.jar:?]
    at org.eclipse.osgi.internal.framework.BundleContextImpl.dispatchEvent(BundleContextImpl.java:985) [org.eclipse.osgi_3.14.0.v20190517-1309.jar:?]
    at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:234) [org.eclipse.osgi_3.14.0.v20190517-1309.jar:?]
    at org.eclipse.osgi.framework.eventmgr.ListenerQueue.dispatchEventSynchronous(ListenerQueue.java:151) [org.eclipse.osgi_3.14.0.v20190517-1309.jar:?]
    at org.eclipse.osgi.internal.serviceregistry.ServiceRegistry.publishServiceEventPrivileged(ServiceRegistry.java:866) [org.eclipse.osgi_3.14.0.v20190517-1309.jar:?]
    at org.eclipse.osgi.internal.serviceregistry.ServiceRegistry.publishServiceEvent(ServiceRegistry.java:804) [org.eclipse.osgi_3.14.0.v20190517-1309.jar:?]
    at org.eclipse.osgi.internal.serviceregistry.ServiceRegistrationImpl.register(ServiceRegistrationImpl.java:130) [org.eclipse.osgi_3.14.0.v20190517-1309.jar:?]
    at org.eclipse.osgi.internal.serviceregistry.ServiceRegistry.registerService(ServiceRegistry.java:228) [org.eclipse.osgi_3.14.0.v20190517-1309.jar:?]
    at org.eclipse.osgi.internal.framework.BundleContextImpl.registerService(BundleContextImpl.java:525) [org.eclipse.osgi_3.14.0.v20190517-1309.jar:?]
    at org.eclipse.osgi.internal.framework.BundleContextImpl.registerService(BundleContextImpl.java:544) [org.eclipse.osgi_3.14.0.v20190517-1309.jar:?]
    at org.wso2.carbon.core.init.CarbonServerManager.initializeCarbon(CarbonServerManager.java:529) [org.wso2.carbon.core_4.6.0.jar:?]
    at org.wso2.carbon.core.init.CarbonServerManager.removePendingItem(CarbonServerManager.java:305) [org.wso2.carbon.core_4.6.0.jar:?]
    at org.wso2.carbon.core.init.PreAxis2ConfigItemListener.bundleChanged(PreAxis2ConfigItemListener.java:118) [org.wso2.carbon.core_4.6.0.jar:?]
    at org.eclipse.osgi.internal.framework.BundleContextImpl.dispatchEvent(BundleContextImpl.java:973) [org.eclipse.osgi_3.14.0.v20190517-1309.jar:?]
    at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:234) [org.eclipse.osgi_3.14.0.v20190517-1309.jar:?]
    at org.eclipse.osgi.framework.eventmgr.EventManager$EventThread.run(EventManager.java:345) [org.eclipse.osgi_3.14.0.v20190517-1309.jar:?]
[2020-11-23 21:19:11,106] ERROR - StandardContext One or more Filters failed to start. Full details will be found in the appropriate container log file
[2020-11-23 21:19:11,106] ERROR - StandardContext Context [/api/identity/recovery/v0.9] startup failed due to previous errors

Steps to reproduce:

Start the WSO2 API Manager server with below command sh bin/wso2server.sh -Dprofile=gateway-worker

Affected Product Version:

APIM 3.2.0 WUM (wso2am-3.2.0+1599802896156.full)

Environment details (with versions):

chanakaudaya commented 3 years ago

apim-worker-profile-start-error.txt

DaniduWijendra commented 2 years ago

These errors can happen when you have started the APIM server as a gateway worker profile without running the profile optimization script. Once you have updated the APIM pack, you need to run a profile optimization script to remove unwanted jar files and war files.

You can follow the below steps to profile optimize the gateway-worker node.

Go to the /repository/conf directory and backup the deployment.toml file.

Go to the /bin directory and execute the below command to optimize the API Manager pack as a gateway worker. (This will optimize and remove files in the API Manager pack that are not needed to run the API manager as a gateway-worker profile) sh profileSetup.sh -Dprofile=gateway-worker

Restore the deployment.toml file and execute the below command to start the API Manager as a gateway-worker. sh wso2server.sh -Dprofile=gateway-worker [1] https://apim.docs.wso2.com/en/3.2.0/install-and-setup/setup/distributed-deployment/product-profiles/