Spring boot 1.5.8.
Liberty version:
/opt/Liberty/bin/productInfo version
Product name: WebSphere Application Server
Product version: 17.0.0.2
Product edition: LIBERTY_CORE
I have problems booting on Liberty
WARN org.springframework.boot.context.embedded.AnnotationConfigEmbeddedWebApplicationContext - Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'methodValidationPostProcessor' defined in class path resource [org/springframework/boot/autoconfigure/validation/ValidationAutoConfiguration.class]: Unsatisfied dependency expressed through method 'methodValidationPostProcessor' parameter 1; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'defaultValidator' defined in class path resource [org/springframework/boot/autoconfigure/validation/DefaultValidatorConfiguration.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.LinkageError: loading constraint violation when resolving method "javax/validation/Validation.byDefaultProvider()Ljavax/validation/bootstrap/GenericBootstrap;" : loader "com/ibm/ws/classloading/internal/AppClassLoader@a3fad3f0" of class "org/springframework/boot/validation/MessageInterpolatorFactory" and loader "org/eclipse/osgi/internal/loader/EquinoxClassLoader@65505351" of class "javax/validation/Validation" have different types for the method signature
My war contents (alongside other stuff):
unzip -t dropins/myapp.war |grep -i val
testing: WEB-INF/lib/validation-api-1.1.0.Final.jar OK
testing: WEB-INF/lib/hibernate-validator-5.4.1.Final.jar OK
There seems to be other with the same problem: https://www.cpume.com/question/fhfsooff-spring-boot-jpa-applicationeventmulticaster-not-initialized-issue.html
Looks to me like a conflict between the bean validation classes in your app and in WLP. I think you’ll either need to exclude the validation dependencies from your app or, if it’s possible to do so, configure Liberty so that it uses your application’s version of those classes in preference to its own.
Interestingly, our WLP deployment test has no such exclusions or configuration. It’s testing with WLP 16.x so perhaps this is only a problem in more recent versions or the deployment test doesn’t exercise the problematic code path.
Tried dropping both hibernate and the validation-api from the app, now I get:
FFDC1015I: An FFDC Incident has been created: "org.springframework.context.ApplicationContextException: Unable to start embedded container; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'org.springframework.boot.autoconfigure.web.MultipartAutoConfiguration': Unsatisfied dependency expressed through constructor parameter 0; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'spring.http.multipart-org.springframework.boot.autoconfigure.web.MultipartProperties': Initialization of bean failed; nested exception is java.lang.NoClassDefFoundError: javax.validation.bootstrap.GenericBootstrap com.ibm.ws.webcontainer.osgi.DynamicVirtualHost startWebApp" at ffdc_17.11.01_23.05.47.0.log
Can you share the full stack trace from the FFDC file please?
It seems to work with webProfile-7.0 - which is even more strange - as it should allow for the provided api and implementation (hibernate-validator) when not relying on built-in container features.
Thanks. Given that this works with the web profile configured, I think my suspicion that this is a WLP problem has been confirmed. From what you’ve shown thus far, when the web profile is not being used it appears that a subset of the bean validation API is leaking into the application. Can you please raise this with IBM? We can re-open this issue if it turns out that Boot is at fault.
"Can you please raise this with IBM" - is the end of progress on this :-)
I'll try and let it enter into the IBM freezing blackhole - if I manage to jump over the "support" fence in the 1st place
@davidkarlsen That's not good to hear… Perhaps progress would be more likely if it were raised as an OpenLiberty GitHub issue? That would have the added benefit that we could subscribe to the issue and, hopefully, keep it moving along.
@wilkinsona thanks a lot - was not aware of that possibility!
FWIW, I just tried changing our WLP deployment test to use the Java EE 7 variant of WLP 17.0.0.3 (it uses the Web Profile variant of WLP 16.0.0.4 at the moment) and the app started without the warning reported above:
[02/11/17 12:12:42:342 GMT] 00000050 com.ibm.ws.webcontainer.osgi.webapp.WebGroup I SRVE0169I: Loading Web Module: bootapp.
[02/11/17 12:12:42:342 GMT] 00000050 com.ibm.ws.webcontainer I SRVE0250I: Web Module bootapp has been bound to default_host.
[02/11/17 12:12:42:342 GMT] 00000050 com.ibm.ws.http.internal.VirtualHostImpl A CWWKT0016I: Web application available (default_host): http://localhost:53567/bootapp/
[02/11/17 12:12:42:347 GMT] 00000050 com.ibm.ws.app.manager.AppMessageHelper A CWWKZ0001I: Application bootapp started in 7.798 seconds.
[02/11/17 12:12:42:383 GMT] 00000022 com.ibm.ws.webcontainer.osgi.mbeans.PluginGenerator I SRVE9103I: A configuration file for a web server plugin was automatically generated for this server at /Users/awilkinson/dev/spring/spring-boot/master/spring-boot-tests/spring-boot-deployment-tests/spring-boot-deployment-test-wlp/target/cargo/configurations/liberty/servers/defaultServer/logs/state/plugin-cfg.xml.
[02/11/17 12:12:42:421 GMT] 00000018 com.ibm.ws.kernel.feature.internal.FeatureManager A CWWKF0012I: The server installed the following features: [servlet-3.1, beanValidation-1.1, ssl-1.0, jndi-1.0, jca-1.7, jms-2.0, ejbPersistentTimer-3.2, appSecurity-2.0, j2eeManagement-1.1, jdbc-4.1, jaxrs-2.0, wasJmsServer-1.0, javaMail-1.5, cdi-1.2, webProfile-7.0, jcaInboundSecurity-1.0, jpa-2.1, jsp-2.3, ejbLite-3.2, managedBeans-1.0, jsf-2.2, ejbHome-3.2, jaxws-2.2, jsonp-1.0, el-3.0, jaxrsClient-2.0, concurrent-1.0, appClientSupport-1.0, ejbRemote-3.2, jaxb-2.2, javaee-7.0, mdb-3.2, jacc-1.5, batch-1.0, ejb-3.2, jaspic-1.1, json-1.0, jpaContainer-2.1, distributedMap-1.0, websocket-1.1, wasJmsSecurity-1.0, wasJmsClient-2.0].
[02/11/17 12:12:42:422 GMT] 00000018 com.ibm.ws.kernel.feature.internal.FeatureManager I CWWKF0008I: Feature update completed in 14.248 seconds.
[02/11/17 12:12:42:422 GMT] 00000018 com.ibm.ws.kernel.feature.internal.FeatureManager A CWWKF0011I: The server defaultServer is ready to run a smarter planet.
[02/11/17 12:12:42:456 GMT] 00000020 com.ibm.ws.logging.internal.impl.IncidentImpl I FFDC1015I: An FFDC Incident has been created: "java.lang.NoClassDefFoundError: org/apache/tiles/el/ScopeELResolver com.ibm.ws.injectionengine.InjectionProcessorManager.getAllDeclaredFields 249" at ffdc_17.11.02_12.12.42.0.log
[02/11/17 12:12:42:456 GMT] 00000020 com.ibm.ws.injectionengine.InjectionProcessorManager W CWNEN0047W: Resource annotations on the fields of the org.springframework.web.servlet.view.tiles3.TilesConfigurer$CompositeELResolverImpl class will be ignored. The annotations could not be obtained because of the exception : java.lang.NoClassDefFoundError: org/apache/tiles/el/ScopeELResolver
[02/11/17 12:12:42:460 GMT] 00000020 com.ibm.ws.logging.internal.impl.IncidentImpl I FFDC1015I: An FFDC Incident has been created: "java.lang.NoClassDefFoundError: org/apache/tiles/el/ScopeELResolver com.ibm.wsspi.injectionengine.MethodMap.getAllDeclaredMethods 106" at ffdc_17.11.02_12.12.42.1.log
[02/11/17 12:12:42:460 GMT] 00000020 com.ibm.wsspi.injectionengine.MethodMap W CWNEN0049W: Resource annotations on the methods of the org.springframework.web.servlet.view.tiles3.TilesConfigurer$CompositeELResolverImpl class will be ignored. The annotations could not be obtained because of the exception : java.lang.NoClassDefFoundError: org/apache/tiles/el/ScopeELResolver
[02/11/17 12:12:42:461 GMT] 00000020 com.ibm.ws.session.WASSessionCore I SESN0176I: A new session context will be created for application key default_host/bootapp
[02/11/17 12:12:42:462 GMT] 00000020 com.ibm.ws.util I SESN0172I: The session manager is using the Java default SecureRandom implementation for session ID generation.
[02/11/17 12:12:42:604 GMT] 00000020 com.ibm.ws.webcontainer.webapp I SRVE0292I: Servlet Message - [bootapp]:.2 Spring WebApplicationInitializers detected on classpath
[02/11/17 12:12:42:678 GMT] 00000020 SystemOut O 12:12:42.677 [Default Executor-thread-3] DEBUG org.springframework.web.context.support.StandardServletEnvironment - Adding PropertySource 'servletConfigInitParams' with lowest search precedence
[02/11/17 12:12:42:679 GMT] 00000020 SystemOut O 12:12:42.679 [Default Executor-thread-3] DEBUG org.springframework.web.context.support.StandardServletEnvironment - Adding PropertySource 'servletContextInitParams' with lowest search precedence
[02/11/17 12:12:42:704 GMT] 00000020 SystemOut O 12:12:42.704 [Default Executor-thread-3] DEBUG org.springframework.web.context.support.StandardServletEnvironment - Adding PropertySource 'jndiProperties' with lowest search precedence
[02/11/17 12:12:42:705 GMT] 00000020 SystemOut O 12:12:42.705 [Default Executor-thread-3] DEBUG org.springframework.web.context.support.StandardServletEnvironment - Adding PropertySource 'systemProperties' with lowest search precedence
[02/11/17 12:12:42:705 GMT] 00000020 SystemOut O 12:12:42.705 [Default Executor-thread-3] DEBUG org.springframework.web.context.support.StandardServletEnvironment - Adding PropertySource 'systemEnvironment' with lowest search precedence
[02/11/17 12:12:42:707 GMT] 00000020 SystemOut O 12:12:42.706 [Default Executor-thread-3] DEBUG org.springframework.web.context.support.StandardServletEnvironment - Initialized StandardServletEnvironment with PropertySources [StubPropertySource@962277032 {name='servletConfigInitParams', properties=java.lang.Object@b197209}, StubPropertySource@1617103157 {name='servletContextInitParams', properties=java.lang.Object@2a3343ae}, JndiPropertySource@1258100270 {name='jndiProperties', properties=org.springframework.jndi.JndiLocatorDelegate@a34ac42}, MapPropertySource@1927685776 {name='systemProperties', properties={com.ibm.ws390.jta.TransactionManager=com.ibm.wsspi.zos.tx.RRSTXSynchronizationManager, java.vendor=Oracle Corporation, sun.java.launcher=SUN_STANDARD, sun.management.compiler=HotSpot 64-Bit Tiered Compilers, shared.resource.dir=/Users/awilkinson/dev/spring/spring-boot/master/spring-boot-tests/spring-boot-deployment-tests/spring-boot-deployment-test-wlp/target/cargo/configurations/liberty/shared/resources/, os.name=Mac OS X, sun.boot.class.path=/Library/Java/JavaVirtualMachines/jdk1.8.0_151.jdk/Contents/Home/jre/lib/resources.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_151.jdk/Contents/Home/jre/lib/rt.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_151.jdk/Contents/Home/jre/lib/sunrsasign.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_151.jdk/Contents/Home/jre/lib/jsse.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_151.jdk/Contents/Home/jre/lib/jce.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_151.jdk/Contents/Home/jre/lib/charsets.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_151.jdk/Contents/Home/jre/lib/jfr.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_151.jdk/Contents/Home/jre/classes, kernel.launch.time=1467274713484064, java.vm.specification.vendor=Oracle Corporation, shared.app.dir=/Users/awilkinson/dev/spring/spring-boot/master/spring-boot-tests/spring-boot-deployment-tests/spring-boot-deployment-test-wlp/target/cargo/configurations/liberty/shared/apps/, java.runtime.version=1.8.0_151-b12, wlp.lib.dir=/Users/awilkinson/dev/spring/spring-boot/master/spring-boot-tests/spring-boot-deployment-tests/spring-boot-deployment-test-wlp/target/cargo/installs/wlp-javaee7-17.0.0.3/wlp/lib/, user.name=awilkinson, server.tmp.dir=/Users/awilkinson/dev/spring/spring-boot/master/spring-boot-tests/spring-boot-deployment-tests/spring-boot-deployment-test-wlp/target/cargo/configurations/liberty/servers/defaultServer/workarea/tmp/, user.language=en, sun.boot.library.path=/Library/Java/JavaVirtualMachines/jdk1.8.0_151.jdk/Contents/Home/jre/lib, wlp.install.dir=/Users/awilkinson/dev/spring/spring-boot/master/spring-boot-tests/spring-boot-deployment-tests/spring-boot-deployment-test-wlp/target/cargo/installs/wlp-javaee7-17.0.0.3/wlp/, server.output.dir=/Users/awilkinson/dev/spring/spring-boot/master/spring-boot-tests/spring-boot-deployment-tests/spring-boot-deployment-test-wlp/target/cargo/configurations/liberty/servers/defaultServer/, java.version=1.8.0_151, java.util.logging.manager=com.ibm.ws.kernel.boot.logging.WsLogManager, user.timezone=Europe/London, java.net.preferIPv4Stack=true, sun.arch.data.model=64, java.endorsed.dirs=/Library/Java/JavaVirtualMachines/jdk1.8.0_151.jdk/Contents/Home/jre/lib/endorsed, sun.cpu.isalist=, sun.jnu.encoding=UTF-8, file.encoding.pkg=sun.io, file.separator=/, java.specification.name=Java Platform API Specification, java.class.version=52.0, user.country=GB, java.home=/Library/Java/JavaVirtualMachines/jdk1.8.0_151.jdk/Contents/Home/jre, java.vm.info=mixed mode, os.version=10.12.6, sun.font.fontmanager=sun.font.CFontManager, path.separator=:, org.apache.aries.blueprint.preemptiveShutdown=false, java.vm.version=25.151-b12, wlp.user.dir.isDefault=false, ibm.cds.suppresserrors=true, java.awt.printerjob=sun.lwawt.macosx.CPrinterJob, sun.io.unicode.encoding=UnicodeBig, awt.toolkit=sun.lwawt.macosx.LWCToolkit, org.apache.cxf.stax.allowInsecureParser=1, user.home=/Users/awilkinson, java.net.preferIPv4Addresses=true, java.specification.vendor=Oracle Corporation, org.jboss.weld.xml.disableValidating=true, java.library.path=/Users/awilkinson/Library/Java/Extensions:/Library/Java/Extensions:/Network/Library/Java/Extensions:/System/Library/Java/Extensions:/usr/lib/java:., java.vendor.url=http://java.oracle.com/, java.vm.vendor=Oracle Corporation, gopherProxySet=false, java.runtime.name=Java(TM) SE Runtime Environment, sun.net.http.retryPost=false, sun.java.command=/Users/awilkinson/dev/spring/spring-boot/master/spring-boot-tests/spring-boot-deployment-tests/spring-boot-deployment-test-wlp/target/cargo/installs/wlp-javaee7-17.0.0.3/wlp/bin/tools/ws-server.jar defaultServer, java.class.path=/Users/awilkinson/dev/spring/spring-boot/master/spring-boot-tests/spring-boot-deployment-tests/spring-boot-deployment-test-wlp/target/cargo/installs/wlp-javaee7-17.0.0.3/wlp/bin/tools/ws-server.jar:/Users/awilkinson/dev/spring/spring-boot/master/spring-boot-tests/spring-boot-deployment-tests/spring-boot-deployment-test-wlp/target/cargo/installs/wlp-javaee7-17.0.0.3/wlp/bin/tools/ws-javaagent.jar, server.config.dir=/Users/awilkinson/dev/spring/spring-boot/master/spring-boot-tests/spring-boot-deployment-tests/spring-boot-deployment-test-wlp/target/cargo/configurations/liberty/servers/defaultServer/, wlp.user.dir=/Users/awilkinson/dev/spring/spring-boot/master/spring-boot-tests/spring-boot-deployment-tests/spring-boot-deployment-test-wlp/target/cargo/configurations/liberty/, java.vm.specification.name=Java Virtual Machine Specification, java.vm.specification.version=1.8, sun.cpu.endian=little, sun.os.patch.level=unknown, java.awt.headless=true, java.io.tmpdir=/var/folders/zq/v6xkr2696kv05jbf3bddt9680000gn/T/, java.vendor.url.bug=http://bugreport.sun.com/bugreport/, shared.config.dir=/Users/awilkinson/dev/spring/spring-boot/master/spring-boot-tests/spring-boot-deployment-tests/spring-boot-deployment-test-wlp/target/cargo/configurations/liberty/shared/config/, os.arch=x86_64, java.awt.graphicsenv=sun.awt.CGraphicsEnvironment, java.ext.dirs=/Users/awilkinson/Library/Java/Extensions:/Library/Java/JavaVirtualMachines/jdk1.8.0_151.jdk/Contents/Home/jre/lib/ext:/Library/Java/Extensions:/Network/Library/Java/Extensions:/System/Library/Java/Extensions:/usr/lib/java, user.dir=/Users/awilkinson/dev/spring/spring-boot/master/spring-boot-tests/spring-boot-deployment-tests/spring-boot-deployment-test-wlp/target/cargo/configurations/liberty/servers/defaultServer, line.separator=
, java.vm.name=Java HotSpot(TM) 64-Bit Server VM, wlp.process.type=server, javax.management.builder.initial=com.ibm.ws.kernel.boot.jmx.internal.PlatformMBeanServerBuilder, file.encoding=UTF-8, java.specification.version=1.8, wlp.server.name=defaultServer}}, SystemEnvironmentPropertySource@1123558737 {name='systemEnvironment', properties={PATH=/Users/awilkinson/.sdkman/candidates/springboot/current/bin:/Users/awilkinson/.sdkman/candidates/groovy/current/bin:/Users/awilkinson/.sdkman/candidates/grails/current/bin:/Users/awilkinson/.rbenv/shims:/opt/local/bin:/opt/local/sbin:/usr/local/bin:/usr/local/share/npm/bin:/usr/local/sbin:/Library/Java/JavaVirtualMachines/jdk1.8.0_151.jdk/Contents/Home/bin:/Users/awilkinson/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin, HISTCONTROL=erasedups, SDKMAN_VERSION=5.5.9+231, GRAILS_HOME=/Users/awilkinson/.sdkman/candidates/grails/current, RBENV_SHELL=bash, WLP_SKIP_MAXPERMSIZE=true, MAVEN_HOME=/usr/local/Cellar/maven/3.5.0/libexec, JAVA_MAIN_CLASS_31920=com.ibm.ws.kernel.boot.cmdline.EnvCheck, COLORTERM=truecolor, JAVA_MAIN_CLASS_31888=org.codehaus.plexus.classworlds.launcher.Launcher, SDKMAN_DIR=/Users/awilkinson/.sdkman, LOGNAME=awilkinson, PWD=/Users/awilkinson/dev/spring/spring-boot/master/spring-boot-tests/spring-boot-deployment-tests/spring-boot-deployment-test-wlp/target/cargo/configurations/liberty/servers/defaultServer, TERM_PROGRAM_VERSION=3.1.5.beta.1, SPRINGBOOT_HOME=/Users/awilkinson/.sdkman/candidates/springboot/current, SHELL=/bin/bash, SECURITYSESSIONID=187e3, OLDPWD=/Users/awilkinson/dev/spring/spring-boot/master/spring-boot-tests/spring-boot-deployment-tests/spring-boot-deployment-test-wlp/target/cargo/installs/wlp-javaee7-17.0.0.3/wlp, ITERM_PROFILE=Default, TMPDIR=/var/folders/zq/v6xkr2696kv05jbf3bddt9680000gn/T/, XPC_FLAGS=0x0, X_LOG_FILE=console.log, TERM_SESSION_ID=w0t0p0:6514772C-D27C-4AEC-9966-3041F9F95D12, X_CMD=/Library/Java/JavaVirtualMachines/jdk1.8.0_151.jdk/Contents/Home/jre/bin/java , __CF_USER_TEXT_ENCODING=0x1F5:0x0:0x2, X_LOG_DIR=/Users/awilkinson/dev/spring/spring-boot/master/spring-boot-tests/spring-boot-deployment-tests/spring-boot-deployment-test-wlp/target/cargo/configurations/liberty/servers/defaultServer/logs, Apple_PubSub_Socket_Render=/private/tmp/com.apple.launchd.PwcyNFgww6/Render, COLORFGBG=7;0, IBM_JAVA_OPTIONS=, SHLVL=1, SDKMAN_CURRENT_API=https://api.sdkman.io/2, HISTSIZE=10000, JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_151.jdk/Contents/Home/jre, TERM=xterm, LANG=en_GB.UTF-8, COMMAND_MODE=unix2003, MAVEN_OPTS=-Xmx1024m -XX:MaxPermSize=1024M -Xmx1024M -Djava.awt.headless=true, GROOVY_HOME=/Users/awilkinson/.sdkman/candidates/groovy/current, ITERM_SESSION_ID=w0t0p0:6514772C-D27C-4AEC-9966-3041F9F95D12, XPC_SERVICE_NAME=0, MAVEN_CMD_LINE_ARGS= clean install, SDKMAN_CANDIDATES_DIR=/Users/awilkinson/.sdkman/candidates, SDKMAN_LEGACY_API=https://api.sdkman.io/1, WLP_OUTPUT_DIR=/Users/awilkinson/dev/spring/spring-boot/master/spring-boot-tests/spring-boot-deployment-tests/spring-boot-deployment-test-wlp/target/cargo/configurations/liberty/servers, TERM_PROGRAM=iTerm.app, WLP_USER_DIR=/Users/awilkinson/dev/spring/spring-boot/master/spring-boot-tests/spring-boot-deployment-tests/spring-boot-deployment-test-wlp/target/cargo/configurations/liberty, MAVEN_PROJECTBASEDIR=/Users/awilkinson/dev/spring/spring-boot/master, SDKMAN_PLATFORM=Darwin, USER=awilkinson, INVOKED=/Users/awilkinson/dev/spring/spring-boot/master/spring-boot-tests/spring-boot-deployment-tests/spring-boot-deployment-test-wlp/target/cargo/installs/wlp-javaee7-17.0.0.3/wlp/bin/server, SSH_AUTH_SOCK=/private/tmp/com.apple.launchd.n3qVoofcK2/Listeners, EDITOR=subl -w, HOME=/Users/awilkinson}}]
[02/11/17 12:12:42:708 GMT] 00000020 SystemOut O 12:12:42.708 [Default Executor-thread-3] DEBUG org.springframework.web.context.support.StandardServletEnvironment - Replacing PropertySource 'servletContextInitParams' with 'servletContextInitParams'
[02/11/17 12:12:43:137 GMT] 00000020 SystemOut O . ____ _ __ _ _
[02/11/17 12:12:43:138 GMT] 00000020 SystemOut O /\\ / ___'_ __ _ _(_)_ __ __ _ \ \ \ \
[02/11/17 12:12:43:138 GMT] 00000020 SystemOut O ( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
[02/11/17 12:12:43:138 GMT] 00000020 SystemOut O \\/ ___)| |_)| | | | | || (_| | ) ) ) )
[02/11/17 12:12:43:138 GMT] 00000020 SystemOut O ' |____| .__|_| |_|_| |_\__, | / / / /
[02/11/17 12:12:43:138 GMT] 00000020 SystemOut O =========|_|==============|___/=/_/_/_/
[02/11/17 12:12:43:139 GMT] 00000020 SystemOut O :: Spring Boot :: (v2.0.0.BUILD-SNAPSHOT)
[02/11/17 12:12:43:187 GMT] 00000020 SystemOut O 2017-11-02 12:12:43.186 INFO 31920 --- [ecutor-thread-3] sample.SampleWlpDeployApplication : Starting SampleWlpDeployApplication on aw-rmbp.local with PID 31920 (/Users/awilkinson/dev/spring/spring-boot/master/spring-boot-tests/spring-boot-deployment-tests/spring-boot-deployment-test-wlp/target/cargo/configurations/liberty/servers/defaultServer/apps/expanded/bootapp.war/WEB-INF/classes started by awilkinson in /Users/awilkinson/dev/spring/spring-boot/master/spring-boot-tests/spring-boot-deployment-tests/spring-boot-deployment-test-wlp/target/cargo/configurations/liberty/servers/defaultServer)
[02/11/17 12:12:43:191 GMT] 00000020 SystemOut O 2017-11-02 12:12:43.191 INFO 31920 --- [ecutor-thread-3] sample.SampleWlpDeployApplication : No active profile set, falling back to default profiles: default
[02/11/17 12:12:43:205 GMT] 00000020 SystemOut O 2017-11-02 12:12:43.205 INFO 31920 --- [ecutor-thread-3] ConfigServletWebServerApplicationContext : Refreshing org.springframework.boot.web.servlet.context.AnnotationConfigServletWebServerApplicationContext@563d3de9: startup date [Thu Nov 02 12:12:43 GMT 2017]; root of context hierarchy
[02/11/17 12:12:43:820 GMT] 00000020 SystemOut O 2017-11-02 12:12:43.820 INFO 31920 --- [ecutor-thread-3] f.a.AutowiredAnnotationBeanPostProcessor : JSR-330 'javax.inject.Inject' annotation found and supported for autowiring
[02/11/17 12:12:43:863 GMT] 00000020 SystemOut O 2017-11-02 12:12:43.863 INFO 31920 --- [ecutor-thread-3] com.ibm.ws.webcontainer.webapp : SRVE0292I: Servlet Message - [bootapp]:.Initializing Spring embedded WebApplicationContext
[02/11/17 12:12:43:863 GMT] 00000020 SystemOut O 2017-11-02 12:12:43.863 INFO 31920 --- [ecutor-thread-3] o.s.web.context.ContextLoader : Root WebApplicationContext: initialization completed in 658 ms
[02/11/17 12:12:44:175 GMT] 00000020 SystemOut O 2017-11-02 12:12:44.175 INFO 31920 --- [ecutor-thread-3] o.s.b.w.servlet.ServletRegistrationBean : Mapping servlet: 'dispatcherServlet' to [/]
[02/11/17 12:12:44:181 GMT] 00000020 SystemOut O 2017-11-02 12:12:44.180 INFO 31920 --- [ecutor-thread-3] o.s.b.w.servlet.FilterRegistrationBean : Mapping filter: 'errorPageFilter' to: [/*]
[02/11/17 12:12:44:181 GMT] 00000020 SystemOut O 2017-11-02 12:12:44.181 INFO 31920 --- [ecutor-thread-3] o.s.b.w.servlet.FilterRegistrationBean : Mapping filter: 'characterEncodingFilter' to: [/*]
[02/11/17 12:12:44:181 GMT] 00000020 SystemOut O 2017-11-02 12:12:44.181 INFO 31920 --- [ecutor-thread-3] o.s.b.w.servlet.FilterRegistrationBean : Mapping filter: 'hiddenHttpMethodFilter' to: [/*]
[02/11/17 12:12:44:181 GMT] 00000020 SystemOut O 2017-11-02 12:12:44.181 INFO 31920 --- [ecutor-thread-3] o.s.b.w.servlet.FilterRegistrationBean : Mapping filter: 'httpPutFormContentFilter' to: [/*]
[02/11/17 12:12:44:181 GMT] 00000020 SystemOut O 2017-11-02 12:12:44.181 INFO 31920 --- [ecutor-thread-3] o.s.b.w.servlet.FilterRegistrationBean : Mapping filter: 'requestContextFilter' to: [/*]
[02/11/17 12:12:44:475 GMT] 00000020 SystemOut O 2017-11-02 12:12:44.475 INFO 31920 --- [ecutor-thread-3] s.w.s.m.m.a.RequestMappingHandlerAdapter : Looking for @ControllerAdvice: org.springframework.boot.web.servlet.context.AnnotationConfigServletWebServerApplicationContext@563d3de9: startup date [Thu Nov 02 12:12:43 GMT 2017]; root of context hierarchy
[02/11/17 12:12:44:514 GMT] 00000020 SystemOut O 2017-11-02 12:12:44.514 INFO 31920 --- [ecutor-thread-3] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/],methods=[GET]}" onto public java.lang.String sample.SampleController.hello()
[02/11/17 12:12:44:522 GMT] 00000020 SystemOut O 2017-11-02 12:12:44.521 INFO 31920 --- [ecutor-thread-3] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/error]}" onto public org.springframework.http.ResponseEntity<java.util.Map<java.lang.String, java.lang.Object>> org.springframework.boot.autoconfigure.web.servlet.error.BasicErrorController.error(javax.servlet.http.HttpServletRequest)
[02/11/17 12:12:44:523 GMT] 00000020 SystemOut O 2017-11-02 12:12:44.523 INFO 31920 --- [ecutor-thread-3] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/error],produces=[text/html]}" onto public org.springframework.web.servlet.ModelAndView org.springframework.boot.autoconfigure.web.servlet.error.BasicErrorController.errorHtml(javax.servlet.http.HttpServletRequest,javax.servlet.http.HttpServletResponse)
[02/11/17 12:12:44:551 GMT] 00000020 SystemOut O 2017-11-02 12:12:44.551 INFO 31920 --- [ecutor-thread-3] o.s.w.s.handler.SimpleUrlHandlerMapping : Mapped URL path [/webjars/**] onto handler of type [class org.springframework.web.servlet.resource.ResourceHttpRequestHandler]
[02/11/17 12:12:44:552 GMT] 00000020 SystemOut O 2017-11-02 12:12:44.552 INFO 31920 --- [ecutor-thread-3] o.s.w.s.handler.SimpleUrlHandlerMapping : Mapped URL path [/**] onto handler of type [class org.springframework.web.servlet.resource.ResourceHttpRequestHandler]
[02/11/17 12:12:44:585 GMT] 00000020 SystemOut O 2017-11-02 12:12:44.585 INFO 31920 --- [ecutor-thread-3] o.s.w.s.handler.SimpleUrlHandlerMapping : Mapped URL path [/**/favicon.ico] onto handler of type [class org.springframework.web.servlet.resource.ResourceHttpRequestHandler]
[02/11/17 12:12:44:724 GMT] 00000020 SystemOut O 2017-11-02 12:12:44.724 INFO 31920 --- [ecutor-thread-3] o.s.j.e.a.AnnotationMBeanExporter : Registering beans for JMX exposure on startup
[02/11/17 12:12:44:738 GMT] 00000020 SystemOut O 2017-11-02 12:12:44.738 INFO 31920 --- [ecutor-thread-3] sample.SampleWlpDeployApplication : Started SampleWlpDeployApplication in 2.027 seconds (JVM running for 17.757)
[02/11/17 12:12:44:747 GMT] 0000004e SystemOut O 2017-11-02 12:12:44.747 INFO 31920 --- [cutor-thread-20] com.ibm.ws.webcontainer.webapp : SRVE0292I: Servlet Message - [bootapp]:.Initializing Spring FrameworkServlet 'dispatcherServlet'
[02/11/17 12:12:44:748 GMT] 0000004e SystemOut O 2017-11-02 12:12:44.748 INFO 31920 --- [cutor-thread-20] o.s.web.servlet.DispatcherServlet : FrameworkServlet 'dispatcherServlet': initialization started
[02/11/17 12:12:44:765 GMT] 0000004e SystemOut O 2017-11-02 12:12:44.765 INFO 31920 --- [cutor-thread-20] o.s.web.servlet.DispatcherServlet : FrameworkServlet 'dispatcherServlet': initialization completed in 17 ms
[02/11/17 12:12:44:766 GMT] 0000004e SystemOut O 2017-11-02 12:12:44.766 INFO 31920 --- [cutor-thread-20] com.ibm.ws.webcontainer.servlet : SRVE0242I: [bootapp] [/bootapp] [dispatcherServlet]: Initialization successful.
Perhaps this isn't surprising if the default configuration is a superset of what you get in the web profile?
@davidkarlsen I've subscribed to the issue you opened.
Try with this set of features:
<feature>monitor-1.0</feature>
<feature>servlet-3.1</feature>
<feature>localConnector-1.0</feature>
<feature>jsp-2.3</feature>
<feature>cdi-1.2</feature>
<feature>jndi-1.0</feature>
<feature>concurrent-1.0</feature>
<feature>collectiveMember-1.0</feature>
With some help from the WLP team, the problem's been tracked down to the cdi-1.2 feature leaking a subset of the Bean Validation 1.1 API's packages into the app's class loader. This causes ConfigurationPropertiesBindingPostProcessor to assume that all of the Bean Validation API is available when, in fact, classes in javax.validation.bootstrap are not available. This is particularly nasty as classes in javax.validation return instances of classes in javax.validation.bootstrap. This really needs to be fixed in WLP but, in the meantime, we can probably look for a class in javax.validation.bootstrap as well.
OK - it now works if I don't include the hibernate-validator&validation-api in my app - still fails if I add them.
@davidkarlsen Thanks for trying a snapshot. I'm not entirely surprised to see it confirmed that it still fails if you add Hibernate Validator and the Validation API to your app. I don't know the exact details of the ClassLoader topology in WLP, but I can make a somewhat informed guess at to why it's failing.
With the previously described dependencies in place, the Bean Validation API is still split across two ClassLoaders. This means that Boot can see all of the classes that it needs, but that ValidatorFactory is loaded by a ClassLoader that can't see any of the javax.validation.bootstrap classes as they're only in its child. This means that Boot tries to use Bean Validation but can't as the ClassLoader that loaded ValidatorFactory can't load javax.validation.bootstrap.GenericBootstrap.
I suspect you could work around this behaviour by configuring your application to use parent-last class loader delegation.
Most helpful comment
With some help from the WLP team, the problem's been tracked down to the cdi-1.2 feature leaking a subset of the Bean Validation 1.1 API's packages into the app's class loader. This causes
ConfigurationPropertiesBindingPostProcessorto assume that all of the Bean Validation API is available when, in fact, classes injavax.validation.bootstrapare not available. This is particularly nasty as classes injavax.validationreturn instances of classes injavax.validation.bootstrap. This really needs to be fixed in WLP but, in the meantime, we can probably look for a class injavax.validation.bootstrapas well.