My issue is quite similar to this one and it's kinda straightforward: copy paste service from maven to gradle project makes starters non operational.
Here is the project I've used as an example and it starts like a charm:
Spring-Boot: (v2.2.5.RELEASE)
Camunda BPM: (v7.12.0)
Camunda BPM Spring Boot Starter: (v3.4.1)
INFO 227460 --- [main] com.camunda.demo.springboot.Application : Starting Application on archbox with PID 227460 (/home/user/ide/IdeaProjects/camunda-spring-boot-amqp-microservice-cloud-example/target/classes started by user in /home/user/ide/IdeaProjects/camunda-spring-boot-amqp-microservice-cloud-example)
INFO 227460 --- [main] com.camunda.demo.springboot.Application : No active profile set, falling back to default profiles: default
INFO 227460 --- [main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat initialized with port(s): 8080 (http)
INFO 227460 --- [main] o.apache.catalina.core.StandardService : Starting service [Tomcat]
INFO 227460 --- [main] org.apache.catalina.core.StandardEngine : Starting Servlet engine: [Apache Tomcat/9.0.31]
INFO 227460 --- [main] o.a.c.c.C.[Tomcat].[localhost].[/] : Initializing Spring embedded WebApplicationContext
INFO 227460 --- [main] o.s.web.context.ContextLoader : Root WebApplicationContext: initialization completed in 1095 ms
INFO 227460 --- [main] .c.b.s.b.s.r.CamundaJerseyResourceConfig : Configuring camunda rest api.
INFO 227460 --- [main] .c.b.s.b.s.r.CamundaJerseyResourceConfig : Finished configuring camunda rest api.
INFO 227460 --- [main] org.camunda.bpm.spring.boot : STARTER-SB040 Setting up jobExecutor with corePoolSize=3, maxPoolSize:10
INFO 227460 --- [main] o.s.s.concurrent.ThreadPoolTaskExecutor : Initializing ExecutorService 'camundaTaskExecutor'
INFO 227460 --- [main] org.camunda.bpm.engine.cfg : ENGINE-12003 Plugin 'CompositeProcessEnginePlugin[genericPropertiesConfiguration, camundaEngineHistoryConfiguration, camundaIdGeneratorConfiguration, camundaProcessEngineConfiguration, camundaDatasourceConfiguration, camundaJobConfiguration, camundaHistoryConfiguration, camundaMetricsConfiguration, camundaAuthorizationConfiguration, failedJobConfiguration, SendEventListenerPlugin, disableDeploymentResourcePattern, eventPublisherPlugin]' activated on process engine 'default'
INFO 227460 --- [main] org.camunda.bpm.spring.boot : STARTER-SB020 ProcessApplication enabled: autoDeployment via springConfiguration#deploymentResourcePattern is disabled
INFO 227460 --- [main] o.c.b.s.b.s.event.EventPublisherPlugin : EVENTING-001: Initialized Camunda Spring Boot Eventing Engine Plugin.
INFO 227460 --- [main] o.c.b.s.b.s.event.EventPublisherPlugin : EVENTING-003: Task events will be published as Spring Events.
INFO 227460 --- [main] o.c.b.s.b.s.event.EventPublisherPlugin : EVENTING-005: Execution events will be published as Spring Events.
INFO 227460 --- [main] o.c.b.s.b.s.event.EventPublisherPlugin : EVENTING-007: History events will be published as Spring events.
INFO 227460 --- [main] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Starting...
INFO 227460 --- [main] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Start completed.
INFO 227460 --- [main] org.camunda.bpm.engine : ENGINE-00001 Process Engine default created.
INFO 227460 --- [main] o.c.b.s.b.s.w.f.LazyInitRegistration : lazy initialized org.camunda.bpm.spring.boot.starter.webapp.filter.LazyProcessEnginesFilter#69364b2d
INFO 227460 --- [main] o.c.b.s.b.s.w.f.LazyInitRegistration : lazy initialized org.camunda.bpm.spring.boot.starter.webapp.filter.LazySecurityFilter#52f6900a
However project I've copied from part of sources gives following:
Spring-Boot: (v2.1.3.RELEASE)
Camunda BPM: (v7.12.0)
Camunda BPM Spring Boot Starter: (v3.4.1)
INFO 227891 --- [main] com.test.camundatest.Application : Starting Application on archbox with PID 227891 (/home/user/ide/IdeaProjects/gradle-camunda-service/build/classes/java/main started by user in /home/user/ide/IdeaProjects/gradle-camunda-service)
INFO 227891 --- [main] com.test.camundatest.Application : No active profile set, falling back to default profiles: default
INFO 227891 --- [main] .s.d.r.c.RepositoryConfigurationDelegate : Multiple Spring Data modules found, entering strict repository configuration mode!
INFO 227891 --- [main] .s.d.r.c.RepositoryConfigurationDelegate : Bootstrapping Spring Data repositories in DEFAULT mode.
INFO 227891 --- [main] .s.d.r.c.RepositoryConfigurationDelegate : Finished Spring Data repository scanning in 14ms. Found 0 repository interfaces.
INFO 227891 --- [main] .s.d.r.c.RepositoryConfigurationDelegate : Multiple Spring Data modules found, entering strict repository configuration mode!
INFO 227891 --- [main] .s.d.r.c.RepositoryConfigurationDelegate : Bootstrapping Spring Data repositories in DEFAULT mode.
INFO 227891 --- [main] .s.d.r.c.RepositoryConfigurationDelegate : Finished Spring Data repository scanning in 3ms. Found 0 repository interfaces.
INFO 227891 --- [main] trationDelegate$BeanPostProcessorChecker : Bean 'org.springframework.transaction.annotation.ProxyTransactionManagementConfiguration' of type [org.springframework.transaction.annotation.ProxyTransactionManagementConfiguration$$EnhancerBySpringCGLIB$$d980ca4f] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
INFO 227891 --- [main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat initialized with port(s): 8080 (http)
INFO 227891 --- [main] o.apache.catalina.core.StandardService : Starting service [Tomcat]
INFO 227891 --- [main] org.apache.catalina.core.StandardEngine : Starting Servlet engine: [Apache Tomcat/9.0.16]
INFO 227891 --- [main] o.a.catalina.core.AprLifecycleListener : The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: [/usr/java/packages/lib:/usr/lib64:/lib64:/lib:/usr/lib]
INFO 227891 --- [main] o.a.c.c.C.[Tomcat].[localhost].[/] : Initializing Spring embedded WebApplicationContext
INFO 227891 --- [main] o.s.web.context.ContextLoader : Root WebApplicationContext: initialization completed in 1883 ms
ERROR 227891 --- [main] o.s.b.web.embedded.tomcat.TomcatStarter : Error starting Tomcat context. Exception: org.springframework.beans.factory.BeanCreationException. Message: Error creating bean with name 'servletEndpointRegistrar' defined in class path resource [org/springframework/boot/actuate/autoconfigure/endpoint/web/ServletEndpointManagementContextConfiguration$WebMvcServletEndpointManagementContextConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.boot.actuate.endpoint.web.ServletEndpointRegistrar]: Factory method 'servletEndpointRegistrar' threw exception; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'healthEndpoint' defined in class path resource [org/springframework/boot/actuate/autoconfigure/health/HealthEndpointConfiguration.class]: Unsatisfied dependency expressed through method 'healthEndpoint' parameter 1; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'healthIndicatorRegistry' defined in class path resource [org/springframework/boot/actuate/autoconfigure/health/HealthIndicatorAutoConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.boot.actuate.health.HealthIndicatorRegistry]: Factory method 'healthIndicatorRegistry' threw exception; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'org.camunda.bpm.engine.spring.SpringProcessEngineServicesConfiguration': Unsatisfied dependency expressed through field 'processEngine'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'org.camunda.bpm.spring.boot.starter.CamundaBpmAutoConfiguration$ProcessEngineConfigurationImplDependingConfiguration': Unsatisfied dependency expressed through field 'processEngineConfigurationImpl'; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'org.camunda.bpm.engine.impl.cfg.ProcessEngineConfigurationImpl' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {#org.springframework.beans.factory.annotation.Autowired(required=true)}
INFO 227891 --- [main] o.apache.catalina.core.StandardService : Stopping service [Tomcat]
WARN 227891 --- [main] ConfigServletWebServerApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.context.ApplicationContextException: Unable to start web server; nested exception is org.springframework.boot.web.server.WebServerException: Unable to start embedded Tomcat
INFO 227891 --- [main] ConditionEvaluationReportLoggingListener :
Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
2020-06-06 10:21:45.754 ERROR 227891 --- [main] o.s.b.d.LoggingFailureAnalysisReporter :
***************************
APPLICATION FAILED TO START
***************************
Description:
Field processEngineConfigurationImpl in org.camunda.bpm.spring.boot.starter.CamundaBpmAutoConfiguration$ProcessEngineConfigurationImplDependingConfiguration required a bean of type 'org.camunda.bpm.engine.impl.cfg.ProcessEngineConfigurationImpl' that could not be found.
The following candidates were found but could not be injected:
- Bean method 'processEngineConfigurationImpl' in 'CamundaBpmConfiguration' not loaded because #ConditionalOnMissingBean (types: org.camunda.bpm.engine.impl.cfg.ProcessEngineConfigurationImpl; SearchStrategy: all) found beans of type 'org.camunda.bpm.engine.impl.cfg.ProcessEngineConfigurationImpl' processEngineConfiguration
Action:
Consider revisiting the entries above or defining a bean of type 'org.camunda.bpm.engine.impl.cfg.ProcessEngineConfigurationImpl' in your configuration.
What should I add / change in configs to make my "gradle" service work like "maven" one?
Surprisingly there's key difference in the way that two given projects retrieving connection and data source details.
For instance it's enough for me to put this into maven project properties to point camunda engine to my db (rest left "as-is"):
spring.datasource.url=${POSTGRES_ADDRESS:jdbc:postgresql://localhost:5432/myservice}
spring.datasource.username=${POSTGRES_USER:postgres}
spring.datasource.password=${POSTGRES_PASSWORD:12345}
spring.jpa.properties.hibernate.temp.use_jdbc_metadata_defaults=false
while same config just doesn't work for gradle completely, obscurely complaining about processEngineConfigurationImpl bean absence when all what engine needs is database connection details.
So that's what I figured:
#Configuration
#ImportResource({"classpath:config.xml"})
public class Config {
#Value("${spring.datasource.url}")
private String url;
#Value("${spring.datasource.username}")
private String username;
#Value("${spring.datasource.password}")
private String password;
#Bean
public DataSource dataSource() {
BasicDataSource dataSource = new BasicDataSource();
dataSource.setDriverClassName("org.postgresql.Driver");
dataSource.setUrl(url);
dataSource.setUsername(username);
dataSource.setPassword(password);
return dataSource;
}
#Bean
public PlatformTransactionManager transactionManager() {
return new DataSourceTransactionManager(dataSource());
}
#Bean
public ProcessEngineConfigurationImpl processEngineConfiguration() throws IOException {
SpringProcessEngineConfiguration config = new SpringProcessEngineConfiguration();
config.setDataSource(dataSource());
config.setTransactionManager(transactionManager());
config.setDatabaseSchemaUpdate("true");
config.setJobExecutorActivate(true);
config.setAuthorizationEnabled(true);
config.setDefaultSerializationFormat("application/json");
PathMatchingResourcePatternResolver resolver = new PathMatchingResourcePatternResolver();
config.setDeploymentResources(resolver.getResources("classpath:/bpmn/*.bpmn"));
List<ProcessEnginePlugin> processEnginePlugins = new ArrayList<>();
config.setProcessEnginePlugins(processEnginePlugins);
return config;
}
}
And it works:
Spring-Boot: (v2.1.3.RELEASE)
Camunda BPM: (v7.13.0)
Camunda BPM Spring Boot Starter: (v7.13.0)
INFO 378753 --- [main] com.myname.myservice.Application : Starting Application on pc with PID 378753 (/home/user/IdeaProjects/myservice/build/classes/java/main started by user in /home/user/IdeaProjects/myservice)
INFO 378753 --- [main] com.myname.myservice.Application : No active profile set, falling back to default profiles: default
INFO 378753 --- [main] .s.d.r.c.RepositoryConfigurationDelegate : Multiple Spring Data modules found, entering strict repository configuration mode!
INFO 378753 --- [main] .s.d.r.c.RepositoryConfigurationDelegate : Bootstrapping Spring Data repositories in DEFAULT mode.
INFO 378753 --- [main] .s.d.r.c.RepositoryConfigurationDelegate : Finished Spring Data repository scanning in 7ms. Found 0 repository interfaces.
INFO 378753 --- [main] .s.d.r.c.RepositoryConfigurationDelegate : Multiple Spring Data modules found, entering strict repository configuration mode!
INFO 378753 --- [main] .s.d.r.c.RepositoryConfigurationDelegate : Bootstrapping Spring Data repositories in DEFAULT mode.
INFO 378753 --- [main] .s.d.r.c.RepositoryConfigurationDelegate : Finished Spring Data repository scanning in 7ms. Found 0 repository interfaces.
INFO 378753 --- [main] trationDelegate$BeanPostProcessorChecker : Bean 'org.springframework.kafka.annotation.KafkaBootstrapConfiguration' of type [org.springframework.kafka.annotation.KafkaBootstrapConfiguration$$EnhancerBySpringCGLIB$$f04798b1] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
INFO 378753 --- [main] trationDelegate$BeanPostProcessorChecker : Bean 'org.springframework.transaction.annotation.ProxyTransactionManagementConfiguration' of type [org.springframework.transaction.annotation.ProxyTransactionManagementConfiguration$$EnhancerBySpringCGLIB$$1c95872e] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
INFO 378753 --- [main] o.f.c.internal.license.VersionPrinter : Flyway Community Edition 5.2.4 by Boxfuse
INFO 378753 --- [main] o.f.c.internal.database.DatabaseFactory : Database: jdbc:postgresql://localhost:5432/myservice (PostgreSQL 12.1)
WARN 378753 --- [main] o.f.c.internal.database.base.Database : Flyway upgrade recommended: PostgreSQL 12.1 is newer than this version of Flyway and support has not been tested.
INFO 378753 --- [main] o.f.core.internal.command.DbValidate : Successfully validated 2 migrations (execution time 00:00.010s)
INFO 378753 --- [main] o.f.core.internal.command.DbMigrate : Current version of schema "public": 1
INFO 378753 --- [main] o.f.core.internal.command.DbMigrate : Schema "public" is up to date. No migration necessary.
INFO 378753 --- [main] o.hibernate.jpa.internal.util.LogHelper : HHH000204: Processing PersistenceUnitInfo [
name: default
...]
INFO 378753 --- [main] org.hibernate.Version : HHH000412: Hibernate Core {5.3.7.Final}
INFO 378753 --- [main] org.hibernate.cfg.Environment : HHH000206: hibernate.properties not found
INFO 378753 --- [main] o.hibernate.annotations.common.Version : HCANN000001: Hibernate Commons Annotations {5.0.4.Final}
INFO 378753 --- [main] org.hibernate.dialect.Dialect : HHH000400: Using dialect: org.hibernate.dialect.PostgreSQL95Dialect
INFO 378753 --- [main] o.h.e.j.e.i.LobCreatorBuilderImpl : HHH000422: Disabling contextual LOB creation as connection was null
INFO 378753 --- [main] org.hibernate.type.BasicTypeRegistry : HHH000270: Type registration [java.util.UUID] overrides previous : org.hibernate.type.UUIDBinaryType#642c6461
INFO 378753 --- [main] j.LocalContainerEntityManagerFactoryBean : Initialized JPA EntityManagerFactory for persistence unit 'default'
INFO 378753 --- [main] org.camunda.feel.FeelEngine : Engine created. [value-mapper: CompositeValueMapper(List(org.camunda.feel.impl.JavaValueMapper#a047bdb)), function-provider: org.camunda.bpm.dmn.feel.impl.scala.function.CustomFunctionTransformer#173b1af1, configuration: Configuration(false)]
INFO 378753 --- [main] org.camunda.bpm.engine : ENGINE-00001 Process Engine default created.
INFO 378753 --- [main] org.camunda.bpm.engine.jobexecutor : ENGINE-14014 Starting up the JobExecutor[org.camunda.bpm.engine.impl.jobexecutor.DefaultJobExecutor].
INFO 378753 --- [ultJobExecutor]] org.camunda.bpm.engine.jobexecutor : ENGINE-14018 JobExecutor[org.camunda.bpm.engine.impl.jobexecutor.DefaultJobExecutor] starting to acquire jobs
INFO 378753 --- [main] o.s.s.concurrent.ThreadPoolTaskExecutor : Initializing ExecutorService 'asyncExecutor'
INFO 378753 --- [main] i.micrometer.influx.InfluxMeterRegistry : publishing metrics to influx every 1m
INFO 378753 --- [main] org.camunda.bpm.spring.boot : STARTER-SB040 Setting up jobExecutor with corePoolSize=3, maxPoolSize:10
INFO 378753 --- [main] o.s.s.concurrent.ThreadPoolTaskExecutor : Initializing ExecutorService 'camundaTaskExecutor'
INFO 378753 --- [main] o.s.s.c.ThreadPoolTaskScheduler : Initializing ExecutorService 'taskScheduler'
INFO 378753 --- [main] n.d.b.g.s.s.GrpcServerLifecycle : gRPC Server started, listening on address: *, port: 8081
INFO 378753 --- [main] org.camunda.bpm.container : ENGINE-08024 Found processes.xml file at file:/home/user/IdeaProjects/myservice/build/resources/main/META-INF/processes.xml
INFO 378753 --- [main] org.camunda.bpm.container : ENGINE-08023 Deployment summary for process archive 'application':
As a sidenote - for unknown reason sql dialect is very important for bpm so this one is mandatory to set like this:
spring.jpa.database-platform = org.hibernate.dialect.PostgreSQL95Dialect
and not to forget to please flyway if used:
spring.flyway.baseline-on-migrate = true
Related
I am trying to run a basic spring boot application with JPA by using spanner emulator. However, I am getting the below error after startup after hitting any exposed end point.
PERMISSION_DENIED: com.google.api.gax.rpc.PermissionDeniedException: io.grpc.StatusRuntimeException: PERMISSION_DENIED: Caller is missing IAM permission spanner.sessions.create on resource projects/test-project/instances/test-instance/databases/test-database.
Project has been cloned from https://github.com/GoogleCloudPlatform/google-cloud-spanner-hibernate/tree/master/google-cloud-spanner-hibernate-samples/spring-data-jpa-sample
and the only change I have done is updated the application.properties file.
as per my understanding spanner emulator should not have any IAM related issues as it doesn't need any. I am not sure what is causing this issue here. I have verified that the emulator config is the active config and hence I would expect the code to connect to emulator.
# Application configuration to use Cloud Spanner with Spring Data JPA
# Spanner connection URL.
# - ${PROJECT_ID} Replace with your GCP project ID
# - ${INSTANCE_ID} Replace with your Spanner instance ID
# - ${DATABASE_NAME} Replace with your Spanner database name within your Spanner instance
spring.datasource.url=jdbc:cloudspanner:/projects/test-project/instances/test-instance/databases/test-database
# Specify the Spanner JDBC driver.
spring.datasource.driver-class-name=com.google.cloud.spanner.jdbc.JdbcDriver
# Specify the Spanner Hibernate dialect.
spring.jpa.properties.hibernate.dialect=com.google.cloud.spanner.hibernate.SpannerDialect
#spring.jpa.hibernate.ddl-auto=update //same error even if I uncomment this line
# Settings to enable batching statements for efficiency
spring.jpa.properties.hibernate.jdbc.batch_size=100
# You may display SQL statements and stats for debugging if needed.
spring.jpa.properties.hibernate.show_sql=true
spring.jpa.properties.hibernate.format_sql=true
Please find the console logs below:
2021-10-06 12:59:12.549 INFO 9747 --- [ main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat initialized with port(s): 8080 (http)
2021-10-06 12:59:12.556 INFO 9747 --- [ main] o.apache.catalina.core.StandardService : Starting service [Tomcat]
2021-10-06 12:59:12.556 INFO 9747 --- [ main] org.apache.catalina.core.StandardEngine : Starting Servlet engine: [Apache Tomcat/9.0.53]
2021-10-06 12:59:12.617 INFO 9747 --- [ main] o.a.c.c.C.[Tomcat].[localhost].[/] : Initializing Spring embedded WebApplicationContext
2021-10-06 12:59:12.617 INFO 9747 --- [ main] w.s.c.ServletWebServerApplicationContext : Root WebApplicationContext: initialization completed in 694 ms
2021-10-06 12:59:12.707 INFO 9747 --- [ main] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Starting...
2021-10-06 12:59:12.737 WARN 9747 --- [ main] c.g.a.oauth2.DefaultCredentialsProvider : Your application has authenticated using end user credentials from Google Cloud SDK. We recommend that most server applications use service accounts instead. If your application continues to use end user credentials from Cloud SDK, you might receive a "quota exceeded" or "API not enabled" error. For more information about service accounts, see https://cloud.google.com/docs/authentication/.
2021-10-06 12:59:14.558 INFO 9747 --- [ main] com.zaxxer.hikari.pool.PoolBase : HikariPool-1 - Driver does not support get/set network timeout for connections. (Network timeout is not supported)
2021-10-06 12:59:22.165 INFO 9747 --- [ main] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Start completed.
2021-10-06 12:59:22.197 INFO 9747 --- [ main] o.hibernate.jpa.internal.util.LogHelper : HHH000204: Processing PersistenceUnitInfo [name: default]
2021-10-06 12:59:22.231 INFO 9747 --- [ main] org.hibernate.Version : HHH000412: Hibernate ORM core version 5.4.29.Final
2021-10-06 12:59:22.337 INFO 9747 --- [ main] o.hibernate.annotations.common.Version : HCANN000001: Hibernate Commons Annotations {5.1.2.Final}
2021-10-06 12:59:22.396 INFO 9747 --- [ main] org.hibernate.dialect.Dialect : HHH000400: Using dialect: com.google.cloud.spanner.hibernate.SpannerDialect
2021-10-06 12:59:22.851 INFO 9747 --- [ main] o.h.e.t.j.p.i.JtaPlatformInitiator : HHH000490: Using JtaPlatform implementation: [org.hibernate.engine.transaction.jta.platform.internal.NoJtaPlatform]
2021-10-06 12:59:22.857 INFO 9747 --- [ main] j.LocalContainerEntityManagerFactoryBean : Initialized JPA EntityManagerFactory for persistence unit 'default'
2021-10-06 12:59:23.060 WARN 9747 --- [ 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
2021-10-06 12:59:23.184 INFO 9747 --- [ main] o.s.b.a.w.s.WelcomePageHandlerMapping : Adding welcome page template: index
2021-10-06 12:59:23.290 INFO 9747 --- [ main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat started on port(s): 8080 (http) with context path ''
2021-10-06 12:59:23.298 INFO 9747 --- [ main] com.example.CoffeeApplication : Started CoffeeApplication in 12.957 seconds (JVM running for 13.227)
2021-10-06 12:59:33.646 INFO 9747 --- [nio-8080-exec-1] o.a.c.c.C.[Tomcat].[localhost].[/] : Initializing Spring DispatcherServlet 'dispatcherServlet'
2021-10-06 12:59:33.646 INFO 9747 --- [nio-8080-exec-1] o.s.web.servlet.DispatcherServlet : Initializing Servlet 'dispatcherServlet'
2021-10-06 12:59:33.647 INFO 9747 --- [nio-8080-exec-1] o.s.web.servlet.DispatcherServlet : Completed initialization in 1 ms
Hibernate:
select
customer0_.id as id1_1_,
customer0_.email as email2_1_,
customer0_.name as name3_1_
from
customer customer0_
2021-10-06 12:59:35.650 WARN 9747 --- [nio-8080-exec-1] o.h.engine.jdbc.spi.SqlExceptionHelper : SQL Error: 7, SQLState: null
2021-10-06 12:59:35.650 ERROR 9747 --- [nio-8080-exec-1] o.h.engine.jdbc.spi.SqlExceptionHelper : PERMISSION_DENIED: com.google.api.gax.rpc.PermissionDeniedException: io.grpc.StatusRuntimeException: PERMISSION_DENIED: Caller is missing IAM permission spanner.sessions.create on resource projects/test-project/instances/test-instance/databases/test-database.
2021-10-06 12:59:35.668 ERROR 9747 --- [nio-8080-exec-1] o.a.c.c.C.[.[.[/].[dispatcherServlet] : Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Request processing failed; nested exception is org.springframework.orm.jpa.JpaSystemException: could not extract ResultSet; nested exception is org.hibernate.exception.GenericJDBCException: could not extract ResultSet] with root cause
io.grpc.StatusRuntimeException: PERMISSION_DENIED: Caller is missing IAM permission spanner.sessions.create on resource projects/test-project/instances/test-instance/databases/test-database.
at io.grpc.Status.asRuntimeException(Status.java:535) ~[grpc-api-1.40.1.jar:1.40.1]
at io.grpc.stub.ClientCalls$UnaryStreamToFuture.onClose(ClientCalls.java:533) ~[grpc-stub-1.40.1.jar:1.40.1]
at io.grpc.PartialForwardingClientCallListener.onClose(PartialForwardingClientCallListener.java:39) ~[grpc-api-1.40.1.jar:1.40.1]
at io.grpc.ForwardingClientCallListener.onClose(ForwardingClientCallListener.java:23) ~[grpc-api-1.40.1.jar:1.40.1]
at io.grpc.ForwardingClientCallListener$SimpleForwardingClientCallListener.onClose(ForwardingClientCallListener.java:40) ~[grpc-api-1.40.1.jar:1.40.1]
at com.google.cloud.spanner.spi.v1.SpannerErrorInterceptor$1$1.onClose(SpannerErrorInterceptor.java:100) ~[google-cloud-spanner-6.12.5.jar:6.12.5]
at io.grpc.internal.ClientCallImpl.closeObserver(ClientCallImpl.java:557) ~[grpc-core-1.40.1.jar:1.40.1]
at io.grpc.internal.ClientCallImpl.access$300(ClientCallImpl.java:69) ~[grpc-core-1.40.1.jar:1.40.1]
at io.grpc.internal.ClientCallImpl$ClientStreamListenerImpl$1StreamClosed.runInternal(ClientCallImpl.java:738) ~[grpc-core-1.40.1.jar:1.40.1]
at io.grpc.internal.ClientCallImpl$ClientStreamListenerImpl$1StreamClosed.runInContext(ClientCallImpl.java:717) ~[grpc-core-1.40.1.jar:1.40.1]
at io.grpc.internal.ContextRunnable.run(ContextRunnable.java:37) ~[grpc-core-1.40.1.jar:1.40.1]
at io.grpc.internal.SerializingExecutor.run(SerializingExecutor.java:133) ~[grpc-core-1.40.1.jar:1.40.1]
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) ~[na:1.8.0_281]
at java.util.concurrent.FutureTask.run(FutureTask.java:266) ~[na:1.8.0_281]
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180) ~[na:1.8.0_281]
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293) ~[na:1.8.0_281]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) ~[na:1.8.0_281]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) ~[na:1.8.0_281]
at java.lang.Thread.run(Thread.java:748) [na:1.8.0_281]
The error is a clear indication that your application is not trying to connect to the emulator, but to a real Spanner database. In order to connect to the emulator instead of 'real' Cloud Spanner, you should do one of the following:
Set the environment variable SPANNER_EMULATOR_HOST=localhost:9010
OR: Edit the JDBC connection URL to include the autoConfigEmulator=true property. Your JDBC URL would then become jdbc:cloudspanner:/projects/test-project/instances/test-instance/databases/test-database;autoConfigEmulator=true
The advantage of the second alternative is that the autoConfigEmulator property will not only ensure that the JDBC driver is connecting to the emulator, it will also automatically create the test-instance and test-database on the emulator if they do not already exist.
please, I need some help, I've been stuck with this error 2 days.
org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'adsController': Unsatisfied dependency expressed through field 'shortUrlService'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'shortUrlServiceImpl': Unsatisfied dependency expressed through field 'shortUrlRepository'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'shortUrlRepository' defined in com.codepressed.urlShortener.dao.ShortUrlRepository defined in #EnableMongoRepositories declared on MongoRepositoriesRegistrar.EnableMongoRepositoriesConfiguration: Invocation of init method failed; nested exception is org.springframework.data.mapping.PropertyReferenceException: No property desc found for type LocalDateTime! Traversed path: ShortUrl.creationDate.
Error display
This is my code:
Service class
#Service
public class AdvertisementServiceImpl implements AdvertisementService{
#Autowired
AdvertisementRepository advertisementRepository;
#Autowired
private MongoUtilsService mongoUtilsService;
#Override
public Advertisement save(Advertisement advertisement) {
advertisement.set_id(mongoUtilsService.getNextValue("AD"));
return advertisementRepository.insert(advertisement);
}
#Override
public void removeAd(Advertisement advertisement) {
advertisementRepository.delete(advertisement);
}
#Override
public Advertisement randomAd() {
List<Advertisement> allAds = advertisementRepository.findAll();
Random random = new Random();
return allAds.get(random.nextInt(allAds.size()-1));
}
}
My repository
#RepositoryRestResource
public interface AdvertisementRepository extends MongoRepository<Advertisement,Long> {
}
Controller class
#Controller
#RequestMapping("/ad")
public class AdsController {
#Autowired
AdvertisementService advertisementService;
#Autowired
ShortUrlService shortUrlService;
#GetMapping(value="/{id}")
public String getRandomAd(#PathVariable Long id, Model model){
model.addAttribute("ad", advertisementService.randomAd());
String url;
if (shortUrlService.findUrlById(id) != null){
url = shortUrlService.findUrlById(id);
}else if (shortUrlService.findUrlByCustom(String.valueOf(id)) != null){
url = shortUrlService.findUrlByCustom(String.valueOf(id));
}else {
url = "/error404.html";
}
model.addAttribute("url", url);
return "go";
}
I would like to use the ServiceImpl and Service but I don't know why wouldn't I be able to autowire them.
Additionaly, I have on my Config Class the following annotation:
#ComponentScan({"com.codepressed.urlShortener", "com.codepressed.urlShortener.dao",
"com.codepressed.urlShortener.service", "com.codepressed.urlShortener.controller"})
but doesn't seem to be enough...
please, any help is appreciated, I can't see the error or I don't understand it.
GITHUB REPO: https://github.com/codepressed/Jurly/tree/master/src/main/java/com/codepressed/urlShortener
I just cloned your code, on github.
I found that your method naming does not conform to the Spring-Data JPA specification.
Rename ShortUrlRepository method:
List<ShortUrl> findFirst10ByCreationDateDesc();
to:
List<ShortUrl> findFirst10ByOrderByCreationDateDesc();
When this problem is solved, run the application,console output:
No session repository could be auto-configured, check your configuration
So I created a mongo http session config:
package com.codepressed.urlShortener.config;
import org.springframework.context.annotation.Bean;
import org.springframework.session.data.mongo.JdkMongoSessionConverter;
import org.springframework.session.data.mongo.config.annotation.web.http.EnableMongoHttpSession;
import java.time.Duration;
#EnableMongoHttpSession
public class HttpSessionConfig {
#Bean
public JdkMongoSessionConverter jdkMongoSessionConverter() {
return new JdkMongoSessionConverter(Duration.ofMinutes(30));
}
}
Then I run the application again,No exception output!
2021-06-18 00:06:49.844 INFO 13960 --- [ main] c.c.u.UrlShortenerApplication : Starting UrlShortenerApplication using Java 11.0.10 on Mashiros-iMac.lan with PID 13960 (/Users/rat/IdeaProjects/Jurly/target/classes started by rat in /Users/rat/IdeaProjects/Jurly)
2021-06-18 00:06:49.850 INFO 13960 --- [ main] c.c.u.UrlShortenerApplication : No active profile set, falling back to default profiles: default
2021-06-18 00:06:50.295 INFO 13960 --- [ main] .s.d.r.c.RepositoryConfigurationDelegate : Bootstrapping Spring Data MongoDB repositories in DEFAULT mode.
2021-06-18 00:06:50.329 INFO 13960 --- [ main] .s.d.r.c.RepositoryConfigurationDelegate : Finished Spring Data repository scanning in 32 ms. Found 2 MongoDB repository interfaces.
2021-06-18 00:06:50.667 INFO 13960 --- [ main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat initialized with port(s): 8080 (http)
2021-06-18 00:06:50.674 INFO 13960 --- [ main] o.apache.catalina.core.StandardService : Starting service [Tomcat]
2021-06-18 00:06:50.674 INFO 13960 --- [ main] org.apache.catalina.core.StandardEngine : Starting Servlet engine: [Apache Tomcat/9.0.45]
2021-06-18 00:06:50.717 INFO 13960 --- [ main] o.a.c.c.C.[Tomcat].[localhost].[/] : Initializing Spring embedded WebApplicationContext
2021-06-18 00:06:50.718 INFO 13960 --- [ main] w.s.c.ServletWebServerApplicationContext : Root WebApplicationContext: initialization completed in 833 ms
2021-06-18 00:06:50.838 INFO 13960 --- [ main] org.mongodb.driver.cluster : Cluster created with settings {hosts=[127.0.0.1:27017], mode=SINGLE, requiredClusterType=UNKNOWN, serverSelectionTimeout='30000 ms'}
2021-06-18 00:06:50.875 INFO 13960 --- [127.0.0.1:27017] org.mongodb.driver.connection : Opened connection [connectionId{localValue:2, serverValue:1}] to 127.0.0.1:27017
2021-06-18 00:06:50.875 INFO 13960 --- [127.0.0.1:27017] org.mongodb.driver.connection : Opened connection [connectionId{localValue:1, serverValue:2}] to 127.0.0.1:27017
2021-06-18 00:06:50.876 INFO 13960 --- [127.0.0.1:27017] org.mongodb.driver.cluster : Monitor thread successfully connected to server with description ServerDescription{address=127.0.0.1:27017, type=STANDALONE, state=CONNECTED, ok=true, minWireVersion=0, maxWireVersion=9, maxDocumentSize=16777216, logicalSessionTimeoutMinutes=30, roundTripTimeNanos=11069828}
2021-06-18 00:06:51.052 INFO 13960 --- [ main] org.mongodb.driver.connection : Opened connection [connectionId{localValue:3, serverValue:3}] to 127.0.0.1:27017
2021-06-18 00:06:51.067 INFO 13960 --- [ main] o.s.s.d.m.AbstractMongoSessionConverter : Creating TTL index on field expireAt
2021-06-18 00:06:51.536 INFO 13960 --- [ main] o.s.s.concurrent.ThreadPoolTaskExecutor : Initializing ExecutorService 'applicationTaskExecutor'
2021-06-18 00:06:51.600 INFO 13960 --- [ main] o.s.b.a.w.s.WelcomePageHandlerMapping : Adding welcome page template: index
2021-06-18 00:06:51.891 INFO 13960 --- [ main] .s.s.UserDetailsServiceAutoConfiguration :
Using generated security password: 1c0d09bd-73cc-42aa-8f6a-df157db252fe
2021-06-18 00:06:52.022 INFO 13960 --- [ main] o.s.s.web.DefaultSecurityFilterChain : Will secure any request with [org.springframework.security.web.context.request.async.WebAsyncManagerIntegrationFilter#1e95f584, org.springframework.security.web.context.SecurityContextPersistenceFilter#1a336906, org.springframework.security.web.header.HeaderWriterFilter#39afe59f, org.springframework.security.web.csrf.CsrfFilter#3a3316b6, org.springframework.security.web.authentication.logout.LogoutFilter#57fce8b, org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter#1b4ba615, org.springframework.security.web.authentication.ui.DefaultLoginPageGeneratingFilter#3a9c11fb, org.springframework.security.web.authentication.ui.DefaultLogoutPageGeneratingFilter#54997f67, org.springframework.security.web.authentication.www.BasicAuthenticationFilter#18e8eb59, org.springframework.security.web.savedrequest.RequestCacheAwareFilter#20f63ddc, org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter#24f177f5, org.springframework.security.web.authentication.AnonymousAuthenticationFilter#bf4e48e, org.springframework.security.web.session.SessionManagementFilter#43756cb, org.springframework.security.web.access.ExceptionTranslationFilter#48ee3c2d, org.springframework.security.web.access.intercept.FilterSecurityInterceptor#e6e5da4]
2021-06-18 00:06:52.105 INFO 13960 --- [ main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat started on port(s): 8080 (http) with context path ''
2021-06-18 00:06:52.115 INFO 13960 --- [ main] c.c.u.UrlShortenerApplication : Started UrlShortenerApplication in 2.542 seconds (JVM running for 3.116)
I think you should refer to the following tutorials:
Spring Session with MongoDB
Sorting Query Results with Spring Data
I deployed a springboot application package in WAR format. But I am not seeing the spring related logs in my console. Also, I cannot see the application running. What could be the possible reason? I am attaching the tomcat logs herewith. Thanks in advance
2020-07-02 17:22:17.744 INFO 17952 --- [ost-startStop-1] c.s.narayaneeyam.ServletInitializer : Starting ServletInitializer v0.0.1-SNAPSHOT on DESKTOP-PB6GB90 with PID 17952 (D:\Tomcat\apache-tomcat-8.5.56-windows-x64\apache-tomcat-8.5.56\webapps\narayaneeyam-0.0.1-SNAPSHOT\WEB-INF\classes started by sachi in D:\Tomcat\apache-tomcat-8.5.56-windows-x64\apache-tomcat-8.5.56\bin)
2020-07-02 17:22:17.754 INFO 17952 --- [ost-startStop-1] c.s.narayaneeyam.ServletInitializer : No active profile set, falling back to default profiles: default
2020-07-02 17:22:20.982 INFO 17952 --- [ost-startStop-1] .s.d.r.c.RepositoryConfigurationDelegate : Bootstrapping Spring Data JPA repositories in DEFERRED mode.
2020-07-02 17:22:21.248 INFO 17952 --- [ost-startStop-1] .s.d.r.c.RepositoryConfigurationDelegate : Finished Spring Data repository scanning in 227ms. Found 4 JPA repository interfaces.
2020-07-02 17:22:22.688 INFO 17952 --- [ost-startStop-1] w.s.c.ServletWebServerApplicationContext : Root WebApplicationContext: initialization completed in 4795 ms
2020-07-02 17:22:23.760 INFO 17952 --- [ost-startStop-1] o.s.s.concurrent.ThreadPoolTaskExecutor : Initializing ExecutorService 'applicationTaskExecutor'
2020-07-02 17:22:23.944 INFO 17952 --- [ task-1] o.hibernate.jpa.internal.util.LogHelper : HHH000204: Processing PersistenceUnitInfo [name: default]
2020-07-02 17:22:24.042 WARN 17952 --- [ost-startStop-1] 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
2020-07-02 17:22:24.172 INFO 17952 --- [ost-startStop-1] .s.s.UserDetailsServiceAutoConfiguration :
Using generated security password: 3c2c7634-78d3-4015-ab8e-c9a6c99c4b3b
2020-07-02 17:22:24.288 INFO 17952 --- [ task-1] org.hibernate.Version : HHH000412: Hibernate ORM core version 5.4.17.Final
2020-07-02 17:22:25.162 INFO 17952 --- [ task-1] o.hibernate.annotations.common.Version : HCANN000001: Hibernate Commons Annotations {5.1.0.Final}
2020-07-02 17:22:25.745 INFO 17952 --- [ task-1] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Starting...
2020-07-02 17:22:26.474 INFO 17952 --- [ task-1] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Start completed.
2020-07-02 17:22:26.573 INFO 17952 --- [ task-1] org.hibernate.dialect.Dialect : HHH000400: Using dialect: org.hibernate.dialect.MySQL8Dialect
2020-07-02 17:22:26.621 INFO 17952 --- [ost-startStop-1] o.s.s.web.DefaultSecurityFilterChain : Creating filter chain: any request, [org.springframework.security.web.context.request.async.WebAsyncManagerIntegrationFilter#2e78fc6, org.springframework.security.web.context.SecurityContextPersistenceFilter#5adbbfc, org.springframework.security.web.header.HeaderWriterFilter#5e4ef05f, org.springframework.security.web.csrf.CsrfFilter#6f946b3c, org.springframework.security.web.authentication.logout.LogoutFilter#61bb46d, org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter#5dcf9e1a, org.springframework.security.web.authentication.ui.DefaultLoginPageGeneratingFilter#5a5ac80e, org.springframework.security.web.authentication.ui.DefaultLogoutPageGeneratingFilter#4fb155f8, org.springframework.security.web.savedrequest.RequestCacheAwareFilter#54779eb2, org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter#39715673, org.springframework.security.web.authentication.AnonymousAuthenticationFilter#6708ba7c, org.springframework.security.web.session.SessionManagementFilter#53fa3c7e, org.springframework.security.web.access.ExceptionTranslationFilter#e50c54, org.springframework.security.web.access.intercept.FilterSecurityInterceptor#50b9a845]
2020-07-02 17:22:29.827 INFO 17952 --- [ task-1] o.h.e.t.j.p.i.JtaPlatformInitiator : HHH000490: Using JtaPlatform implementation: [org.hibernate.engine.transaction.jta.platform.internal.NoJtaPlatform]
2020-07-02 17:22:29.865 INFO 17952 --- [ task-1] j.LocalContainerEntityManagerFactoryBean : Initialized JPA EntityManagerFactory for persistence unit 'default'
2020-07-02 17:22:29.994 INFO 17952 --- [ost-startStop-1] o.s.b.a.e.web.EndpointLinksResolver : Exposing 2 endpoint(s) beneath base path '/actuator'
2020-07-02 17:22:30.060 INFO 17952 --- [ost-startStop-1] DeferredRepositoryInitializationListener : Triggering deferred initialization of Spring Data repositoriesà
2020-07-02 17:22:31.170 INFO 17952 --- [ost-startStop-1] DeferredRepositoryInitializationListener : Spring Data repositories initialized!
2020-07-02 17:22:31.187 INFO 17952 --- [ost-startStop-1] c.s.narayaneeyam.ServletInitializer : Started ServletInitializer in 14.858 seconds (JVM running for 42.474)
02-Jul-2020 17:22:31.264 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployWAR Deployment of web application archive [D:\Tomcat\apache-tomcat-8.5.56-windows-x64\apache-tomcat-8.5.56\webapps\narayaneeyam-0.0.1-SNAPSHOT.war] has finished in [41,103] ms
02-Jul-2020 17:22:31.283 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory [D:\Tomcat\apache-tomcat-8.5.56-windows-x64\apache-tomcat-8.5.56\webapps\docs]
02-Jul-2020 17:22:31.316 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory [D:\Tomcat\apache-tomcat-8.5.56-windows-x64\apache-tomcat-8.5.56\webapps\docs] has finished in [33] ms
02-Jul-2020 17:22:31.316 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory [D:\Tomcat\apache-tomcat-8.5.56-windows-x64\apache-tomcat-8.5.56\webapps\examples]
02-Jul-2020 17:22:32.114 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory [D:\Tomcat\apache-tomcat-8.5.56-windows-x64\apache-tomcat-8.5.56\webapps\examples] has finished in [798] ms
02-Jul-2020 17:22:32.115 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory [D:\Tomcat\apache-tomcat-8.5.56-windows-x64\apache-tomcat-8.5.56\webapps\host-manager]
02-Jul-2020 17:22:32.155 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory [D:\Tomcat\apache-tomcat-8.5.56-windows-x64\apache-tomcat-8.5.56\webapps\host-manager] has finished in [40] ms
02-Jul-2020 17:22:32.156 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory [D:\Tomcat\apache-tomcat-8.5.56-windows-x64\apache-tomcat-8.5.56\webapps\manager]
02-Jul-2020 17:22:32.201 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory [D:\Tomcat\apache-tomcat-8.5.56-windows-x64\apache-tomcat-8.5.56\webapps\manager] has finished in [45] ms
02-Jul-2020 17:22:32.201 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory [D:\Tomcat\apache-tomcat-8.5.56-windows-x64\apache-tomcat-8.5.56\webapps\ROOT]
02-Jul-2020 17:22:32.236 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory [D:\Tomcat\apache-tomcat-8.5.56-windows-x64\apache-tomcat-8.5.56\webapps\ROOT] has finished in [35] ms
02-Jul-2020 17:22:32.242 INFO [main] org.apache.coyote.AbstractProtocol.start Starting ProtocolHandler ["http-nio-8080"]
02-Jul-2020 17:22:32.257 INFO [main] org.apache.catalina.startup.Catalina.start Server startup in 42167 ms
These are are all spring's logs:
2020-07-02 17:22:20.982 INFO 17952 --- [ost-startStop-1] .s.d.r.c.RepositoryConfigurationDelegate : Bootstrapping Spring Data JPA repositories in DEFERRED mode.
2020-07-02 17:22:21.248 INFO 17952 --- [ost-startStop-1] .s.d.r.c.RepositoryConfigurationDelegate : Finished Spring Data repository scanning in 227ms. Found 4 JPA repository interfaces.
2020-07-02 17:22:26.621 INFO 17952 --- [ost-startStop-1] o.s.s.web.DefaultSecurityFilterChain : Creating filter chain: any request, [org.springframework.security.web.context.request.async.WebAsyncManagerIntegrationFilter#2e78fc6, org.springframework.security.web.context.SecurityContextPersistenceFilter#5adbbfc, org.springframework.security.web.header.HeaderWriterFilter#5e4ef05f, org.springframework.security.web.csrf.CsrfFilter#6f946b3c, org.springframework.security.web.authentication.logout.LogoutFilter#61bb46d, org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter#5dcf9e1a, org.springframework.security.web.authentication.ui.DefaultLoginPageGeneratingFilter#5a5ac80e, org.springframework.security.web.authentication.ui.DefaultLogoutPageGeneratingFilter#4fb155f8, org.springframework.security.web.savedrequest.RequestCacheAwareFilter#54779eb2, org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter#39715673, org.springframework.security.web.authentication.AnonymousAuthenticationFilter#6708ba7c, org.springframework.security.web.session.SessionManagementFilter#53fa3c7e, org.springframework.security.web.access.ExceptionTranslationFilter#e50c54, org.springframework.security.web.access.intercept.FilterSecurityInterceptor#50b9a845]
2020-07-02 17:22:29.994 INFO 17952 --- [ost-startStop-1] o.s.b.a.e.web.EndpointLinksResolver : Exposing 2 endpoint(s) beneath base path '/actuator'
o.s.d.r.c means org.springframework.data.repository.config
o.s.s.web means org.springframework.security.web
So these are all logs from Spring's classes.
If you want to see more spring logs, just set the log level to debug in application.yaml:
logging:
level:
org.springframework.boot: debug
My springboot application is not starting. The eclipse console is not giving any hint. Earlier it used to start, but now its screwed up. Also, my colleague have almost identical workspace. And it app starts on his machine. Is anyone able to spot anything in this eclipse log:
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/C:/Users/593932/.m2/repository/ch/qos/logback/logback-classic/1.1.11/logback-classic-1.1.11.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/C:/Users/593932/.m2/repository/org/slf4j/slf4j-log4j12/1.7.25/slf4j-log4j12-1.7.25.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
SLF4J: Actual binding is of type [ch.qos.logback.classic.util.ContextSelectorStaticBinder]
2017-07-21 17:22:26.612 DEBUG 7316 --- [ main] o.s.boot.SpringApplication : Loading source class org.springframework.cloud.netflix.eureka.config.EurekaDiscoveryClientConfigServiceBootstrapConfiguration,class org.springframework.cloud.config.client.ConfigServiceBootstrapConfiguration,class org.springframework.cloud.config.client.DiscoveryClientConfigServiceBootstrapConfiguration,class org.springframework.cloud.bootstrap.config.PropertySourceBootstrapConfiguration,class org.springframework.cloud.bootstrap.encrypt.EncryptionBootstrapConfiguration,class org.springframework.cloud.autoconfigure.ConfigurationPropertiesRebinderAutoConfiguration,class org.springframework.boot.autoconfigure.PropertyPlaceholderAutoConfiguration
2017-07-21 17:22:26.734 DEBUG 7316 --- [ main] o.s.b.c.c.ConfigFileApplicationListener : Activated profiles dev3
2017-07-21 17:22:26.735 DEBUG 7316 --- [ main] o.s.b.c.c.ConfigFileApplicationListener : Loaded config file 'file:/C:/Mahesh/workspaces/xyzws8/blueprint-graph/target/classes/bootstrap.properties' (classpath:/bootstrap.properties)
2017-07-21 17:22:26.735 DEBUG 7316 --- [ main] o.s.b.c.c.ConfigFileApplicationListener : Skipped (empty) config file 'file:/C:/Mahesh/workspaces/xyzws8/blueprint-graph/target/classes/bootstrap.properties' (classpath:/bootstrap.properties) for profile dev3
2017-07-21 17:22:26.741 INFO 7316 --- [ main] s.c.a.AnnotationConfigApplicationContext : Refreshing org.springframework.context.annotation.AnnotationConfigApplicationContext#2118cddf: startup date [Fri Jul 21 17:22:26 IST 2017]; root of context hierarchy
2017-07-21 17:22:27.501 INFO 7316 --- [ main] f.a.AutowiredAnnotationBeanPostProcessor : JSR-330 'javax.inject.Inject' annotation found and supported for autowiring
2017-07-21 17:22:27.633 INFO 7316 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'configurationPropertiesRebinderAutoConfiguration' of type [org.springframework.cloud.autoconfigure.ConfigurationPropertiesRebinderAutoConfiguration$$EnhancerBySpringCGLIB$$7474b600] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2017-07-21 17:22:28.183 DEBUG 7316 --- [ main] utoConfigurationReportLoggingInitializer :
=========================
AUTO-CONFIGURATION REPORT
=========================
Positive matches:
-----------------
ConfigServiceBootstrapConfiguration#configServicePropertySource matched:
- #ConditionalOnProperty (spring.cloud.config.enabled) matched (OnPropertyCondition)
ConfigurationPropertiesRebinderAutoConfiguration matched:
- #ConditionalOnBean (types: org.springframework.boot.context.properties.ConfigurationPropertiesBindingPostProcessor; SearchStrategy: all) found bean 'org.springframework.boot.context.properties.ConfigurationPropertiesBindingPostProcessor' (OnBeanCondition)
ConfigurationPropertiesRebinderAutoConfiguration#configurationPropertiesBeans matched:
- #ConditionalOnMissingBean (types: org.springframework.cloud.context.properties.ConfigurationPropertiesBeans; SearchStrategy: current) did not find any beans (OnBeanCondition)
ConfigurationPropertiesRebinderAutoConfiguration#configurationPropertiesRebinder matched:
- #ConditionalOnMissingBean (types: org.springframework.cloud.context.properties.ConfigurationPropertiesRebinder; SearchStrategy: current) did not find any beans (OnBeanCondition)
EncryptionBootstrapConfiguration matched:
- #ConditionalOnClass found required class 'org.springframework.security.crypto.encrypt.TextEncryptor'; #ConditionalOnMissingClass did not find unwanted class (OnClassCondition)
PropertyPlaceholderAutoConfiguration#propertySourcesPlaceholderConfigurer matched:
- #ConditionalOnMissingBean (types: org.springframework.context.support.PropertySourcesPlaceholderConfigurer; SearchStrategy: current) did not find any beans (OnBeanCondition)
Negative matches:
-----------------
ConfigServiceBootstrapConfiguration.RetryConfiguration:
Did not match:
- #ConditionalOnClass did not find required class 'org.springframework.retry.annotation.Retryable' (OnClassCondition)
DiscoveryClientConfigServiceBootstrapConfiguration:
Did not match:
- #ConditionalOnProperty (spring.cloud.config.discovery.enabled) did not find property 'spring.cloud.config.discovery.enabled' (OnPropertyCondition)
EncryptionBootstrapConfiguration.RsaEncryptionConfiguration:
Did not match:
- Keystore nor key found in Environment (EncryptionBootstrapConfiguration.KeyCondition)
Matched:
- #ConditionalOnClass found required class 'org.springframework.security.rsa.crypto.RsaSecretEncryptor'; #ConditionalOnMissingClass did not find unwanted class (OnClassCondition)
EncryptionBootstrapConfiguration.VanillaEncryptionConfiguration:
Did not match:
- #ConditionalOnMissingClass found unwanted class 'org.springframework.security.rsa.crypto.RsaSecretEncryptor' (OnClassCondition)
EurekaDiscoveryClientConfigServiceBootstrapConfiguration:
Did not match:
- #ConditionalOnProperty (spring.cloud.config.discovery.enabled) did not find property 'spring.cloud.config.discovery.enabled' (OnPropertyCondition)
Matched:
- #ConditionalOnClass found required class 'org.springframework.cloud.config.client.ConfigServicePropertySourceLocator'; #ConditionalOnMissingClass did not find unwanted class (OnClassCondition)
Exclusions:
-----------
None
Unconditional classes:
----------------------
None
. ____ _ __ _ _
/\\ / ___'_ __ _ _(_)_ __ __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
\\/ ___)| |_)| | | | | || (_| | ) ) ) )
' |____| .__|_| |_|_| |_\__, | / / / /
=========|_|==============|___/=/_/_/_/
:: Spring Boot :: (v1.5.3.RELEASE)
2017-07-21 17:22:28.874 INFO 7316 --- [ main] c.c.c.ConfigServicePropertySourceLocator : Fetching config from server at: http://localhost:8888
2017-07-21 17:22:30.026 WARN 7316 --- [ main] c.c.c.ConfigServicePropertySourceLocator : Could not locate PropertySource: I/O error on GET request for "http://localhost:8888/pqr/dev3": Connection refused: connect; nested exception is java.net.ConnectException: Connection refused: connect
2017-07-21 17:22:30.029 INFO 7316 --- [ main] com.abc.xyz.pqr.pqrApplication : The following profiles are active: dev3
2017-07-21 17:22:30.033 DEBUG 7316 --- [ main] o.s.boot.SpringApplication : Loading source class com.abc.xyz.pqr.pqrApplication
2017-07-21 17:22:30.056 DEBUG 7316 --- [ main] o.s.b.c.c.ConfigFileApplicationListener : Activated profiles dev3
2017-07-21 17:22:30.057 DEBUG 7316 --- [ main] o.s.b.c.c.ConfigFileApplicationListener : Loaded config file 'jar:file:/C:/Users/593932/.m2/repository/com/abc/xyz/utils/logger/2.0.0.1-SNAPSHOT/logger-2.0.0.1-SNAPSHOT.jar!/application.properties' (classpath:/application.properties)
2017-07-21 17:22:30.057 DEBUG 7316 --- [ main] o.s.b.c.c.ConfigFileApplicationListener : Loaded config file 'file:/C:/Mahesh/workspaces/xyzws8/pqr-rest/target/classes/application-dev3.properties' (classpath:/application-dev3.properties)
2017-07-21 17:22:30.057 DEBUG 7316 --- [ main] o.s.b.c.c.ConfigFileApplicationListener : Skipped (empty) config file 'file:/C:/Mahesh/workspaces/xyzws8/pqr-rest/target/classes/application-dev3.properties' (classpath:/application-dev3.properties) for profile dev3
2017-07-21 17:22:30.057 DEBUG 7316 --- [ main] o.s.b.c.c.ConfigFileApplicationListener : Skipped (empty) config file 'jar:file:/C:/Users/593932/.m2/repository/com/abc/xyz/utils/logger/2.0.0.1-SNAPSHOT/logger-2.0.0.1-SNAPSHOT.jar!/application.properties' (classpath:/application.properties) for profile dev3
2017-07-21 17:22:30.057 INFO 7316 --- [ main] ationConfigEmbeddedWebApplicationContext : Refreshing org.springframework.boot.context.embedded.AnnotationConfigEmbeddedWebApplicationContext#590c73d3: startup date [Fri Jul 21 17:22:30 IST 2017]; parent: org.springframework.context.annotation.AnnotationConfigApplicationContext#2118cddf
2017-07-21 17:22:30.061 DEBUG 7316 --- [ main] ationConfigEmbeddedWebApplicationContext : Bean factory for org.springframework.boot.context.embedded.AnnotationConfigEmbeddedWebApplicationContext#590c73d3: org.springframework.beans.factory.support.DefaultListableBeanFactory#6c67e137: defining beans [org.springframework.context.annotation.internalConfigurationAnnotationProcessor,org.springframework.context.annotation.internalAutowiredAnnotationProcessor,org.springframework.context.annotation.internalRequiredAnnotationProcessor,org.springframework.context.annotation.internalCommonAnnotationProcessor,org.springframework.context.annotation.internalPersistenceAnnotationProcessor,org.springframework.context.event.internalEventListenerProcessor,org.springframework.context.event.internalEventListenerFactory,pqrApplication]; parent: org.springframework.beans.factory.support.DefaultListableBeanFactory#5afa3c9
2017-07-21 17:22:54.813 INFO 7316 --- [ main] o.s.b.f.s.DefaultListableBeanFactory : Overriding bean definition for bean 'dataSource' with a different definition: replacing [Root bean: class [null]; scope=; abstract=false; lazyInit=false; autowireMode=3; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=org.springframework.boot.autoconfigure.jdbc.DataSourceConfiguration$Hikari; factoryMethodName=dataSource; initMethodName=null; destroyMethodName=(inferred); defined in class path resource [org/springframework/boot/autoconfigure/jdbc/DataSourceConfiguration$Hikari.class]] with [Root bean: class [null]; scope=; abstract=false; lazyInit=false; autowireMode=3; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=org.springframework.boot.autoconfigure.jdbc.DataSourceConfiguration$Tomcat; factoryMethodName=dataSource; initMethodName=null; destroyMethodName=(inferred); defined in class path resource [org/springframework/boot/autoconfigure/jdbc/DataSourceConfiguration$Tomcat.class]]
2017-07-21 17:22:56.472 INFO 7316 --- [ main] o.s.cloud.context.scope.GenericScope : BeanFactory id=913a3bd9-b3c0-3356-9fa2-16200e317e2e
2017-07-21 17:22:56.572 INFO 7316 --- [ main] f.a.AutowiredAnnotationBeanPostProcessor : JSR-330 'javax.inject.Inject' annotation found and supported for autowiring
2017-07-21 17:22:56.727 INFO 7316 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'com.abc.xyz.workitem.client.WorkItemClient' of type [org.springframework.cloud.netflix.feign.FeignClientFactoryBean] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2017-07-21 17:22:57.254 INFO 7316 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'org.springframework.transaction.annotation.ProxyTransactionManagementConfiguration' of type [org.springframework.transaction.annotation.ProxyTransactionManagementConfiguration$$EnhancerBySpringCGLIB$$585ab303] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2017-07-21 17:22:57.706 INFO 7316 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'org.apache.camel.spring.boot.CamelAutoConfiguration' of type [org.apache.camel.spring.boot.CamelAutoConfiguration$$EnhancerBySpringCGLIB$$7a847922] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2017-07-21 17:22:57.946 INFO 7316 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'org.springframework.cloud.netflix.metrics.MetricsInterceptorConfiguration$MetricsRestTemplateConfiguration' of type [org.springframework.cloud.netflix.metrics.MetricsInterceptorConfiguration$MetricsRestTemplateConfiguration$$EnhancerBySpringCGLIB$$8a875944] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2017-07-21 17:22:57.998 INFO 7316 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'org.springframework.cloud.autoconfigure.ConfigurationPropertiesRebinderAutoConfiguration' of type [org.springframework.cloud.autoconfigure.ConfigurationPropertiesRebinderAutoConfiguration$$EnhancerBySpringCGLIB$$7474b600] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2017-07-21 17:22:58.013 DEBUG 7316 --- [ main] ationConfigEmbeddedWebApplicationContext : Unable to locate MessageSource with name 'messageSource': using default [org.springframework.context.support.DelegatingMessageSource#2589d787]
2017-07-21 17:22:58.013 DEBUG 7316 --- [ main] ationConfigEmbeddedWebApplicationContext : Unable to locate ApplicationEventMulticaster with name 'applicationEventMulticaster': using default [org.springframework.context.event.SimpleApplicationEventMulticaster#1788cb61]
2017-07-21 17:22:59.563 DEBUG 7316 --- [ main] .t.TomcatEmbeddedServletContainerFactory : Code archive: C:\Users\593932\.m2\repository\org\springframework\boot\spring-boot\1.5.3.RELEASE\spring-boot-1.5.3.RELEASE.jar
2017-07-21 17:22:59.564 DEBUG 7316 --- [ main] .t.TomcatEmbeddedServletContainerFactory : Code archive: C:\Users\593932\.m2\repository\org\springframework\boot\spring-boot\1.5.3.RELEASE\spring-boot-1.5.3.RELEASE.jar
2017-07-21 17:22:59.564 DEBUG 7316 --- [ main] .t.TomcatEmbeddedServletContainerFactory : Document root: C:\Mahesh\workspaces\xyzws8\pqr-rest\src\main\webapp
2017-07-21 17:22:59.685 INFO 7316 --- [ main] s.b.c.e.t.TomcatEmbeddedServletContainer : Tomcat initialized with port(s): 0 (http)
Jul 21, 2017 5:22:59 PM org.apache.catalina.core.StandardService startInternal
INFO: Starting service Tomcat
Jul 21, 2017 5:22:59 PM org.apache.catalina.core.StandardEngine startInternal
INFO: Starting Servlet Engine: Apache Tomcat/8.5.14
Jul 21, 2017 5:23:02 PM org.apache.catalina.core.ApplicationContext log
INFO: Initializing Spring embedded WebApplicationContext
2017-07-21 17:23:02.138 INFO 7316 --- [ost-startStop-1] o.s.web.context.ContextLoader : Root WebApplicationContext: initialization completed in 32081 ms
2017-07-21 17:23:02.513 DEBUG 7316 --- [ost-startStop-1] o.s.b.w.s.ServletContextInitializerBeans : Added existing Servlet initializer bean 'dispatcherServletRegistration'; order=2147483647, resource=class path resource [org/springframework/boot/autoconfigure/web/DispatcherServletAutoConfiguration$DispatcherServletRegistrationConfiguration.class]
2017-07-21 17:23:03.639 DEBUG 7316 --- [ost-startStop-1] o.s.b.w.s.ServletContextInitializerBeans : Created Filter initializer for bean 'metricsFilter'; order=-2147483648, resource=class path resource [org/springframework/boot/actuate/autoconfigure/MetricFilterAutoConfiguration.class]
2017-07-21 17:23:03.639 DEBUG 7316 --- [ost-startStop-1] o.s.b.w.s.ServletContextInitializerBeans : Created Filter initializer for bean 'characterEncodingFilter'; order=-2147483648, resource=class path resource [org/springframework/boot/autoconfigure/web/HttpEncodingAutoConfiguration.class]
2017-07-21 17:23:03.639 DEBUG 7316 --- [ost-startStop-1] o.s.b.w.s.ServletContextInitializerBeans : Created Filter initializer for bean 'hiddenHttpMethodFilter'; order=-10000, resource=class path resource [org/springframework/boot/autoconfigure/web/WebMvcAutoConfiguration.class]
2017-07-21 17:23:03.639 DEBUG 7316 --- [ost-startStop-1] o.s.b.w.s.ServletContextInitializerBeans : Created Filter initializer for bean 'httpPutFormContentFilter'; order=-9900, resource=class path resource [org/springframework/boot/autoconfigure/web/WebMvcAutoConfiguration.class]
2017-07-21 17:23:03.639 DEBUG 7316 --- [ost-startStop-1] o.s.b.w.s.ServletContextInitializerBeans : Created Filter initializer for bean 'requestContextFilter'; order=-105, resource=class path resource [org/springframework/boot/autoconfigure/web/WebMvcAutoConfiguration$WebMvcAutoConfigurationAdapter.class]
2017-07-21 17:23:03.639 DEBUG 7316 --- [ost-startStop-1] o.s.b.w.s.ServletContextInitializerBeans : Created Filter initializer for bean 'webRequestLoggingFilter'; order=2147483637, resource=class path resource [org/springframework/boot/actuate/autoconfigure/TraceWebFilterAutoConfiguration.class]
2017-07-21 17:23:03.640 DEBUG 7316 --- [ost-startStop-1] o.s.b.w.s.ServletContextInitializerBeans : Created Filter initializer for bean 'applicationContextIdFilter'; order=2147483647, resource=class path resource [org/springframework/boot/actuate/autoconfigure/EndpointWebMvcAutoConfiguration$ApplicationContextFilterConfiguration.class]
2017-07-21 17:23:03.674 INFO 7316 --- [ost-startStop-1] o.s.b.w.servlet.ServletRegistrationBean : Mapping servlet: 'dispatcherServlet' to [/]
2017-07-21 17:23:03.700 INFO 7316 --- [ost-startStop-1] o.s.b.w.servlet.FilterRegistrationBean : Mapping filter: 'metricsFilter' to: [/*]
2017-07-21 17:23:03.701 INFO 7316 --- [ost-startStop-1] o.s.b.w.servlet.FilterRegistrationBean : Mapping filter: 'characterEncodingFilter' to: [/*]
2017-07-21 17:23:03.720 INFO 7316 --- [ost-startStop-1] o.s.b.w.servlet.FilterRegistrationBean : Mapping filter: 'hiddenHttpMethodFilter' to: [/*]
2017-07-21 17:23:03.721 INFO 7316 --- [ost-startStop-1] o.s.b.w.servlet.FilterRegistrationBean : Mapping filter: 'httpPutFormContentFilter' to: [/*]
2017-07-21 17:23:03.721 INFO 7316 --- [ost-startStop-1] o.s.b.w.servlet.FilterRegistrationBean : Mapping filter: 'requestContextFilter' to: [/*]
2017-07-21 17:23:03.721 INFO 7316 --- [ost-startStop-1] o.s.b.w.servlet.FilterRegistrationBean : Mapping filter: 'webRequestLoggingFilter' to: [/*]
2017-07-21 17:23:03.721 INFO 7316 --- [ost-startStop-1] o.s.b.w.servlet.FilterRegistrationBean : Mapping filter: 'applicationContextIdFilter' to: [/*]
2017-07-21 17:23:03.913 DEBUG 7316 --- [ost-startStop-1] o.s.b.w.f.OrderedRequestContextFilter : Initializing filter 'requestContextFilter'
2017-07-21 17:23:03.916 DEBUG 7316 --- [ost-startStop-1] o.s.b.w.f.OrderedRequestContextFilter : Filter 'requestContextFilter' configured successfully
2017-07-21 17:23:03.917 DEBUG 7316 --- [ost-startStop-1] o.s.b.w.f.ApplicationContextHeaderFilter : Initializing filter 'applicationContextIdFilter'
2017-07-21 17:23:03.917 DEBUG 7316 --- [ost-startStop-1] o.s.b.w.f.ApplicationContextHeaderFilter : Filter 'applicationContextIdFilter' configured successfully
2017-07-21 17:23:03.917 DEBUG 7316 --- [ost-startStop-1] .s.b.w.f.OrderedHttpPutFormContentFilter : Initializing filter 'httpPutFormContentFilter'
2017-07-21 17:23:03.917 DEBUG 7316 --- [ost-startStop-1] .s.b.w.f.OrderedHttpPutFormContentFilter : Filter 'httpPutFormContentFilter' configured successfully
2017-07-21 17:23:03.918 DEBUG 7316 --- [ost-startStop-1] o.s.b.w.f.OrderedHiddenHttpMethodFilter : Initializing filter 'hiddenHttpMethodFilter'
2017-07-21 17:23:03.918 DEBUG 7316 --- [ost-startStop-1] o.s.b.w.f.OrderedHiddenHttpMethodFilter : Filter 'hiddenHttpMethodFilter' configured successfully
2017-07-21 17:23:03.918 DEBUG 7316 --- [ost-startStop-1] o.s.b.w.f.OrderedCharacterEncodingFilter : Initializing filter 'characterEncodingFilter'
2017-07-21 17:23:03.918 DEBUG 7316 --- [ost-startStop-1] o.s.b.w.f.OrderedCharacterEncodingFilter : Filter 'characterEncodingFilter' configured successfully
2017-07-21 17:23:03.918 DEBUG 7316 --- [ost-startStop-1] o.s.b.a.trace.WebRequestTraceFilter : Initializing filter 'webRequestLoggingFilter'
2017-07-21 17:23:03.918 DEBUG 7316 --- [ost-startStop-1] o.s.b.a.trace.WebRequestTraceFilter : Filter 'webRequestLoggingFilter' configured successfully
2017-07-21 17:23:03.918 DEBUG 7316 --- [ost-startStop-1] o.s.b.a.autoconfigure.MetricsFilter : Initializing filter 'metricsFilter'
2017-07-21 17:23:03.919 DEBUG 7316 --- [ost-startStop-1] o.s.b.a.autoconfigure.MetricsFilter : Filter 'metricsFilter' configured successfully
2017-07-21 17:23:06.527 DEBUG 7316 --- [ main] o.s.b.a.AutoConfigurationPackages : #EnableAutoConfiguration was declared on a class in the package 'com.abc.xyz,com.abc.xyz.pqr'. Automatic #Repository and #Entity scanning is enabled.
2017-07-21 17:23:08.193 INFO 7316 --- [ main] j.LocalContainerEntityManagerFactoryBean : Building JPA container EntityManagerFactory for persistence unit 'default'
2017-07-21 17:23:08.608 INFO 7316 --- [ main] o.hibernate.jpa.internal.util.LogHelper : HHH000204: Processing PersistenceUnitInfo [
name: default
...]
2017-07-21 17:23:10.167 INFO 7316 --- [ main] org.hibernate.Version : HHH000412: Hibernate Core {5.0.12.Final}
2017-07-21 17:23:10.180 INFO 7316 --- [ main] org.hibernate.cfg.Environment : HHH000205: Loaded properties from resource hibernate.properties: {hibernate.temp.use_jdbc_metadata_defaults=false, hibernate.bytecode.use_reflection_optimizer=false}
2017-07-21 17:23:10.181 INFO 7316 --- [ main] org.hibernate.cfg.Environment : HHH000021: Bytecode provider name : javassist
2017-07-21 17:23:10.602 INFO 7316 --- [ main] o.hibernate.annotations.common.Version : HCANN000001: Hibernate Commons Annotations {5.0.1.Final}
2017-07-21 17:23:11.278 INFO 7316 --- [ main] org.hibernate.dialect.Dialect : HHH000400: Using dialect: com.abc.xyz.hibernate.dialect.JSONBPostgreSQLDialect
2017-07-21 17:23:11.355 INFO 7316 --- [ main] o.h.e.j.e.i.LobCreatorBuilderImpl : HHH000422: Disabling contextual LOB creation as connection was null
2017-07-21 17:23:11.361 INFO 7316 --- [ main] org.hibernate.type.BasicTypeRegistry : HHH000270: Type registration [java.util.UUID] overrides previous : org.hibernate.type.UUIDBinaryType#18811c42
2017-07-21 17:23:12.153 WARN 7316 --- [ main] org.hibernate.id.UUIDHexGenerator : HHH000409: Using org.hibernate.id.UUIDHexGenerator which does not generate IETF RFC 4122 compliant UUID values; consider using org.hibernate.id.UUIDGenerator instead
2017-07-21 17:23:13.606 INFO 7316 --- [ main] org.hibernate.tool.hbm2ddl.SchemaUpdate : HHH000228: Running hbm2ddl schema update
2017-07-21 17:23:15.246 INFO 7316 --- [ main] j.LocalContainerEntityManagerFactoryBean : Initialized JPA EntityManagerFactory for persistence unit 'default'
2017-07-21 17:23:15.326 INFO 7316 --- [ main] o.s.aop.framework.CglibAopProxy : Final method [protected final void org.springframework.boot.web.support.SpringBootServletInitializer.setRegisterErrorPageFilter(boolean)] cannot get proxied via CGLIB: Calls to this method will NOT be routed to the target instance and might lead to NPEs against uninitialized fields in the proxy instance.
2017-07-21 17:23:15.908 INFO 7316 --- [ main] s.c.a.AnnotationConfigApplicationContext : Refreshing org.springframework.context.annotation.AnnotationConfigApplicationContext#691eb389: startup date [Fri Jul 21 17:23:15 IST 2017]; parent: org.springframework.boot.context.embedded.AnnotationConfigEmbeddedWebApplicationContext#590c73d3
2017-07-21 17:23:16.015 INFO 7316 --- [ main] f.a.AutowiredAnnotationBeanPostProcessor : JSR-330 'javax.inject.Inject' annotation found and supported for autowiring
Jul 21, 2017 5:23:18 PM org.apache.catalina.core.StandardService stopInternal
INFO: Stopping service Tomcat
Is this line an issue?:
2017-07-21 17:23:11.355 INFO 7316 --- [ main] o.h.e.j.e.i.LobCreatorBuilderImpl : HHH000422: Disabling contextual LOB creation as connection was null
Earlier I used to get following:
2017-07-21 16:43:44.438 INFO 7008 --- [ main] o.h.e.j.e.i.LobCreatorBuilderImpl : HHH000424: Disabling contextual LOB creation as createClob() method threw error : java.lang.reflect.InvocationTargetException
So I added
hibernate.temp.use_jdbc_metadata_defaults=false
to properties file.
Notice that the tomcat stops abruptly (last two lines):
Jul 21, 2017 5:23:18 PM org.apache.catalina.core.StandardService stopInternal
INFO: Stopping service Tomcat
Sorry for putting so much log. I put --debug in programs arguments. Is there anything else I can do to get some more information?
Here are some files as requested in comments:
pom file
main class file
Note that I have other applications as dependencies. So they will also be adding many other dependencies which are not getting captured in above pom. How can I share them here?
The main class is really a placeholder which triggers SpringBoot which in turn runs various stuff say load beans, run apache camel routes etc.
I want to deploy jhipster registry war on tomcat, deployment is successful but I am unable to access the url. I tried http://localhost:8080/jhipster-registry-2.5.8/ and http://localhost:8761/#/ neither worked. I know that default port for registry is 8761, Does Tomcat overwrites it?
2017-02-23 10:19:05.782 INFO 89248 --- [ost-startStop-1] i.g.jhipster.registry.ApplicationWebXml : The following profiles are active: prod
2017-02-23 10:19:08.230 WARN 89248 --- [ost-startStop-1] o.s.c.a.ConfigurationClassPostProcessor : Cannot enhance #Configuration bean definition 'refreshScope' since its singleton instance has been created too early. The typical cause is a non-static #Bean method with a BeanDefinitionRegistryPostProcessor return type: Consider decl
2017-02-23 10:19:09.221 DEBUG 89248 --- [ost-startStop-1] i.g.j.r.config.MetricsConfiguration : Registering JVM gauges
2017-02-23 10:19:09.258 DEBUG 89248 --- [ost-startStop-1] i.g.j.r.config.MetricsConfiguration : Initializing Metrics JMX reporting
2017-02-23 10:19:12.162 INFO 89248 --- [ost-startStop-1] i.g.j.registry.config.WebConfigurer : Web application configuration, using profiles: [prod]
2017-02-23 10:19:12.176 DEBUG 89248 --- [ost-startStop-1] i.g.j.registry.config.WebConfigurer : Initializing Metrics registries
2017-02-23 10:19:12.188 DEBUG 89248 --- [ost-startStop-1] i.g.j.registry.config.WebConfigurer : Registering Metrics Filter
2017-02-23 10:19:12.190 DEBUG 89248 --- [ost-startStop-1] i.g.j.registry.config.WebConfigurer : Registering Metrics Servlet
2017-02-23 10:19:12.198 DEBUG 89248 --- [ost-startStop-1] i.g.j.registry.config.WebConfigurer : Registering Caching HTTP Headers Filter
2017-02-23 10:19:12.200 INFO 89248 --- [ost-startStop-1] i.g.j.registry.config.WebConfigurer : Web application fully configured
2017-02-23 10:19:12.227 INFO 89248 --- [ost-startStop-1] i.g.jhipster.registry.JHipsterRegistry : Running with Spring profile(s) : [prod]
2017-02-23 10:19:15.853 INFO 89248 --- [ost-startStop-1] com.netflix.discovery.DiscoveryClient : Client configured to neither register nor query for data.
2017-02-23 10:19:15.883 INFO 89248 --- [ost-startStop-1] com.netflix.discovery.DiscoveryClient : Discovery Client initialized at timestamp 1487863155883 with initial instances count: 0
2017-02-23 10:19:16.072 INFO 89248 --- [ost-startStop-1] c.n.eureka.DefaultEurekaServerContext : Initializing ...
2017-02-23 10:19:16.075 INFO 89248 --- [ost-startStop-1] c.n.eureka.cluster.PeerEurekaNodes : Adding new peer nodes [http://localhost:8761/eureka/]
2017-02-23 10:19:16.313 INFO 89248 --- [ost-startStop-1] c.n.d.provider.DiscoveryJerseyProvider : Using JSON encoding codec LegacyJacksonJson
2017-02-23 10:19:16.321 INFO 89248 --- [ost-startStop-1] c.n.d.provider.DiscoveryJerseyProvider : Using JSON decoding codec LegacyJacksonJson
2017-02-23 10:19:16.321 INFO 89248 --- [ost-startStop-1] c.n.d.provider.DiscoveryJerseyProvider : Using XML encoding codec XStreamXml
2017-02-23 10:19:16.322 INFO 89248 --- [ost-startStop-1] c.n.d.provider.DiscoveryJerseyProvider : Using XML decoding codec XStreamXml
2017-02-23 10:19:16.802 INFO 89248 --- [ost-startStop-1] c.n.eureka.cluster.PeerEurekaNodes : Replica node URL: http://localhost:8761/eureka/
2017-02-23 10:19:16.836 INFO 89248 --- [ost-startStop-1] c.n.e.registry.AbstractInstanceRegistry : Finished initializing remote region registries. All known remote regions: []
2017-02-23 10:19:16.838 INFO 89248 --- [ost-startStop-1] c.n.eureka.DefaultEurekaServerContext : Initialized
2017-02-23 10:19:21.092 WARN 89248 --- [ost-startStop-1] c.n.c.sources.URLConfigurationSource : No URLs will be polled as dynamic configuration sources.
2017-02-23 10:19:21.097 INFO 89248 --- [ost-startStop-1] c.n.c.sources.URLConfigurationSource : To enable URLs as dynamic configuration sources, define System property archaius.configurationSource.additionalUrls or make config.properties available on classpath.
2017-02-23 10:19:21.116 WARN 89248 --- [ost-startStop-1] c.n.c.sources.URLConfigurationSource : No URLs will be polled as dynamic configuration sources.
2017-02-23 10:19:21.117 INFO 89248 --- [ost-startStop-1] c.n.c.sources.URLConfigurationSource : To enable URLs as dynamic configuration sources, define System property archaius.configurationSource.additionalUrls or make config.properties available on classpath.
2017-02-23 10:19:23.779 INFO 89248 --- [ Thread-13] c.n.e.r.PeerAwareInstanceRegistryImpl : Got 1 instances from neighboring DS node
2017-02-23 10:19:23.794 INFO 89248 --- [ Thread-13] c.n.e.r.PeerAwareInstanceRegistryImpl : Renew threshold is: 1
2017-02-23 10:19:23.801 INFO 89248 --- [ Thread-13] c.n.e.r.PeerAwareInstanceRegistryImpl : Changing status to UP
2017-02-23 10:19:23.854 INFO 89248 --- [ost-startStop-1] i.g.jhipster.registry.ApplicationWebXml : Started ApplicationWebXml in 21.486 seconds (JVM running for 40.931)
2017-02-23 10:19:23.938 INFO 89248 --- [ost-startStop-1] c.s.j.s.i.a.WebApplicationImpl : Initiating Jersey application, version 'Jersey: 1.19.1 03/11/2016 02:08 PM'
2017-02-23 10:19:24.045 INFO 89248 --- [ost-startStop-1] c.n.d.provider.DiscoveryJerseyProvider : Using JSON encoding codec LegacyJacksonJson
2017-02-23 10:19:24.052 INFO 89248 --- [ost-startStop-1] c.n.d.provider.DiscoveryJerseyProvider : Using JSON decoding codec LegacyJacksonJson
2017-02-23 10:19:24.052 INFO 89248 --- [ost-startStop-1] c.n.d.provider.DiscoveryJerseyProvider : Using XML encoding codec XStreamXml
2017-02-23 10:19:24.053 INFO 89248 --- [ost-startStop-1] c.n.d.provider.DiscoveryJerseyProvider : Using XML decoding codec XStreamXml
23-Feb-2017 10:19:25.047 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployWAR Deployment of web application archive C:\apache-tomcat-8.0.39\webapps\jhipster-registry-2.5.war has finished in 36,797 ms
23-Feb-2017 10:19:25.060 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory C:\apache-tomcat-8.0.39\webapps\docs
23-Feb-2017 10:19:25.110 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory C:\apache-tomcat-8.0.39\webapps\docs has finished in 50 ms
23-Feb-2017 10:19:25.111 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory C:\apache-tomcat-8.0.39\webapps\examples
23-Feb-2017 10:19:25.530 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory C:\apache-tomcat-8.0.39\webapps\examples has finished in 419 ms
23-Feb-2017 10:19:25.530 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory C:\apache-tomcat-8.0.39\webapps\host-manager
23-Feb-2017 10:19:25.578 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory C:\apache-tomcat-8.0.39\webapps\host-manager has finished in 48 ms
23-Feb-2017 10:19:25.580 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory C:\apache-tomcat-8.0.39\webapps\manager
23-Feb-2017 10:19:25.606 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory C:\apache-tomcat-8.0.39\webapps\manager has finished in 27 ms
23-Feb-2017 10:19:25.607 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory C:\apache-tomcat-8.0.39\webapps\ROOT
23-Feb-2017 10:19:25.636 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory C:\apache-tomcat-8.0.39\webapps\ROOT has finished in 28 ms
23-Feb-2017 10:19:25.644 INFO [main] org.apache.coyote.AbstractProtocol.start Starting ProtocolHandler ["http-apr-8080"]
23-Feb-2017 10:19:25.663 INFO [main] org.apache.coyote.AbstractProtocol.start Starting ProtocolHandler ["ajp-apr-8009"]
23-Feb-2017 10:19:25.666 INFO [main] org.apache.catalina.startup.Catalina.start Server startup in 41071 ms
2017-02-23 10:20:22.433 DEBUG 89248 --- [apr-8080-exec-9] i.g.j.r.s.Http401UnauthorizedEntryPoint : Pre-authenticated entry point called. Rejecting access
2017-02-23 10:20:23.804 INFO 89248 --- [a-EvictionTimer] c.n.e.registry.AbstractInstanceRegistry : Running the evict task with compensationTime 0ms
2017-02-23 10:21:23.804 INFO 89248 --- [a-EvictionTimer] c.n.e.registry.AbstractInstanceRegistry : Running the evict task with compensationTime 1ms
I reproduced your setup and got same problems.
Weird thing is that running
curl http://admin:admin#localhost:8080/jhipster-registry-2.5.8/
works fine: I get the home page contents.
So something does not work in the browser.
Using another port than 8761 and a context path different than / (in your case /jhipster-registry-2.5.8/) means that you must modify several application properties in registry's application*.yml and also the bootstrap.yml files from all your services and gateways registering with this registry.
To avoid this, I changed tomcat's port to 8761 and renamed the registry war file to ROOT.war but it still does not work.
To make it work would require some significant effort in debugging. So, I highly recommend that you stick to the recommended usage: either using java -jar jhipster-registry.war or using docker.