I'm working with Spring Boot 1.4.1, using spring boot gradle plugin, therefor it is using spring framework 4.3.3. Loading my application, I'm getting this error, it is driving me nuts:
[timestamp=23:49:24.983] [thread="main"] [session="undefined"] [request="undefined"] [level=WARN ] [logger=o.s.b.c.e.AnnotationConfigEmbeddedWebApplicationContext] [class=org.springframework.context.support.AbstractApplicationContext] [line=549]
- Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'heapdumpMvcEndpoint': Could not bind properties to HeapdumpMvcEndpoint (prefix=endpoints.heapdump, ignoreInvalidFields=false, ignoreUnknownFields=true, ignoreNestedProperties=false); nested exception is org.springframework.validation.BindException: org.springframework.boot.bind.RelaxedDataBinder$RelaxedBeanPropertyBindingResult: 1 errors
***************************
APPLICATION FAILED TO START
***************************
Description:
Binding to target org.springframework.boot.actuate.endpoint.mvc.HeapdumpMvcEndpoint#29897daf failed:
Property: endpoints.heapdump.path
Value: null
Reason: may not be null
Action:
Update your application's configuration
I have no idea what parts of my code show to you guys, this error is freaking me out. If somebody has any idea, I can start sending my build file, my Application class, etc.
The error says something about a bean named 'heapdumpMvcEndpoint' and a property called endpoints.heapdump.path. I tried adding 'endpoints.heapdump.path' to my application properties, and it didn't work.
Related
I have installed tomcat-9.0.41
I build cas-overlay-template 6.3 and placed the cas.war in the webapps
started the server, everything works as it should.
I then build the cas-management-overlay 6.3 placed the cas-management.war in webapps but when I restart tomcat I get the following error when tomcat tries to load
firstly I dont understand what the exact problem is and how am I supposed to correct this "classpath" that the action is talking about.
any help would be appreciated!
2021-01-22 20:39:04,641 WARN [org.springframework.boot.web.servlet.context.AnnotationConfigServletWebServerApplicationContext] - <Exception encountered during context initialization - cancelling refresh attempt: org.springframework.context.ApplicationContextException: Unable to start web server; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'formContentFilter' defined in class path resource [org/springframework/boot/autoconfigure/web/servlet/WebMvcAutoConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.boot.web.servlet.filter.OrderedFormContentFilter]: Factory method 'formContentFilter' threw exception; nested exception is java.lang.NoSuchMethodError: 'com.fasterxml.jackson.databind.cfg.MutableCoercionConfig com.fasterxml.jackson.dataformat.xml.XmlMapper.coercionConfigDefaults()'>
2021-01-22 20:39:04,666 ERROR [org.springframework.boot.diagnostics.LoggingFailureAnalysisReporter] - <
***************************
APPLICATION FAILED TO START
***************************
Description:
An attempt was made to call a method that does not exist. The attempt was made from the following location:
com.fasterxml.jackson.dataformat.xml.XmlMapper.<init>(XmlMapper.java:175)
The following method did not exist:
'com.fasterxml.jackson.databind.cfg.MutableCoercionConfig com.fasterxml.jackson.dataformat.xml.XmlMapper.coercionConfigDefaults()'
The method's class, com.fasterxml.jackson.dataformat.xml.XmlMapper, is available from the following locations:
jar:file:/opt/cas/tomcat-9.0.41/webapps/cas-management/WEB-INF/lib/jackson-dataformat-xml-2.12.0.jar!/com/fasterxml/jackson/dataformat/xml/XmlMapper.class
The class hierarchy was loaded from the following locations:
com.fasterxml.jackson.dataformat.xml.XmlMapper: file:/opt/cas/tomcat-9.0.41/webapps/cas-management/WEB-INF/lib/jackson-dataformat-xml-2.12.0.jar
com.fasterxml.jackson.databind.ObjectMapper: file:/opt/cas/tomcat-9.0.41/webapps/cas-management/WEB-INF/lib/jackson-databind-2.11.3.jar
com.fasterxml.jackson.core.ObjectCodec: file:/opt/cas/tomcat-9.0.41/webapps/cas-management/WEB-INF/lib/jackson-core-2.11.3.jar
com.fasterxml.jackson.core.TreeCodec: file:/opt/cas/tomcat-9.0.41/webapps/cas-management/WEB-INF/lib/jackson-core-2.11.3.jar
Action:
Correct the classpath of your application so that it contains a single, compatible version of com.fasterxml.jackson.dataformat.xml.XmlMapper
I downloaded the latest versions, reinstalled everything into two different tomcat servers with different domains. Which was not needed after all
I used as suggested
./gradlew clean copyCasConfiguration build
The error persisted.
So I took the jar files from the cas installation in
/opt/cas/apache-tomcat-9.0.41/cas/ROOT/WEB-INF/lib/jackson-*
and coppied them into
/opt/casmgmt/apache-tomcat-9.0.41/casmgmt/ROOT/WEB-INF/lib/
and the casmgmt server server app started successfully. apparently the people who wrote the source of the overlays either they don't have enough documentation as to what libs and versions should be used and when, or they have some sort of misconfigurations as to what the dependencies are and all
I am working on a Desktop Application, with OpenJfx and SpringBoot. It works well thus far.
However, this application will consume a WebService and I want to use RestTemplate. When I add spring-web dependency to my pom.xml file, Spring Boot attempts to instantiate several things for which I do not have use.
The dependency added:
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-web</artifactId>
<version>5.0.7.RELEASE</version>
</dependency>
First, the following error is displayed:
[2020-08-11 10:26:20] - WARN - Exception encountered during context initialization - cancelling refresh attempt: org.springframework.context.ApplicationContextException: Unable to start web server; nested exception is org.springframework.context.ApplicationContextException: Unable to start ServletWebServerApplicationContext due to missing ServletWebServerFactory bean. [AbstractApplicationContext.java:558]
I added the following propery, as per this response:
spring.main.web-application-type=none
Running the application again, more things attempt to instantiate:
[2020-08-11 10:29:47] - WARN - Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'jacksonObjectMapper' defined in class path resource [org/springframework/boot/autoconfigure/jackson/JacksonAutoConfiguration$JacksonObjectMapperConfiguration.class]: Unsatisfied dependency expressed through method 'jacksonObjectMapper' parameter 0; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'jacksonObjectMapperBuilder' defined in class path resource [org/springframework/boot/autoconfigure/jackson/JacksonAutoConfiguration$JacksonObjectMapperBuilderConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.http.converter.json.Jackson2ObjectMapperBuilder]: Factory method 'jacksonObjectMapperBuilder' threw exception; nested exception is java.lang.NoSuchMethodError: org.springframework.http.converter.json.Jackson2ObjectMapperBuilder.visibility(Lcom/fasterxml/jackson/annotation/PropertyAccessor;Lcom/fasterxml/jackson/annotation/JsonAutoDetect$Visibility;)Lorg/springframework/http/converter/json/Jackson2ObjectMapperBuilder; [AbstractApplicationContext.java:558]
[2020-08-11 10:29:47] - INFO -
Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled. [ConditionEvaluationReportLoggingListener.java:136]
[2020-08-11 10:29:47] - ERROR -
***************************
APPLICATION FAILED TO START
***************************
Description:
An attempt was made to call a method that does not exist. The attempt was made from the following location:
org.springframework.boot.autoconfigure.jackson.JacksonAutoConfiguration$Jackson2ObjectMapperBuilderCustomizerConfiguration$StandardJackson2ObjectMapperBuilderCustomizer.configureVisibility(JacksonAutoConfiguration.java:258)
The following method did not exist:
org.springframework.http.converter.json.Jackson2ObjectMapperBuilder.visibility(Lcom/fasterxml/jackson/annotation/PropertyAccessor;Lcom/fasterxml/jackson/annotation/JsonAutoDetect$Visibility;)Lorg/springframework/http/converter/json/Jackson2ObjectMapperBuilder;
The method's class, org.springframework.http.converter.json.Jackson2ObjectMapperBuilder, is available from the following locations:
jar:file:/C:/Users/xxx/.m2/repository/org/springframework/spring-web/5.0.7.RELEASE/spring-web-5.0.7.RELEASE.jar!/org/springframework/http/converter/json/Jackson2ObjectMapperBuilder.class
It was loaded from the following location:
file:/C:/Users/xxx/.m2/repository/org/springframework/spring-web/5.0.7.RELEASE/spring-web-5.0.7.RELEASE.jar
Action:
Correct the classpath of your application so that it contains a single, compatible version of org.springframework.http.converter.json.Jackson2ObjectMapperBuilder
[LoggingFailureAnalysisReporter.java:40]
The problem is, I only want to use RestTemplate to consume a Rest Service. Is there a way I can add Classes native to other spring libraries, without all the additional baggage?
RestTemplate is only a wrapper around a HttpClient implementation. That http client needs to be provided by someone for example an underlying server implementation like tomcat, undertow, netty, jetty etc. But can also come from a standalone client.
So if we walk through your errors:
[2020-08-11 10:26:20] - WARN - Exception encountered during context initialization - cancelling refresh attempt: org.springframework.context.ApplicationContextException: Unable to start web server; nested exception is org.springframework.context.ApplicationContextException: Unable to start ServletWebServerApplicationContext due to missing ServletWebServerFactory bean. [AbstractApplicationContext.java:558]
This says that it can't start a server, because you have pulled in spring-web which is a lot of classes that needs a server. It tries to autostart a lot of classes.
spring.main.web-application-type=none
So with this parameter you basically disable all the autostart classes that will get run if you have a web application. This will not disable the creation of the spring context (the context is needed to create all spring classes, to make sure autowiring works, beans etc etc)
[2020-08-11 10:29:47] - WARN - Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'jacksonObjectMapper' defined in class path resource [org/springframework/boot/autoconfigure/jackson/JacksonAutoConfiguration$JacksonObjectMapperConfiguration.class]: Unsatisfied dependency expressed through method 'jacksonObjectMapper' parameter 0; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'jacksonObjectMapperBuilder' defined in class path resource [org/springframework/boot/autoconfigure/jackson/JacksonAutoConfiguration$JacksonObjectMapperBuilderConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.http.converter.json.Jackson2ObjectMapperBuilder]: Factory method 'jacksonObjectMapperBuilder' threw exception; nested exception is java.lang.NoSuchMethodError: org.springframework.http.converter.json.Jackson2ObjectMapperBuilder.visibility(Lcom/fasterxml/jackson/annotation/PropertyAccessor;Lcom/fasterxml/jackson/annotation/JsonAutoDetect$Visibility;)Lorg/springframework/http/converter/json/Jackson2ObjectMapperBuilder; [AbstractApplicationContext.java:558]
So when you run it now it tries to create the context and fails because it can't find Jackson because jackson is needed and is created using the autostart classes that you disabled with your previous parameter.
Its basically saying you want to use a car, but you don't want the engine, wheels, interior, doors, steering wheel etc. etc. If you don't have a server or anything for that matter that provides the HttpClient there is nothing for RestTemplate to use or wrap around.
If you are looking for a standalone simple rest client i would suggest looking into OkHttp
I've been tasked to update a spring boot app that makes use of Microsoft Azure servicebus.
However, the client claims it runs fine on Azure - but I can't get it to start:
Relevant config:
azure:
notificationConnectionString: Endpoint=sb://voobv.servicebus.windows.net/;SharedAccessKeyName=DefaultFullSharedAccessSignature;SharedAccessKey=xxxx/0XJib3iJA45p1D6Wc=
notificationHubName: voob
servicebus:
connection-string: Endpoint=sb://xxx.servicebus.windows.net/;SharedAccessKeyName=RootManageSharedAccessKey;SharedAccessKey=xxxx=
topic-name: applicationbuildevents
subscription-name: apiserver_applicationbuildevents
subscription-receive-mode: PEEKLOCK
Error message:
***************************
APPLICATION FAILED TO START
***************************
Description:
Failed to bind properties under 'azure.servicebus.subscription-receive-mode' to com.microsoft.azure.servicebus.ReceiveMode:
Property: azure.servicebus.subscription-receive-mode
Value: PEEKLOCK
Origin: class path resource [application.yml]:75:32
Reason: 0
Action:
Update your application's configuration
I've googled alot around this but seem to have my hand on an unique problem (and a extremly bad error message from spring/microsoft)
Anyone that have seen similar issues? I'm leaning strongly to remove all servicebus code for now, but would rather keep the code intact...
I'm using embedmongo-spring only for dev purposes. I have a problem using it on my test server as it is failing downloading the embeddedmongo zip file (not a lot of disk space), but anyways, I don't need it to be downloaded as I'm using a real mongoDB server for testing.
The problem is that spring automatically trying to create the embeddedMongoServer:
11:10:51.998 [main] WARN o.s.w.c.s.GenericWebApplicationContext -
Exception encountered during context initialization - cancelling
refresh attempt:
org.springframework.beans.factory.BeanCreationException: Error
creating bean with name 'embeddedMongoServer' defined in class path
resource
[org/springframework/boot/autoconfigure/mongo/embedded/EmbeddedMongoAutoConfiguration.class]:
Bean instantiation via factory method failed; nested exception is
org.springframework.beans.BeanInstantiationException: Failed to
instantiate [de.flapdoodle.embed.mongo.MongodExecutable]: Factory
method 'embeddedMongoServer' threw exception; nested exception is
java.lang.RuntimeException: could not create dir
/users//.embedmongo/extracted/Linux-B64--3.2.2 11:10:52.009
[main] INFO o.s.b.a.l.ConditionEvaluationReportLoggingListener -
The only place I'm using the embedded mongo is at some class named MongoDevConfiguration which annotated with #Profile("dev") (and the output above is for the active profile test)
How can I guide spring not to create the embeddedMongoServer on the test server?
I found the solution:
#EnableAutoConfiguration(exclude = EmbeddedMongoAutoConfiguration.class)
I'm running tomcat 8-RC10 and (attempting) geoserver 2.4.3 deployed from .war.
Geoserver won't start with the above error, and the catalina.out (which is so long and detailed as to be almost useless) seems to have trouble at the point:
ERROR [context.ContextLoader] - context initialization failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'geoServerLoader' defined in URL [jar:file:/home/XXX/tomcat/webapps/geoserver/WEB-INF/lib/main-2.2.4.jar!/applicationContext.xml]: Cannot resolve reference to bean 'resourceLoader' while setting constructor argument;
nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'resourceLoader' defined in URL [jar:file:/home/XXX/tomcat/webapps/geoserver/WEB-INF/lib/main-2.2.4.jar!/applicationContext.xml]: initialization of bean failed;
nested exception is java.lang.IllegalArgumentException: The resource path [WEB-INF] is not valid.
Appreciate any suggestions, I'm quite clearly in over my head here.
One of your beans references a bean named 'resourceloader' but there is no bean with that name in your application context as indicated by the message:
cannot resolve reference to bean 'resourceloader
If anyone else runs into this, it seems that tomcat 8 is not supported by geoserver as yet. My recommendation is downloading and unzipping tomcat7 from the .tar, according the instructions at : http://diegobenna.blogspot.com.au/2011/01/install-tomcat-7-in-ubuntu-1010.html