Payara 5 issue with deployment due to io.lettuce.core.support.LettuceCdiExtension - payara

I tried looking for solutions to my problem but I haven't found any help.
Our application is using Redis Lettuce but during deployment using Payara 5.2022.3, I can't proceed and it's because of the LettuceCdiExtension error. Can anyone help me? I'm also using jdk11 if it helps
org.glassfish.deployment.common.DeploymentException: CDI deployment failure:Error instantiating :io.lettuce.core.support.LettuceCdiExtension -- Error instantiating :io.lettuce.core.support.LettuceCdiExtension
at org.jboss.weld.util.ServiceLoader.createInstance(ServiceLoader.java:315)
at org.jboss.weld.util.ServiceLoader.prepareInstance(ServiceLoader.java:247)
at org.jboss.weld.util.ServiceLoader.loadService(ServiceLoader.java:215)
at org.jboss.weld.util.ServiceLoader.loadServiceFile(ServiceLoader.java:185)
at org.jboss.weld.util.ServiceLoader.reload(ServiceLoader.java:165)
at org.jboss.weld.util.ServiceLoader.iterator(ServiceLoader.java:289)
at org.glassfish.weld.DeploymentImpl.getExtensions(DeploymentImpl.java:495)
at org.glassfish.weld.WeldDeployer.processApplicationLoaded(WeldDeployer.java:518)
at org.glassfish.weld.WeldDeployer.event(WeldDeployer.java:434)
at org.glassfish.kernel.event.EventsImpl.send(EventsImpl.java:131)
Exception while loading the app : CDI deployment failure:Error instantiating :io.lettuce.core.support.LettuceCdiExtension -- Error instantiating :io.lettuce.core.support.LettuceCdiExtension]]
This is part of the pom.xml
<!-- JPA -->
<dependency>
<groupId>javax.transaction</groupId>
<artifactId>jta</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.data</groupId>
<artifactId>spring-data-jpa</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.data</groupId>
<artifactId>spring-data-envers</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.data</groupId>
<artifactId>spring-data-redis</artifactId>
</dependency>
<dependency>
<groupId>io.lettuce</groupId>
<artifactId>lettuce-core</artifactId>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-aspects</artifactId>
</dependency>
<!-- JPA End -->

Related

Apache Flink: JMXReporterFactory could not be found

