how to run spring batch admin in Websphere ND 8.5 - spring

Has someone really managed to run Spring Batch Admin in Websphere 8.5 ND? I have spent like 50 hours to run the most simple Spring Batch Admin in Websphere ND 8.5 and I can find anything else to try in order to fix
"Error creating bean with name 'mbeanExporter'... Unable to register MBean [org.springframework.integration.monitor.IntegrationMBeanExporter#65e7255d] with key 'integrationMBeanExporter'"
Kindly, see all I have done after read everything I could find in foruns about it:
1) Spring Batch on Clustered environment - Websphere
It says that SpringBatch does not support any means of clustered executions. Well I am not relying in clustered executions nor in any schedulle. I am just trying to start the Spring Batch Admin console and then geting such integrationMBeanExporter error. In other words, I didn't see started the Spring Batch Admin so I didn't trigger yet any job.
2)https://jira.spring.io/browse/BATCHADM-169
It says two interesting statements but none of them change the error at all
(2.1) - use classloading order to PARENT_LAST. I did it for both Server and Application. No changes in error.
(2.2) - use the exact jar versions found here http://docs.spring.io/spring-batch-admin/spring-batch-admin-sample/dependencies.html. I am using it. IN fact, I am trying to use the example provided inside of Spring Batch Admin (spring-batch-admin-sample) and it contains exactly such jar versions. IN my local Websphere Liberty Profile such sample, spring-batch-admin-sample, runs perfectly but when deployed to Websphere ND it gave same integrationMBeanExporter error
3 - https://www.intertech.com/Blog/spring-batch-admin-tutorial/
I followed such step-by-step tutorial and I can run in my local Websphere Liberty Profile but same integrationMBeanExporter error when running in Websphere ND.
4 - I could reproduce same integrationMBeanExporter error in my local Websphere Liberty Profile when I deployed two Spring Batch Admin to it. Well, just to make sure it wasn't the problem, I deleted all others application from Websphere ND Server and left just a single Spring Batch Admin. Same integrationMBeanExporter raises.
5 - In my local Websphere Liberty I fixed the integrationMBeanExporter issue caused by having two Spring Batch Admin when I followed the suggestion found in Deploying two Spring batch applications in same cluster in a single Weblogic Domain?. I mean, I created
<int-jmx:mbean-export id="integrationMBeanExporter" default-domain="SpringBatchAdmin" server="mbeanServer" />
<context:mbean-export default-domain="SpringBatchAdmin" server="mbeanServer" />
in one of the two applications in my local WAS Liberty and then it fix the issue and allowed me to open two Spring Batch Admin in the same server. Well, again, in Websphere ND I have deleted all application other then my Spring Batch Admin so it doesn't make much sense to me by the way I tried and it didn't change the error at all.
It seems I can have SPring Batch Admin very easy up and running in any Web Container different of Websphere ND 8.5.5. I guess, but I am not sure that there might exist some way to fix such error by a simple configuration but I can imagine what else to try.
The entire error:
[9/10/16 14:32:40:484 CDT] FFDC Exception:org.springframework.beans.factory.BeanCreationException SourceId:com.ibm.ws.webcontainer.webapp.WebApp.notifyServletContextCreated ProbeId:1341 Reporter:com.ibm.ws.webcontainer.webapp.WebAppImpl#a2268c26
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'mbeanExporter':
Invocation of init method failed; nested exception is org.springframework.jmx.export.UnableToRegisterMBeanException:
Unable to register MBean [org.springframework.integration.monitor.IntegrationMBeanExporter#65e7255d] with key 'integrationMBeanExporter';
nested exception is javax.management.RuntimeOperationsException
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1553)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:539)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:475)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:304)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:228)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:300)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:195)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:703)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:760)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:482)
at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:410)
at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:306)
at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:112)
at com.ibm.ws.webcontainer.webapp.WebApp.notifyServletContextCreated(WebApp.java:1704)
at com.ibm.ws.webcontainer.webapp.WebAppImpl.initialize(WebAppImpl.java:411)
at com.ibm.ws.webcontainer.webapp.WebGroupImpl.addWebApplication(WebGroupImpl.java:88)
at com.ibm.ws.webcontainer.VirtualHostImpl.addWebApplication(VirtualHostImpl.java:169)
at com.ibm.ws.webcontainer.WSWebContainer.addWebApp(WSWebContainer.java:749)
at com.ibm.ws.webcontainer.WSWebContainer.addWebApplication(WSWebContainer.java:634)
at com.ibm.ws.webcontainer.component.WebContainerImpl.install(WebContainerImpl.java:426)
at com.ibm.ws.webcontainer.component.WebContainerImpl.start(WebContainerImpl.java:718)
at com.ibm.ws.runtime.component.ApplicationMgrImpl.start(ApplicationMgrImpl.java:1177)
at com.ibm.ws.runtime.component.DeployedApplicationImpl.fireDeployedObjectStart(DeployedApplicationImpl.java:1370)
at com.ibm.ws.runtime.component.DeployedModuleImpl.start(DeployedModuleImpl.java:639)
at com.ibm.ws.runtime.component.DeployedApplicationImpl.start(DeployedApplicationImpl.java:968)
at com.ibm.ws.runtime.component.ApplicationMgrImpl.startApplication(ApplicationMgrImpl.java:776)
at com.ibm.ws.runtime.component.ApplicationMgrImpl$5.run(ApplicationMgrImpl.java:2195)
at com.ibm.ws.security.auth.ContextManagerImpl.runAs(ContextManagerImpl.java:5477)
at com.ibm.ws.security.auth.ContextManagerImpl.runAsSystem(ContextManagerImpl.java:5603)
at com.ibm.ws.security.core.SecurityContext.runAsSystem(SecurityContext.java:255)
at com.ibm.ws.runtime.component.ApplicationMgrImpl.start(ApplicationMgrImpl.java:2200)
at com.ibm.ws.runtime.component.CompositionUnitMgrImpl.start(CompositionUnitMgrImpl.java:435)
at com.ibm.ws.runtime.component.CompositionUnitImpl.start(CompositionUnitImpl.java:123)
at com.ibm.ws.runtime.component.CompositionUnitMgrImpl.start(CompositionUnitMgrImpl.java:378)
at com.ibm.ws.runtime.component.CompositionUnitMgrImpl.access$500(CompositionUnitMgrImpl.java:126)
at com.ibm.ws.runtime.component.CompositionUnitMgrImpl$CUInitializer.run(CompositionUnitMgrImpl.java:984)
at com.ibm.wsspi.runtime.component.WsComponentImpl$_AsynchInitializer.run(WsComponentImpl.java:502)
at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1881)
Caused by: org.springframework.jmx.export.UnableToRegisterMBeanException: Unable to register MBean [org.springframework.integration.monitor.IntegrationMBeanExporter#65e7255d] with key 'integrationMBeanExporter'; nested exception is javax.management.RuntimeOperationsException
at org.springframework.jmx.export.MBeanExporter.registerBeanNameOrInstance(MBeanExporter.java:610)
at org.springframework.jmx.export.MBeanExporter.registerBeans(MBeanExporter.java:535)
at org.springframework.jmx.export.MBeanExporter.afterPropertiesSet(MBeanExporter.java:417)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1612)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1549)
... 37 more
Caused by: javax.management.RuntimeOperationsException
at com.ibm.ws.management.PlatformMBeanServer.registerMBean(PlatformMBeanServer.java:567)
at org.springframework.jmx.support.MBeanRegistrationSupport.doRegister(MBeanRegistrationSupport.java:195)
at org.springframework.jmx.export.MBeanExporter.registerBeanInstance(MBeanExporter.java:663)
at org.springframework.jmx.export.MBeanExporter.registerBeanNameOrInstance(MBeanExporter.java:600)
... 41 more
Caused by: javax.management.JMRuntimeException: java.lang.reflect.UndeclaredThrowableException
at com.ibm.CORBA.iiop.UtilDelegateImpl.mapSystemException(UtilDelegateImpl.java:242)
at javax.rmi.CORBA.Util.mapSystemException(Util.java:78)
at com.ibm.ws.management._ControlAdminService_Stub.activateProxyMBean(_ControlAdminService_Stub.java:168)
at com.ibm.ws.management.PlatformMBeanServer.registerMBean(PlatformMBeanServer.java:515)
at org.springframework.jmx.support.MBeanRegistrationSupport.doRegister(MBeanRegistrationSupport.java:195)
at org.springframework.jmx.export.MBeanExporter.registerBeanInstance(MBeanExporter.java:663)
at org.springframework.jmx.export.MBeanExporter.registerBeanNameOrInstance(MBeanExporter.java:600)
at org.springframework.jmx.export.MBeanExporter.registerBeans(MBeanExporter.java:535)
at org.springframework.jmx.export.MBeanExporter.afterPropertiesSet(MBeanExporter.java:417)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1612)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1549)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:539)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:475)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:304)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:228)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:300)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:195)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:703)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:760)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:482)
at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:410)
at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:306)
at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:112)
at com.ibm.ws.webcontainer.webapp.WebApp.notifyServletContextCreated(WebApp.java:1704)
at com.ibm.ws.webcontainer.webapp.WebAppImpl.initialize(WebAppImpl.java:411)
at com.ibm.ws.webcontainer.webapp.WebGroupImpl.addWebApplication(WebGroupImpl.java:88)
at com.ibm.ws.webcontainer.VirtualHostImpl.addWebApplication(VirtualHostImpl.java:169)
at com.ibm.ws.webcontainer.WSWebContainer.addWebApp(WSWebContainer.java:749)
at com.ibm.ws.webcontainer.WSWebContainer.addWebApplication(WSWebContainer.java:634)
at com.ibm.ws.webcontainer.component.WebContainerImpl.install(WebContainerImpl.java:426)
at com.ibm.ws.webcontainer.component.WebContainerImpl.start(WebContainerImpl.java:718)
at com.ibm.ws.runtime.component.ApplicationMgrImpl.start(ApplicationMgrImpl.java:1177)
at com.ibm.ws.runtime.component.DeployedApplicationImpl.fireDeployedObjectStart(DeployedApplicationImpl.java:1370)
at com.ibm.ws.runtime.component.DeployedModuleImpl.start(DeployedModuleImpl.java:639)
at com.ibm.ws.runtime.component.DeployedApplicationImpl.start(DeployedApplicationImpl.java:968)
at com.ibm.ws.runtime.component.ApplicationMgrImpl.startApplication(ApplicationMgrImpl.java:776)
at com.ibm.ws.runtime.component.ApplicationMgrImpl$5.run(ApplicationMgrImpl.java:2195)
at com.ibm.ws.security.auth.ContextManagerImpl.runAs(ContextManagerImpl.java:5477)
at com.ibm.ws.security.auth.ContextManagerImpl.runAsSystem(ContextManagerImpl.java:5603)
at com.ibm.ws.security.core.SecurityContext.runAsSystem(SecurityContext.java:255)
at com.ibm.ws.runtime.component.ApplicationMgrImpl.start(ApplicationMgrImpl.java:2200)
at com.ibm.ws.runtime.component.CompositionUnitMgrImpl.start(CompositionUnitMgrImpl.java:435)
at com.ibm.ws.runtime.component.CompositionUnitImpl.start(CompositionUnitImpl.java:123)
at com.ibm.ws.runtime.component.CompositionUnitMgrImpl.start(CompositionUnitMgrImpl.java:378)
at com.ibm.ws.runtime.component.CompositionUnitMgrImpl.access$500(CompositionUnitMgrImpl.java:126)
at com.ibm.ws.runtime.component.CompositionUnitMgrImpl$CUInitializer.run(CompositionUnitMgrImpl.java:984)
at com.ibm.wsspi.runtime.component.WsComponentImpl$_AsynchInitializer.run(WsComponentImpl.java:502)
at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1881)
Caused by: java.lang.reflect.InvocationTargetException
at sun.reflect.GeneratedMethodAccessor20.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:56)
at java.lang.reflect.Method.invoke(Method.java:620)
at com.ibm.ws390.orb.RIRProtectedProxyHandler.invoke(RIRProtectedProxyHandler.java:192)
at com.sun.proxy.$Proxy3._invoke(Unknown Source)
at com.ibm.ws390.orb.CommonBridge.invoke(CommonBridge.java:1898)
at com.ibm.ws390.orb.ORBEJSBridge.invoke(ORBEJSBridge.java:286)
at sun.reflect.GeneratedMethodAccessor16.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:56)
at java.lang.reflect.Method.invoke(Method.java:620)
at com.ibm.ws390.orb.parameters.ORBEJSBridgeInvoke.ORBEJSBridgeInvokeParmSetter(ORBEJSBridgeInvoke.java:234)
Caused by: org.omg.CORBA.portable.UnknownException: vmcid: 0x0 minor code: 0 completed: Maybe
at com.ibm.ws.management._ControlAdminServiceImpl_Tie._invoke(_ControlAdminServiceImpl_Tie.java:123)

