Error Migrating from Spring 3.2.2 to 4.0.2 - spring

We are trying to migrate a Spring MVC application from 3.2.2 to 4.0.2 and receive the below error.
The .jar files in the lib folder are (all below jar files have been changed to 4.0.2 version):
spring-beans-3.2.2.RELEASE.jar spring-context-3.2.2.RELEASE.jar
spring-core-3.2.2.RELEASE.jar spring-expression-3.2.2.RELEASE.jar
spring-orm-3.2.2.RELEASE.jar spring-web-3.2.2.RELEASE.jar
spring-webmvc-3.2.2.RELEASE.jar
Also added one more jar : spring-aop-4.0.2.RELEASE
ERROR:
[9/28/15 1:43:54:731 EDT] 00000026 ServletWrappe E com.ibm.ws.webcontainer.servlet.ServletWrapper service SRVE0014E: Uncaught service() exception root cause /xbnp/sprin
g/BenefitDistributionParameter.jsp: com.ibm.websphere.servlet.error.ServletErrorReport: java.lang.NoSuchMethodError: org/springframework/web/servlet/tags/form/InputTag.
setDisabled(Ljava/lang/String;)V
at org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:695)
at com.ibm._jsp._BenefitDistributionParameter._jspService(_BenefitDistributionParameter.java:1953)
at com.ibm.ws.jsp.runtime.HttpJspBase.service(HttpJspBase.java:99)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:668)
Caused by: java.lang.NoSuchMethodError: org/springframework/web/servlet/tags/form/InputTag.setDisabled(Ljava/lang/String;)V
at com.ibm._jsp._BenefitDistributionParameter._jspx_meth_spring_input_1(_BenefitDistributionParameter.java:2010)
at com.ibm._jsp._BenefitDistributionParameter._jspService(_BenefitDistributionParameter.java:624)
How can we rectify this error?

Related

java.lang.NoSuchMethodError: org.springframework.boot.builder.SpringApplicationBuilder.weblogic.application.ModuleException

