Intellij idea - there are no line breaks in stack trace - java

When executing or debugging Intellij Idea on a mac, errors in stack trace are concatenated into one line. How do I fix the line delimiter settings?
example output:
Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
2021-09-09 06:17:55.961 ERROR 89612 ---[main] - [Trace-] o.s.boot.SpringApplication - Application run failed org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'costOrchestrationServiceComponent' defined in file [/Users/git/mydir/build/classes/java/main/adjustment/component/CostOrchestrationServiceComponent.class]: Unsatisfied dependency expressed through constructor parameter 2; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'appCredentialsFromVault' defined in class path resource [com.whatever.adjustment/config/PromotionAppSecretsConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [com.whatever.adjustment.domain.AppCredentialsFromVault]: Factory method 'appCredentialsFromVault' threw exception; nested exception is com.whatever.vault.exception.VaultAccessException: [VAULT EXCEPTION] Error connecting to Vault. Could not log into Vault and retrieve auth token.u2028 at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:769)u2028 at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:218)u2028 at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(Abstra

Related

APPLICATION FAILED TO START in Spring Boot

i have the default spring aplication and throws this warn and stopped working
don't have a controller and service it's just a demo app
WARN 9256 --- [ restartedMain] ConfigServletWebServerApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'dataSourceScriptDatabaseInitializer' defined in class path resource [org/springframework/boot/autoconfigure/sql/init/DataSourceInitializationConfiguration.class]: Unsatisfied dependency expressed through method 'dataSourceScriptDatabaseInitializer' parameter 0; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dataSource' defined in class path resource [org/springframework/boot/autoconfigure/jdbc/DataSourceConfiguration$Hikari.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [com.zaxxer.hikari.HikariDataSource]: Factory method 'dataSource' threw exception; nested exception is org.springframework.boot.autoconfigure.jdbc.DataSourceProperties$DataSourceBeanCreationException: Failed to determine a suitable driver class
Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
11:00 ERROR 9256 --- [ restartedMain] o.s.b.d.LoggingFailureAnalysisReporter :
Description:
Failed to configure a DataSource: 'url' attribute is not specified and no embedded datasource could be configured.
Reason: Failed to determine a suitable driver class
If you have spring data as a dependency, You need to specify a datasource url to connect to a database in your application.properties file.
Make sure that in your application.properties file data will be filled correctly or not.
spring.datasource.url=jdbc:postgresql://localhost:5432/your_database_name
spring.datasource.username=username
spring.datasource.password=password
spring.jpa.database=postgresql
spring.jpa.hibernate.ddl-auto=update

Unable to run war file on Amazon EC2 instance

I am working on a spring boot application with latest Angular 7. I have created a build and generated war file.
I have configured a folder in this the structure is :
project-tool.war
config/application-prod.yml
config/application-dev.yml
config/application.yml
run.sh
run.bat
In run.sh/run.bat, these command written -> java -jar project-tool.war --spring.profiles.active=prod --spring.config.location=config\application-prod.yml
I have created Oracle database instance on AWS and put the configuration in application-prod.yml.
Then I have run this project using the war file on Windows OS, it works fine.
I have to run this war file on Amazon EC2 instance. So I have uploaded this folder on EC2 medium instance. As I run this, it throws an error :
2019-03-02 06:50:53.489 ERROR 3082 --- [ost-startStop-1] o.s.b.web.embedded.tomcat.TomcatStarter : Error starting Tomcat context. Exception: org.springframework.beans.factory.UnsatisfiedDependencyException. Message: Error creating bean with name 'securityConfiguration': Unsatisfied dependency expressed through field 'userDetailsService'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'userDetailsService' defined in URL [jar:file:/home/ec2-user/theProject/project-tool.war!/WEB-INF/classes!/com/myProject/security/DomainUserDetailsService.class]: Unsatisfied dependency expressed through constructor parameter 0; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'userService': Unsatisfied dependency expressed through field 'auditLogService'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'auditLogService' defined in URL [jar:file:/home/ec2-user/theProject/project-tool.war!/WEB-INF/classes!/com/myProject/service/AuditLogService.class]: Unsatisfied dependency expressed through constructor parameter 0; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'auditLogRepository': Cannot create inner bean '(inner bean)#44dbafd9' of type [org.springframework.orm.jpa.SharedEntityManagerCreator] while setting bean property 'entityManager'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name '(inner bean)#44dbafd9': Cannot resolve reference to bean 'entityManagerFactory' while setting constructor argument; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory' defined in class path resource [org/springframework/boot/autoconfigure/orm/jpa/HibernateJpaConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean]: Factory method 'entityManagerFactory' threw exception; nested exception is com.zaxxer.hikari.pool.HikariPool$PoolInitializationException: Failed to initialize pool: IO Error: The Network Adapter could not establish the connection
2019-03-02 06:50:53.551 WARN 3082 --- [ost-startStop-1] o.a.c.loader.WebappClassLoaderBase : The web application [ROOT] appears to have started a thread named [oracle.jdbc.driver.BlockSource.ThreadedCachingBlockSource.BlockReleaser] but has failed to stop it. This is very likely to create a memory leak. Stack trace of thread:
java.lang.Object.wait(Native Method)
oracle.jdbc.driver.BlockSource$ThreadedCachingBlockSource$BlockReleaser.run(BlockSource.java:327)
2019-03-02 06:50:53.556 WARN 3082 --- [ 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
I also have another instance and other project working (spring and angularJS) fine in a similar manner. But why this not working, is there any issue with the command or with angular?
How to work it on Amazon EC2?
Your problem here reading your error stack trace is the database connection. Pay attention to the core error message:
Failed to initialize pool: IO Error: The Network Adapter could not establish the connection
I don't know how the Oracle database is configured but probably you have a problem with database listener configuration or more simply whit the network communication between your EC2 and Oracle Database instance i can suggest to try to see on the security group and network configuration.
The problem is not Angular but the database link between your app and the database.

integrating springboot application with cassandra deployed on openshift

I have deployed cassandra 3.11 service in openshift (OpenShift Web Console )
Through port forwarding, I am to connect to cassandra service through my local
terminal.
oc port-forward cassandra-0 9042:9042
cqlsh -u cassandra -p cassandra
I want to access cassandra service through my springboot application.
For that I am using below property file.
spring.data.cassandra.contact-points=cassandra-0.cassandra-1:9042,cassandra-1.cassandra-1:9042,cassandra-2.cassandra-1:9042
#spring.data.cassandra.port=9042
spring.data.cassandra.username=cassandra
spring.data.cassandra.password=cassandra
spring.data.cassandra.cluster-name=cassandra
When I am trying to run springboot application through above property file I am getting below error
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 forg.springframework.boot.actuate.endpoint.web.ServletEndpointRegistrad: 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.springframework.boot.actuate.autoconfigure.cassandra.CassandraHealthIndicatorAutoConfiguration': Unsatisfied dependency expressed through constructor parameter 0; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'cassandraTemplate' defined in class path resource [o rg/springframework/boot/autoconfigure/data/cassandra/CassandraDataAutoConfiguration.class]: Unsatisfied dependency expressed through method 'cassandraTemplate' parameter 0; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'cassandraSession' defined in class path resource [org/springframework /boot/autoconfigure/data/cassandra/CassandraDataAutoConfiguration.class]: Invocation of init method failed; nested exception is com.datastax.driver.core.exceptions.AuthenticationException: Authentication error on host cassandra.b360—non—prod.svc/10.128.16.156:9042: Host cassandra.b360— non—prod.svc/10.128.16.156:9042 requires authentication, but no authenticator found in Cluster configuration 2019-02-12 00:59:50.026 INFO 1 --- [ main] o.apache.catalina.core.StandardService : Stopping service [Tomcat] 2019-02-12 00:59:50.141 WARN 1 --- [ main] o.a.c.loader.WebappClassLoaderBase : The web application [ROOT] appears to have started a thread named [cluster1— connection—reaper-0] but has failed to stop it. This is very likely to create a memory leak. Stack trace of thread:
Try localhost:9042.
oc port-forward can forward requests from local to remote pod. So, accessing localhost:9042 will forward to cassandra-0:9042

Starting with JHipster

this is my first post on here. I generally try to find everything myself but I feel like I've hit every possible wall. I apologize if I'm not specific enough but hope someone here can help me.
I just started using jHipster and have successfully generated a project and have also added it to IntelliJ IDEA (using the trial edition). Unfortunately I have not been able to get the application to run. I continue to receive this error (had to cut down to fit in the character constraints):
2016-01-06 11:46:58.838 ERROR 8188 --- [ost-startStop-1]
o.a.c.c.C.[Tomcat].[localhost].[/] : Exception starting filter
springSecurityFilterChain
org.springframework.beans.factory.BeanCreationException: Error
creating bean with name
'org.springframework.security.config.annotation.web.configuration.WebSecurityConfiguration':
Injection of autowired dependencies failed; 2016-01-06 11:46:58.841
ERROR 8188 --- [ost-startStop-1]
o.apache.catalina.core.StandardContext : One or more Filters failed
to start. Full details will be found in the appropriate container log
file 2016-01-06 11:46:58.843 ERROR 8188 --- [ost-startStop-1]
o.apache.catalina.core.StandardContext : Context [] startup failed
due to previous errors 2016-01-06 11:46:59.897 ERROR 8188 --- [
restartedMain] o.s.boot.SpringApplication : Application
startup failed
org.springframework.beans.factory.UnsatisfiedDependencyException:
Error creating bean with name 'liquibase' defined in class path
resource [com/contactapp/config/DatabaseConfiguration.class]:
Unsatisfied dependency expressed through constructor argument with
index 0 of type [javax.sql.DataSource]: : Error creating bean with
name 'dataSource' defined in class path resource
[com/contactapp/config/DatabaseConfiguration.class]: Bean
instantiation via factory method failed; nested exception is
org.springframework.beans.BeanInstantiationException: Failed to
instantiate [javax.sql.DataSource]: Factory method 'dataSource' threw
exception; nested exception is
com.zaxxer.hikari.pool.PoolInitializationException: Exception during
pool initialization: Connection to localhost:5432 refused. Check that
the hostname and port are correct and that the postmaster is accepting
TCP/IP connections.; nested exception is
org.springframework.beans.factory.BeanCreationException: Error
creating bean with name 'dataSource' defined in class path resource
[com/contactapp/config/DatabaseConfiguration.class]: Bean
instantiation via factory method failed; nested exception is
org.springframework.beans.BeanInstantiationException: Failed to
instantiate [javax.sql.DataSource]: Factory method 'dataSource' threw
exception; nested exception is
com.zaxxer.hikari.pool.PoolInitializationException: Exception during
pool initialization: Connection to localhost:5432 refused. Check that
the hostname and port are correct and that the postmaster is accepting
TCP/IP connections. 2016-01-06 11:46:59.907 WARN 8188 --- [
restartedMain] o.s.boot.SpringApplication : Error
handling failed (Error creating bean with name
'delegatingApplicationListener' defined in class path resource
[org/springframework/security/config/annotation/web/configuration/WebSecurityConfiguration.class]:
BeanPostProcessor before instantiation of bean failed; nested
exception is org.springframework.beans.factory.BeanCreationException:
Error creating bean with name
'org.springframework.cache.annotation.ProxyCachingConfiguration':
Initialization of bean failed; nested exception is
org.springframework.beans.factory.NoSuchBeanDefinitionException: No
bean named
'org.springframework.context.annotation.ConfigurationClassPostProcessor.importRegistry'
is defined)
Process finished with exit code 1
These are just the beginning of errors I have received. I have followed the all of the setup procedures listed on the jHipster website including installing node.js, npm, bower, yo, grunt, maven, git. I am attempting to use Java 8 for this but don't see what the problem is that I can't run an unchanged generated project without errors. I followed instructions to add Spring to the module project structure but to no avail. The project will make and compile but will not run. Running "grunt serve" starts up an empty server and using mvn spring-boot:run closes with the errors listed above which is the same as just trying to run the Java application. Just to note I have also attempted to use Eclipse with the same errors. If anyone needs more information in helping me with this error I'd be more than happy to provide any necessary details. I can figure out what to do after getting the application to run but just can't get it to that point. If anyone can be of any assistance I'd more than appreciate it. Thanks everyone!
It looks like the error is with connecting to your postgres server. Make sure you have a postgres running with database name as defined in application.yml. If you don't want to use postgres, you can configure jHipster to use an embedded H2 database.
This is the segment of the error trace that is relevant :
com.zaxxer.hikari.pool.PoolInitializationException: Exception during
pool initialization: Connection to localhost:5432 refused. Check that
the hostname and port are correct and that the postmaster is accepting
TCP/IP connections.

Can't manage run the completed Spring Yummy Noodle Bar tutorials

I'm trying to run the completed version of the Yummy Noodle Bar tutorials (REST + WebApp) locally, so that I can dig through the code a little bit on my 2*6hr bus rides this weekend.
http://spring.io/guides/tutorials/web/
http://spring.io/guides/tutorials/rest/
According to both guides, the finished code is available:
$ cd ../6/complete
$ ./gradlew tomcatRunWar
However, both versions do not run for me and give build errors.
Can anyone else manage to run these? Is there anything wrong with my Java version or Path?
2014-09-19 09:36:10 ERROR ContextLoader:319 - Context initialization failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'securityConfig': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire method: public void org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter.setObjectPostProcessor(org.springframework.security.config.annotation.ObjectPostProcessor); nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'objectPostProcessor' defined in class org.springframework.security.config.annotation.configuration.ObjectPostProcessorConfiguration: Initialization of bean failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.security.config.annotation.method.configuration.GlobalMethodSecurityConfiguration': Initialization of bean failed; nested exception is java.lang.IllegalStateException: org.springframework.core.NestedIOException: ASM ClassReader failed to parse class file - probably due to a new Java class file version that isn't supported yet: class path resource [com/yummynoodlebar/config/SecurityConfig.class]; nested exception is java.lang.IllegalArgumentException
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:288)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1116)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:519)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:458)

Categories

Resources