My Spring cloud config server is throwing below error when trying to access the property file content using http://localhost:8080/application/default
There was an unexpected error (type=Internal Server Error, status=500).
Could not construct context for config=application profile=default label= includeOrigin=false; nested exception is java.lang.IllegalStateException: ConfigFileApplicationListener [org.springframework.boot.context.config.ConfigFileApplicationListener] is deprecated and can only be used as an EnvironmentPostProcessor
org.springframework.cloud.config.server.environment.FailedToConstructEnvironmentException: Could not construct context for config=application profile=default label= includeOrigin=false; nested exception is java.lang.IllegalStateException: ConfigFileApplicationListener [org.springframework.boot.context.config.ConfigFileApplicationListener] is deprecated and can only be used as an EnvironmentPostProcessor
at org.springframework.cloud.config.server.environment.NativeEnvironmentRepository.findOne(NativeEnvironmentRepository.java:161)
at org.springframework.cloud.config.server.environment.AbstractScmEnvironmentRepository.findOne(AbstractScmEnvironmentRepository.java:59)
at org.springframework.cloud.config.server.environment.MultipleJGitEnvironmentRepository.findOne(MultipleJGitEnvironmentRepository.java:187)
at org.springframework.cloud.config.server.environment.CompositeEnvironmentRepository.findOne(CompositeEnvironmentRepository.java:58)
at org.springframework.cloud.config.server.environment.EnvironmentEncryptorEnvironmentRepository.findOne(EnvironmentEncryptorEnvironmentRepository.java:61)
at org.springframework.cloud.config.server.environment.EnvironmentController.getEnvironment(EnvironmentController.java:136)
at org.springframework.cloud.config.server.environment.EnvironmentController.defaultLabel(EnvironmentController.java:108)
at sun.reflect.GeneratedMethodAccessor68.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
My application.properties in config server looks like this
spring.cloud.config.server.git.uri=/Users/joe/MyProgs/Java/spring-ws/config and I even tried with this spring.cloud.config.server.git.uri=${HOME}/MyProgs/Java/spring-ws/config
Content of the property file in the local git repository is
martin:
name: Martin D'vloper
job: Developer
skill: Elite
Please let me know what I am doing wrong.
It looks like this deprecation message was added just a couple of weeks ago in this issue. These changes are not even released yet (marked for release in a future milestone version of Spring Boot 2.4.0-M2).
What version of Spring Boot are you using? I suppose you have a SNAPSHOT dependency somewhere in your build configuration.
Related
APPLICATION FAILED TO START
Description:
Binding to target HikariDataSource (HikariPool-1) failed:
Property: spring.datasource.hikari.connectionTestQuery
Value: SELECT 1
Reason: Property 'connectionTestQuery' threw exception; nested exception is java.lang.IllegalStateException: The configuration of the pool is sealed once started. Use HikariConfigMXBean for runtime changes.
As per Hikari documentation, you may not required to set this property if you use latest JDBC drivers. This property is for legacy JDBC drivers (<JDBC4).
You can try running your application without setting this property. Moreover, if still issue persists, please share hikari bean definition; I will update my answer based on that.
After upgrading the application to the below version of the spring boot, the application started with no errors
<parent>
<groupId>com.accurate.boot</groupId>
<artifactId>accurate-spring-starter-parent</artifactId>
<version>1.5.22.RELEASE</version>
We are trying to upgrade one of our application from spring boot 1.5 to spring boot 2.3 (tried 2.6 also). We have made the necessary changes in pom and application.yml. This works fine in local . but, we we are trying to deploy this to dev/stage then deployment is failing( we are using concourse pipeline to deploy). To make sure we tried deploying the previous package(spring boot 1.5) it works fine. we are not seeing any error in our output logs other than the below one. we are just seeing the below error repeatedly and deployment fails. Any help would be highly appreciated. Just to highlight we are using Java 11. Thank you.
Error in output logs:
E0422 19:09:35.020452 4210 throttler_api.cc:71] GRPC: src/core/lib/security/transport/handshake.c:128 Security han
dshake failed: {"created":"#1650654575.020440344","description":"Handshake failed","file":"src/core/lib/security/tr
ansport/handshake.c","file_line":264,"tsi_code":10,"tsi_error":"TSI_PROTOCOL_FAILURE"}
E0422 19:11:35.020635 4210 throttler_api.cc:71] GRPC: src/core/lib/tsi/ssl_transport_security.c:945 Handshake fail
ed with fatal error SSL_ERROR_SSL: error:14090086:SSL routines:ssl3_get_server_certificate:certificate verify faile
d.
I have an app that uses EHCache, it worked when using Payara Application server version 1.0.5 but after upgrading to 1.1.0 it started breaking.
Here's a snippet of the code:
persistentEntityStoreCacheManager
= CacheManagerBuilder.newCacheManagerBuilder().withCache("defaultPersistentEntityStoreCache",
CacheConfigurationBuilder.newCacheConfigurationBuilder(String.class, PersistentEntityStore.class, ResourcePoolsBuilder.heap(100)).build()).build(true);
And it is throwing this error:
java.lang.IllegalStateException: org.ehcache.core.spi.ServiceLocator$DependencyException: Failed to find provider with satisfied dependency set for interface org.ehcache.core.spi.store.Store$Provider [ca
ndidates []]
at org.ehcache.core.spi.ServiceLocator$DependencySet.build(ServiceLocator.java:350)
at org.ehcache.core.EhcacheManager.resolveServices(EhcacheManager.java:154)
at org.ehcache.core.EhcacheManager.<init>(EhcacheManager.java:125)
at org.ehcache.core.EhcacheManager.<init>(EhcacheManager.java:115)
at org.ehcache.core.EhcacheManager.<init>(EhcacheManager.java:111)
at org.ehcache.config.builders.CacheManagerBuilder.newCacheManager(CacheManagerBuilder.java:117)
at org.ehcache.config.builders.CacheManagerBuilder.build(CacheManagerBuilder.java:73)
What's this EHCache and and what could be missing here?
In my case, there are multiple EhCache imported by different modules.After useing the same version of EhCache. The problem solved.
We are using the owasp dependencyCheck plugin in our project.
Version used: 1.4.5
We are facing the following issue in our build jobs on Jenkins:
The build job fails intermittently saying " :dependencyCheck FAILED "
The stacktrace of the error is as follows:
:dependencyCheck
Verifying dependencies for project stock-service
Checking for updates and analyzing vulnerabilities for dependencies
Unable to update Cached Web DataSource, using local data instead. Results may not include recent vulnerabilities.
Exception occurred initializing CPE Analyzer.
Generating report for project stock-service
Found 0 vulnerabilities in project stock-service
:dependencyCheck FAILED
Caused by: org.owasp.dependencycheck.exception.ExceptionCollection: One or more exceptions occurred during dependency-check analysis
org.xml.sax.SAXException: Unable to get primary key for new cpe: cpe:/a:uchida_yoko_co._ltd:assetbase:8.0
org.owasp.dependencycheck.data.nvdcve.DatabaseException: Unable to get primary key for new cpe: cpe:/a:uchida_yoko_co._ltd:assetbase:8.0
An exception occurred accessing the database
at org.owasp.dependencycheck.Engine.analyzeDependencies(Engine.java:543)
at org.owasp.dependencycheck.Engine$analyzeDependencies$0.call(Unknown Source)
at org.owasp.dependencycheck.gradle.tasks.Check.check(Check.groovy:86)
... 66 more
If your code has multiple microservices, then all the services create a database locally on Jenkins and update it as part of owasp dependencyCheck task on the following location:
/{your jenkins
directory}/.gradle/caches/modules-2/files-2.1/org.owasp/dependency-check-utils/dependency-check-data/3.0/dc.h2.db
Since this file is shared by all the services, there are locking issues. If any one service fails during build, the lock that it created on the file is not removed and thus the other services would subsequently fail.
Following link describes the issue and suggests a solution:
https://github.com/jeremylong/DependencyCheck/issues/410
This solution was not usable as is, we had to change the "autoUpdate=true" so that the service creates a db file if it does not already exist.
After the above change ( i.e adding "data directory" configuration in dependencyCheck task [visit the above link for this config]),
the issue seems to have been fixed.
I tried to deploy a Vaadin hello world application in JBOSS. The application is as simple as it can be.
My development environment is eclipse for java EE + tomcat
java.lang.RuntimeException: Error configuring property: includeWebInfInClasspath for WarClassLoaderDeployer
at org.jboss.kernel.plugins.dependency.ConfigureAction.dispatchSetProperty(ConfigureAction.java:112)
at org.jboss.kernel.plugins.dependency.ConfigureAction.setAttributes(ConfigureAction.java:85)
(...)
Caused by: java.lang.IllegalArgumentException: No such property includeWebInfInClasspath for bean org.jboss.web.tomcat.service.deployers.WarClassLoaderDeployer available [java2ClassLoadingCompliance, parentFirst, requiredInputs, filteredPackages, allInputs, deploymentRegistry, class, stage, wantComponents, componentsOnly, input, inputs, relativeOrder, output, useUnitName, outputs, topLevelOnly]
I have tried to google this error with no success.
Does anyone have any clues?
Is it a web server configuration or my *.war is missing something?
EDIT:
This error occur when I start the server after placing my *.war in the folder.
My JBOSS version is 5
I guess, you're using an old JBoss 5.
The WarClassLoaderDeployer is configured in the file server/default/deployers/jbossweb.deployer/META-INF/war-deployers-jboss-beans.xml. (The 'default' directory should be changed to whatever you passed as -c parameter) Open the file, find the WarClassLoaderDeployer bean and drop the line defining the property with name includeWebInfInClasspath.