Blockquote
i am getting below error not able to resolve it can anyone help me in this . Using springboot version 1.4.3 , servlet 3.0 weblogic 12.2.1.4
java.lang.NoSuchMethodError: org.springframework.boot.builder.SpringApplicationBuilder.([Ljava/lang/Class;)V"
weblogic.application.ModuleException: java.lang.NoSuchMethodError:
Blockquote

Websphere 8.5.5 - spring boot error: SpringServletContainerInitializer not a subtype

I have a spring boot application that works fine on Tomcat 8. When I try to deploy it on Websphere 8.5.5 with "Class loader order" set to "Classes loaded with local class loader first (parent last)" the application fails to start with the following exception:
... 73 more
Caused by: java.util.ServiceConfigurationError: javax.servlet.ServletContainerInitializer: Provider org.springframework.web.SpringServletContainerInitializer not a subtype
at java.util.ServiceLoader.fail(ServiceLoader.java:242)
at java.util.ServiceLoader.access$300(ServiceLoader.java:192)
at java.util.ServiceLoader$LazyIterator.next(ServiceLoader.java:380)
at java.util.ServiceLoader$1.next(ServiceLoader.java:456)
at com.ibm.ws.webcontainer.webapp.WebAppImpl.initializeServletContainerInitializers(WebAppImpl.java:537)
at com.ibm.ws.webcontainer.webapp.WebAppImpl.initialize(WebAppImpl.java:410)
at com.ibm.ws.webcontainer.webapp.WebGroupImpl.addWebApplication(WebGroupImpl.java:88)
at com.ibm.ws.webcontainer.VirtualHostImpl.addWebApplication(VirtualHostImpl.java:171)
... 74 more
Just adding my experience with this problem, looking around on the various answers to similar problems I found out that the problem could be caused by some javax-servlet related jar in the classpath. After some trial and error I noticed that the spring-boot-starter-web dependency has an inherited spring-boot-starter-tomcat dependency. Excludung this jar from the application classpath when deploying on Websphere 8.5.5 solved the problem.

Jersey 2.10 in IBM WebSphere

I am setting up project with Jersey 2.10, JavaSE 1.7 in Websphere 8.5.5.2 (websphere 7.1 SDK)
When i deploy the project, i get this error
com.ibm.ws.webcontainer.webapp.WebApp commonInitializationFinally SRVE0266E: Error occured while initializing servlets: {0}
javax.servlet.ServletException: SRVE0207E: Uncaught initialization exception created by servlet
at com.ibm.ws.webcontainer.servlet.ServletWrapper.init(ServletWrapper.java:404)
at com.ibm.ws.webcontainer.servlet.ServletWrapperImpl.init(ServletWrapperImpl.java:168)
I tried to delete the jersey libraries after deploying the project and map it to shared library (same jersey libraries) on websphere. The shared library is mapped to project now, but get other error when i run the application like below.
com.ibm.ws.webcontainer.webapp.WebApp logServletError SRVE0293E: [Servlet Error]-[RESTSrv01]: com.ibm.ws.webcontainer.webapp.WebAppErrorReport: Internal Server Error
at com.ibm.ws.webcontainer.webapp.WebAppDispatcherContext.sendError(WebAppDispatcherContext.java:626)
at com.ibm.ws.webcontainer.webapp.WebAppDispatcherContext.sendError(WebAppDispatcherContext.java:656)
at com.ibm.ws.webcontainer.srt.SRTServletResponse.sendError(SRTServletResponse.java:1301)
at org.glassfish.jersey.servlet.internal.ResponseWriter.commit(ResponseWriter.java:199)
at org.glassfish.jersey.server.ContainerResponse.close(ContainerResponse.java:412)
Any suggestion what could be the problem?

Worklight Server6.0 Installation on WAS

I have WAS v8.0.0.3 running on my machine. I've installed worklight server v6.0 on WAS using IBM Installation manager. But using this config, when i try to install a woklight .war of an application and try to access console, it throws an exception.
Error 500: java.lang.RuntimeException: BaseProjectLocal is null
From the logs, while accessing application console, this exception comes:
[8/21/13 3:32:28:986 PDT] 0000008b LocalTranCoor E WLTC0017E: Resources rolled back due to setRollbackOnly() being called.
[8/21/13 3:32:28:997 PDT] 0000008b webapp E com.ibm.ws.webcontainer.webapp.WebApp logServletError SRVE0293E: [Servlet Error]-[ServletNameNotFound]: java.lang.RuntimeException: BaseProjectLocal is null
at com.worklight.common.util.BaseProjectLocal.get(BaseProjectLocal.java:41)
at com.worklight.server.util.ProjectLocal.get(ProjectLocal.java:55)
at com.worklight.server.util.ProjectLocal.getCoreBeanFactoryS(ProjectLocal.java:95)
at com.worklight.core.util.RssBrokerUtils.getBeanFactory(RssBrokerUtils.java:60)
While starting the application, this exception comes in logs:
[8/21/13 3:37:56:992 PDT] 000000a5 webapp E com.ibm.ws.webcontainer.webapp.WebApp notifyServletContextCreated SRVE0283E: Exception caught while initializing context: {0}
java.lang.NullPointerException
at com.worklight.server.bundle.project.JeeProjectActivator.contextInitialized(JeeProjectActivator.java:105)
at com.ibm.ws.webcontainer.webapp.WebApp.notifyServletContextCreated(WebApp.java:1651)
at com.ibm.ws.webcontainer.webapp.WebAppImpl.initialize(WebAppImpl.java:410)
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:422)
at com.ibm.ws.webcontainer.component.WebContainerImpl.start(WebContainerImpl.java:714)
at com.ibm.ws.runtime.component.ApplicationMgrImpl.start(ApplicationMgrImpl.java:1160)
I fear if something is wrong with installation configuration or database configuration. I'm using mySQL database as backend for worklight. Installation has created Datasource on WAS and test connection also succeeds.
Any help would be highly appreciated.
The IBM Installation Manager does not install Worklight into your existing WAS installation.
In Worklight 6.0 all that it currently does, is:
extract the Worklight framework files and place them in your HD
extract Ant task scripts
You then need to edit these Ant task scripts with your database and .war information and run them to actually install.
Make sure you read the IBM Worklight 6.0 Information Center at:
http://pic.dhe.ibm.com/infocenter/wrklight/v6r0m0/topic/com.ibm.worklight.help.doc/admin/c_installation.html

SLF4J error: This version of SLF4J requires log4j version 1.2.12 or later

When I am trying to deploy the application on Websphere 7.0 I get the error message on console
0000000d SystemErr R SLF4J: This version of SLF4J requires log4j version 1.2.12 or later. See also http://www.slf4j.org/codes.html#log4j_version
Further when spring internally calling log4j api, following error occurs:
0000000d webapp E com.ibm.ws.webcontainer.webapp.WebApp notifyServletContextCreated SRVE0283E: Exception caught while initializing context: {0}
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'processEngine' defined in ServletContext resource
[/WEB-INF/spring_config/jbpm_applicationContext.xml]: Instantiation of bean failed;
nested exception is org.springframework.beans.factory.BeanDefinitionStoreException:
Factory method [public org.jbpm.api.ProcessEngine org.jbpm.pvm.internal.processengine.SpringHelper.createProcessEngine()] threw exception; nested exception is java.lang.NoSuchMethodError: org/apache/log4j/Logger.trace(Ljava/lang/Object;)V
I upgraded the log4j api from 1.2.16 to 1.2.17 but still i got the same error.
Additionally, slf4j-api-1.6.1.jar and slf4j-log4j12-1.6.1.jar are being used in classpath.
You should switch classloading policy for your application to "parent last". Then the version of log4j bundled with your application will be used. Please see Class loader settings for details.

Resources