Issue with io.github.resilience4j version 1.7.2 (SpelResolverConfigurationOnMissingBean.spelResolver() method that does not exist) - spring-boot

I'm using io.github.resilience4j. Everything is working fine with 1.6.1 version but when upgraded to 1.7.1 version my application is not running. Please find my code changes below.
My pom.xml dependencies
<dependency>
<groupId>io.github.resilience4j</groupId>
<artifactId>resilience4j-core</artifactId>
<version>1.7.1</version>
</dependency>
<dependency>
<groupId>io.github.resilience4j</groupId>
<artifactId>resilience4j-spring-boot2</artifactId>
<version>1.7.1</version>
</dependency>
Here is application.propertes changes
resilience4j.circuitbreaker.configs.default.registerHealthIndicator=true
resilience4j.circuitbreaker.configs.default.slidingWindowSize= 10
resilience4j.circuitbreaker.configs.default.minimumNumberOfCalls=5
resilience4j.circuitbreaker.configs.default.permittedNumberOfCallsInHalfOpenState= 3
resilience4j.circuitbreaker.configs.default.automaticTransitionFromOpenToHalfOpenEnabled=true
resilience4j.circuitbreaker.configs.default.waitDurationInOpenState=5s
resilience4j.circuitbreaker.configs.default.failureRateThreshold=50
resilience4j.circuitbreaker.configs.default.eventConsumerBufferSize=10
resilience4j.circuitbreaker.configs.shared.slidingWindowSize=100
resilience4j.circuitbreaker.configs.shared.permittedNumberOfCallsInHalfOpenState=30
resilience4j.circuitbreaker.configs.shared.waitDurationInOpenState=1s
resilience4j.circuitbreaker.configs.shared.failureRateThreshold=50
resilience4j.circuitbreaker.configs.shared.eventConsumerBufferSize=10
resilience4j.circuitbreaker.instances.profile.registerHealthIndicator=true
resilience4j.circuitbreaker.instances.profile.slidingWindowSize=10
resilience4j.circuitbreaker.instances.profile.minimumNumberOfCalls=10
resilience4j.circuitbreaker.instances.profile.permittedNumberOfCallsInHalfOpenState=3
resilience4j.circuitbreaker.instances.profile.waitDurationInOpenState=5s
resilience4j.circuitbreaker.instances.profile.failureRateThreshold=50
resilience4j.circuitbreaker.instances.profile.eventConsumerBufferSize=10
resilience4j.retry.configs.default.maxAttempts=3
resilience4j.retry.configs.default.waitDuration=100
resilience4j.retry.instances.profile.baseConfig=default
resilience4j.bulkhead.configs.default.maxConcurrentCalls=30
resilience4j.bulkhead.configs.instances.profile.maxWaitDuration=10ms
resilience4j.bulkhead.configs.instances.profile.maxConcurrentCalls=20
resilience4j.thread-pool-bulkhead.configs.default.maxThreadPoolSize=4
resilience4j.thread-pool-bulkhead.configs.default.coreThreadPoolSize=2
resilience4j.thread-pool-bulkhead.configs.default.queueCapacity=2
resilience4j.thread-pool-bulkhead.instances.profile.maxThreadPoolSize=1
resilience4j.thread-pool-bulkhead.instances.profile.coreThreadPoolSize=1
resilience4j.thread-pool-bulkhead.instances.profile.queueCapacity=1
resilience4j.ratelimiter.configs.default.registerHealthIndicator=false
resilience4j.ratelimiter.configs.default.limitForPeriod=10
resilience4j.ratelimiter.configs.default.limitRefreshPeriod=1s
resilience4j.ratelimiter.configs.default.timeoutDuration=0
resilience4j.ratelimiter.configs.default.eventConsumerBufferSize=100
resilience4j.timelimiter.configs.default.cancelRunningFuture=false
resilience4j.timelimiter.configs.default.timeoutDuration=2s
resilience4j.timelimiter.instances.profile.baseConfig=default
Here is controller API changes
private static final String PROFILE="profile";
#GetMapping("/{programType}/profile")
#AdobeIOAuthentication
#RateLimiter(name = PROFILE)
#TimeLimiter(name = PROFILE)
#CircuitBreaker(name = PROFILE)
#Bulkhead(name = PROFILE)
Error I'm getting while getting building
Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
2021-08-11 14:37:21.503 IST ERROR requestId=NA x-correlation-id=NA 17200 --- [ main] o.s.b.d.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:
io.github.resilience4j.spelresolver.autoconfigure.SpelResolverConfigurationOnMissingBean.spelResolver(SpelResolverConfigurationOnMissingBean.java:54)
The following method did not exist:
'io.github.resilience4j.spelresolver.SpelResolver io.github.resilience4j.spelresolver.configure.SpelResolverConfiguration.spelResolver(org.springframework.expression.spel.standard.SpelExpressionParser, org.springframework.core.ParameterNameDiscoverer, org.springframework.beans.factory.BeanFactory)'
The method's class, io.github.resilience4j.spelresolver.configure.SpelResolverConfiguration, is available from the following locations:
jar:file:/C:/Users/169576/.m2/repository/io/github/resilience4j/resilience4j-spring/1.6.0/resilience4j-spring-1.6.0.jar!/io/github/resilience4j/spelresolver/configure/SpelResolverConfiguration.class
The class hierarchy was loaded from the following locations:
io.github.resilience4j.spelresolver.configure.SpelResolverConfiguration: file:/C:/Users/169576/.m2/repository/io/github/resilience4j/resilience4j-spring/1.6.0/resilience4j-spring-1.6.0.jar
Can some one please help me to fix this issue.