I had similar issue in my project, it took almost a week to identify the cause, the root cause in my case was just because of a dependency added.
<dependency>
<groupId>com.ibm.websphere.appserver.runtime</groupId>
<artifactId>com.ibm.ws.admin.client</artifactId>
<version>7.0.0</version>
</dependency>
The above dependency was working fine in tomcat but the same not in WAS Liberty server.
<exclusions>
<exclusion>
<artifactId>com.ibm.ws.webservices.thinclient_7.0.0</artifactId>
<groupId>serverwas85</groupId>
</exclusion>
</exclusions>
Hope this will resolve your issue.(Since this exclusion is specific to my application added as reference if someone face similar issue. If you don't have any such relative dependency ignore it)

Related

what could be possible reasons for integrationMBeanExporter ... javax.management.InstanceAlreadyExistsException

I have chose to implement my jobs using Spring Batch Admin and, unfortunately, it works perfectly in all environment except the production. I guess there is another application from another team causing some indirect effect but I can't stop them in order to check which one is affecting and if there is really some application affect.
I am desparetely looking for possible causes and I can't find. Any imagine reason would be a start point appreciatted.
The entire error is:
Trace: 2016/09/09 22:49:17.049 02 t=9BDE88 c=UNK key=P8 tag= (13007004)
SourceId: com.ibm.ws.webcontainer.webapp.WebApp.logServletError
ExtendedMessage: BBOO0220E: SRVE0293E: ÝServlet Error¨-ÝBatch Servlet¨: org.springframework.beans.factory.BeanCreationException: E
rror creating bean with name 'mbeanExporter': Invocation of init method failed; nested exception is org.springframework.jmx.export.U
nableToRegisterMBeanException: Unable to register MBean Ýorg.springframework.integration.monitor.IntegrationMBeanExporter#4ed60bcf¨
with key 'integrationMBeanExporter'; nested exception is javax.management.InstanceAlreadyExistsException: spring.application:cell=dt
l85cel,name=integrationMBeanExporter,type=IntegrationMBeanExporter,node=wlemyAppa,process=WLEmyApp
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.j
ava:1553)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.jav
a:539)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:
475)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:304)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:228)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:300)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:195)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:70
3)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:7
60)
...
at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanSe
at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:814)
at com.ibm.ws390.management.connector.corba.CorbaConnectorImpl.invoke(CorbaCon
at com.ibm.ws390.management.connector.corba._CorbaConnectorImplBase._invoke(_C
at com.ibm.ws390.orb.CommonBridge.invoke(CommonBridge.java:1898)
at com.ibm.ws390.orb.CommonBridge.getAndProcessWork(CommonBridge.java:725)
at com.ibm.ws390.orb.CommonBridge.runApplicationThread(CommonBridge.java:614)
at com.ibm.ws390.management.connector.corba.CorbaConnectorImpl.invoke(CorbaCon
at com.ibm.ws390.management.connector.corba._CorbaConnectorImplBase._invoke(_C
at com.ibm.ws390.orb.CommonBridge.invoke(CommonBridge.java:1898)
at com.ibm.ws390.orb.CommonBridge.getAndProcessWork(CommonBridge.java:725)
at com.ibm.ws390.orb.CommonBridge.runApplicationThread(CommonBridge.java:614)
at com.ibm.ws.util.ThreadPool$ZOSWorker.run(ThreadPool.java:2116)
Caused by: org.springframework.jmx.export.UnableToRegisterMBeanException: Unable to register MBean Ýorg.springframework.integration.
monitor.IntegrationMBeanExporter#4ed60bcf¨ with key 'integrationMBeanExporter';nested exception is javax.management.InstanceAlready
ExistsException: spring.application:cell=mycel,name=integrationMBeanExporter,type=IntegrationMBeanExporter,node=wlemyAppa,process
Is there any way to turn off in Spring Batch Admin such duplicated Bean? How can I try IGNORE_EXISTING or REPLACE_EXISTING just to see if it fix my problem?

SpringXD not able to find classes present in Uber Jar's lib

I've created a custom-module in Spring XD where 'm hitting Oracle DB and caching the results using ehcache.Other than the jars present in xd/lib i'm using "ehcache-2.9.0.jar and ojdbc6-11.1.0.7.0.jar" in my module.I created UBER jar for my custom module. Uber Jar/lib contains both the additional jar i've added.Module upload command works works well when i upload uberjar in XD env.How ever when i create stream i get java.lang.NoClassDefFoundError: net/sf/ehcache/CacheManager. Stack trace is given below.If i place ehcache-2.9.0.jar in xd/lib folder and restart xd i'm able to create stream but it defeats the purpose of uber jar. Any suggestions/solution?
2015-10-05T21:52:37-0400 1.2.0.RELEASE INFO DeploymentSupervisor-0 zk.ZKStreamDeploymentHandler - Deployment status for stream 'reconPublicationDev': DeploymentStatus{state=failed,error(s)=org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'integrationEvaluationContext': Invocation of init method failed; nested exception is java.lang.NoClassDefFoundError: net/sf/ehcache/CacheManager
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1574)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:539)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:476)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:303)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:299)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:736)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:757)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:480)
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:686)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:320)
at org.springframework.boot.builder.SpringApplicationBuilder.run(SpringApplicationBuilder.java:139)
at org.springframework.xd.module.core.SimpleModule.initialize(SimpleModule.java:213)
at org.springframework.xd.dirt.module.ModuleDeployer.doDeploy(ModuleDeployer.java:217)
at org.springframework.xd.dirt.module.ModuleDeployer.deploy(ModuleDeployer.java:200)
at org.springframework.xd.dirt.server.container.DeploymentListener.deployModule(DeploymentListener.java:365)
at org.springframework.xd.dirt.server.container.DeploymentListener.deployStreamModule(DeploymentListener.java:334)
at org.springframework.xd.dirt.server.container.DeploymentListener.onChildAdded(DeploymentListener.java:181)
at org.springframework.xd.dirt.server.container.DeploymentListener.childEvent(DeploymentListener.java:149)
at org.apache.curator.framework.recipes.cache.PathChildrenCache$5.apply(PathChildrenCache.java:509)
at org.apache.curator.framework.recipes.cache.PathChildrenCache$5.apply(PathChildrenCache.java:503)
at org.apache.curator.framework.listen.ListenerContainer$1.run(ListenerContainer.java:92)
at com.google.common.util.concurrent.MoreExecutors$SameThreadExecutorService.execute(MoreExecutors.java:297)
at org.apache.curator.framework.listen.ListenerContainer.forEach(ListenerContainer.java:83)
at org.apache.curator.framework.recipes.cache.PathChildrenCache.callListeners(PathChildrenCache.java:500)
at org.apache.curator.framework.recipes.cache.EventOperation.invoke(EventOperation.java:35)
at org.apache.curator.framework.recipes.cache.PathChildrenCache$10.run(PathChildrenCache.java:762)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.NoClassDefFoundError: net/sf/ehcache/CacheManager
at java.lang.Class.getDeclaredMethods0(Native Method)
at java.lang.Class.privateGetDeclaredMethods(Class.java:2701)
at java.lang.Class.getDeclaredMethods(Class.java:1975)
at org.springframework.util.ReflectionUtils.getDeclaredMethods(ReflectionUtils.java:571)
at org.springframework.util.ReflectionUtils.doWithMethods(ReflectionUtils.java:488)
at org.springframework.util.ReflectionUtils.doWithMethods(ReflectionUtils.java:474)
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.determineCandidateConstructors(AutowiredAnnotationBeanPostProcessor.java:241)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.determineConstructorsFromBeanPostProcessors(AbstractAutowireCapableBeanFactory.java:1065)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1038)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.getSingletonFactoryBeanForTypeCheck(AbstractAutowireCapableBeanFactory.java:860)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.getTypeForFactoryBean(AbstractAutowireCapableBeanFactory.java:790)
at org.springframework.beans.factory.support.AbstractBeanFactory.isTypeMatch(AbstractBeanFactory.java:542)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.doGetBeanNamesForType(DefaultListableBeanFactory.java:436)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeanNamesForType(DefaultListableBeanFactory.java:412)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeansOfType(DefaultListableBeanFactory.java:519)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeansOfType(DefaultListableBeanFactory.java:512)
at org.springframework.context.support.AbstractApplicationContext.getBeansOfType(AbstractApplicationContext.java:1052)
at org.springframework.beans.factory.BeanFactoryUtils.beansOfTypeIncludingAncestors(BeanFactoryUtils.java:227)
at org.springframework.integration.config.IntegrationEvaluationContextFactoryBean.afterPropertiesSet(IntegrationEvaluationContextFactoryBean.java:129)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1633)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1570)
... 34 more
Caused by: java.lang.ClassNotFoundException: net.sf.ehcache.CacheManager
at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
... 55 more
My suggestion would be to create a exploded dependencies within the uber jar using Maven Shaded Plugin. In your case, ehcache is in Module Classloader and Spring-Context & Spring-context-support is on Parent Classloader. This will cause a bean(type) injection failure. Use shaded plugin to create the Uber jar with necessary dependencies along with Spring-Context & Spring-context-support. This uber jar version will solve your problem.
I would look into following things
1) If the custom module is uploaded correctly i.e. check your custom modules folder if the uber jar is available.
2) I would do an jar -vft <jar file name> to see if the jar containing the offending class is in the Uber jar for sure.
3) If I was running distributed mode then I have to make sure that the custom-modules folder is shared between admin and containers and container node custom-modules folder has the jar file. This is very important to understand that custom-modules folder must be shared or the content of the directory between admin and containers be kept sync by external means - XD will not sync the custom-modules folder if you haven't set it up as shared folder.

