Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ISPN-12688 Support spring session embedded with protostream #9035

Conversation

danberindei
Copy link
Member

https://issues.redhat.com/browse/ISPN-12688

Depends on #9031

  • Create MapSession protostream adapter.
  • Allow session attribute values to be marshalled
    either with Protostream or with Java Serialization.
  • Use a raw marshaller to handle the serialization.
  • Add Spring classes to allow list.
  • Add spring-session test using protostream encoding
    (EmbeddedProtostreamSpringSessionTest).

@danberindei danberindei force-pushed the ISPN-12688_spring_session_embedded_protostream branch from 175ed6c to 4bf44af Compare February 5, 2021 10:05
Copy link
Contributor

@karesti karesti left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

needs rebase but LGTM!!

@danberindei danberindei force-pushed the ISPN-12688_spring_session_embedded_protostream branch from 4bf44af to 7775e60 Compare February 15, 2021 07:25
@danberindei
Copy link
Member Author

Rebased

@danberindei danberindei changed the title [PREVIEW] ISPN-12688 Support spring session embedded with protostream ISPN-12688 Support spring session embedded with protostream Feb 15, 2021
@ryanemerson
Copy link
Contributor

ryanemerson commented Feb 15, 2021

@danberindei Overall LGTM but something isn't right with classloading and the marshallers which is breaking the testsuite.

Caused by: java.lang.NoClassDefFoundError: org/springframework/session/MapSession
	at org.infinispan.spring.common.session.MapSessionProtoAdapter$___Marshaller_48803e1f63a1a9e51a9233b15e4119cb175205331f293f7d77e3cdbdf04f092b.getJavaClass(MapSessionProtoAdapter$___Marshaller_48803e1f63a1a9e51a9233b15e4119cb175205331f293f7d77e3cdbdf04f092b.java:27)
	at org.infinispan.protostream.impl.SerializationContextImpl.makeMarshallerDelegate(SerializationContextImpl.java:215)
	at org.infinispan.protostream.impl.SerializationContextImpl.registerMarshaller(SerializationContextImpl.java:203)
	at org.infinispan.spring.common.PersistenceContextInitializerImpl.registerMarshallers(PersistenceContextInitializerImpl.java:56)
	at org.infinispan.marshall.protostream.impl.SerializationContextRegistryImpl$MarshallerContext.lambda$update$0(SerializationContextRegistryImpl.java:148)
	at java.base/java.util.ArrayList.forEach(ArrayList.java:1541)
	at org.infinispan.marshall.protostream.impl.SerializationContextRegistryImpl$MarshallerContext.update(SerializationContextRegistryImpl.java:146)
	at org.infinispan.marshall.protostream.impl.SerializationContextRegistryImpl.lambda$addContextInitializer$3(SerializationContextRegistryImpl.java:85)
	at org.infinispan.marshall.protostream.impl.SerializationContextRegistryImpl.update(SerializationContextRegistryImpl.java:105)
	at org.infinispan.marshall.protostream.impl.SerializationContextRegistryImpl.addContextInitializer(SerializationContextRegistryImpl.java:85)
	at org.infinispan.spring.embedded.SpringEmbeddedModule.cacheManagerStarting(SpringEmbeddedModule.java:35)
	at org.infinispan.factories.GlobalComponentRegistry.modulesManagerStarting(GlobalComponentRegistry.java:270)
	at org.infinispan.factories.GlobalComponentRegistry.access$000(GlobalComponentRegistry.java:63)
	at org.infinispan.factories.GlobalComponentRegistry$ModuleInitializer.start(GlobalComponentRegistry.java:360)
	at org.infinispan.factories.CorePackageImpl$11.start(CorePackageImpl.java:173)
	at org.infinispan.factories.CorePackageImpl$11.start(CorePackageImpl.java:171)
	at org.infinispan.factories.impl.BasicComponentRegistryImpl.invokeStart(BasicComponentRegistryImpl.java:604)
	at org.infinispan.factories.impl.BasicComponentRegistryImpl.doStartWrapper(BasicComponentRegistryImpl.java:595)
	at org.infinispan.