Try version 1.7.0
<dependency>
<groupId>io.github.resilience4j</groupId>
<artifactId>resilience4j-core</artifactId>
<version>1.7.0</version>
</dependency>
<dependency>
<groupId>io.github.resilience4j</groupId>
<artifactId>resilience4j-spring-boot2</artifactId>
<version>1.7.0</version>
</dependency>

I have encountered this issue. I update also to version 1.7.0 but it not works.
I saw that the log information is show version to reference like that:
io.github.resilience4j.spelresolver.configure.SpelResolverConfiguration: file:/C:/Users/169576/.m2/repository/io/github/resilience4j/resilience4j-spring/1.6.0/resilience4j-spring-1.6.0.jar
We need only follow on log and update version to 1.6.0 means that same version in log

Related

Missing newline character in rawlogs using log4j and slf4j

I am working on a bug using log4j2 and slf4j. I have been reviewing the commit history in Github, but cannot find where the bug was introduced. In the log file rawlogs.log the newline character %n has been replaced by %replace%n. Please see the example below:
applog.line=16,applog.msg=ConfigChangeListener Initilized!%replace%nXXXXXXXX03172 123456789 2019-06-11 15:06:35.080 devHostname
I am using the following dependencies:
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-api</artifactId>
<version>2.10.0</version>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-core</artifactId>
<version>2.10.0</version>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-to-slf4j</artifactId>
<version>2.10.0</version>
</dependency>
In the files with logs the LoggerFactory is created with the example below:
private static final Logger LOGGER = LoggerFactory.getLogger(ClassName.class);
I have tried using both a log4j2.properties, and log4j2.xml files from log4j2 examples, but always get this error on startup:
2019-06-11 15:19:16,063 warmup - 7 ERROR No log4j2 configuration file found. Using default configuration: logging only errors to the console.
The rawlogs.log file is created and populated on startup.
Has anyone experienced this before? Any insight is appreciated.
EDIT: To clarify, project did not use a .xml or .properties file for configurations. I introduced them in an attempt to expose the root cause of the bug, but have not had success.

Correct the classpath of your application so that it contains a single, compatible version of org.elasticsearch.common.logging.Loggers