IBM Worklight 6.0 - Failed manual deployment of .war file in WebSphere 8.5

I am using worklight 6.0 and websphere 8.5.
While deploying the worklight war, im getting the following error.
Caused by: org.springframework.beans.factory.BeanCreationException:
Error creating bean with name 'brokerSessionFactory' defined in URL
[wsjar:file:/C:/Program%20Files/IBM/Worklight/WorklightServer/worklight-jee-library.jar!/conf/spring-server-core.xml]:
Invocation of init method failed; nested exception is
java.lang.AbstractMethodError:
javax/persistence/spi/PersistenceUnitInfo.getValidationMode()Ljavax/persistence/ValidationMode;
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1338)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:473)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:409)
at java.security.AccessController.doPrivileged(AccessController.java:252)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:380)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:264)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:261)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:185)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:164)
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:269)
... 116 more
Caused by: java.lang.AbstractMethodError:
javax/persistence/spi/PersistenceUnitInfo.getValidationMode()Ljavax/persistence/ValidationMode;
at org.apache.openjpa.persistence.PersistenceUnitInfoImpl.toOpenJPAProperties(PersistenceUnitInfoImpl.java:477)
at org.apache.openjpa.persistence.PersistenceProductDerivation.load(PersistenceProductDerivation.java:315)
at org.apache.openjpa.persistence.PersistenceProviderImpl.createContainerEntityManagerFactory(PersistenceProviderImpl.java:160)
at org.apache.openjpa.persistence.PersistenceProviderImpl.createContainerEntityManagerFactory(PersistenceProviderImpl.java:62)
at org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean.createNativeEntityManagerFactory(LocalContainerEntityManagerFactoryBean.java:224)
at org.springframework.orm.jpa.AbstractEntityManagerFactoryBean.afterPropertiesSet(AbstractEntityManagerFactoryBean.java:291)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1369)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1335)
... 126 more
In typical fashion, the user asked a question and disappeared...
The solution, as written in the comments:
I solved the issue by setting the classloader order as
"Classes loaded with local class loader first (parent last)".
More information about this setting can be read in this IBM WebSphere Information Center topic.