@karesti
Copy link
Contributor

karesti commented Feb 15, 2021

@danberindei Overall LGTM but something isn't right with classloading and the marshallers which is breaking the testsuite.

Caused by: java.lang.NoClassDefFoundError: org/springframework/session/MapSession
	at org.infinispan.spring.common.session.MapSessionProtoAdapter$___Marshaller_48803e1f63a1a9e51a9233b15e4119cb175205331f293f7d77e3cdbdf04f092b.getJavaClass(MapSessionProtoAdapter$___Marshaller_48803e1f63a1a9e51a9233b15e4119cb175205331f293f7d77e3cdbdf04f092b.java:27)
	at org.infinispan.protostream.impl.SerializationContextImpl.makeMarshallerDelegate(SerializationContextImpl.java:215)
	at org.infinispan.protostream.impl.SerializationContextImpl.registerMarshaller(SerializationContextImpl.java:203)
	at org.infinispan.spring.common.PersistenceContextInitializerImpl.registerMarshallers(PersistenceContextInitializerImpl.java:56)
	at org.infinispan.marshall.protostream.impl.SerializationContextRegistryImpl$MarshallerContext.lambda$update$0(SerializationContextRegistryImpl.java:148)
	at java.base/java.util.ArrayList.forEach(ArrayList.java:1541)
	at org.infinispan.marshall.protostream.impl.SerializationContextRegistryImpl$MarshallerContext.update(SerializationContextRegistryImpl.java:146)
	at org.infinispan.marshall.protostream.impl.SerializationContextRegistryImpl.lambda$addContextInitializer$3(SerializationContextRegistryImpl.java:85)
	at org.infinispan.marshall.protostream.impl.SerializationContextRegistryImpl.update(SerializationContextRegistryImpl.java:105)
	at org.infinispan.marshall.protostream.impl.SerializationContextRegistryImpl.addContextInitializer(SerializationContextRegistryImpl.java:85)
	at org.infinispan.spring.embedded.SpringEmbeddedModule.cacheManagerStarting(SpringEmbeddedModule.java:35)
	at org.infinispan.factories.GlobalComponentRegistry.modulesManagerStarting(GlobalComponentRegistry.java:270)
	at org.infinispan.factories.GlobalComponentRegistry.access$000(GlobalComponentRegistry.java:63)
	at org.infinispan.factories.GlobalComponentRegistry$ModuleInitializer.start(GlobalComponentRegistry.java:360)
	at org.infinispan.factories.CorePackageImpl$11.start(CorePackageImpl.java:173)
	at org.infinispan.factories.CorePackageImpl$11.start(CorePackageImpl.java:171)
	at org.infinispan.factories.impl.BasicComponentRegistryImpl.invokeStart(BasicComponentRegistryImpl.java:604)
	at org.infinispan.factories.impl.BasicComponentRegistryImpl.doStartWrapper(BasicComponentRegistryImpl.java:595)
	at org.infinispan.

yep, we discussed it off github!

Reference only the lower bound when defining a type id,
never another type id.
@danberindei danberindei force-pushed the ISPN-12688_spring_session_embedded_protostream branch from 7775e60 to c1341e3 Compare February 16, 2021 12:17
@karesti
Copy link
Contributor

karesti commented Feb 16, 2021

@danberindei still failing just in case

* Create MapSession protostream adapter.
* Allow session attribute values to be marshalled
  either with Protostream or with Java Serialization.
* Use a raw marshaller to handle the marshalling of session attributes.
* Add Spring classes to allow list.
* Add spring-session test using protostream encoding
  (EmbeddedProtostreamSpringSessionTest).
@danberindei danberindei force-pushed the ISPN-12688_spring_session_embedded_protostream branch from c1341e3 to 8cc73e5 Compare February 16, 2021 16:24
@karesti karesti merged commit 7f5ffab into infinispan:master Feb 16, 2021
@karesti
Copy link
Contributor

karesti commented Feb 16, 2021

@danberindei nice work, you are the best!

@danberindei danberindei deleted the ISPN-12688_spring_session_embedded_protostream branch February 17, 2021 21:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants