UPDATED QUESTION:
I have a spring-boot 1.1.3.RELEASE project that is using EmbeddedTomcat and Spring-Security. I posted this a while back but that question wasn't answered (My apologies for those that saw that post and it didn't make sense. Hopefully this one is better)
Here is my setup:
build.gradle:
project.ext {
springBootVersion = '1.1.3.RELEASE'
}
dependencies {
compile("org.springframework.boot:spring-boot-starter-web:$springBootVersion")
compile("org.springframework.boot:spring-boot-starter-thymeleaf")
compile("org.springframework.boot:spring-boot-starter-security")
compile("org.springframework.boot:spring-boot-starter-data-jpa:$springBootVersion")
compile("org.springframework.security:spring-security-web:4.0.0.M1")
compile("org.springframework.security:spring-security-config:4.0.0.M1")
compile('org.thymeleaf.extras:thymeleaf-extras-springsecurity3:2.1.1.RELEASE')
compile("org.hibernate:hibernate-core:4.3.4.Final")
compile("org.hibernate:hibernate-entitymanager:4.3.4.Final")
compile("org.hibernate:hibernate-validator")
compile("com.h2database:h2:1.3.172")
compile("joda-time:joda-time:2.3")
// compile("org.thymeleaf:thymeleaf-spring4")
compile("org.codehaus.groovy.modules.http-builder:http-builder:0.7.1")
compile('org.codehaus.groovy:groovy-all:2.2.1')
compile('org.jadira.usertype:usertype.jodatime:2.0.1')
compile("org.liquibase:liquibase-core")
testCompile('org.spockframework:spock-core:1.0-groovy-2.0-SNAPSHOT') {
exclude group: 'org.codehaus.groovy', module: 'groovy-all'
}
testCompile('org.spockframework:spock-spring:1.0-groovy-2.0-SNAPSHOT') {
exclude group: 'org.spockframework', module: 'spock-core'
exclude group: 'org.spockframework', module: 'spring-beans'
exclude group: 'org.spockframework', module: 'spring-test'
exclude group: 'org.codehaus.groovy', module: 'groovy-all'
}
testCompile("org.springframework.boot:spring-boot-starter-test:$springBootVersion")
testCompile('org.codehaus.groovy.modules.http-builder:http-builder:0.7+')
testCompile("junit:junit")
}
My Main Class:
#ComponentScan
#EnableAutoConfiguration
#EnableGlobalMethodSecurity(securedEnabled = true)
public class OFAC {
public static void main(String[] args) {
ApplicationContext ofac = SpringApplication.run( OFAC.class, args );
}
}
My primary configuration:
#Configuration
#EnableScheduling
public class OFAConfiguration {
#Autowired
private ConfigurationSettings configurationSettings;
#Bean
#Order(Ordered.HIGHEST_PRECEDENCE)
public EmbeddedServletContainerCustomizer servletContainerCustomizer() {
return new SessionTimeoutEmbeddedServletContainerCustomizer();
}
}
And my embeddedServletContainer recommended by Marten:
public class SessionTimeoutEmbeddedServletContainerCustomizer implements EmbeddedServletContainerCustomizer {
#Autowired
private ConfigurationSettings configurationSettings;
#Override
public void customize(ConfigurableEmbeddedServletContainer configurableEmbeddedServletContainer) {
int port = 9000;
TomcatEmbeddedServletContainerFactory tomcat = (TomcatEmbeddedServletContainerFactory) configurableEmbeddedServletContainer;
if ( configurationSettings.getServerPort() != null ) {
port = Integer.parseInt( configurationSettings.getServerPort() );
}
tomcat.setPort( port );
tomcat.addErrorPages( new ErrorPage( HttpStatus.NOT_FOUND, "/notfound.html" ) );
}
}
And my Security Configuration:
#Configuration
#EnableWebMvcSecurity
public class ApplicationSecurity extends WebSecurityConfigurerAdapter {
#Autowired
private DataSource datasource;
#Override
protected void configure(HttpSecurity http) throws Exception {
http
.authorizeRequests()
.antMatchers("/").permitAll()
.antMatchers("/resources/**").permitAll()
.antMatchers("/css/**").permitAll()
.antMatchers("/libs/**").permitAll();
http
.formLogin().failureUrl("/login?error")
.defaultSuccessUrl("/")
.loginPage("/login")
.permitAll()
.and()
.logout().logoutRequestMatcher(new AntPathRequestMatcher("/logout")).logoutSuccessUrl("/")
.permitAll();
http
.sessionManagement()
.maximumSessions(1)
.expiredUrl("/login?expired")
.maxSessionsPreventsLogin(true)
.and()
.sessionCreationPolicy(SessionCreationPolicy.IF_REQUIRED)
.invalidSessionUrl("/");
http
.authorizeRequests().anyRequest().authenticated();
}
and
#Order(Ordered.HIGHEST_PRECEDENCE)
#Configuration
public class AuthenticationSecurity extends GlobalAuthenticationConfigurerAdapter {
// no code actually
}
In my application.properties I have a five minute timeout:
server.session-timeout=300
When I start up, I see the following log messages:
2014-07-08 14:02:18.735 INFO 69422 --- [ main] ationConfigEmbeddedWebApplicationContext : Refreshing org.springframework.boot.context.embedded.AnnotationConfigEmbeddedWebApplicationContext#340b9eec: startup date [Tue Jul 08 14:02:18 MDT 2014]; root of context hierarchy
2014-07-08 14:02:20.827 INFO 69422 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'org.springframework.scheduling.annotation.SchedulingConfiguration' of type [class org.springframework.scheduling.annotation.SchedulingConfiguration$$EnhancerBySpringCGLIB$$75b53f01] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2014-07-08 14:02:20.983 INFO 69422 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'org.springframework.transaction.annotation.ProxyTransactionManagementConfiguration' of type [class org.springframework.transaction.annotation.ProxyTransactionManagementConfiguration$$EnhancerBySpringCGLIB$$6ac51dc6] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2014-07-08 14:02:21.016 INFO 69422 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'transactionAttributeSource' of type [class org.springframework.transaction.annotation.AnnotationTransactionAttributeSource] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2014-07-08 14:02:21.035 INFO 69422 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'transactionInterceptor' of type [class org.springframework.transaction.interceptor.TransactionInterceptor] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2014-07-08 14:02:21.047 INFO 69422 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'org.springframework.transaction.config.internalTransactionAdvisor' of type [class org.springframework.transaction.interceptor.BeanFactoryTransactionAttributeSourceAdvisor] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2014-07-08 14:02:21.097 INFO 69422 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'org.springframework.security.config.annotation.configuration.ObjectPostProcessorConfiguration' of type [class org.springframework.security.config.annotation.configuration.ObjectPostProcessorConfiguration$$EnhancerBySpringCGLIB$$38601c80] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2014-07-08 14:02:21.118 INFO 69422 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'objectPostProcessor' of type [class org.springframework.security.config.annotation.configuration.AutowireBeanFactoryObjectPostProcessor] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2014-07-08 14:02:21.120 INFO 69422 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'org.springframework.security.access.expression.method.DefaultMethodSecurityExpressionHandler#2f8ffdc4' of type [class org.springframework.security.access.expression.method.DefaultMethodSecurityExpressionHandler] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2014-07-08 14:02:21.177 INFO 69422 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'authenticationSecurity' of type [class com.edelweissco.ofac.configuration.AuthenticationSecurity$$EnhancerBySpringCGLIB$$85675816] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2014-07-08 14:02:21.199 INFO 69422 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'enableGlobalAuthenticationAutowiredConfigurer' of type [class org.springframework.security.config.annotation.authentication.configuration.AuthenticationConfiguration$EnableGlobalAuthenticationAutowiredConfigurer] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2014-07-08 14:02:21.218 INFO 69422 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'org.springframework.security.config.annotation.authentication.configuration.AuthenticationConfiguration' of type [class org.springframework.security.config.annotation.authentication.configuration.AuthenticationConfiguration$$EnhancerBySpringCGLIB$$2da1b835] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2014-07-08 14:02:21.219 INFO 69422 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'org.springframework.security.config.annotation.method.configuration.GlobalMethodSecurityConfiguration' of type [class org.springframework.security.config.annotation.method.configuration.GlobalMethodSecurityConfiguration$$EnhancerBySpringCGLIB$$c09573b2] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2014-07-08 14:02:21.250 INFO 69422 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'methodSecurityMetadataSource' of type [class org.springframework.security.access.method.DelegatingMethodSecurityMetadataSource] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2014-07-08 14:02:21.258 INFO 69422 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'metaDataSourceAdvisor' of type [class org.springframework.security.access.intercept.aopalliance.MethodSecurityMetadataSourceAdvisor] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2014-07-08 14:02:21.934 INFO 69422 --- [ main] .t.TomcatEmbeddedServletContainerFactory : Server initialized with port: 9001
2014-07-08 14:02:22.213 INFO 69422 --- [ main] o.apache.catalina.core.StandardService : Starting service Tomcat
2014-07-08 14:02:22.213 INFO 69422 --- [ main] org.apache.catalina.core.StandardEngine : Starting Servlet Engine: Apache Tomcat/7.0.54
2014-07-08 14:02:22.363 INFO 69422 --- [ost-startStop-1] o.a.c.c.C.[Tomcat].[localhost].[/] : Initializing Spring embedded WebApplicationContext
2014-07-08 14:02:22.364 INFO 69422 --- [ost-startStop-1] o.s.web.context.ContextLoader : Root WebApplicationContext: initialization completed in 3631 ms
2014-07-08 14:02:24.157 INFO 69422 --- [ost-startStop-1] o.s.s.web.DefaultSecurityFilterChain : Creating filter chain: org.springframework.security.web.util.matcher.AnyRequestMatcher#1, [org.springframework.security.web.context.request.async.WebAsyncManagerIntegrationFilter#6e3afd5, org.springframework.security.web.context.SecurityContextPersistenceFilter#96219e4, org.springframework.security.web.header.HeaderWriterFilter#12cad708, org.springframework.security.web.csrf.CsrfFilter#78688290, org.springframework.security.web.authentication.logout.LogoutFilter#655490cd, org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter#331b7b16, org.springframework.security.web.session.ConcurrentSessionFilter#5d42f8e3, org.springframework.security.web.savedrequest.RequestCacheAwareFilter#750bff35, org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter#1dd0a8c0, org.springframework.security.web.authentication.AnonymousAuthenticationFilter#4e2ccc7b, org.springframework.security.web.session.SessionManagementFilter#7b54be6d, org.springframework.security.web.access.ExceptionTranslationFilter#5497e581, org.springframework.security.web.access.intercept.FilterSecurityInterceptor#16254dd7]
2014-07-08 14:02:24.242 INFO 69422 --- [ost-startStop-1] o.s.b.c.e.ServletRegistrationBean : Mapping servlet: 'dispatcherServlet' to [/]
2014-07-08 14:02:24.244 INFO 69422 --- [ost-startStop-1] o.s.b.c.embedded.FilterRegistrationBean : Mapping filter: 'springSecurityFilterChain' to: [/*]
2014-07-08 14:02:24.244 INFO 69422 --- [ost-startStop-1] o.s.b.c.embedded.FilterRegistrationBean : Mapping filter: 'hiddenHttpMethodFilter' to: [/*]
..
2014-07-08 14:02:31.240 INFO 69422 --- [ main] o.s.w.s.handler.SimpleUrlHandlerMapping : Mapped URL path [/**/favicon.ico] onto handler of type [class org.springframework.web.servlet.resource.ResourceHttpRequestHandler]
2014-07-08 14:02:31.357 INFO 69422 --- [ main] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/about],methods=[GET],params=[],headers=[],consumes=[],produces=[],custom=[]}" onto public java.lang.String com.edelweissco.ofac.controller.AboutController.get(org.springframework.ui.Model)
2014-07-08 14:02:31.357 INFO 69422 --- [ main] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/admin],methods=[GET],params=[],headers=[],consumes=[],produces=[],custom=[]}" onto public java.lang.String com.edelweissco.ofac.controller.AdminController.displayUpload(org.springframework.ui.Model)
2014-07-08 14:02:31.358 INFO 69422 --- [ main] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/upload],methods=[GET],params=[],headers=[],consumes=[],produces=[],custom=[]}" onto public java.lang.String com.edelweissco.ofac.controller.CustomerDataController.displayUpload(org.springframework.ui.Model)
2014-07-08 14:02:31.358 INFO 69422 --- [ main] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/customerFile],methods=[POST],params=[],headers=[],consumes=[],produces=[],custom=[]}" onto public java.lang.String com.edelweissco.ofac.controller.CustomerDataController.handleFileUpload(org.springframework.web.multipart.MultipartFile,org.springframework.ui.Model,org.springframework.security.core.Authentication)
2014-07-08 14:02:31.358 INFO 69422 --- [ main] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/fileDownloadService],methods=[],params=[],headers=[],consumes=[],produces=[],custom=[]}" onto public java.util.List<java.lang.String> com.edelweissco.ofac.controller.FileDownloadController.index()
2014-07-08 14:02:31.359 INFO 69422 --- [ main] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/search],methods=[GET],params=[],headers=[],consumes=[],produces=[],custom=[]}" onto public java.lang.String com.edelweissco.ofac.controller.SearchController.getSearchCustomerForm(org.springframework.ui.Model)
2014-07-08 14:02:31.359 INFO 69422 --- [ main] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/searchTreasuryData],methods=[POST],params=[],headers=[],consumes=[],produces=[],custom=[]}" onto public java.lang.String com.edelweissco.ofac.controller.SearchController.searchTreasury(com.edelweissco.ofac.model.SdnSearch,org.springframework.ui.Model)
2014-07-08 14:02:31.360 INFO 69422 --- [ main] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/status],methods=[GET],params=[],headers=[],consumes=[],produces=[],custom=[]}" onto public java.lang.String com.edelweissco.ofac.controller.StatusController.get(org.springframework.ui.Model)
2014-07-08 14:02:31.360 INFO 69422 --- [ main] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/refreshData],methods=[POST],params=[],headers=[],consumes=[],produces=[],custom=[]}" onto public java.lang.String com.edelweissco.ofac.controller.StatusController.searchCustomer(org.springframework.ui.Model)
2014-07-08 14:02:31.366 INFO 69422 --- [ main] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/error],methods=[],params=[],headers=[],consumes=[],produces=[],custom=[]}" onto public org.springframework.http.ResponseEntity<java.util.Map<java.lang.String, java.lang.Object>> org.springframework.boot.autoconfigure.web.BasicErrorController.error(javax.servlet.http.HttpServletRequest)
2014-07-08 14:02:31.366 INFO 69422 --- [ main] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/error],methods=[],params=[],headers=[],consumes=[],produces=[text/html],custom=[]}" onto public org.springframework.web.servlet.ModelAndView org.springframework.boot.autoconfigure.web.BasicErrorController.errorHtml(javax.servlet.http.HttpServletRequest)
2014-07-08 14:02:31.379 INFO 69422 --- [ main] o.s.w.s.handler.SimpleUrlHandlerMapping : Mapped URL path [/about] onto handler of type [class org.springframework.web.servlet.mvc.ParameterizableViewController]
2014-07-08 14:02:31.380 INFO 69422 --- [ main] o.s.w.s.handler.SimpleUrlHandlerMapping : Mapped URL path [/status] onto handler of type [class org.springframework.web.servlet.mvc.ParameterizableViewController]
2014-07-08 14:02:31.380 INFO 69422 --- [ main] o.s.w.s.handler.SimpleUrlHandlerMapping : Mapped URL path [/home] onto handler of type [class org.springframework.web.servlet.mvc.ParameterizableViewController]
2014-07-08 14:02:31.380 INFO 69422 --- [ main] o.s.w.s.handler.SimpleUrlHandlerMapping : Mapped URL path [/login] onto handler of type [class org.springframework.web.servlet.mvc.ParameterizableViewController]
2014-07-08 14:02:31.380 INFO 69422 --- [ main] o.s.w.s.handler.SimpleUrlHandlerMapping : Mapped URL path [/search] onto handler of type [class org.springframework.web.servlet.mvc.ParameterizableViewController]
2014-07-08 14:02:31.380 INFO 69422 --- [ main] o.s.w.s.handler.SimpleUrlHandlerMapping : Mapped URL path [/upload] onto handler of type [class org.springframework.web.servlet.mvc.ParameterizableViewController]
2014-07-08 14:02:31.380 INFO 69422 --- [ main] o.s.w.s.handler.SimpleUrlHandlerMapping : Root mapping to handler of type [class org.springframework.web.servlet.mvc.ParameterizableViewController]
2014-07-08 14:02:31.380 INFO 69422 --- [ main] o.s.w.s.handler.SimpleUrlHandlerMapping : Mapped URL path [/admin] onto handler of type [class org.springframework.web.servlet.mvc.ParameterizableViewController]
2014-07-08 14:02:31.397 INFO 69422 --- [ main] o.s.w.s.handler.SimpleUrlHandlerMapping : Mapped URL path [/**] onto handler of type [class org.springframework.web.servlet.resource.ResourceHttpRequestHandler]
2014-07-08 14:02:31.397 INFO 69422 --- [ main] o.s.w.s.handler.SimpleUrlHandlerMapping : Mapped URL path [/webjars/**] onto handler of type [class org.springframework.web.servlet.resource.ResourceHttpRequestHandler]
2014-07-08 14:02:32.907 INFO 69422 --- [ main] o.s.j.e.a.AnnotationMBeanExporter : Registering beans for JMX exposure on startup
2014-07-08 14:02:33.112 INFO 69422 --- [ main] s.b.c.e.t.TomcatEmbeddedServletContainer : Tomcat started on port(s): 9001/http
2014-07-08
So i am able to log in. But if leave it inactive, I am still logged in and able to use full authorized functionality. I try to login with the same credentials from two different browsers and the second attempt fails with "invalid username/password" so I think the concurrent session setting is being picked up. There isn't any AJAX call being picked up by FireBug or browser dev tools.
Can anyone see what the error is?
So it would appear that to get the Embedded Tomcat to honor a session timeout, when you use the server.session-timeout value, use it in minutes, not seconds. My previous attempts were with server.session-timeout=300 and after waiting at least 45 minutes, the timeout never occurred. However, I added HttpSessionListener bean with system.outs to message on sessionCreated() and sessionDestroyed(). With an application.properties setting of server.session-timeout=5 I saw the session get destroyed just after 5 minutes of inactivity.
So, I can now control the session length with these parameters. Thank you to M. Deinum and Dave Sayers for your help and advice. If nothing else, you really helped me clean up my code and understand Spring a bit more.
as of current version (http://docs.spring.io/spring-boot/docs/current/reference/html/common-application-properties.html)
there is typo, property is: server.session.timeout
I suggest you take a look at this which explains how to modify the embedded tomcat. Instead of trying to bootstrap your own container let spring boot do that and use a EmbeddedServletContainerCustomizer to modify what you need.
public class SessionTimeoutEmbeddedServletContainerCustomizer implements EmbeddedServletContainerCustomizer {
#Override
public void customize(ConfigurableEmbeddedServletContainer configurableEmbeddedServletContainer) {
TomcatEmbeddedServletContainerFactory tomcat = (TomcatEmbeddedServletContainerFactory) configurableEmbeddedServletContainer;
tomcat.setSessionTimeout(30, TimeUnit.MINUTES);
tomcat.addErrorPages(new ErrorPage(HttpStatus.NOT_FOUND, "/notfound.html"));
}
}
Then remove your container from the configuration and replace it with a #Bean method constructing this customizer. (I would probably add it as a #Bean method to the starter class, that way you have everything related to bootstrapping the application in one class!).
#Configuration
public class OFAConfiguration {
#Bean
public EmbeddedServletContainerCustomizer servletContainerCustomizer() {
return new SessionTimeoutEmbeddedServletContainerCustomizer();
}
}
The advantage of this is that Spring Boot still does all its magic with the servlet container and you only modify what is needed.
Some other things I noticed first your dependencies are a bit of a mess and your configuration contains to much.
Dependencies
You are mxing Spring Boot 1.0.1 and 1.1.1 and probably also 1.1.3, fix this mixture to prevent weird dependency issues.
YOu include spring-orm version 4.0.0.RC1 whilst this is already on version 4.0.5 and provided by the spring-boot-starter-data-jpa dependency, remove it.
Configuration
Your configuration contains multiple #EnableJpaRepositories which you can remove as Spring Boot detects the presence of Spring Data JPA and will enable this for you as well as the #EnableTransactionManagement
Your main class extends WebMvcConfigurerAdapter which shouldn't be needed as this is also detected and configured by Spring Boot.
#ComponentScan
#EnableAutoConfiguration
#EnableGlobalMethodSecurity(securedEnabled = true)
public class OFAC {
public static void main(String[] args) {
ApplicationContext ofac = SpringApplication.run( OFAC.class, args );
}
}
This should be all you need for your starter class.
Just to update this, because I went looking for an answer and couldn't find it easily:
You can set the
server.session.cookie.max-age=
in your application.properties to force the log out after a certain time.
This one actually uses seconds, not minutes, as the integer value. So set it to something reasonable like 120 for 2 minutes.
Things change but as of Spring boot 2.1.3 (which has Spring web 5.1.5, optionally adding Spring Session 2.1.4), the property is now
server.servlet.session.timeout=<your-value>><units>
for example the value to be set could be 1800s for 1800 seconds or 30m for 30 minutes
The spring session property spring.session.timeout if not configured falls back to the property above..
Related
We recently upgraded to k8s version 1.20.9 and not sure if that is the root cause but SCDF server pod fails to come up with the error below.
I usually deploy scdf server using kubectl based deployment.
Anyone has any idea ? Attached error below.
2022-01-05 05:08:56.207 INFO 1 --- [ main]
o.a.coyote.http11.Http11NioProtocol : Starting ProtocolHandler
["http-nio-80"] 2022-01-05 05:08:56.300 WARN 1 --- [ main]
ConfigServletWebServerApplicationContext : Exception encountered
during context initialization - cancelling refresh attempt:
org.springframework.context.ApplicationContextException: Failed to
start bean 'webServerStartStop'; nested exception is
org.springframework.boot.web.server.WebServerException: Unable to
start embedded Tomcat server 2022-01-05 05:08:56.798 INFO 1 --- [
main] j.LocalContainerEntityManagerFactoryBean : Closing JPA
EntityManagerFactory for persistence unit 'default' 2022-01-05
05:08:56.893 INFO 1 --- [ main]
com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Shutdown
initiated... 2022-01-05 05:08:57.194 INFO 1 --- [ main]
com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Shutdown
completed. 2022-01-05 05:08:57.197 INFO 1 --- [ main]
o.a.coyote.http11.Http11NioProtocol : Pausing ProtocolHandler
["http-nio-80"] 2022-01-05 05:08:57.197 INFO 1 --- [ main]
o.apache.catalina.core.StandardService : Stopping service [Tomcat]
2022-01-05 05:08:57.292 INFO 1 --- [ main]
o.a.coyote.http11.Http11NioProtocol : Stopping ProtocolHandler
["http-nio-80"] 2022-01-05 05:08:57.293 INFO 1 --- [ main]
o.a.coyote.http11.Http11NioProtocol : Destroying ProtocolHandler
["http-nio-80"] 2022-01-05 05:08:57.793 ERROR 1 --- [ main]
o.s.boot.SpringApplication : Application run failed
org.springframework.context.ApplicationContextException: Failed to
start bean 'webServerStartStop'; nested exception is
org.springframework.boot.web.server.WebServerException: Unable to
start embedded Tomcat server Caused by:
org.springframework.boot.web.server.WebServerException: Unable to
start embedded Tomcat server Caused by:
java.lang.IllegalArgumentException:
standardService.connector.startFailed Caused by:
org.apache.catalina.LifecycleException: Protocol handler start failed
Caused by: java.net.SocketException: Permission denied
What stands out in the trace is SocketException: permission denied It is likely due to some security configuration change in the upgrade affecting the TCP layer. I would start with your security configuration. Keep us posted.
I use SCDF with skipper server 2.3.2 and dataflow server 2.4.2. deployed with Docker-compose
I build a task with composed-task-runner 2.1.3 release
I try with my task but even with samples, composed-task-runner doesn't launch tasks
Example :
composed-task-runner && mytask && myTask
2020-04-14 14:40:41.633 INFO 231 --- [ main] o.s.s.concurrent.ThreadPoolTaskExecutor : Initializing ExecutorService 'taskExecutor'
2020-04-14 14:40:41.752 INFO 231 --- [ main] o.s.b.c.r.s.JobRepositoryFactoryBean : No database type set, using meta data indicating: POSTGRES
2020-04-14 14:40:41.885 INFO 231 --- [ main] o.s.b.c.l.support.SimpleJobLauncher : No TaskExecutor has been set, defaulting to synchronous executor.
2020-04-14 14:40:42.083 DEBUG 231 --- [ main] o.s.c.t.a.c.DataFlowConfiguration : Not configuring basic security for accessing the Data Flow Server
2020-04-14 14:40:46.922 DEBUG 231 --- [ main] o.s.c.t.r.s.TaskRepositoryInitializer : Initializing task schema for postgresql database
2020-04-14 14:40:47.461 DEBUG 231 --- [ main] BatchConfiguration$ReferenceTargetSource : Initializing lazy target object
2020-04-14 14:40:47.552 DEBUG 231 --- [ main] o.s.c.t.r.support.SimpleTaskRepository : Starting: TaskExecution{executionId=102, parentExecutionId=null, exitCode=null, taskName='testComposedTask2', startTime=Tue Apr 14 14:40:47 GMT 2020, endTime=null, exitMessage='null', externalExecutionId='null', errorMessage='null', arguments=[xx=7777, --spring.cloud.data.flow.platformname=default, --spring.cloud.task.executionid=102, --spring.cloud.data.flow.taskappname=composed-task-runner]}
2020-04-14 14:40:47.675 INFO 231 --- [ main] .t.a.c.ComposedtaskrunnerTaskApplication : Started ComposedtaskrunnerTaskApplication in 33.768 seconds (JVM running for 38.059)
2020-04-14 14:40:47.743 DEBUG 231 --- [ main] o.s.c.t.r.support.SimpleTaskRepository : Updating: TaskExecution with executionId=102 with the following {exitCode=0, endTime=Tue Apr 14 14:40:47 GMT 2020, exitMessage='null', errorMessage='null'}
2020-04-14 14:40:47.831 INFO 231 --- [ Thread-7] o.s.s.concurrent.ThreadPoolTaskExecutor : Shutting down ExecutorService 'taskExecutor'
2020-04-14 14:40:47.836 INFO 231 --- [ Thread-7] j.LocalContainerEntityManagerFactoryBean : Closing JPA EntityManagerFactory for persistence unit 'default'
2020-04-14 14:40:47.852 INFO 231 --- [ Thread-7] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Shutdown initiated...
2020-04-14 14:40:47.909 INFO 231 --- [ Thread-7] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Shutdown completed.
Could you help me? I am with a Postgres DB
New remark :
I build a new composed task as said in the documentation :
testComposedTaskA with definition myTask && timestamp
dataflow:>task list
╔═══════════════════════════╤═══════════════════╤═══════════╤═══════════╗
║ Task Name │ Task Definition │description│Task Status║
╠═══════════════════════════╪═══════════════════╪═══════════╪═══════════╣
║testComposedTaskA-myTask │myTask │ │UNKNOWN ║
║testComposedTaskA-timestamp│timestamp │ │UNKNOWN ║
║testComposedTaskA │myTask && timestamp│ │UNKNOWN ║
╚═══════════════════════════╧═══════════════════╧═══════════╧═══════════╝
dataflow:>task launch testComposedTaskA
Launched task 'testComposedTaskA' with execution id 135
dataflow:>task execution list
╔═════════════════╤═══╤════════════════════════════╤════════════════════════════╤═════════╗
║ Task Name │ID │ Start Time │ End Time │Exit Code║
╠═════════════════╪═══╪════════════════════════════╪════════════════════════════╪═════════╣
║testComposedTaskA│135│Fri Apr 17 15:04:42 GMT 2020│Fri Apr 17 15:04:42 GMT 2020│0 ║
╚═════════════════╧═══╧════════════════════════════╧════════════════════════════╧═════════╝
Sub-tasks are never executed . In the samples, we can see the sub task as executed
What is wrong?
As request, the dataflow server start log
Hi the dataflow server start log :
dataflow-server | 2020-04-20 07:43:24.047 INFO 1 --- [ main] o.h.e.t.j.p.i.JtaPlatformInitiator : HHH000490: Using JtaPlatform implementation: [org.hibernate.engine.transaction.jta.platform.internal.NoJtaPlatform]
dataflow-server | 2020-04-20 07:43:24.061 INFO 1 --- [ main] j.LocalContainerEntityManagerFactoryBean : Initialized JPA EntityManagerFactory for persistence unit 'default'
dataflow-server | 2020-04-20 07:43:27.735 DEBUG 1 --- [ main] o.s.c.t.c.SimpleTaskAutoConfiguration : Using org.springframework.cloud.task.configuration.DefaultTaskConfigurer TaskConfigurer
dataflow-server | 2020-04-20 07:43:27.745 DEBUG 1 --- [ main] o.s.c.t.c.DefaultTaskConfigurer : EntityManager was found, using JpaTransactionManager
dataflow-server | 2020-04-20 07:43:28.282 INFO 1 --- [ main] o.s.b.c.r.s.JobRepositoryFactoryBean : No database type set, using meta data indicating: POSTGRES
skipper | 2020-04-20 07:43:28.294 INFO 1 --- [ main] j.LocalContainerEntityManagerFactoryBean : Initialized JPA EntityManagerFactory for persistence unit 'default'
dataflow-server | 2020-04-20 07:43:28.505 INFO 1 --- [ main] o.s.c.d.s.b.SimpleJobServiceFactoryBean : No database type set, using meta data indicating: POSTGRES
dataflow-server | 2020-04-20 07:43:28.975 WARN 1 --- [ main] JpaBaseConfiguration$JpaWebConfiguration : spring.jpa.open-in-view is enabled by default. Therefore, database queries may be performed during view rendering. Explicitly configure spring.jpa.open-in-view to disable this warning
dataflow-server | 2020-04-20 07:43:29.392 INFO 1 --- [ main] o.s.s.concurrent.ThreadPoolTaskExecutor : Initializing ExecutorService 'applicationTaskExecutor'
dataflow-server | 2020-04-20 07:43:32.150 INFO 1 --- [ main] .s.c.DataFlowControllerAutoConfiguration : Skipper URI [http://skipper-server:7577/api]
dataflow-server | 2020-04-20 07:43:32.614 INFO 1 --- [ main] o.a.coyote.http11.Http11NioProtocol : Starting ProtocolHandler ["http-nio-9393"]
dataflow-server | 2020-04-20 07:43:32.764 INFO 1 --- [ main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat started on port(s): 9393 (http) with context path ''
dataflow-server | 2020-04-20 07:43:32.780 INFO 1 --- [ main] o.s.c.d.s.s.DataFlowServerApplication : Started DataFlowServerApplication in 68.947 seconds (JVM running for 78.165)
dataflow-server | 2020-04-20 07:43:33.396 INFO 1 --- [ main] .s.c.d.s.s.LauncherInitializationService : Added 'Local' platform account 'default' into Task Launcher repository.
The log at the start of the task :
2020-04-20 08:01:58.886 INFO 115 --- [ main] .s.d.r.c.RepositoryConfigurationDelegate : Bootstrapping Spring Data repositories in DEFAULT mode.
2020-04-20 08:01:59.008 INFO 115 --- [ main] .s.d.r.c.RepositoryConfigurationDelegate : Finished Spring Data repository scanning in 68ms. Found 0 repository interfaces.
2020-04-20 08:02:00.545 INFO 115 --- [ main] o.s.cloud.context.scope.GenericScope : BeanFactory id=56219e3d-5a2d-3fb3-8901-c3dad5be90af
2020-04-20 08:02:00.943 INFO 115 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'org.springframework.transaction.annotation.ProxyTransactionManagementConfiguration' of type [org.springframework.transaction.annotation.ProxyTransactionManagementConfiguration$$EnhancerBySpringCGLIB$$cd22d842] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2020-04-20 08:02:01.049 INFO 115 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'org.springframework.cloud.autoconfigure.ConfigurationPropertiesRebinderAutoConfiguration' of type [org.springframework.cloud.autoconfigure.ConfigurationPropertiesRebinderAutoConfiguration$$EnhancerBySpringCGLIB$$e93cdb3f] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2020-04-20 08:02:01.062 INFO 115 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'org.springframework.cloud.task.batch.configuration.TaskBatchAutoConfiguration' of type [org.springframework.cloud.task.batch.configuration.TaskBatchAutoConfiguration$$EnhancerBySpringCGLIB$$529283ce] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2020-04-20 08:02:01.094 INFO 115 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'org.springframework.cloud.task.batch.listener.BatchEventAutoConfiguration' of type [org.springframework.cloud.task.batch.listener.BatchEventAutoConfiguration$$EnhancerBySpringCGLIB$$9ae88dd1] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2020-04-20 08:02:02.529 INFO 115 --- [ main] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Starting...
2020-04-20 08:02:03.239 INFO 115 --- [ main] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Start completed.
2020-04-20 08:02:04.489 INFO 115 --- [ main] o.hibernate.jpa.internal.util.LogHelper : HHH000204: Processing PersistenceUnitInfo [
name: default
...]
2020-04-20 08:02:07.075 INFO 115 --- [ main] org.hibernate.Version : HHH000412: Hibernate Core {5.3.13.Final}
2020-04-20 08:02:07.111 INFO 115 --- [ main] org.hibernate.cfg.Environment : HHH000206: hibernate.properties not found
2020-04-20 08:02:08.896 INFO 115 --- [ main] o.hibernate.annotations.common.Version : HCANN000001: Hibernate Commons Annotations {5.0.4.Final}
2020-04-20 08:02:10.736 INFO 115 --- [ main] org.hibernate.dialect.Dialect : HHH000400: Using dialect: org.hibernate.dialect.PostgreSQL95Dialect
2020-04-20 08:02:10.825 INFO 115 --- [ main] o.h.e.j.e.i.LobCreatorBuilderImpl : HHH000422: Disabling contextual LOB creation as connection was null
2020-04-20 08:02:10.843 INFO 115 --- [ main] org.hibernate.type.BasicTypeRegistry : HHH000270: Type registration [java.util.UUID] overrides previous : org.hibernate.type.UUIDBinaryType#3eb91815
2020-04-20 08:02:11.457 INFO 115 --- [ main] j.LocalContainerEntityManagerFactoryBean : Initialized JPA EntityManagerFactory for persistence unit 'default'
2020-04-20 08:02:11.675 DEBUG 115 --- [ main] o.s.c.t.c.SimpleTaskAutoConfiguration : Using org.springframework.cloud.task.configuration.DefaultTaskConfigurer TaskConfigurer
2020-04-20 08:02:11.679 DEBUG 115 --- [ main] o.s.c.t.c.DefaultTaskConfigurer : EntityManager was found, using JpaTransactionManager
2020-04-20 08:02:11.902 INFO 115 --- [ main] o.s.s.concurrent.ThreadPoolTaskExecutor : Initializing ExecutorService 'taskExecutor'
2020-04-20 08:02:12.005 INFO 115 --- [ main] o.s.b.c.r.s.JobRepositoryFactoryBean : No database type set, using meta data indicating: POSTGRES
2020-04-20 08:02:12.107 INFO 115 --- [ main] o.s.b.c.l.support.SimpleJobLauncher : No TaskExecutor has been set, defaulting to synchronous executor.
2020-04-20 08:02:12.203 DEBUG 115 --- [ main] o.s.c.t.a.c.DataFlowConfiguration : Not configuring basic security for accessing the Data Flow Server
2020-04-20 08:02:15.942 DEBUG 115 --- [ main] o.s.c.t.r.s.TaskRepositoryInitializer : Initializing task schema for postgresql database
2020-04-20 08:02:16.551 DEBUG 115 --- [ main] BatchConfiguration$ReferenceTargetSource : Initializing lazy target object
2020-04-20 08:02:16.617 DEBUG 115 --- [ main] o.s.c.t.r.support.SimpleTaskRepository : Starting: TaskExecution{executionId=136, parentExecutionId=null, exitCode=null, taskName='testComposedTaskA', startTime=Mon Apr 20 08:02:16 GMT 2020, endTime=null, exitMessage='null', externalExecutionId='null', errorMessage='null', arguments=[--spring.cloud.data.flow.platformname=default, --spring.cloud.task.executionid=136, --spring.cloud.data.flow.taskappname=composed-task-runner]}
2020-04-20 08:02:16.686 INFO 115 --- [ main] .t.a.c.ComposedtaskrunnerTaskApplication : Started ComposedtaskrunnerTaskApplication in 31.176 seconds (JVM running for 34.541)
2020-04-20 08:02:16.717 DEBUG 115 --- [ main] o.s.c.t.r.support.SimpleTaskRepository : Updating: TaskExecution with executionId=136 with the following {exitCode=0, endTime=Mon Apr 20 08:02:16 GMT 2020, exitMessage='null', errorMessage='null'}
2020-04-20 08:02:16.778 INFO 115 --- [ Thread-7] o.s.s.concurrent.ThreadPoolTaskExecutor : Shutting down ExecutorService 'taskExecutor'
2020-04-20 08:02:16.784 INFO 115 --- [ Thread-7] j.LocalContainerEntityManagerFactoryBean : Closing JPA EntityManagerFactory for persistence unit 'default'
2020-04-20 08:02:16.803 INFO 115 --- [ Thread-7] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Shutdown initiated...
2020-04-20 08:02:16.854 INFO 115 --- [ Thread-7] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Shutdown completed.
the docker compose used :
dataflow-server:
environment:
- SPRING_DATASOURCE_URL=jdbc:postgresql://postgres:5432/dataflow
- SPRING_DATASOURCE_USERNAME=root
- SPRING_DATASOURCE_PASSWORD=rootpw
- SPRING_DATASOURCE_DRIVER_CLASS_NAME=org.postgresql.Driver
- spring.jpa.properties.hibernate.temp.use_jdbc_metadata_defaults=false
- spring.jpa.database-platform=org.hibernate.dialect.PostgreSQL95Dialect
entrypoint: "./wait-for-it.sh -t 240 postgres:5432 -- java -jar /maven/spring-cloud-dataflow-server.jar"
skipper-server:
environment:
- SPRING_DATASOURCE_URL=jdbc:postgresql://postgres:5432/dataflow
- SPRING_DATASOURCE_USERNAME=root
- SPRING_DATASOURCE_PASSWORD=rootpw
- SPRING_DATASOURCE_DRIVER_CLASS_NAME=org.postgresql.Driver
entrypoint: "./wait-for-it.sh -t 240 postgres:5432 -- java -Djava.security.egd=file:/dev/./urandom -jar /spring-cloud-skipper-server.jar"
I hope, it will be an help.
Regards
Frederic
From the log: composed-task-runner && mytask && myTask, the syntax for creating the Composed Task definition looks incorrect.
The app name composed-task-runner should not be part of the task DSL.
You can check here for the detailed documentation on how to create and manage composed tasks.
I am running jBPM (v7.18) in docker on localhost using the following docker-compose configuration:
version: '2'
services:
postgres:
image: postgres:10.4
volumes:
- ./volumes/psql/:/var/lib/postgresql/data/
environment:
- POSTGRES_USER=jbpm
- POSTGRES_PASSWORD=jbpm
ports:
- 5432:5432
jbpm:
image: jboss/jbpm-server-full
environment:
JBPM_DB_DRIVER: postgres
JBPM_DB_HOST: postgres
ports:
- 8080:8080
- 8001:8001
volumes:
- "/Users/guest/prac/jbpm/quickfox:/opt/jboss/quickfox"
depends_on:
- postgres
I generated the business application from https://start.jbpm.org/
I am starting the service of the business application in dev mode as follows.
./launch-dev.sh clean install
As per the documentation ,
KIE server configuration needs to be as follows:
kieserver.serverId=business-application-service
kieserver.serverName=business-application-service
kieserver.location=http://localhost:8090/rest/server
kieserver.controllers=http://localhost:8080/jbpm-console/rest/controller
(which are the default settings in application-dev.properties)
But when I start the service it is not able to connect to business-central. I get the following logs
2019-05-01 11:56:50.789 INFO 47000 --- [ main] o.k.s.s.j.u.f.r.BootstrapFormRenderer : Boostrap Form renderer templates loaded successfully.
2019-05-01 11:56:50.795 INFO 47000 --- [ main] o.k.s.s.j.u.f.r.PatternflyFormRenderer : patternfly Form renderer templates loaded successfully.
2019-05-01 11:56:50.799 INFO 47000 --- [ main] o.k.s.s.j.u.f.r.PatternflyFormRenderer : workbench Form renderer templates loaded successfully.
2019-05-01 11:56:50.801 INFO 47000 --- [ main] o.k.server.services.impl.KieServerImpl : jBPM-UI KIE Server extension has been successfully registered as server extension
2019-05-01 11:56:50.802 INFO 47000 --- [ main] o.k.server.services.impl.KieServerImpl : DMN KIE Server extension has been successfully registered as server extension
2019-05-01 11:56:50.806 INFO 47000 --- [ main] o.k.s.s.impl.policy.PolicyManager : Registered KeepLatestContainerOnlyPolicy{interval=0 ms} policy under name KeepLatestOnly
2019-05-01 11:56:50.807 INFO 47000 --- [ main] o.k.s.s.impl.policy.PolicyManager : Policy manager started successfully, activated policies are []
2019-05-01 11:56:50.817 WARN 47000 --- [ main] o.kie.server.common.KeyStoreHelperUtil : Unable to load key store. Using password from configuration
2019-05-01 11:56:50.933 WARN 47000 --- [ main] o.k.s.s.i.c.DefaultRestControllerImpl : Exception encountered while syncing with controller at http://localhost:8080/jbpm-console/rest/controller/server/business-application-service-dev error Error while sending PUT request to http://localhost:8080/jbpm-console/rest/controller/server/business-application-service-dev response code 405
2019-05-01 11:56:50.933 WARN 47000 --- [ main] o.k.s.s.i.ControllerBasedStartupStrategy : Unable to connect to any controllers, delaying container installation until connection can be established
2019-05-01 11:56:50.934 WARN 47000 --- [ntrollerConnect] o.kie.server.common.KeyStoreHelperUtil : Unable to load key store. Using password from configuration
2019-05-01 11:56:50.950 WARN 47000 --- [ntrollerConnect] o.k.s.s.i.c.DefaultRestControllerImpl : Exception encountered while syncing with controller at http://localhost:8080/jbpm-console/rest/controller/server/business-application-service-dev error Error while sending PUT request to http://localhost:8080/jbpm-console/rest/controller/server/business-application-service-dev response code 405
2019-05-01 11:56:51.009 INFO 47000 --- [ main] o.k.s.s.a.KieServerAutoConfiguration : KieServer (id business-application-service-dev) started successfully
2019-05-01 11:56:51.339 INFO 47000 --- [ main] org.apache.cxf.endpoint.ServerImpl : Setting the server's publish address to be /
2019-05-01 11:56:51.652 INFO 47000 --- [ main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat started on port(s): 8090 (http) with context path ''
2019-05-01 11:56:51.658 INFO 47000 --- [ main] com.quickfox.service.Application : Started Application in 13.158 seconds (JVM running for 13.969)
2019-05-01 11:57:00.954 WARN 47000 --- [ntrollerConnect] o.kie.server.common.KeyStoreHelperUtil : Unable to load key store. Using password from configuration
2019-05-01 11:57:00.961 WARN 47000 --- [ntrollerConnect] o.k.s.s.i.c.DefaultRestControllerImpl : Exception encountered while syncing with controller at http://localhost:8080/jbpm-console/rest/controller/server/business-application-service-dev error Error while sending PUT request to http://localhost:8080/jbpm-console/rest/controller/server/business-application-service-dev response code 405
2019-05-01 11:57:10.963 WARN 47000 --- [ntrollerConnect] o.kie.server.common.KeyStoreHelperUtil : Unable to load key store. Using password from configuration
2019-05-01 11:57:10.972 WARN 47000 --- [ntrollerConnect] o.k.s.s.i.c.DefaultRestControllerImpl : Exception encountered while syncing with controller at http://localhost:8080/jbpm-console/rest/controller/server/business-application-service-dev error Error while sending PUT request to http://localhost:8080/jbpm-console/rest/controller/server/business-application-service-dev response code 405
But If I use the following configuration it works.
kieserver.serverId=business-application-service-dev
kieserver.serverName=business-application-service Dev
kieserver.location=http://localhost:8080/kie-server/services/rest/server
kieserver.controllers=http://localhost:8080/business-central/rest/controller
Can someone tell me what is the reason for this behavior? Please correct me if I am missing anything.
The 2nd set of URLs that you used are correct URLs. It seems like documentation needs to be corrected. "jbpm-console" end point were used in older versions.
I just created simple Spring starter project that contains a single controller and only one Rest API that print logs on the console. I don't see any exceptions/errors in the spring boot server startup, everything looks fine. but I get 504 Gateway timeout error when I access the rest API through Postman or Curl. here is my controller class.
Controller Class
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
#RestController
#RequestMapping(path = "/test")
public class SampleController {
private static final Logger LOG =
LoggerFactory.getLogger(SampleController.class.getSimpleName());
#GetMapping(value = "/method")
public void saveEcu() {
LOG.info("---> reached test/method----> ");
}
}
Log console
2018-06-28 22:03:52.890 INFO 7040 --- [ main] o.s.j.e.a.AnnotationMBeanExporter : Registering beans for JMX exposure on startup
2018-06-28 22:03:52.898 DEBUG 7040 --- [ main] o.s.w.c.s.StandardServletEnvironment : Adding PropertySource 'Management Server' with lowest search precedence
2018-06-28 22:03:52.901 INFO 7040 --- [ main] o.s.c.support.DefaultLifecycleProcessor : Starting beans in phase 0
2018-06-28 22:03:53.014 DEBUG 7040 --- [ main] o.s.w.s.resource.ResourceUrlProvider : Looking for resource handler mappings
2018-06-28 22:03:53.014 DEBUG 7040 --- [ main] o.s.w.s.resource.ResourceUrlProvider : Found resource handler mapping: URL pattern="/**/favicon.ico", locations=[ServletContext resource [/], class path resource [META-INF/resources/], class path resource [resources/], class path resource [static/], class path resource [public/], class path resource []], resolvers=[org.springframework.web.servlet.resource.PathResourceResolver#3c744059]
2018-06-28 22:03:53.014 DEBUG 7040 --- [ main] o.s.w.s.resource.ResourceUrlProvider : Found resource handler mapping: URL pattern="/webjars/**", locations=[class path resource [META-INF/resources/webjars/]], resolvers=[org.springframework.web.servlet.resource.PathResourceResolver#ab2dd851]
2018-06-28 22:03:53.015 DEBUG 7040 --- [ main] o.s.w.s.resource.ResourceUrlProvider : Found resource handler mapping: URL pattern="/**", locations=[ServletContext resource [/], class path resource [META-INF/resources/], class path resource [resources/], class path resource [static/], class path resource [public/]], resolvers=[org.springframework.web.servlet.resource.PathResourceResolver#c804fffb]
2018-06-28 22:03:53.042 INFO 7040 --- [ main] s.b.c.e.t.TomcatEmbeddedServletContainer : Tomcat started on port(s): 9091 (http)
2018-06-28 22:03:53.043 DEBUG 7040 --- [ main] o.s.w.c.s.StandardServletEnvironment : Adding PropertySource 'server.ports' with highest search precedence
2018-06-28 22:03:53.047 INFO 7040 --- [ main] c.e.demo.NewStarterProjectApplication : Started NewStarterProjectApplication in 3.822 seconds (JVM running for 5.088)
:: Before findByName ::
2018-02-16 12:08:28.544 ERROR --- [ main] o.h.p.access.spi.SetterMethodImpl : HHH000123: IllegalArgumentException in class: com.iconn
ect.grails.mis.model.BaseReportCriteriaCommand, setter method of property: groupByList
2018-02-16 12:08:28.560 ERROR --- [ main] o.h.p.access.spi.SetterMethodImpl : HHH000091: Expected type: java.util.ArrayList, actual v
alue: org.hibernate.collection.internal.PersistentList
2018-02-16 12:08:28.709 ERROR --- [ main] o.s.boot.SpringApplication : Application startup failed
strong text
Change the type of groupByList in BaseReportCriteriaCommand from ArrayList to List.