Spring 3.1 not able to load Configuration Class:

I am working on project that has Rest Service with Spring 3.1.0. Release.
I am using Config class to load beans.
As suggested, using cglib 2.2 and asm-3.3 jars.
This fails in websphere 8.5 with following exception. But works in Apache Tomcat 7.0.
[12/19/12 12:47:26:439 EST] 00000062 webapp E com.ibm.ws.webcontainer.webapp.WebApp logServletError SRVE0293E: [Servlet Error]-[dispatcher]: java.lang.IllegalStateException: Cannot load configuration class: com.hps.config.ApplicationConfig
at org.springframework.context.annotation.ConfigurationClassPostProcessor.enhanceConfigurationClasses(ConfigurationClassPostProcessor.java:313)
at org.springframework.context.annotation.ConfigurationClassPostProcessor.postProcessBeanFactory(ConfigurationClassPostProcessor.java:197)
at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:681)
at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:620)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:446)
at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:384)
at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:283)
at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:111)
at com.ibm.ws.webcontainer.webapp.WebApp.notifyServletContextCreated(WebApp.java:1651)
at com.ibm.ws.webcontainer.webapp.WebAppImpl.initialize(WebAppImpl.java:414)
at com.ibm.ws.webcontainer.webapp.WebGroupImpl.addWebApplication(WebGroupImpl.java:88)
at com.ibm.ws.webcontainer.VirtualHostImpl.addWebApplication(VirtualHostImpl.java:169)
at com.ibm.ws.webcontainer.WSWebContainer.addWebApp(WSWebContainer.java:746)
at com.ibm.ws.webcontainer.WSWebContainer.addWebApplication(WSWebContainer.java:634)
at com.ibm.ws.webcontainer.component.WebContainerImpl.install(WebContainerImpl.java:426)
at com.ibm.ws.webcontainer.component.WebContainerImpl.start(WebContainerImpl.java:718)
at com.ibm.ws.runtime.component.ApplicationMgrImpl.start(ApplicationMgrImpl.java:1170)
at com.ibm.ws.runtime.component.DeployedApplicationImpl.fireDeployedObjectStart(DeployedApplicationImpl.java:1370)
at com.ibm.ws.runtime.component.DeployedModuleImpl.start(DeployedModuleImpl.java:638)
at com.ibm.ws.runtime.component.DeployedApplicationImpl.start(DeployedApplicationImpl.java:968)
at com.ibm.ws.runtime.component.ApplicationMgrImpl.startApplication(ApplicationMgrImpl.java:769)
at com.ibm.ws.runtime.component.ApplicationMgrImpl.startApplicationDynamically(ApplicationMgrImpl.java:1364)
at com.ibm.ws.runtime.component.ApplicationMgrImpl.start(ApplicationMgrImpl.java:2169)
Caused by: java.lang.VerifyError: JVMVRFY007 final method overridden; class=net/sf/cglib/core/DebuggingClassWriter, method=visit(IILjava/lang/String;Ljava/lang/String;Ljava/lang/String;[Ljava/lang/String;)V
at java.lang.ClassLoader.defineClassImpl(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:262)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:69)
at com.ibm.ws.classloader.CompoundClassLoader._defineClass(CompoundClassLoader.java:852)
at com.ibm.ws.classloader.CompoundClassLoader.localFindClass(CompoundClassLoader.java:762)
at com.ibm.ws.classloader.CompoundClassLoader.loadClass(CompoundClassLoader.java:585)
at java.lang.ClassLoader.loadClass(ClassLoader.java:627)
at java.lang.J9VMInternals.verifyImpl(Native Method)
at java.lang.J9VMInternals.verify(J9VMInternals.java:85)
at java.lang.J9VMInternals.initialize(J9VMInternals.java:162)
at net.sf.cglib.core.AbstractClassGenerator.<init>(AbstractClassGenerator.java:38)
at net.sf.cglib.core.KeyFactory$Generator.<init>(KeyFactory.java:127)
at net.sf.cglib.core.KeyFactory.create(KeyFactory.java:112)
at net.sf.cglib.core.KeyFactory.create(KeyFactory.java:108)
at net.sf.cglib.core.KeyFactory.create(KeyFactory.java:104)
at net.sf.cglib.proxy.Enhancer.<clinit>(Enhancer.java:69)
at java.lang.J9VMInternals.initializeImpl(Native Method)
at java.lang.J9VMInternals.initialize(J9VMInternals.java:228)
at org.springframework.context.annotation.ConfigurationClassEnhancer.newEnhancer(ConfigurationClassEnhancer.java:136)
at org.springframework.context.annotation.ConfigurationClassEnhancer.enhance(ConfigurationClassEnhancer.java:109)
at org.springframework.context.annotation.ConfigurationClassPostProcessor.enhanceConfigurationClasses(ConfigurationClassPostProcessor.java:303)
... 109 more
Any suggestion on how to fix this issue.
Tried with different versions of cglib and asm jars, but no luck..
Make sure all the dependent JAR files are stored in WEB-INF/lib directory of your WAR file including Sam-3.3. If your using Maven then make sure you don't exclude this JAR or inadvertently set its scope as provided.
Now you you deploy the application in WebSphere make sure you set the application class loading before to application first (parent last). To do this in WebSphere you need to find the link Manage Modules and locate class loading link, don't really remember what it was in WebSphere however should be easy to find. This should resolve your issues.
Update: just noticed the link you provided already suggests using parent last. In WebSphere I find this is a must otherwise you will hit many of these issues and furthermore upgrades become much easier!
I am able to resolve this issue..
Issue is with Websphere 8.5
It has own version of asm4.0 jars. And spring3.1 uses cglib2.2 jar that is only compatible with asm3.3. asm4.0 jar of websphere is the culprit..
workaround is to use cglib-nodep jar instead of cglib2.2 jar
http://www.ibm.com/developerworks/forums/thread.jspa?messageID=14880673
It seems that this was a bug (PM71336) in Websphere 8.5
The bug has been fixed in the Websphere V8.5 Fix Pack 2
http://www-01.ibm.com/support/docview.wss?uid=swg24034672
Use cglib-nodep jar instead of cglib2.2 jar. Also, don't forget to remove asm3.3 jar from your lib. Initially I wasn't removing asm3.3 jar which was still causing the problem.

