Unable to deploy Springboot app in Jboss-eap-6.4 - java

i am facing below issue while deploying my springboot app in Jboss server,
Changes done for deploying springboot app in Jboss server
I have extended SpringBootServletInitializer in my main class
Excluded spring-boot-starter-tomcat from my pom.xml
Version details
Spring boot version 2.1.8.RELEASE
JBoss server Version 6.4
ErrorLog
08:09:21,934 ERROR [org.jboss.web] (ServerService Thread Pool -- 53) JBAS018202: Error calling onStartup for servlet container initializer: org.springframework.web.SpringServletContainerInitializer: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'defaultValidator' defined in class path resource [org/springframework/boot/autoconfigure/validation/ValidationAutoConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.validation.beanvalidation.LocalValidatorFactoryBean]: Factory method 'defaultValidator' threw exception; nested exception is java.lang.NoClassDefFoundError: javax/el/ELManager
at org.springframework.beans.factory.support.ConstructorResolver.instantiate(ConstructorResolver.java:627) [spring-beans-5.1.9.RELEASE.jar:5.1.9.RELEASE]
at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:456) [spring-beans-5.1.9.RELEASE.jar:5.1.9.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1321) [spring-beans-5.1.9.RELEASE.jar:5.1.9.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1160) [spring-beans-5.1.9.RELEASE.jar:5.1.9.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:555) [spring-beans-5.1.9.RELEASE.jar:5.1.9.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:515) [spring-beans-5.1.9.RELEASE.jar:5.1.9.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:320) [spring-beans-5.1.9.RELEASE.jar:5.1.9.RELEASE]
i have verified javax.el-api dependency in place at jboss server (< JBOSS _HOME >\modules\system\layers\base\javax\el\api\main)

seems JBoss server 6.4 not support springBoot 2.1.8 RELEASE. when i downgrade the springboot version to 1.5.22 RELEASE, i can able to deploy the war file.

Related

Error creating bean with name 'log4jConfigurer' defined in class path resource [common-context.xml]

I am using spring 4.x dependency jars in my spring boot 2.0.3 application and one of the classes in the jars depends on org.springframework.util.Log4jConfigurer
Below is the exception trace I get when starting the application
ERROR: org.springframework.boot.SpringApplication - Application run failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'log4jConfigurer' defined in class path resource [common-context.xml]: Invocation of init method failed; nested exception is java.lang.NoClassDefFoundError: org/springframework/util/Log4jConfigurer
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1708)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:581)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:503)
at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:317)
Caused by: java.lang.NoClassDefFoundError: org/springframework/util/Log4jConfigurer
at com.xyz.common.util.config.XyzLog4jConfigurer.initializeLog4JConfigurer(XyzLog4jConfigurer.java:58)
at com.xyz.common.util.config.XyzLog4jConfigurer.init(XyzLog4jConfigurer.java:24)
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.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeCustomInitMethod(AbstractAutowireCapableBeanFactory.java:1833)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1776)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1704)
... 24 more
I have the following ivy configuration corresponding to the class in the dependent project's ivy.xml
<dependency org="org.springframework" name="spring-core" rev="4.1.6" conf="compile->compile(*),master(*);runtime->runtime(*);all->default(*)"/>
I don't understand why does the error occur. Can someone help me fix this ?
It was because of spring boot version 2.0.3. I think Log4jConfigurer is deprecated in version 2.0. It was fixed by using spring boot 1.5.10.RELEASE

SpringMVC non-web project runs well in Intelij Idea, but error occurs when exported as jar files

I am using Intelij Idea to develop a non-web SpringMVC project and this project has 5 modules. These module run well in Intelij Idea console, but after I built artifacts and run them through 'java -jar xxx.jar', the following error occurs, I don't know what's wrong with it. There is no maven conflicts.
Exception encountered during context initialization - cancelling refresh attempt:
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.context.event.internalEventListenerProcessor': Initialization of bean failed; nested exception is java.lang.AbstractMethodError
Exception in thread "main" org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.context.event.internalEventListenerProcessor': Initialization of bean failed; nested exception is java.lang.AbstractMethodError
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:564)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:483)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:312)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:308)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:197)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:761)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:867)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:543)
at org.springframework.context.annotation.AnnotationConfigApplicationContext.<init>(AnnotationConfigApplicationContext.java:84)
at com.zhixinsou.master.entry.MasterEntry.main(MasterEntry.java:18)
Caused by: java.lang.AbstractMethodError
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyBeanPostProcessorsBeforeInitialization(AbstractAutowireCapableBeanFactory.java:409)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1626)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:555)
... 10 more

Got JdkVersion classNotFoundException