I try to check out Apache Flink's function to report metrics to external systems. I started with the JMX reporter because it doesn't need an additional dependency since it's included in Flink via "org.apache.flink.metrics.jmx.JMXReporter". I'm running everything from IntelliJ, so that I had to add the setup to my configuration like this:
Properties props = new Properties();
props.put("metrics.reporter.jmx.factory.class", "org.apache.flink.metrics.jmx.JMXReporterFactory");
Configuration conf = ConfigurationUtils.createConfiguration(props);
env = StreamExecutionEnvironment.createLocalEnvironmentWithWebUI(conf);
So far so good. I got this warning from my console:
14:06:58,715 WARN org.apache.flink.runtime.metrics.ReporterSetup [] - The reporter factory (org.apache.flink.metrics.jmx.JMXReporterFactory) could not be found for reporter jmx. Available factories: [].
So it tells me there's no available reporter factory, right? But why? In addition I get following error message, if I try to add the reporter setup with
conf.setClass("metrics.reporter.jmx.factory.class", org.apache.flink.metrics.jmx.JMXReporterFactory);
Cannot resolve symbol 'jmx'
So it can't find jmx what is strange cause the documentary told me it's included.
This is my pom.xml:
<dependencies>
<dependency>
<groupId>org.apache.flink</groupId>
<artifactId>flink-walkthrough-common_${scala.binary.version}</artifactId>
<version>${flink.version}</version>
</dependency>
<dependency>
<groupId>org.apache.flink</groupId>
<artifactId>flink-runtime-web_2.12</artifactId>
<version>${flink.version}</version>
</dependency>
<!-- This dependency is provided, because it should not be packaged into the JAR file. -->
<dependency>
<groupId>org.apache.flink</groupId>
<artifactId>flink-streaming-java_${scala.binary.version}</artifactId>
<version>${flink.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.apache.flink</groupId>
<artifactId>flink-clients_${scala.binary.version}</artifactId>
<version>${flink.version}</version>
<scope>provided</scope>
</dependency>
<!-- Add connector dependencies here. They must be in the default scope (compile). -->
<!-- Example:
<dependency>
<groupId>org.apache.flink</groupId>
<artifactId>flink-connector-kafka_${scala.binary.version}</artifactId>
<version>${flink.version}</version>
</dependency>
-->
<!-- Add logging framework, to produce console output when running in the IDE. -->
<!-- These dependencies are excluded from the application JAR by default. -->
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-slf4j-impl</artifactId>
<version>${log4j.version}</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-api</artifactId>
<version>${log4j.version}</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-core</artifactId>
<version>${log4j.version}</version>
<scope>runtime</scope>
</dependency>
</dependencies>

Stackdriver monitoring nosuchmethoderror when having a 'google-api-services-compute'

There is an error from a java application using the Stackdriver Monitoring client when I have a dependency to the google-api-services-compute.
exception:
java.lang.NoSuchMethodError:
com.google.common.base.Preconditions.checkArgument(ZLjava/lang/String;CLjava/lang/Object;)V
at io.grpc.Metadata$Key.validateName(Metadata.java:629)
at io.grpc.Metadata$Key.<init>(Metadata.java:637)
at io.grpc.Metadata$Key.<init>(Metadata.java:567)
at io.grpc.Metadata$AsciiKey.<init>(Metadata.java:742)
at io.grpc.Metadata$AsciiKey.<init>(Metadata.java:737)
at io.grpc.Metadata$Key.of(Metadata.java:593)
at io.grpc.Metadata$Key.of(Metadata.java:589)
at com.google.api.gax.grpc.GrpcHeaderInterceptor.<init>(GrpcHeaderInterceptor.java:60)
at com.google.api.gax.grpc.InstantiatingGrpcChannelProvider.createSingleChannel(InstantiatingGrpcChannelProvider.java:220)
at com.google.api.gax.grpc.InstantiatingGrpcChannelProvider.createChannel(InstantiatingGrpcChannelProvider.java:193)
at com.google.api.gax.grpc.InstantiatingGrpcChannelProvider.getTransportChannel(InstantiatingGrpcChannelProvider.java:185)
at com.google.api.gax.rpc.ClientContext.create(ClientContext.java:155)
at com.google.cloud.monitoring.v3.stub.GrpcMetricServiceStub.create(GrpcMetricServiceStub.java:176)
at com.google.cloud.monitoring.v3.stub.MetricServiceStubSettings.createStub(MetricServiceStubSettings.java:188)
at com.google.cloud.monitoring.v3.MetricServiceClient.<init>(MetricServiceClient.java:157)
at com.google.cloud.monitoring.v3.MetricServiceClient.create(MetricServiceClient.java:138)
at com.google.cloud.monitoring.v3.MetricServiceClient.create(MetricServiceClient.java:129)
at com.vmware.adapter3.gcp.builder.GoogleCloudMonitoringManager.testGoogleCloudMonitoringConnection(GoogleCloudMonitoringManager.java:356)
on the create method:
MetricServiceClient metricServiceClient = MetricServiceClient.create();
only when Maven Dependencies :
<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
<version>${project.gson.version}</version>
</dependency>
<dependency>
<groupId>com.google.http-client</groupId>
<artifactId>google-http-client-jackson2</artifactId>
<version>${project.http.version}</version>
</dependency>
<dependency>
<groupId>com.google.oauth-client</groupId>
<artifactId>google-oauth-client-jetty</artifactId>
<version>${project.oauth.version}</version>
</dependency>
<dependency>
<groupId>com.google.apis</groupId>
<artifactId>google-api-services-compute</artifactId>
<version>v1-rev158-1.23.0</version>
</dependency>
<dependency>
<groupId>com.google.apis</groupId>
<artifactId>google-api-services-storage</artifactId>
<version>v1-rev158-1.25.0</version>
</dependency>
<dependency>
<groupId>com.google.cloud</groupId>
<artifactId>google-cloud-monitoring</artifactId>
<version>1.98.0</version>
Please help me to come out of this problem.
It seems the issue is the lower case function name "create": It has to start with a higher case "C", being "Create", as in "MetricServiceClient.Create()".

Apache Shiro: Permission filter is validating last matched path

I am using Apache Shiro with Guice on Google App Engine.
Following filter chain is present in configureShiroWeb() function
addFilterChain("/**/first/second/third/**", AUTHC_BASIC, config(REST, "X"));
addFilterChain("/**/first/**", AUTHC_BASIC, config(REST, "Y"));
When a request is made for an API- example.appspot.com/v1/first/second/third, the first filter is bypassed and the access is granted for a user with permission Y and not with X.
I am using the following shiro and guice related dependencies:
<dependency>
<groupId>org.apache.shiro</groupId>
<artifactId>shiro-core</artifactId>
<version>1.2.4</version>
</dependency>
<dependency>
<groupId>org.apache.shiro</groupId>
<artifactId>shiro-web</artifactId>
<version>1.2.4</version>
</dependency>
<dependency>
<groupId>org.apache.shiro</groupId>
<artifactId>shiro-guice</artifactId>
<version>1.2.4</version>
</dependency>
<dependency>
<groupId>com.google.inject</groupId>
<artifactId>guice</artifactId>
<version>3.0</version>
</dependency>
<dependency>
<groupId>com.google.inject.extensions</groupId>
<artifactId>guice-servlet</artifactId>
<version>3.0</version>
</dependency>
<dependency>
<groupId>com.google.inject.extensions</groupId>
<artifactId>guice-multibindings</artifactId>
<version>3.0</version>
</dependency>
<dependency>
<groupId>com.sun.jersey.contribs</groupId>
<artifactId>jersey-guice</artifactId>
<version>1.8</version>
</dependency>
Upgrade Shiro, If you are still running into this issue let us know.

NoSuchMethodError on DeferredFileOutputStream when called from RestEasy ApacheHttpClient4Engine

I have looked at a few links which seems related with no luck:
*How to solve this java.lang.NoClassDefFoundError: org/apache/commons/io/output/DeferredFileOutputStream?
*RESTEasy Client + NoSuchMethodError
The exception reads:
Caused by: java.lang.NoSuchMethodError:
org.apache.commons.io.output.DeferredFileOutputStream.(ILjava/lang/String;Ljava/lang/String;Ljava/io/File;)V
at
org.jboss.resteasy.client.jaxrs.engines.ApacheHttpClient4Engine.writeRequestBodyToOutputStream(ApacheHttpClient4Engine.java:554)
at
org.jboss.resteasy.client.jaxrs.engines.ApacheHttpClient4Engine.buildEntity(ApacheHttpClient4Engine.java:524)
The dependencies I have are:
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<version>2.0</version>
</dependency>
<dependency>
<groupId>org.jboss.resteasy</groupId>
<artifactId>resteasy-client</artifactId>
<version>3.0.7.Final</version>
</dependency>
<dependency>
<groupId>org.jboss.resteasy</groupId>
<artifactId>resteasy-jackson-provider</artifactId>
<version>3.0.7.Final</version>
</dependency>
System is running on JDK 1.7, JBoss 5.1 GA with ESB modules.
Thanks
Late but but last update.. this method was found inside the JBoss application server; when I replaced this jar inside JBoss with the same (was using v1.4) then there was no more exceptions such as above
You are missing a dependency. You need to add commons-io to your pom.xml:
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<version>1.4</version>
</dependency>

Working Maven3 configuration for AppEngine + DataNucleus + JPA 2

I'm trying to create GAE project via Maven and I'm facing problem with persistence libraries configuration. I try including different dependencies and specifying different scopes, but I always get some errors like:
java.lang.NoClassDefFoundError: org/datanucleus/ObjectManagerFactoryImpl
.
java.lang.NoClassDefFoundError: javax/persistence/spi/ProviderUtil
.
java.lang.NoClassDefFoundError: org/datanucleus/ClassLoaderResolver
.
Invocation of init method failed; nested exception is javax.persistence.PersistenceException: No persistence providers available for "transactions-optional" after trying the following discovered implementations: org.datanucleus.api.jpa.PersistenceProviderImpl
Well, eventually I've found the solution for my case:
<!-- Persistence Dependencies -->
<dependency>
<groupId>com.google.appengine.orm</groupId>
<artifactId>datanucleus-appengine</artifactId>
<version>2.1.2</version>
</dependency>
<dependency>
<groupId>javax.jdo</groupId>
<artifactId>jdo-api</artifactId>
<version>3.0.1</version>
</dependency>
<dependency>
<groupId>org.apache.geronimo.specs</groupId>
<artifactId>geronimo-jpa_2.0_spec</artifactId>
<version>1.1</version>
</dependency>
<dependency>
<groupId>org.datanucleus</groupId>
<artifactId>datanucleus-core</artifactId>
<version>[3.1.1, 3.1.99]</version>
</dependency>
<dependency>
<groupId>org.datanucleus</groupId>
<artifactId>datanucleus-api-jpa</artifactId>
<version>[3.1.1, 3.1.99]</version>
</dependency>
<dependency>
<groupId>org.datanucleus</groupId>
<artifactId>datanucleus-jpa-query</artifactId>
<version>3.0.2</version>
</dependency>
I hope it will help somebody with same issues.
check the GAE dependencies here
https://code.google.com/p/datanucleus-appengine/wiki/Compatibility
Its possible you may be using some incompatible versions.

Resources