Spring 3 and MyBatis 3.0.4 / 3.0.6: MalformedParameterizedTypeException

I am trying to use Spring 3.0.5.RELEASE together with MyBatis in a Maven environment. I added the mybatis-spring dependency. This turned out not to work due to a MalformedParameterizedTypeException (a detailed stacktrace is included below).
Stacktrace:
SEVERE: Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListener
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sqlSessionFactory' defined in ServletContext resource [/WEB-INF/applicationContext.xml]: Initialization of bean failed; nested exception is java.lang.reflect.MalformedParameterizedTypeException
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:527)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:291)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:288)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:190)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:563)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:895)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:425)
at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:276)
at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:197)
at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:47)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4723)
at org.apache.catalina.core.StandardContext$1.call(StandardContext.java:5226)
at org.apache.catalina.core.StandardContext$1.call(StandardContext.java:5221)
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:1110)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
at java.lang.Thread.run(Thread.java:679)
Caused by: java.lang.reflect.MalformedParameterizedTypeException
at sun.reflect.generics.reflectiveObjects.ParameterizedTypeImpl.validateConstructorArguments(ParameterizedTypeImpl.java:60)
at sun.reflect.generics.reflectiveObjects.ParameterizedTypeImpl.<init>(ParameterizedTypeImpl.java:53)
at sun.reflect.generics.reflectiveObjects.ParameterizedTypeImpl.make(ParameterizedTypeImpl.java:95)
at sun.reflect.generics.factory.CoreReflectionFactory.makeParameterizedType(CoreReflectionFactory.java:104)
at sun.reflect.generics.visitor.Reifier.visitClassTypeSignature(Reifier.java:140)
at sun.reflect.generics.tree.ClassTypeSignature.accept(ClassTypeSignature.java:49)
at sun.reflect.generics.visitor.Reifier.visitArrayTypeSignature(Reifier.java:159)
at sun.reflect.generics.tree.ArrayTypeSignature.accept(ArrayTypeSignature.java:42)
at sun.reflect.generics.repository.ConstructorRepository.getParameterTypes(ConstructorRepository.java:94)
at java.lang.reflect.Method.getGenericParameterTypes(Method.java:300)
at java.beans.FeatureDescriptor.getParameterTypes(FeatureDescriptor.java:385)
at java.beans.MethodDescriptor.setMethod(MethodDescriptor.java:116)
at java.beans.MethodDescriptor.<init>(MethodDescriptor.java:74)
at java.beans.MethodDescriptor.<init>(MethodDescriptor.java:58)
at java.beans.Introspector.getTargetMethodInfo(Introspector.java:1196)
at java.beans.Introspector.getBeanInfo(Introspector.java:423)
at java.beans.Introspector.getBeanInfo(Introspector.java:189)
at org.springframework.beans.CachedIntrospectionResults.<init>(CachedIntrospectionResults.java:224)
at org.springframework.beans.CachedIntrospectionResults.forClass(CachedIntrospectionResults.java:149)
at org.springframework.beans.BeanWrapperImpl.getCachedIntrospectionResults(BeanWrapperImpl.java:305)
at org.springframework.beans.BeanWrapperImpl.getPropertyDescriptorInternal(BeanWrapperImpl.java:335)
at org.springframework.beans.BeanWrapperImpl.isWritableProperty(BeanWrapperImpl.java:407)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1327)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1086)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:517)
... 19 more
There are quite some posts concerning this iusse, yet most of them refer to the problem as being caused by having some Spring 2 dependency somewhere in the class-path which was not the case for me:
http://mybatis-user.963551.n3.nabble.com/mybatis-integration-with-Spring-2-5-not-working-td2499805.html
http://groups.google.com/group/mybatis-user/browse_thread/thread/42698cff74504603
The first link mentions an imcompatability to Spring 2 because of the BeanFactory being paramterized in Spring 3 but not in Spring 2. Well, it turns out that the real problem was, that I had a separate MyBatis version (3.0.4) in my dependencies. I changed version 3.0.4 to version 3.0.6 and everything worked just fine. Usually, if one does not have a separate MyBatis dependency somewhere in the project (or parent projects!), the mybatis-spring artifact from Maven comes with MyBatis 3.0.6.
Side note: I had some other issues with the Maven dependency management system I was using because the changed pom.xml dependency would not propagate through to the top-level projects. Obviously after running a mvn clean install -Dmaven.text.skip=true dependencies got propagated to the top level projects and everything was working.

Resources