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

Gateway profile looks for MBStoreDB in startup #4926

Closed mcvidanagama closed 5 years ago

mcvidanagama commented 5 years ago

Description: Even when the node is started as gateway worker[1], it looks for mb store db at startup. If we havent added mbstore in any of the datasources files the startup fails.

Suggested Labels: APIM, 260,gateway_profile Suggested Assignees: N/A Affected Product Version: 260 -wum updated up to date of creation of this issue OS, DB, other environment details and versions:
RHEL7, Puppet controlled deployment Steps to reproduce: Remove mb store db configs from datasources file. Start server with command[1]

[1] - ./bin/wso2server.sh --optimize -Dprofile=gateway-worker -DworkerNode=true start Related Issues: N/A

mcvidanagama commented 5 years ago

Error stack trace

TID: [-1234] [] [2019-05-28 10:38:57,793] ERROR {org.wso2.andes.server.registry.ApplicationRegistry} - org.wso2.andes.kernel.AndesException: Couldn't look up jndi entry for "WSO2MBStoreDB" {org.wso2.andes.server.registry.ApplicationRegistry} TID: [-1234] [] [2019-05-28 10:38:57,794] ERROR {org.wso2.andes.server.Main} - Exception during startup. Triggering shutdown {org.wso2.andes.server.Main} org.wso2.andes.kernel.AndesException: Unable to initialise application registry at org.wso2.andes.server.Broker.startupImpl(Broker.java:311) at org.wso2.andes.server.Broker.startup(Broker.java:110) at org.wso2.andes.server.Main.startBroker(Main.java:217) at org.wso2.andes.server.Main.execute(Main.java:206) at org.wso2.andes.server.Main.(Main.java:54) at org.wso2.andes.server.Main.main(Main.java:47) at org.wso2.carbon.andes.internal.QpidServiceComponent.startAndesBroker(QpidServiceComponent.java:396) at org.wso2.carbon.andes.internal.QpidServiceComponent.activate(QpidServiceComponent.java:166) 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.eclipse.equinox.internal.ds.model.ServiceComponent.activate(ServiceComponent.java:260) at org.eclipse.equinox.internal.ds.model.ServiceComponentProp.activate(ServiceComponentProp.java:146) at org.eclipse.equinox.internal.ds.model.ServiceComponentProp.build(ServiceComponentProp.java:345) at org.eclipse.equinox.internal.ds.InstanceProcess.buildComponent(InstanceProcess.java:620) at org.eclipse.equinox.internal.ds.InstanceProcess.buildComponents(InstanceProcess.java:197) at org.eclipse.equinox.internal.ds.Resolver.getEligible(Resolver.java:343) at org.eclipse.equinox.internal.ds.SCRManager.serviceChanged(SCRManager.java:222) at org.eclipse.osgi.internal.serviceregistry.FilteredServiceListener.serviceChanged(FilteredServiceListener.java:107) at org.eclipse.osgi.framework.internal.core.BundleContextImpl.dispatchEvent(BundleContextImpl.java:861) at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:230) at org.eclipse.osgi.framework.eventmgr.ListenerQueue.dispatchEventSynchronous(ListenerQueue.java:148) at org.eclipse.osgi.internal.serviceregistry.ServiceRegistry.publishServiceEventPrivileged(ServiceRegistry.java:819) at org.eclipse.osgi.internal.serviceregistry.ServiceRegistry.publishServiceEvent(ServiceRegistry.java:771) at org.eclipse.osgi.internal.serviceregistry.ServiceRegistrationImpl.register(ServiceRegistrationImpl.java:130) at org.eclipse.osgi.internal.serviceregistry.ServiceRegistry.registerService(ServiceRegistry.java:214) at org.eclipse.osgi.framework.internal.core.BundleContextImpl.registerService(BundleContextImpl.java:433) at org.eclipse.osgi.framework.internal.core.BundleContextImpl.registerService(BundleContextImpl.java:451) at org.wso2.carbon.server.admin.internal.ServerAdminServiceComponent.activate(ServerAdminServiceComponent.java:106) 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.eclipse.equinox.internal.ds.model.ServiceComponent.activate(ServiceComponent.java:260) at org.eclipse.equinox.internal.ds.model.ServiceComponentProp.activate(ServiceComponentProp.java:146) at org.eclipse.equinox.internal.ds.model.ServiceComponentProp.build(ServiceComponentProp.java:345) at org.eclipse.equinox.internal.ds.InstanceProcess.buildComponent(InstanceProcess.java:620) at org.eclipse.equinox.internal.ds.InstanceProcess.buildComponents(InstanceProcess.java:197) at org.eclipse.equinox.internal.ds.Resolver.getEligible(Resolver.java:343) at org.eclipse.equinox.internal.ds.SCRManager.serviceChanged(SCRManager.java:222) at org.eclipse.osgi.internal.serviceregistry.FilteredServiceListener.serviceChanged(FilteredServiceListener.java:107) at org.eclipse.osgi.framework.internal.core.BundleContextImpl.dispatchEvent(BundleContextImpl.java:861) at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:230) at org.eclipse.osgi.framework.eventmgr.ListenerQueue.dispatchEventSynchronous(ListenerQueue.java:148) at org.eclipse.osgi.internal.serviceregistry.ServiceRegistry.publishServiceEventPrivileged(ServiceRegistry.java:819) at org.eclipse.osgi.internal.serviceregistry.ServiceRegistry.publishServiceEvent(ServiceRegistry.java:771) at org.eclipse.osgi.internal.serviceregistry.ServiceRegistrationImpl.register(ServiceRegistrationImpl.java:130) at org.eclipse.osgi.internal.serviceregistry.ServiceRegistry.registerService(ServiceRegistry.java:214) at org.eclipse.osgi.framework.internal.core.BundleContextImpl.registerService(BundleContextImpl.java:433) at org.eclipse.osgi.framework.internal.core.BundleContextImpl.registerService(BundleContextImpl.java:451) at org.wso2.carbon.core.init.CarbonServerManager.initializeCarbon(CarbonServerManager.java:515) at org.wso2.carbon.core.init.CarbonServerManager.start(CarbonServerManager.java:220) at org.wso2.carbon.core.internal.CarbonCoreServiceComponent.activate(CarbonCoreServiceComponent.java:105) 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.eclipse.equinox.internal.ds.model.ServiceComponent.activate(ServiceComponent.java:260) at org.eclipse.equinox.internal.ds.model.ServiceComponentProp.activate(ServiceComponentProp.java:146) at org.eclipse.equinox.internal.ds.model.ServiceComponentProp.build(ServiceComponentProp.java:345) at org.eclipse.equinox.internal.ds.InstanceProcess.buildComponent(InstanceProcess.java:620) at org.eclipse.equinox.internal.ds.InstanceProcess.buildComponents(InstanceProcess.java:197) at org.eclipse.equinox.internal.ds.Resolver.getEligible(Resolver.java:343) at org.eclipse.equinox.internal.ds.SCRManager.serviceChanged(SCRManager.java:222) at org.eclipse.osgi.internal.serviceregistry.FilteredServiceListener.serviceChanged(FilteredServiceListener.java:107) at org.eclipse.osgi.framework.internal.core.BundleContextImpl.dispatchEvent(BundleContextImpl.java:861) at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:230) at org.eclipse.osgi.framework.eventmgr.ListenerQueue.dispatchEventSynchronous(ListenerQueue.java:148) at org.eclipse.osgi.internal.serviceregistry.ServiceRegistry.publishServiceEventPrivileged(ServiceRegistry.java:819) at org.eclipse.osgi.internal.serviceregistry.ServiceRegistry.publishServiceEvent(ServiceRegistry.java:771) at org.eclipse.osgi.internal.serviceregistry.ServiceRegistrationImpl.register(ServiceRegistrationImpl.java:130) at org.eclipse.osgi.internal.serviceregistry.ServiceRegistry.registerService(ServiceRegistry.java:214) at org.eclipse.osgi.framework.internal.core.BundleContextImpl.registerService(BundleContextImpl.java:433) at org.eclipse.equinox.http.servlet.internal.Activator.registerHttpService(Activator.java:81) at org.eclipse.equinox.http.servlet.internal.Activator.addProxyServlet(Activator.java:60) at org.eclipse.equinox.http.servlet.internal.ProxyServlet.init(ProxyServlet.java:40) at org.wso2.carbon.tomcat.ext.servlet.DelegationServlet.init(DelegationServlet.java:38) at org.apache.catalina.core.StandardWrapper.initServlet(StandardWrapper.java:1230) at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1174) at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:1066) at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:5409) at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5707) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:145) at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1707) at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1697) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at java.lang.Thread.run(Thread.java:748) Caused by: java.lang.Exception: org.wso2.andes.kernel.AndesException: Couldn't look up jndi entry for "WSO2MBStoreDB" at org.wso2.andes.server.registry.ApplicationRegistry.initialise(ApplicationRegistry.java:266) at org.wso2.andes.server.registry.ApplicationRegistry.initialise(ApplicationRegistry.java:147) at org.wso2.andes.server.Broker.startupImpl(Broker.java:278) ... 89 more Caused by: org.wso2.andes.kernel.AndesException: Couldn't look up jndi entry for "WSO2MBStoreDB" at org.wso2.andes.store.rdbms.RDBMSConnection.initialize(RDBMSConnection.java:71) at org.wso2.andes.store.rdbms.RDBMSAndesContextStoreImpl.init(RDBMSAndesContextStoreImpl.java:86) at org.wso2.andes.kernel.AndesKernelBoot.createAndesContextStoreFromConfig(AndesKernelBoot.java:252) at org.wso2.andes.kernel.AndesKernelBoot.startAndesStores(AndesKernelBoot.java:297) at org.wso2.andes.server.virtualhost.VirtualHostImpl.initialiseAndesStores(VirtualHostImpl.java:344) at org.wso2.andes.server.virtualhost.VirtualHostImpl.(VirtualHostImpl.java:203) at org.wso2.andes.server.virtualhost.VirtualHostImpl.(VirtualHostImpl.java:155) at org.wso2.andes.server.registry.ApplicationRegistry.createVirtualHost(ApplicationRegistry.java:568) at org.wso2.andes.server.registry.ApplicationRegistry.initialiseVirtualHosts(ApplicationRegistry.java:327) at org.wso2.andes.server.registry.ApplicationRegistry.initialise(ApplicationRegistry.java:261) ... 91 more Caused by: javax.naming.NameNotFoundException: Name [WSO2MBStoreDB] is not bound in this Context. Unable to find [WSO2MBStoreDB]. at org.apache.naming.NamingContext.lookup(NamingContext.java:825) at org.apache.naming.NamingContext.lookup(NamingContext.java:173) at org.wso2.carbon.context.internal.CarbonContextDataHolder$CarbonInitialJNDIContext.lookup(CarbonContextDataHolder.java:709) at javax.naming.InitialContext.lookup(InitialContext.java:417) at javax.naming.InitialContext.doLookup(InitialContext.java:290) at org.wso2.andes.store.rdbms.RDBMSConnection.initialize(RDBMSConnection.java:53) ... 100 more

dushaniw commented 5 years ago

Even though we are not using MB store DB in Gateway, during the server startup, when the broker component tries to initialize, it looks for the MB store DB. Hence we need to keep the default H2 configuration as it is in master-datasource.xml. Need to update the documentation.

dushaniw commented 5 years ago

Tracking the documentation issue in https://github.com/wso2/product-apim/issues/5042.