Hi Shammi/Hasitha, There is a version conflict with existing javax.jms bundles when starting the cache invalidation osgi bundle, which causes the casting problem. Any thoughts on this matter?
Thank you & Best regards, *Amal Gunatilake* Software Engineer WSO2 Inc.; http://wso2.com lean.enterprise.middleware On Tue, May 6, 2014 at 1:22 PM, Shazni Nazeer <sha...@wso2.com> wrote: > Hi Amal, > > Yes now the cache.xml entries are correctly read. After replacing > activemq-core to activemq-all the debugging steps go below the > IniatlContext line, but as you have mentioned when session object is being > created the following exception is thrown. Therefore, still jms > initialization fails. > > [2014-05-06 13:13:58,409] ERROR > {org.wso2.carbon.caching.invalidator.jms.JMSGlobalCacheInvalidationImpl} - > Global cache invalidation: Error jms broker initialization > java.lang.ClassCastException: > org.apache.activemq.ActiveMQConnectionFactory cannot be cast to > javax.jms.TopicConnectionFactory > at > org.wso2.carbon.caching.invalidator.jms.JMSGlobalCacheInvalidationImpl.initJMSBroker(JMSGlobalCacheInvalidationImpl.java:112) > at > org.wso2.carbon.caching.invalidator.jms.JMSGlobalCacheInvalidationImpl.init(JMSGlobalCacheInvalidationImpl.java:96) > at > org.wso2.carbon.caching.invalidator.jms.JMSGlobalCacheInvalidationImpl.invalidateCache(JMSGlobalCacheInvalidationImpl.java:131) > at > org.wso2.carbon.registry.core.caching.CachingHandler.removeFromCache(CachingHandler.java:255) > at > org.wso2.carbon.registry.core.caching.CachingHandler.clearAncestry(CachingHandler.java:211) > at > org.wso2.carbon.registry.core.caching.CachingHandler.clearAncestry(CachingHandler.java:232) > at > org.wso2.carbon.registry.core.caching.CachingHandler.clearAncestry(CachingHandler.java:232) > at > org.wso2.carbon.registry.core.caching.CachingHandler.clearCache(CachingHandler.java:207) > at > org.wso2.carbon.registry.core.caching.CachingHandler.clearCache(CachingHandler.java:91) > at > org.wso2.carbon.registry.core.caching.CachingHandler.put(CachingHandler.java:280) > at > org.wso2.carbon.registry.core.jdbc.handlers.HandlerManager.put(HandlerManager.java:2503) > at > org.wso2.carbon.registry.core.jdbc.handlers.HandlerLifecycleManager.put(HandlerLifecycleManager.java:993) > at > org.wso2.carbon.registry.core.jdbc.EmbeddedRegistry.put(EmbeddedRegistry.java:697) > at > org.wso2.carbon.registry.core.caching.CacheBackedRegistry.put(CacheBackedRegistry.java:508) > at > org.wso2.carbon.registry.core.session.UserRegistry.put(UserRegistry.java:680) > at > org.wso2.carbon.theme.mgt.util.ThemeUtil.transferAllThemesToRegistry(ThemeUtil.java:122) > at > org.wso2.carbon.theme.mgt.util.ThemeUtil.loadResourceThemes(ThemeUtil.java:175) > at > org.wso2.carbon.theme.mgt.internal.TenantThemeMgtServiceComponent.activate(TenantThemeMgtServiceComponent.java:53) > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > at > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) > at > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) > at java.lang.reflect.Method.invoke(Method.java:606) > 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:347) > 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:517) > at > org.wso2.carbon.core.init.CarbonServerManager.start(CarbonServerManager.java:219) > at > org.wso2.carbon.core.internal.CarbonCoreServiceComponent.activate(CarbonCoreServiceComponent.java:77) > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > at > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) > at > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) > at java.lang.reflect.Method.invoke(Method.java:606) > 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:347) > 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:1279) > at > org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1192) > at > org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:1087) > at > org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:5210) > at > org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5493) > at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150) > at > org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1559) > at > org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1549) > at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334) > at java.util.concurrent.FutureTask.run(FutureTask.java:166) > at > java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) > at > java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) > at java.lang.Thread.run(Thread.java:724) > > > > Shazni Nazeer > > Senior Software Engineer > > Mob : +94 715 440 607 > LinkedIn : http://lk.linkedin.com/in/shazninazeer > Blog : http://shazninazeer.blogspot.com > > > On Tue, May 6, 2014 at 11:17 AM, Amal Gunatilake <am...@wso2.com> wrote: > >> Hi Shazni, >> >> There was a problem with the cache.xml read and I fixed it. Somehow when >> starting the osgi bundle it's not picking the child elements and I did an >> alternative way to read the properties in cache.xml. >> >> At the initialization, the isCoordinator check is not necessary since >> this is already done by cache.xml. If the cache.xml is configured with >> global cache invalidation parameters, then the jms initialization will >> happen. The isCoordinator check will happen when publishing a cache >> invalidation message and when receiving a cache invalidation message. >> >> The JMS broker is not being initialized bcuz it is missing the >> ActiveMQInitialContextFactory class at the run-time; therefore you need to >> add the AqtiveMQ-All jar to the components/lib. That will solve the >> InitialContext problem, but then there is another issue which I'm currently >> looking at. >> >> There is a javax.jms class version miss match. At the line that it >> creates the session, the ActiveMQSession cannot be cast into >> javax.jms.Session because at the run-time there is a different jms jar is >> loading into the class-path as I figured. This is actually an exception but >> it's not captured to the carbon console, and instead result in restarting >> the osgi bundle. I located this when debugging the code. >> >> Even though the ActiveMQ-All jar has all the classes needed, it seems >> there is problem as "Type mismatch Can't assign >> org.apache.activemq.ActiveMQSession to javax.jms.Session". But this won't >> throw as an exception because the classes are already there but with >> different versions loaded somehow. Therefore this results in restarting the >> osgi bundle. >> >> I'm looking into this matter and anyone got any thoughts on this would >> warmly welcome. >> >> Thank you & Best regards, >> >> *Amal Gunatilake* >> Software Engineer >> WSO2 Inc.; http://wso2.com >> lean.enterprise.middleware >> >> >> On Tue, May 6, 2014 at 10:24 AM, Shazni Nazeer <sha...@wso2.com> wrote: >> >>> Hi Amal, >>> >>> While testing the GREG after doing the change to use the Global cache >>> invalidation I noticed the following. >>> >>> At the time when cache.xml is parsed, it seems the child elements of the >>> cache.xml is never read. The code at that parsing location seems to be >>> incorrect. >>> >>> Further, at the initializing JMS, the debugging steps never go below the >>> line where InitalContext is created. Therefore the broker is not getting >>> initialized. The debugging steps strangely jumps back to init method a many >>> times. >>> >>> Further more, the coordination check at the initialization returns >>> false, but at the invalidateCache method it becomes true making a >>> NullPointerException for session object. IMO, the isCordinator check at the >>> initialization is not needed. WDYT??? >>> >>> Shazni Nazeer >>> >>> Senior Software Engineer >>> >>> Mob : +94 715 440 607 >>> LinkedIn : http://lk.linkedin.com/in/shazninazeer >>> Blog : http://shazninazeer.blogspot.com >>> >>> >>> On Tue, Apr 29, 2014 at 4:55 PM, Amal Gunatilake <am...@wso2.com> wrote: >>> >>>> The updates are available @ >>>> https://github.com/amalhub/carbon4-kernel/commit/10734eb2ded9afaee57dd96f8cd5665f0638d8c3 >>>> >>>> >>>> Thank you & Best regards, >>>> >>>> *Amal Gunatilake* >>>> Software Engineer >>>> WSO2 Inc.; http://wso2.com >>>> lean.enterprise.middleware >>>> >>>>
_______________________________________________ Dev mailing list Dev@wso2.org http://wso2.org/cgi-bin/mailman/listinfo/dev