infinispan / infinispan-simple-tutorials Goto Github PK
View Code? Open in Web Editor NEWInfinispan Simple Tutorials
Home Page: https://infinispan.org/tutorials/simple/simple_tutorials.html
License: Apache License 2.0
Infinispan Simple Tutorials
Home Page: https://infinispan.org/tutorials/simple/simple_tutorials.html
License: Apache License 2.0
Running the spring boot session remote example from https://github.com/infinispan/infinispan-simple-tutorials/blob/12.1.x/spring-integration/spring-boot/session-remote/src/main/java/org/infinispan/tutorial/simple/spring/session/InfinispanConfiguration.java throws the following exception on startup. There's a similar issue when running just the Spring boot remote example as well (without sessions)
The main issue issue seems to be "Cannot find transcoder between 'application/x-java-object' to 'application/x-java-serialized'**
Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'sessionRepositoryFilterRegistration' defined in class path resource [org/springframework/boot/autoconfigure/session/SessionRepositoryFilterConfiguration.class]: Unsatisfied dependency expressed through method 'sessionRepositoryFilterRegistration' parameter 1; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'springSessionRepositoryFilter' defined in org.infinispan.spring.remote.session.configuration.InfinispanRemoteHttpSessionConfiguration: Unsatisfied dependency expressed through method 'springSessionRepositoryFilter' parameter 0; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionRepository' defined in org.infinispan.spring.remote.session.configuration.InfinispanRemoteHttpSessionConfiguration: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.infinispan.spring.remote.session.InfinispanRemoteSessionRepository]: Factory method 'sessionRepository' threw exception; nested exception is org.infinispan.client.hotrod.exceptions.HotRodClientException:Request for messageId=6 returned server error (status=0x85): org.infinispan.commons.CacheConfigurationException: Unable to inject dependencies for component class org.infinispan.encoding.DataConversion, path org.infinispan.AdvancedCache (a org.infinispan.cache.impl.EncoderCache)
org.infinispan.commons.dataconversion.EncodingException: ISPN000492: **Cannot find transcoder between 'application/x-java-object' to 'application/x-java-serialized'**
at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:800) ~[spring-beans-5.3.4.jar:5.3.4]
at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:541) ~[spring-beans-5.3.4.jar:5.3.4]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1334) ~[spring-beans-5.3.4.jar:5.3.4]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1177) ~[spring-beans-5.3.4.jar:5.3.4]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:564) ~[spring-beans-5.3.4.jar:5.3.4]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:524) ~[spring-beans-5.3.4.jar:5.3.4]
at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:335) ~[spring-beans-5.3.4.jar:5.3.4]
When deploying the simple app from "kubernetes" directory on openshift cluster, I get this error :
Exception in thread "main" org.infinispan.commons.CacheConfigurationException: ISPN000435: Cache manager initialized with a default cache configuration but without a name for it. Set it in the GlobalConfiguration.
at org.infinispan.manager.DefaultCacheManager.<init>(DefaultCacheManager.java:249)
at org.infinispan.manager.DefaultCacheManager.<init>(DefaultCacheManager.java:230)
at org.infinispan.tutorial.simple.kubernetes.InfinispanKubernetes.main(InfinispanKubernetes.java:41)
The application stops right after.
Kubernetes has been deprecating API(s), which will be removed and are no longer available in 1.22. Operators projects using these APIs versions will not work on Kubernetes 1.22 or any cluster vendor using this Kubernetes version(1.22), such as OpenShift 4.9+. Following the APIs that are most likely your projects to be affected by:
Therefore, looks like this project distributes solutions in the repository and does not contain any version compatible with k8s 1.22/OCP 4.9. (More info). Following some findings by checking the distributions published:
NOTE: The above findings are only about the manifests shipped inside of the distribution. It is not checking the codebase.
It would be very nice to see new distributions of this project that are no longer using these APIs and so they can work on Kubernetes 1.22 and newer and published in the community-operators collection. OpenShift 4.9, for example, will not ship operators anymore that do still use v1beta1 extension APIs.
Due to the number of options available to build Operators, it is hard to provide direct guidance on updating your operator to support Kubernetes 1.22. Recent versions of the OperatorSDK greater than 1.0.0 and Kubebuilder greater than 3.0.0 scaffold your project with the latest versions of these APIs (all that is generated by tools only). See the guides to upgrade your projects with OperatorSDK Golang, Ansible, Helm or the Kubebuilder one. For APIs other than the ones mentioned above, you will have to check your code for usage of removed API versions and upgrade to newer APIs. The details of this depend on your codebase.
If this projects only need to migrate the API for CRDs and it was built with OperatorSDK versions lower than 1.0.0 then, you maybe able to solve it with an OperatorSDK version >= v0.18.x < 1.0.0:
$ operator-sdk generate crds --crd-version=v1
INFO[0000] Running CRD generator.
INFO[0000] CRD generation complete.
Alternatively, you can try to upgrade your manifests with controller-gen (version >= v0.4.1) :
$ controller-gen crd:trivialVersions=true,preserveUnknownFields=false rbac:roleName=manager-role paths="./..."
Add the markers sideEffects and admissionReviewVersions to your webhook (Example with sideEffects=None and admissionReviewVersions={v1,v1beta1}: memcached-operator/api/v1alpha1/memcached_webhook.go):
Run the command:
$ controller-gen crd:trivialVersions=true,preserveUnknownFields=false rbac:roleName=manager-role webhook paths="./..."
For further information and tips see the comment.
A handful of tutorials require an external server to be running, ideally the samples should start docker containers for that, similarly to the spark/
demo
The Simple.cs has too many bugs in it and it wouldn't build in VS 2015.
I tried to run spring-boot/remote tutorial. (I run branch 10.1.x). It will fail to me.
How to reproduce:
git branch: 10.1.x
mvn -version
Apache Maven 3.6.1 (Red Hat 3.6.1-5)
Maven home: /usr/share/maven
Java version: 11.0.6, vendor: Oracle Corporation, runtime: /usr/lib/jvm/java-11-openjdk-11.0.6.10-0.fc32.x86_64
Default locale: en_GB, platform encoding: UTF-8
OS name: "linux", version: "5.6.14-300.fc32.x86_64", arch: "amd64", family: "unix"
sudo podman run -it -p 11222:11222 -e USER="infinispan" -e PASS="infinispan" infinispan/server:10.1.6.Final
(It makes sense since I need to configure the auth-username and auth-password to springboot application)
Then I added the following in application.properties :
infinispan.remote.server-list=localhost:11222
# Uncomment client-intelligence if you are running infinispan with docker for mac
# Read https://blog.infinispan.org/2018/03/accessing-infinispan-inside-docker-for.html
# infinispan.remote.client-intelligence=BASIC
infinispan.remote.auth-username=infinispan
infinispan.remote.auth-password=infinispan
infinispan.remote.use-auth=true
Run again
mvn clean spring-boot:run
Then I got the second error:
2020-05-28 09:52:57.923 INFO 381786 --- [ main] o.i.t.s.spring.remote.RemoteClientApp : Starting RemoteClientApp on smokingwell with PID 381786 (/wdc/github/redhat/infinispan-simple-tutorials/spring-boot/remote/target/classes started by rzhang in /wdc/github/redhat/infinispan-simple-tutorials/spring-boot/remote)
2020-05-28 09:52:57.925 INFO 381786 --- [ main] o.i.t.s.spring.remote.RemoteClientApp : No active profile set, falling back to default profiles: default
2020-05-28 09:52:58.928 INFO 381786 --- [ main] org.infinispan.HOTROD : ISPN004021: Infinispan version: Infinispan 'Turia' 10.1.6.Final
2020-05-28 09:53:00.110 ERROR 381786 --- [-async-pool-1-7] org.infinispan.HOTROD : ISPN004007: Exception encountered. Retry 10 out of 10
org.infinispan.client.hotrod.exceptions.TransportException: javax.security.sasl.SaslException: ELY05051: Callback handler does not support credential acquisition [Caused by java.security.NoSuchAlgorithmException: class configured for PasswordFactory (provider: WildFlyElytron) cannot be found.]
at org.infinispan.client.hotrod.impl.transport.netty.ActivationHandler.exceptionCaught(ActivationHandler.java:53) ~[infinispan-client-hotrod-10.1.6.Final.jar:10.1.6.Final]
at io.netty.channel.AbstractChannelHandlerContext.invokeExceptionCaught(AbstractChannelHandlerContext.java:300) ~[netty-transport-4.1.45.Final.jar:4.1.45.Final]
at io.netty.channel.AbstractChannelHandlerContext.invokeExceptionCaught(AbstractChannelHandlerContext.java:279) ~[netty-transport-4.1.45.Final.jar:4.1.45.Final]
at io.netty.channel.AbstractChannelHandlerContext.fireExceptionCaught(AbstractChannelHandlerContext.java:271) ~[netty-transport-4.1.45.Final.jar:4.1.45.Final]
at io.netty.channel.DefaultChannelPipeline$HeadContext.exceptionCaught(DefaultChannelPipeline.java:1377) ~[netty-transport-4.1.45.Final.jar:4.1.45.Final]
at io.netty.channel.AbstractChannelHandlerContext.invokeExceptionCaught(AbstractChannelHandlerContext.java:300) ~[netty-transport-4.1.45.Final.jar:4.1.45.Final]
at io.netty.channel.AbstractChannelHandlerContext.invokeExceptionCaught(AbstractChannelHandlerContext.java:279) ~[netty-transport-4.1.45.Final.jar:4.1.45.Final]
at io.netty.channel.DefaultChannelPipeline.fireExceptionCaught(DefaultChannelPipeline.java:907) ~[netty-transport-4.1.45.Final.jar:4.1.45.Final]
at org.infinispan.client.hotrod.impl.transport.netty.AuthHandler.lambda$channelActive$2(AuthHandler.java:87) ~[infinispan-client-hotrod-10.1.6.Final.jar:10.1.6.Final]
at java.base/java.util.concurrent.CompletableFuture.uniExceptionally(CompletableFuture.java:986) ~[na:na]
at java.base/java.util.concurrent.CompletableFuture$UniExceptionally.tryFire(CompletableFuture.java:970) ~[na:na]
at java.base/java.util.concurrent.CompletableFuture.postComplete(CompletableFuture.java:506) ~[na:na]
at java.base/java.util.concurrent.CompletableFuture.complete(CompletableFuture.java:2073) ~[na:na]
at org.infinispan.client.hotrod.impl.operations.HotRodOperation.complete(HotRodOperation.java:165) ~[infinispan-client-hotrod-10.1.6.Final.jar:10.1.6.Final]
at org.infinispan.client.hotrod.impl.operations.AuthOperation.acceptResponse(AuthOperation.java:64) ~[infinispan-client-hotrod-10.1.6.Final.jar:10.1.6.Final]
at org.infinispan.client.hotrod.impl.transport.netty.HeaderDecoder.decode(HeaderDecoder.java:145) ~[infinispan-client-hotrod-10.1.6.Final.jar:10.1.6.Final]
at org.infinispan.client.hotrod.impl.transport.netty.HintedReplayingDecoder.callDecode(HintedReplayingDecoder.java:94) ~[infinispan-client-hotrod-10.1.6.Final.jar:10.1.6.Final]
at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:276) ~[netty-codec-4.1.45.Final.jar:4.1.45.Final]
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:377) ~[netty-transport-4.1.45.Final.jar:4.1.45.Final]
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:363) ~[netty-transport-4.1.45.Final.jar:4.1.45.Final]
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:355) ~[netty-transport-4.1.45.Final.jar:4.1.45.Final]
at io.netty.handler.timeout.IdleStateHandler.channelRead(IdleStateHandler.java:286) ~[netty-handler-4.1.45.Final.jar:4.1.45.Final]
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:377) ~[netty-transport-4.1.45.Final.jar:4.1.45.Final]
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:363) ~[netty-transport-4.1.45.Final.jar:4.1.45.Final]
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:355) ~[netty-transport-4.1.45.Final.jar:4.1.45.Final]
at io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1410) ~[netty-transport-4.1.45.Final.jar:4.1.45.Final]
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:377) ~[netty-transport-4.1.45.Final.jar:4.1.45.Final]
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:363) ~[netty-transport-4.1.45.Final.jar:4.1.45.Final]
at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:919) ~[netty-transport-4.1.45.Final.jar:4.1.45.Final]
at io.netty.channel.epoll.AbstractEpollStreamChannel$EpollStreamUnsafe.epollInReady(AbstractEpollStreamChannel.java:792) ~[netty-transport-native-epoll-4.1.45.Final-linux-x86_64.jar:4.1.45.Final]
at io.netty.channel.epoll.EpollEventLoop.processReady(EpollEventLoop.java:475) ~[netty-transport-native-epoll-4.1.45.Final-linux-x86_64.jar:4.1.45.Final]
at io.netty.channel.epoll.EpollEventLoop.run(EpollEventLoop.java:378) ~[netty-transport-native-epoll-4.1.45.Final-linux-x86_64.jar:4.1.45.Final]
at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:989) ~[netty-common-4.1.45.Final.jar:4.1.45.Final]
at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74) ~[netty-common-4.1.45.Final.jar:4.1.45.Final]
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) ~[na:na]
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) ~[na:na]
at java.base/java.lang.Thread.run(Thread.java:834) ~[na:na]
Caused by: javax.security.sasl.SaslException: ELY05051: Callback handler does not support credential acquisition
at org.wildfly.security.mechanism._private.MechanismUtil.getPasswordCredential(MechanismUtil.java:139) ~[wildfly-elytron-mechanism-1.10.4.Final.jar:1.10.4.Final]
at org.wildfly.security.mechanism.scram.ScramClient.handleInitialChallenge(ScramClient.java:245) ~[wildfly-elytron-mechanism-scram-1.10.4.Final.jar:1.10.4.Final]
at org.wildfly.security.sasl.scram.ScramSaslClient.evaluateMessage(ScramSaslClient.java:75) ~[wildfly-elytron-sasl-scram-1.10.4.Final.jar:1.10.4.Final]
at org.wildfly.security.sasl.util.AbstractSaslParticipant.evaluateMessage(AbstractSaslParticipant.java:219) ~[wildfly-elytron-sasl-1.10.4.Final.jar:1.10.4.Final]
at org.wildfly.security.sasl.util.AbstractSaslClient.evaluateChallenge(AbstractSaslClient.java:98) ~[wildfly-elytron-sasl-1.10.4.Final.jar:1.10.4.Final]
at org.infinispan.client.hotrod.impl.transport.netty.AuthHandler.evaluateChallenge(AuthHandler.java:106) ~[infinispan-client-hotrod-10.1.6.Final.jar:10.1.6.Final]
at org.infinispan.client.hotrod.impl.transport.netty.AuthHandler.access$200(AuthHandler.java:26) ~[infinispan-client-hotrod-10.1.6.Final.jar:10.1.6.Final]
at org.infinispan.client.hotrod.impl.transport.netty.AuthHandler$ChallengeEvaluator.apply(AuthHandler.java:124) ~[infinispan-client-hotrod-10.1.6.Final.jar:10.1.6.Final]
at org.infinispan.client.hotrod.impl.transport.netty.AuthHandler$ChallengeEvaluator.apply(AuthHandler.java:110) ~[infinispan-client-hotrod-10.1.6.Final.jar:10.1.6.Final]
at java.base/java.util.concurrent.CompletableFuture$UniCompose.tryFire(CompletableFuture.java:1072) ~[na:na]
... 26 common frames omitted
Caused by: java.security.NoSuchAlgorithmException: class configured for PasswordFactory (provider: WildFlyElytron) cannot be found.
at java.base/java.security.Provider$Service.getImplClass(Provider.java:1863) ~[na:na]
at java.base/java.security.Provider$Service.newInstance(Provider.java:1824) ~[na:na]
at org.wildfly.security.password.PasswordFactory.getInstance(PasswordFactory.java:119) ~[wildfly-elytron-credential-1.10.4.Final.jar:1.10.4.Final]
at org.wildfly.security.mechanism._private.MechanismUtil.getPasswordCredential(MechanismUtil.java:78) ~[wildfly-elytron-mechanism-1.10.4.Final.jar:1.10.4.Final]
... 35 common frames omitted
Caused by: java.lang.ClassNotFoundException: org.wildfly.security.password.impl.PasswordFactorySpiImpl
at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:581) ~[na:na]
at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178) ~[na:na]
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521) ~[na:na]
at java.base/java.security.Provider$Service.getImplClass(Provider.java:1850) ~[na:na]
... 38 common frames omitted
The InfinispanDistributed (12.1.x branch) example is using SKIP_REMOTE_LOOKUP
in combination with AdvancedCache:entrySet
to allegedly display "cache contents for this node":
// Display the current cache contents for this node
cache.getAdvancedCache().withFlags(Flag.SKIP_REMOTE_LOOKUP).entrySet()
.forEach(entry -> System.out.printf("%s = %s\n", entry.getKey(), entry.getValue()));
Unfortunately, this doesn't work, in my tests it always displays the whole cache with both entrySet
variants, no difference between AdvancedCache
with SKIP_REMOTE_LOOKUP
and the normal Cache:entrySet
.
The reason for that is probably explained in the documentation for SKIP_REMOTE_LOOKUP
:
When used with distributed cache mode, will prevent retrieving a remote value either when executing a Cache.get(Object) or Cache.containsKey(Object), or to return the overwritten value for Cache.put(Object, Object) or Cache.remove(Object).
So, to me it seems that AdvancedCache:entrySet
simply ignores this flag. Altering the code to, for example, store all locally generated keys in an extra set and then iterating over those to show that some are not in the local node's content, works, though.
Unless the behavior of this Flag has changed in 13.0 - which doesn't seem to be the case according to the JavaDoc - this would also be the same in the main branch.
Running your example: https://github.com/infinispan/infinispan-simple-tutorials/tree/master/spring-integration/spring-boot/remote with the latest infinispan release (12.1.3.final). Results in following Exception:
java.lang.IllegalArgumentException: No marshaller registered for object of Java type org.infinispan.tutorial.simple.spring.remote.BasqueName : BasqueName{id=6, name='Koldo'}
at org.infinispan.protostream.impl.SerializationContextImpl.getMarshallerDelegate(SerializationContextImpl.java:512) ~[protostream-4.4.0.Final.jar:4.4.0.Final]
The error seems to occur while deserialization, since I can see the Entries in the Server. A (quick) Debugging in SerializationContextImpl indicates that class BasqueName neither is present in marshallersByClass nor in legacyMarshallerProviders.
Using the org.infinispan.commons.marshall.JavaSerializationMarshaller works fine.
Has anyone tried setting up L2 Hibernate caching with infinispan hot rod server? It seems like there isn't really an easy way to connect hibernate transactions with this RemoteCacheManager unless I am completely missing something here?
make sure our simple tutorials compile and work
Hi,
I am trying to get spring integrated multi node/clustered cache.
is this infinispan will work for it or not.
Thanks,
Raju.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.