I'm getting following error while running my Spring boot app, I'm new to Spring boot and elastic search, please help to solve this issue.And attached my pom dependencies below.
Thanks in advance,
*************************** APPLICATION FAILED TO START ***************************
Description:
An attempt was made to call the method org.elasticsearch.common.logging.Loggers.getLogger(Ljava/lang/String;)Lorg/apache/logging/log4j/Logger; but it does not exist. Its class, org.elasticsearch.common.logging.Loggers, is available from the following locations:
jar:file:/C:/Users/Sudhakar/.m2/repository/org/elasticsearch/elasticsearch/6.6.2/elasticsearch-6.6.2.jar!/org/elasticsearch/common/logging/Loggers.class
It was loaded from the following location:
file:/C:/Users/Sudhakar/.m2/repository/org/elasticsearch/elasticsearch/6.6.2/elasticsearch-6.6.2.jar
Action:
Correct the classpath of your application so that it contains a single, compatible version of org.elasticsearch.common.logging.Loggers
Process finished with exit code 1
Maven dependencies:
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-to-slf4j</artifactId>
<version>2.11.1</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>1.7.24</version>
</dependency>
<dependency>
<groupId>org.elasticsearch</groupId>
<artifactId>elasticsearch</artifactId>
<version>6.6.2</version>
</dependency>
<dependency>
<groupId>org.elasticsearch.client</groupId>
<artifactId>transport</artifactId>
<version>6.6.2</version>
</dependency>
Spring Boot uses Elasticsearch 6.4 by default. By using 6.6.2 as the versions for two Elasticsearch modules you will have ended up with a mixture of the two versions. You should remove the <version> configuration in your pom. If you are able to use Spring Boot’s default version there’s nothing more to do. If you need to use 6.6.2 you should add an entry in your pom’s <properties>:
<elasticsearch.version>6.6.2</elasticsearch.version>

Cannot load JDBC Driver class in Birt 4.6.0-20160607