I have Updated spring version from 4.2.3 to 5.0.2 and security from 5.0.1 to 5.0.10 and using spring-flex version 1.6.0.RC1.
using BlazeDS Dependencies like this.
<!--=| BlazeDS Dependencies |=-->
<dependency org="com.adobe.blazeds" name="blazeds-core" rev="4.0.0.14931"/>
<dependency org="com.adobe.blazeds" name="blazeds-common" rev="4.0.0.14931"/>
<dependency org="com.adobe.blazeds" name="blazeds-remoting" rev="4.0.0.14931"/>
But i am getting following exception.
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 '_messageBrokerDefaultHandlerMapping': Initialization of bean failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name '_messageBroker': Invocation of init method failed; nested exception is org.springframework.beans.factory.BeanInitializationException: MessageBroker initialization failed; nested exception is java.lang.NoClassDefFoundError: org/springframework/core/JdkVersion
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:591)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:502)
at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:312)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:228)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:310)
the Flex Bean _messageBroker initialized failed.
It seems it only support spring 4.X and JdkVersion is deprecated in Spring 5.X

Spring MVC | IBM Websphere Application Server | Server Startup Error

I am getting the following error while deploying a Spring MVC app on IBM WAS 6.1.
[17/07/13 12:31:55:466 BST] 0000001a WebApp E Exception caught while initializing context
org.springframework.beans.factory.BeanCreationException:
Error creating bean with name 'org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter#0':
Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException:
Could not instantiate bean class [org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter]:
Constructor threw exception; nested exception is java.lang.ClassCastException:
com.sun.org.apache.xalan.internal.xsltc.trax.TransformerFactoryImpl incompatible
with javax.xml.transform.TransformerFactory
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateBean(AbstractAutowireCapableBeanFactory.java:965)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:911)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:485)
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:580)
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 com.ibm.ws.wswebcontainer.webapp.WebApp.notifyServletContextCreated(WebApp.java:917)
at com.ibm.ws.webcontainer.webapp.WebApp.commonInitializationFinish(WebApp.java:378)
at com.ibm.ws.wswebcontainer.webapp.WebApp.initialize(WebApp.java:338)
at com.ibm.ws.wswebcontainer.webapp.WebGroup.addWebApplication(WebGroup.java:93)
at com.ibm.ws.wswebcontainer.VirtualHost.addWebApplication(VirtualHost.java:162)
at com.ibm.ws.wswebcontainer.WebContainer.addWebApp(WebContainer.java:673)
at com.ibm.ws.wswebcontainer.WebContainer.addWebApplication(WebContainer.java:626)
at com.ibm.ws.webcontainer.component.WebContainerImpl.install(WebContainerImpl.java:395)
at com.ibm.ws.webcontainer.component.WebContainerImpl.start(WebContainerImpl.java:611)
at com.ibm.ws.runtime.component.ApplicationMgrImpl.start(ApplicationMgrImpl.java:1274)
at com.ibm.ws.runtime.component.DeployedApplicationImpl.fireDeployedObjectStart(DeployedApplicationImpl.java:1164)
at com.ibm.ws.runtime.component.DeployedModuleImpl.start(DeployedModuleImpl.java:591)
at com.ibm.ws.runtime.component.DeployedApplicationImpl.start(DeployedApplicationImpl.java:831)
at com.ibm.ws.runtime.component.ApplicationMgrImpl.startApplication(ApplicationMgrImpl.java:945)
at com.ibm.ws.runtime.component.ApplicationMgrImpl$AppInitializer.run(ApplicationMgrImpl.java:2120)
at com.ibm.wsspi.runtime.component.WsComponentImpl$_AsynchInitializer.run(WsComponentImpl.java:342)
at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1551)
Same application works fine on Tomcat + Eclipse. But when I deployed this on IBM WAS 6.1 using Rational Application Developer I get this error during server startup.
Could any please help me in resolving this error.
Thanks in advance!
This is a class loader issue and looks very similar to XSLT ClassCastException in WebSphere when Spring tries to create an AnnotationMethodHandlerAdapter
So try setting the class loader policy to PARENT_LAST and remove all dependencies on xml-apis / xerces / javax.xml jars from your application.

Spring App + Tomcat + XSLT = TransformerFactoryConfigurationError

I am trying to deploy a Spring 3.0 Webapplicatoin to a tomcat5.5 server running on CentOS.
Deployment works, but when I try to access the application I get a TransformerFactoryConfigurationError:
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter#0': Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter]: Constructor threw exception; nested exception is javax.xml.transform.TransformerFactoryConfigurationError: Provider org.apache.xalan.processor.TransformerFactoryImpl not found
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateBean(AbstractAutowireCapableBeanFactory.java:946)
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:890)
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:479)
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:450)
org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:290)
org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:287)
org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:189)
org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:557)
org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:842)
org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:416)
org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:443)
org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:459)
org.springframework.web.servlet.FrameworkServlet.initWebApplicationContext(FrameworkServlet.java:340)
org.springframework.web.servlet.FrameworkServlet.initServletBean(FrameworkServlet.java:307)
org.springframework.web.servlet.HttpServletBean.init(HttpServletBean.java:127)
javax.servlet.GenericServlet.init(GenericServlet.java:212)
Also I have xalan and xerces installed:
[root#srv-webserver xerces]# yum list xerces* xalan* | grep installed
xalan-j2.i386 2.7.0-6jpp.1 installed
xerces-j2.i386 2.7.1-7jpp.2.el5_4.2 installed
What am I missing?
When using a tomcat 6 installation from apache.org instead of tc5.5 from the CentOS repos everything works fine :-/

Categories

Resources