java - Deploy Spring Boot 1.3.2 IBM WAS 8.5 -
i'm facing problem deploying simple spring boot web on ibm websphere 8.5.5.8 using full profile
was default using servlet 3.0 , java 1.7.
the application not much, display page "hi - [current-date]".
when deploying war file, see following in server log output:
[2/3/16 13:30:44:857 ast] 00000078 adminhelper admn1008i: attempt made start simpledemo_war application. (user id = defaultwimfilebasedrealm/wps_admin) [2/3/16 13:30:44:871 ast] 00000078 compositionun wsvr0190i: starting composition unit websphere:cuname=simpledemo_war in bla websphere:blaname=simpledemo_war. [2/3/16 13:30:44:958 ast] 00000078 applicationmg wsvr0200i: starting application: simpledemo_war [2/3/16 13:30:44:959 ast] 00000078 applicationmg wsvr0203i: application: simpledemo_war application build level: 0.0.1-snapshot [2/3/16 13:30:46:347 ast] 00000078 webapp com.ibm.ws.webcontainer.webapp.webgroupimpl webgroup srve0169i: loading web module: simpledemo.war. [2/3/16 13:30:46:356 ast] 00000078 methodmap w cwnen0049w: resource annotations on methods of org.springframework.boot.autoconfigure.jdbc.datasourceinitializer class ignored. annotations not obtained because of exception : java.lang.noclassdeffounderror: org.springframework.jdbc.datasource.init.databasepopulator [2/3/16 13:30:46:357 ast] 00000078 injectionproc w cwnen0047w: resource annotations on fields of org.springframework.boot.autoconfigure.jdbc.datasourceinitializer class ignored. annotations not obtained because of exception : java.lang.noclassdeffounderror: org.springframework.jdbc.datasource.init.databasepopulator @ java.lang.j9vminternals.verifyimpl(native method) @ java.lang.j9vminternals.verify(j9vminternals.java:93) @ java.lang.j9vminternals.prepare(j9vminternals.java:490) @ java.lang.class.getdeclaredfields(class.java:605) @ com.ibm.wsspi.injectionengine.injectionprocessor.getalldeclaredfields(injectionprocessor.java:548) @ com.ibm.wsspi.injectionengine.injectionprocessor.processallannotations(injectionprocessor.java:716) @ com.ibm.wsspi.injectionengine.injectionprocessorcontextimpl.processallannotations(injectionprocessorcontextimpl.java:61) @ com.ibm.ws.injectionengine.abstractinjectionengine.processannotations(abstractinjectionengine.java:741) @ com.ibm.ws.injectionengine.abstractinjectionengine.processinjectionmetadata(abstractinjectionengine.java:561) @ com.ibm.ws.injectionengine.sharedinjectionengineimpl.processinjectionmetadata(sharedinjectionengineimpl.java:229) @ com.ibm.ws.injectionengine.referencecontextimpl.processimpl(referencecontextimpl.java:789) @ com.ibm.ws.injectionengine.referencecontextimpl.process(referencecontextimpl.java:390) @ com.ibm.ws.webcontainer.webapp.webappimpl.populatejavanamespace(webappimpl.java:1112) @ com.ibm.ws.webcontainer.webapp.webappimpl.initialize(webappimpl.java:328) @ com.ibm.ws.webcontainer.webapp.webgroupimpl.addwebapplication(webgroupimpl.java:88) @ com.ibm.ws.webcontainer.virtualhostimpl.addwebapplication(virtualhostimpl.java:169) @ com.ibm.ws.webcontainer.wswebcontainer.addwebapp(wswebcontainer.java:746) @ com.ibm.ws.webcontainer.wswebcontainer.addwebapplication(wswebcontainer.java:634) @ com.ibm.ws.webcontainer.component.webcontainerimpl.install(webcontainerimpl.java:426) @ com.ibm.ws.webcontainer.component.webcontainerimpl.start(webcontainerimpl.java:718) @ com.ibm.ws.runtime.component.applicationmgrimpl.start(applicationmgrimpl.java:1175) @ com.ibm.ws.runtime.component.deployedapplicationimpl.firedeployedobjectstart(deployedapplicationimpl.java:1370) @ com.ibm.ws.runtime.component.deployedmoduleimpl.start(deployedmoduleimpl.java:639) @ com.ibm.ws.runtime.component.deployedapplicationimpl.start(deployedapplicationimpl.java:968) @ com.ibm.ws.runtime.component.applicationmgrimpl.startapplication(applicationmgrimpl.java:774) @ com.ibm.ws.runtime.component.applicationmgrimpl.startapplicationdynamically(applicationmgrimpl.java:1374) @ com.ibm.ws.runtime.component.applicationmgrimpl.start(applicationmgrimpl.java:2179) @ com.ibm.ws.runtime.component.compositionunitmgrimpl.start(compositionunitmgrimpl.java:445) @ com.ibm.ws.runtime.component.compositionunitimpl.start(compositionunitimpl.java:123) @ com.ibm.ws.runtime.component.compositionunitmgrimpl.start(compositionunitmgrimpl.java:388) @ com.ibm.ws.runtime.component.compositionunitmgrimpl.access$500(compositionunitmgrimpl.java:116) @ com.ibm.ws.runtime.component.compositionunitmgrimpl$1.run(compositionunitmgrimpl.java:663) @ com.ibm.ws.security.auth.contextmanagerimpl.runas(contextmanagerimpl.java:5474) @ com.ibm.ws.security.auth.contextmanagerimpl.runassystem(contextmanagerimpl.java:5600) @ com.ibm.ws.security.core.securitycontext.runassystem(securitycontext.java:255) @ com.ibm.ws.runtime.component.compositionunitmgrimpl.startcompositionunit(compositionunitmgrimpl.java:677) @ com.ibm.ws.runtime.component.compositionunitmgrimpl.startcompositionunit(compositionunitmgrimpl.java:621) @ com.ibm.ws.runtime.component.applicationmgrimpl.startapplication(applicationmgrimpl.java:1266) @ sun.reflect.nativemethodaccessorimpl.invoke0(native method) @ sun.reflect.nativemethodaccessorimpl.invoke(nativemethodaccessorimpl.java:60) @ sun.reflect.delegatingmethodaccessorimpl.invoke(delegatingmethodaccessorimpl.java:37) @ java.lang.reflect.method.invoke(method.java:611) @ sun.reflect.misc.trampoline.invoke(methodutil.java:49) @ sun.reflect.generatedmethodaccessor33.invoke(unknown source) @ sun.reflect.delegatingmethodaccessorimpl.invoke(delegatingmethodaccessorimpl.java:37) @ java.lang.reflect.method.invoke(method.java:611) @ sun.reflect.misc.methodutil.invoke(methodutil.java:256) @ javax.management.modelmbean.requiredmodelmbean$4.run(requiredmodelmbean.java:1148) @ java.security.accesscontroller.doprivileged(accesscontroller.java:252) @ com.ibm.oti.security.checkedaccesscontrolcontext.securitycheck(checkedaccesscontrolcontext.java:30) @ sun.misc.javasecurityaccesswrapper.dointersectionprivilege(javasecurityaccesswrapper.java:41) @ javax.management.modelmbean.requiredmodelmbean.invokemethod(requiredmodelmbean.java:1142) @ javax.management.modelmbean.requiredmodelmbean.invoke(requiredmodelmbean.java:995) @ com.sun.jmx.interceptor.defaultmbeanserverinterceptor.invoke(defaultmbeanserverinterceptor.java:848) @ com.sun.jmx.mbeanserver.jmxmbeanserver.invoke(jmxmbeanserver.java:774) @ com.ibm.ws.management.adminserviceimpl$1.run(adminserviceimpl.java:1335) @ com.ibm.ws.security.util.accesscontroller.doprivileged(accesscontroller.java:118) @ com.ibm.ws.management.adminserviceimpl.invoke(adminserviceimpl.java:1228) @ com.ibm.ws.management.commands.adminservicecommands$invokecmd.execute(adminservicecommands.java:251) @ com.ibm.ws.console.core.mbean.mbeanhelper.invoke(mbeanhelper.java:241) @ com.ibm.ws.console.appdeployment.applicationdeploymentcollectionaction.execute(applicationdeploymentcollectionaction.java:578) @ org.apache.struts.action.requestprocessor.processactionperform(unknown source) @ org.apache.struts.action.requestprocessor.process(unknown source) @ org.apache.struts.action.actionservlet.process(unknown source) @ org.apache.struts.action.actionservlet.dopost(unknown source) @ javax.servlet.http.httpservlet.service(httpservlet.java:595) @ javax.servlet.http.httpservlet.service(httpservlet.java:668) @ com.ibm.ws.webcontainer.servlet.servletwrapper.service(servletwrapper.java:1227) @ com.ibm.ws.webcontainer.servlet.servletwrapper.handlerequest(servletwrapper.java:776) @ com.ibm.ws.webcontainer.servlet.servletwrapper.handlerequest(servletwrapper.java:458) @ com.ibm.ws.webcontainer.servlet.servletwrapperimpl.handlerequest(servletwrapperimpl.java:178) @ com.ibm.ws.webcontainer.filter.webappfilterchain.invoketarget(webappfilterchain.java:136) @ com.ibm.ws.webcontainer.filter.webappfilterchain.dofilter(webappfilterchain.java:79) @ com.ibm.ws.webcontainer.filter.webappfiltermanager.dofilter(webappfiltermanager.java:928) @ com.ibm.ws.webcontainer.filter.webappfiltermanager.invokefilters(webappfiltermanager.java:1025) @ com.ibm.ws.webcontainer.webapp.webapprequestdispatcher.dispatch(webapprequestdispatcher.java:1385) @ com.ibm.ws.webcontainer.webapp.webapprequestdispatcher.forward(webapprequestdispatcher.java:194) @ org.apache.struts.action.requestprocessor.doforward(unknown source) @ org.apache.struts.tiles.tilesrequestprocessor.doforward(unknown source) @ org.apache.struts.action.requestprocessor.processforwardconfig(unknown source) @ org.apache.struts.tiles.tilesrequestprocessor.processforwardconfig(unknown source) @ org.apache.struts.action.requestprocessor.process(unknown source) @ org.apache.struts.action.actionservlet.process(unknown source) @ org.apache.struts.action.actionservlet.dopost(unknown source) @ javax.servlet.http.httpservlet.service(httpservlet.java:595) @ javax.servlet.http.httpservlet.service(httpservlet.java:668) @ com.ibm.ws.webcontainer.servlet.servletwrapper.service(servletwrapper.java:1227) @ com.ibm.ws.webcontainer.servlet.servletwrapper.handlerequest(servletwrapper.java:776) @ com.ibm.ws.webcontainer.servlet.servletwrapper.handlerequest(servletwrapper.java:458) @ com.ibm.ws.webcontainer.servlet.servletwrapperimpl.handlerequest(servletwrapperimpl.java:178) @ com.ibm.ws.webcontainer.filter.webappfilterchain.invoketarget(webappfilterchain.java:136) @ com.ibm.ws.webcontainer.filter.webappfilterchain.dofilter(webappfilterchain.java:97) @ com.ibm.ws.console.core.servlet.wscurlfilter.setupcommandassistance(wscurlfilter.java:955) @ com.ibm.ws.console.core.servlet.wscurlfilter.continuestoringtaskstate(wscurlfilter.java:504) @ com.ibm.ws.console.core.servlet.wscurlfilter.dofilter(wscurlfilter.java:325) @ com.ibm.ws.webcontainer.filter.filterinstancewrapper.dofilter(filterinstancewrapper.java:195) @ com.ibm.ws.webcontainer.filter.webappfilterchain.dofilter(webappfilterchain.java:91) @ com.ibm.ws.webcontainer.filter.webappfiltermanager.dofilter(webappfiltermanager.java:928) @ com.ibm.ws.webcontainer.filter.webappfiltermanager.invokefilters(webappfiltermanager.java:1025) @ com.ibm.ws.webcontainer.servlet.cacheservletwrapper.handlerequest(cacheservletwrapper.java:87) @ com.ibm.ws.webcontainer.webcontainer.handlerequest(webcontainer.java:909) @ com.ibm.ws.webcontainer.wswebcontainer.handlerequest(wswebcontainer.java:1662) @ com.ibm.ws.webcontainer.channel.wcchannellink.ready(wcchannellink.java:200) @ com.ibm.ws.http.channel.inbound.impl.httpinboundlink.handlediscrimination(httpinboundlink.java:459) @ com.ibm.ws.http.channel.inbound.impl.httpinboundlink.handlenewrequest(httpinboundlink.java:526) @ com.ibm.ws.http.channel.inbound.impl.httpinboundlink.processrequest(httpinboundlink.java:312) @ com.ibm.ws.http.channel.inbound.impl.httpinboundlink.ready(httpinboundlink.java:283) @ com.ibm.ws.ssl.channel.impl.sslconnectionlink.determinenextchannel(sslconnectionlink.java:1048) @ com.ibm.ws.ssl.channel.impl.sslconnectionlink.readyinboundposthandshake(sslconnectionlink.java:716) @ com.ibm.ws.ssl.channel.impl.sslconnectionlink$myhandshakecompletedcallback.complete(sslconnectionlink.java:412) @ com.ibm.ws.ssl.channel.impl.sslutils.handlehandshake(sslutils.java:1066) @ com.ibm.ws.ssl.channel.impl.sslhandshakeiocallback.complete(sslhandshakeiocallback.java:87) @ com.ibm.ws.tcp.channel.impl.aioreadcompletionlistener.futurecompleted(aioreadcompletionlistener.java:175) @ com.ibm.io.async.abstractasyncfuture.invokecallback(abstractasyncfuture.java:217) @ com.ibm.io.async.asyncchannelfuture.firecompletionactions(asyncchannelfuture.java:161) @ com.ibm.io.async.asyncfuture.completed(asyncfuture.java:138) @ com.ibm.io.async.resulthandler.complete(resulthandler.java:204) @ com.ibm.io.async.resulthandler.runeventprocessingloop(resulthandler.java:775) @ com.ibm.io.async.resulthandler$2.run(resulthandler.java:905) @ com.ibm.ws.util.threadpool$worker.run(threadpool.java:1862) caused by: java.lang.classnotfoundexception: org.springframework.jdbc.datasource.init.databasepopulator @ java.net.urlclassloader.findclass(urlclassloader.java:434) @ com.ibm.ws.bootstrap.extclassloader.findclass(extclassloader.java:204) @ java.lang.classloader.loadclasshelper(classloader.java:688) @ java.lang.classloader.loadclass(classloader.java:667) @ com.ibm.ws.bootstrap.extclassloader.loadclass(extclassloader.java:119) @ java.lang.classloader.loadclass(classloader.java:650) @ com.ibm.ws.classloader.protectionclassloader.loadclass(protectionclassloader.java:62) @ com.ibm.ws.classloader.protectionclassloader.loadclass(protectionclassloader.java:58) @ com.ibm.ws.classloader.compoundclassloader.loadclass(compoundclassloader.java:616) @ java.lang.classloader.loadclass(classloader.java:650) @ com.ibm.ws.classloader.compoundclassloader.loadclass(compoundclassloader.java:584) @ java.lang.classloader.loadclass(classloader.java:650) ... 120 more [2/3/16 13:30:46:388 ast] 00000078 wassessioncor sessioncontextregistry getsessioncontext sesn0176i: create new session context application key default_host/simpledemo [2/3/16 13:30:52:873 ast] 00000078 webapp com.ibm.ws.webcontainer.webapp.webapp log srve0292i: servlet message - [simpledemo_war#simpledemo.war]:.spring webapplicationinitializers detected on classpath: [org.springframework.boot.autoconfigure.jersey.jerseyautoconfiguration$jerseywebapplicationinitializer@fcdf38eb] [2/3/16 13:30:52:874 ast] 00000078 webcontainer com.ibm.ws.webcontainer.virtualhostimpl addwebapplication srve0250i: web module null has been bound default_host[*:9080,*:80,*:9443,*:5060,*:5061,*:443]. [2/3/16 13:30:52:889 ast] 00000078 applicationmg wsvr0221i: application started: simpledemo_war [2/3/16 13:30:52:889 ast] 00000078 compositionun wsvr0191i: composition unit websphere:cuname=simpledemo_war in bla websphere:blaname=simpledemo_war started.
spring boot not seem start, i'm not seeing in logs indicate servlet being initialized. i'm using spring boot maven , java 1.7. don't have web.xml file in war. here boot application class:
import org.springframework.boot.springapplication; import org.springframework.boot.autoconfigure.springbootapplication; @springbootapplication public class demosimpleapplication { public static void main(string[] args) { springapplication.run(demosimpleapplication.class, args); } }
project pom is:
<?xml version="1.0" encoding="utf-8"?> <project xmlns="http://maven.apache.org/pom/4.0.0" xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xsi:schemalocation="http://maven.apache.org/pom/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelversion>4.0.0</modelversion> <groupid>com.me.example</groupid> <artifactid>simple-demo</artifactid> <version>0.0.1-snapshot</version> <packaging>war</packaging> <name>simple-demo</name> <description>demo project spring boot</description> <parent> <groupid>org.springframework.boot</groupid> <artifactid>spring-boot-starter-parent</artifactid> <version>1.3.2.release</version> <relativepath/> <!-- lookup parent repository --> </parent> <properties> <project.build.sourceencoding>utf-8</project.build.sourceencoding> <java.version>1.7</java.version> </properties> <dependencies> <dependency> <groupid>org.springframework.boot</groupid> <artifactid>spring-boot-starter-thymeleaf</artifactid> </dependency> <dependency> <groupid>org.springframework.boot</groupid> <artifactid>spring-boot-starter-web</artifactid> </dependency> <dependency> <groupid>org.springframework.boot</groupid> <artifactid>spring-boot-starter-tomcat</artifactid> <scope>provided</scope> </dependency> <dependency> <groupid>org.springframework.boot</groupid> <artifactid>spring-boot-starter-test</artifactid> <scope>test</scope> </dependency> <dependency> <groupid>org.springframework.boot</groupid> <artifactid>spring-boot-devtools</artifactid> </dependency> </dependencies> <build> <plugins> <plugin> <groupid>org.springframework.boot</groupid> <artifactid>spring-boot-maven-plugin</artifactid> </plugin> </plugins> </build> </project>
update-1: have followed spring guide on deploying external containers, same war works on jboss eap 6.2 , tomcat 8
update-2: added new class (i don't know how forgot it) extends springbootservletinitializer , removed spring-boot-devtools pom, see andy wilkinson answer..
i believe can safely ignore warning messages was. they're rather noisy won't stop application starting successfully.
the problem appears don't have springbootservletinitializer
in application. if did, have been listed in log message:
[2/3/16 13:30:52:873 ast] 00000078 webapp com.ibm.ws.webcontainer.webapp.webapp log srve0292i: servlet message - [simpledemo_war#simpledemo.war]:.spring webapplicationinitializers detected on classpath: [org.springframework.boot.autoconfigure.jersey.jerseyautoconfiguration$jerseywebapplicationinitializer@fcdf38eb]
the easiest way provide 1 update demosimpleapplication
extend springbootservletinitializer
, override configure method:
@springbootapplication public class demosimpleapplication extends springbootservletinitializer { @override protected springapplicationbuilder configure(springapplicationbuilder application) { return application.sources(demosimpleapplication.class); } public static void main(string[] args) { springapplication.run(demosimpleapplication.class, args); } }
Comments
Post a Comment