i am having a Java EE project in which i include the Birt runtime as a maven dependency:
<dependency>
<groupId>org.eclipse.birt.runtime</groupId>
<artifactId>org.eclipse.birt.runtime</artifactId>
<version>4.6.0-20160607</version>
<exclusions>
<exclusion>
<groupId>org.eclipse.birt.runtime</groupId>
<artifactId>org.apache.xerces</artifactId>
</exclusion>
<exclusion>
<artifactId>org.apache.poi</artifactId>
<groupId>org.eclipse.birt.runtime</groupId>
</exclusion>
</exclusions>
</dependency>
The engine seems to be created (i hope at least) . In my report i have defined the datasource settings.
<data-sources>
<oda-data-source extensionID="org.eclipse.birt.report.data.oda.jdbc" name="somename" id="43">
<list-property name="privateDriverProperties">
<ex-property>
<name>contentBidiFormatStr</name>
<value>ILYNN</value>
</ex-property>
<ex-property>
<name>metadataBidiFormatStr</name>
<value>ILYNN</value>
</ex-property>
</list-property>
<property name="odaDriverClass">oracle.jdbc.driver.OracleDriver</property>
<property name="odaURL">jdbc:oracle:thin:#host...</property>
<property name="odaUser">username</property>
<encrypted-property name="odaPassword" encryptionID="base64">password</encrypted-property>
</oda-data-source>
</data-sources>
Unfortunately it seems that Birt cannot find the ojdbc driver (Note, we use an oracle database) and we get the following error:
SEVERE [org.eclipse.birt.data.engine.odaconsumer] (default task-20)
Unable to open connection.:
org.eclipse.birt.report.data.oda.jdbc.JDBCException: Cannot load JDBC
Driver class: oracle.jdbc.driver.OracleDriver.
I have included in my Web module under WEB-INF/lib the following jar org.eclipse.birt.report.data.oda.jdbc_4.6.0.v201606072122.jar but i am still getting the same error.
Is there any way to solve this by adding the ojdbc as a maven dependency or is there any other workaround ?
Update: I have tried to also to add the also the org.eclipse.birt.report.data.oda.jdbc_4.6.0.v201606072122.jar as a maven dependency.
<!-- Oracle JDBC driver -->
<dependency>
<groupId>com.oracle</groupId>
<artifactId>ojdbc6</artifactId>
<version>11.2.0.4.0</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.eclipse.birt</groupId>
<artifactId>ojdbc</artifactId>
<scope>system</scope>
<version>1.0</version>
<systemPath>${basedir}\src\main\resources\lib\org.eclipse.birt.report.data.oda.jdbc_4.6.0.v201606072122.jar</systemPath>
</dependency>
I am getting the same error. Bellow some part of the stacktrace:
2017-01-05 13:07:11,990 SEVERE
[org.eclipse.birt.report.data.oda.jdbc.JDBCDriverManager] (default
task-45) DriverClassLoader failed to load class:
oracle.jdbc.driver.OracleDriver: java.lang.ClassNotFoundException:
oracle.jdbc.driver.OracleDriver
at org.eclipse.birt.core.framework.URLClassLoader.findClass1(URLClassLoader.java:188)
......
......
2017-01-05 13:07:12,020 SEVERE
[org.eclipse.birt.data.engine.odaconsumer] (default task-45) Unable to
open connection.: org.eclipse.birt.report.data.oda.jdbc.JDBCException:
Cannot load JDBC Driver class: oracle.jdbc.driver.OracleDriver.
at org.eclipse.birt.report.data.oda.jdbc.JDBCDriverManager.findDriver(JDBCDriverManager.java:881)
Update 2: I made further changes but still without success. I added the org.eclipse.birt.report.data.oda.jdbc_4.6.0.v201606072122.jar library in all my modules under WEB-INF and MEtA-INF
\src\main\webapp\WEB-INF\lib\org.eclipse.birt.report.data.oda.jdbc_4.6.0.v201606072122.jar
The results are quite the same:
2017-01-05 15:40:49,927 SEVERE
[org.eclipse.birt.report.data.oda.jdbc.JDBCDriverManager] (default
task-19) DriverClassLoader failed to load class:
org.eclipse.birt.report.data.oda.jdbc:
java.lang.ClassNotFoundException:
org.eclipse.birt.report.data.oda.jdbc
I would also like to note here something. For our persistence in the application, we use a datasource on our wildfly in which we use the ojdbc driver as a module in Wildfly 10 .
I am slowly running out of ideas with Birt + ojdbc
Finally solved the problem. I had to install the oda jdbc driver in my local manen repository and add it as a dependency in my ejb module.
<dependency>
<groupId>org.eclipse.birt.ojdbc</groupId>
<artifactId>odajdbc</artifactId>
<version>4.6.0-201606072122</version>
</dependency>
Furthermore, for some reason which i cannot yet explain, Birt required also the ojdbc6 driver in my web module. I honestly cannot understand why, since the entire birt implementation and runtime is in the ejb module.
<dependency>
<groupId>com.oracle</groupId>
<artifactId>ojdbc6</artifactId>
<version>11.2.0.4.0</version>
</dependency>
That solved the problem and now the reports are getting generated.
I am now facing two new problems which i have to solve.
1) java.lang.OutOfMemoryError: Java heap space : I found in Eclipse bugzilla that this problem can be solved with the ojdbc7 driver. The reports are not generated unless i push my servers -Xmx above 1400mb
2) [org.eclipse.birt.report.data.oda.jdbc.JDBCDriverManager] (default task-20) DriverClassLoader failed to load class: oracle.jdbc.driver.OracleDriver: java.lang.ClassNotFoundException: oracle.jdbc.driver.OracleDriver: For some reason i get this error only one time when i want to generate a report. The report is generated without problems and the exception never appears again.
At least the reports are working now and can continue solving the other issues.

Glassfish incremental deployment failes when including Selenium

I have a Java EE project which is meant to run on Glassfish 4.1. I want to use Selenium to collect information from some web pages, i.e. I need to include Selenium in the deployment (not just for tests).
I am using Eclipse IDE and have previously utilized the incremental deployment function in Eclipse to automatically deploy all saved changes to the project. But when I included (with Maven) the dependencies for Selenium incremental deployment stopped working. The project can still be deployed to Glassfish but I have to restart Glassfish between every change. I get the following error in Eclipse:
Exception while loading the app : java.lang.IllegalStateException: ContainerBase.addChild: start: org.apache.catalina.LifecycleException: java.lang.RuntimeException: com.sun.faces.config.ConfigurationException: java.util.concurrent.ExecutionException: com.sun.faces.config.ConfigurationException: Unable to parse document 'bundle://136.0:1/com/sun/faces/jsf-ri-runtime.xml': DTD factory class org.apache.xerces.impl.dv.dtd.DTDDVFactoryImpl does not extend from DTDDVFactory.. Please see server.log for more details.
org.apache.xerces.impl.dv.dtd.DTDDVFactoryImpl is included with Selenium as a transitive dependency (xerces:xercesImpl:2.11.0).
Here are my Maven dependencies:
<dependency>
<groupId>org.jboss.arquillian.selenium</groupId>
<artifactId>selenium-bom</artifactId>
<version>2.44.0</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-htmlunit-driver</artifactId>
</dependency>
I hope there is a solution to this but after reading Jens Schauder's response in Dealing with "Xerces hell" in Java/Maven? I'm afraid there might not be. Anyone?
I currently can't reproduce the issue with a simple project, did you make sure that you don't have any other dependencies which are importing another version of xercesImpl?
You can try to place the xercesImpl-2.11.0.jar and the transitive dependency xml-apis-1.4.01.jar in the lib folder of your Glassfish domain and exclude it from your dependencies like this:
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-htmlunit-driver</artifactId>
<version>2.44.0</version>
<exclusions>
<exclusion>
<artifactId>xercesImpl</artifactId>
<groupId>xerces</groupId>
</exclusion>
</exclusions>
</dependency>
See also:
org.apache.xerces.impl.dv.DVFactoryException: DTD factory class org.apache.xerces.impl.dv.dtd.DTDDVFactoryImpl does not extend from DTDDVFactory
Xerces error: org.apache.xerces.impl.dv.dtd.DTDDVFactoryImpl

Exception occurred while accessing jsf page: Servlet.service() for servlet default threw exception: java.lang.NoSuchMethodError

I'm trying to develop a web application using following technologies JSF 2.0 , EJB 3, JPA, Maven.. It's based on MVC design pattern so I have 3 projects so far: one is an EJB project which contains business and model, the second one is the view part which contains JSF and all beans that will be used in JSF pages and the third one is an EAR projects used to unite previous project that I mentioned.
So far I made a simple app and the EAR Project was deployed successfully in JBoss 7 but whenever I try to access a page I get the following exception:
Servlet.service() for servlet default threw exception: java.lang.NoSuchMethodError: com.ocpsoft.pretty.PrettyContext.newDetachedInstance(Ljavax/servlet/http/HttpServletRequest;)Lcom/ocpsoft/pretty/PrettyContext;
I want to mention that I'm not so familiar with these technologies.
Please let me know if you want to give you additional info such as maven dependencies or whatever you think that it can cause this error.
I have the following dependencies related to prettyfaces:
<dependency>
<groupId>com.ocpsoft</groupId>
<artifactId>ocpsoft-pretty-faces</artifactId>
<version>2.0.3</version>
</dependency>
<dependency>
<groupId>org.ocpsoft.rewrite</groupId>
<artifactId>rewrite-servlet</artifactId>
<version>2.0.11.Final</version>
</dependency>
<dependency>
<groupId>org.ocpsoft.rewrite</groupId>
<artifactId>rewrite-integration-faces-annotations</artifactId>
<version>2.0.0.Alpha5</version>
</dependency>
<dependency>
<groupId>org.ocpsoft.rewrite</groupId>
<artifactId>rewrite-config-prettyfaces</artifactId>
<version>2.0.11.Final</version>
</dependency>
I guess that the prettyfaces-core is missing, try to add this dependency :
<dependency>
<groupId>com.ocpsoft</groupId>
<artifactId>prettyfaces-core</artifactId>
<version>3.0.0</version>
</dependency>
I'm not sure about it, if it doesn't work, try the depedencies listed in the link below
http://mavenhub.com/c/com/ocpsoft/pretty/prettycontext

Resources