Re: [hibernate-dev] [infinispan-dev] [jboss-as7-dev] AS7-4007 missing Infinispan dependency for clustered JPA second level cache

2012-03-06 Thread Scott Marlow
On 03/06/2012 02:27 PM, Galder Zamarreño wrote:
> So, to summarise all of this. What I suggest is this:
>
> - Short term:
> The "quick fix" I suggest in 
> http://lists.jboss.org/pipermail/infinispan-dev/2012-March/010317.html

Do we want to try this (requires a new build of Infinispan I think)?  Or 
should applications workaround the issue until we can reach the 
medium/long term?

>
> - Medium term:
> Have a way to pass in marshalling configurations per cache manager and 
> per-cache (or an abstraction of it), which allows the right class resolver to 
> be passed in. (***)
> https://issues.jboss.org/browse/ISPN-1367

ISPN-1367 is targeted to Infinispan 5.2, any idea of the target release 
date for that?  I'm curious as to which AS release it might align with.

>
> - Long term:
> https://issues.jboss.org/browse/ISPN-1413
>
> (***) I still don't fully understand how web apps don't have the same issue 
> as 2LC of not seeing Infinispan classes (Reminder: we're not talking about 
> the contents of the cache, but about the Infinispan classes themselves).

https://github.com/jbossas/jboss-as/blob/master/web/src/main/java/org/jboss/as/web/deployment/JBossContextConfig.java
 
appears to be wired to use Paul's ClassLoaderAwareClassResolver.

>
> On Mar 6, 2012, at 8:19 PM, Galder Zamarreño wrote:
>
>>
>> On Mar 6, 2012, at 8:06 PM, David M. Lloyd wrote:
>>
>>> On 03/06/2012 01:02 PM, Galder Zamarreño wrote:
 On Mar 6, 2012, at 6:31 PM, Paul Ferraro wrote:
 
> To work around this, we typically store MarshalledValues in the cache - 
> which are marshalled/unmarshalled using a marshalling configuration 
> specific to the application (e.g. via a ModularClassResolver using the 
> ModuleLoader of the deployment unit).
> https://github.com/jbossas/jboss-as/blob/master/clustering/api/src/main/java/org/jboss/as/clustering/MarshalledValue.java
> https://github.com/jbossas/jboss-as/blob/master/clustering/api/src/main/java/org/jboss/as/clustering/SimpleMarshalledValue.java
> https://github.com/jbossas/jboss-as/blob/master/clustering/api/src/main/java/org/jboss/as/clustering/HashableMarshalledValue.java

 Isn't a class resolver and a class loader, functionality wise, doing the 
 same thing? I wonder if a custom classloader could not be built that 
 delegates to a ModularClassResolver...
>>>
>>> No, not really.  A class loader loads a class, given a name.  But a
>>> class resolver loads a class given a name *and* stream information.  The
>>> modular class resolver reads the stream information to know which class
>>> loader houses the class in question.  This is critically important
>>> because it's possible (common even) for more than one class to exist in
>>> an AS instance with the same name.  And there is no single class loader
>>> which has visibility to all classes which could potentially be stored in
>>> a cache.
>>>
>>> Yes, accepting a class loader to use is a powerful feature.  However it
>>> *should* just be a convenience abstraction over a more fundamental
>>> feature which allows a class resolver to be set.
>>
>> Thanks for the clarification, makes sense.
>>
>> So, if I understand this correctly, Infinispan should really be enhanced to 
>> accept global and per-cache class resolvers, or more globally, as paul 
>> suggested below, marshalling configuration instances (or abstractions of 
>> them).
>>
>> I think https://issues.jboss.org/browse/ISPN-1367 should be reporpoused to 
>> do this.
>>
>>>
> So, essentially Infinispan itself only ever has to marshal/unmarshal a 
> byte[] wrapper - so the AS has full control over the marshalling process.
>
> I would recommend that the 2LC do something similar, and include a 
> mechanism for providing a MarshallingConfiguration per persistence unit.

 Possibly…

 --
 Galder Zamarreño
 Sr. Software Engineer
 Infinispan, JBoss Cache

>>>
>>>
>>> --
>>> - DML
>>> ___
>>> infinispan-dev mailing list
>>> infinispan-...@lists.jboss.org
>>> https://lists.jboss.org/mailman/listinfo/infinispan-dev
>>
>> --
>> Galder Zamarreño
>> Sr. Software Engineer
>> Infinispan, JBoss Cache
>>
>>
>> ___
>> infinispan-dev mailing list
>> infinispan-...@lists.jboss.org
>> https://lists.jboss.org/mailman/listinfo/infinispan-dev
>
> --
> Galder Zamarreño
> Sr. Software Engineer
> Infinispan, JBoss Cache
>
>
> ___
> infinispan-dev mailing list
> infinispan-...@lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/infinispan-dev

___
hibernate-dev mailing list
hibernate-dev@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/hibernate-dev


Re: [hibernate-dev] [infinispan-dev] [jboss-as7-dev] AS7-4007 missing Infinispan dependency for clustered JPA second level cache

2012-03-06 Thread David M. Lloyd
On 03/06/2012 01:27 PM, Galder Zamarreño wrote:
> (***) I still don't fully understand how web apps don't have the same issue 
> as 2LC of not seeing Infinispan classes (Reminder: we're not talking about 
> the contents of the cache, but about the Infinispan classes themselves).

It's possible that someone saw the exception and said to themselves, 
"oh... well I'll just add Infinispan to all web apps", and then the 
patch slipped by the code review process.  Other problems will continue 
to lurk beneath the surface though.

-- 
- DML
___
hibernate-dev mailing list
hibernate-dev@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/hibernate-dev


Re: [hibernate-dev] [infinispan-dev] [jboss-as7-dev] AS7-4007 missing Infinispan dependency for clustered JPA second level cache

2012-03-06 Thread Paul Ferraro
- Original Message -
> From: "Galder Zamarreño" 
> To: "infinispan -Dev List" 
> Cc: hibernate-dev@lists.jboss.org, "jboss-as7-...@lists.jboss.org 
> Development" 
> Sent: Tuesday, March 6, 2012 2:27:13 PM
> Subject: Re: [infinispan-dev] [jboss-as7-dev] AS7-4007 missing Infinispan 
> dependency for clustered JPA second level
> cache
> 
> So, to summarise all of this. What I suggest is this:
> 
> - Short term:
> The "quick fix" I suggest in
> http://lists.jboss.org/pipermail/infinispan-dev/2012-March/010317.html
> 
> - Medium term:
> Have a way to pass in marshalling configurations per cache manager
> and per-cache (or an abstraction of it), which allows the right
> class resolver to be passed in. (***)
> https://issues.jboss.org/browse/ISPN-1367
> 
> - Long term:
> https://issues.jboss.org/browse/ISPN-1413
> 
> (***) I still don't fully understand how web apps don't have the same
> issue as 2LC of not seeing Infinispan classes (Reminder: we're not
> talking about the contents of the cache, but about the Infinispan
> classes themselves).

To reiterate: in the case of web sessions, the cache instance for an 
application is associated with the classloader of the 
org.jboss.as.clustering.web.infinispan module.  The AS clustering code shields 
Infinispan from direct interaction with application objects by storing sessions 
as MarshalledValues which are eagerly marshalled into byte[] and lazily 
unmarshalled using an application-specific MarshallingConfiguration.
This has been the case since AS5, if not earlier (albeit using JBoss 
Serialization + JBoss Cache + TCCL manipulation).

> On Mar 6, 2012, at 8:19 PM, Galder Zamarreño wrote:
> 
> > 
> > On Mar 6, 2012, at 8:06 PM, David M. Lloyd wrote:
> > 
> >> On 03/06/2012 01:02 PM, Galder Zamarreño wrote:
> >>> On Mar 6, 2012, at 6:31 PM, Paul Ferraro wrote:
> >>> 
>  To work around this, we typically store MarshalledValues in the
>  cache - which are marshalled/unmarshalled using a marshalling
>  configuration specific to the application (e.g. via a
>  ModularClassResolver using the ModuleLoader of the deployment
>  unit).
>  https://github.com/jbossas/jboss-as/blob/master/clustering/api/src/main/java/org/jboss/as/clustering/MarshalledValue.java
>  https://github.com/jbossas/jboss-as/blob/master/clustering/api/src/main/java/org/jboss/as/clustering/SimpleMarshalledValue.java
>  https://github.com/jbossas/jboss-as/blob/master/clustering/api/src/main/java/org/jboss/as/clustering/HashableMarshalledValue.java
> >>> 
> >>> Isn't a class resolver and a class loader, functionality wise,
> >>> doing the same thing? I wonder if a custom classloader could not
> >>> be built that delegates to a ModularClassResolver...
> >> 
> >> No, not really.  A class loader loads a class, given a name.  But
> >> a
> >> class resolver loads a class given a name *and* stream
> >> information.  The
> >> modular class resolver reads the stream information to know which
> >> class
> >> loader houses the class in question.  This is critically important
> >> because it's possible (common even) for more than one class to
> >> exist in
> >> an AS instance with the same name.  And there is no single class
> >> loader
> >> which has visibility to all classes which could potentially be
> >> stored in
> >> a cache.
> >> 
> >> Yes, accepting a class loader to use is a powerful feature.
> >>  However it
> >> *should* just be a convenience abstraction over a more fundamental
> >> feature which allows a class resolver to be set.
> > 
> > Thanks for the clarification, makes sense.
> > 
> > So, if I understand this correctly, Infinispan should really be
> > enhanced to accept global and per-cache class resolvers, or more
> > globally, as paul suggested below, marshalling configuration
> > instances (or abstractions of them).
> > 
> > I think https://issues.jboss.org/browse/ISPN-1367 should be
> > reporpoused to do this.
> > 
> >> 
>  So, essentially Infinispan itself only ever has to
>  marshal/unmarshal a byte[] wrapper - so the AS has full control
>  over the marshalling process.
>  
>  I would recommend that the 2LC do something similar, and include
>  a mechanism for providing a MarshallingConfiguration per
>  persistence unit.
> >>> 
> >>> Possibly…
> >>> 
> >>> --
> >>> Galder Zamarreño
> >>> Sr. Software Engineer
> >>> Infinispan, JBoss Cache
> >>> 
> >> 
> >> 
> >> --
> >> - DML
> >> ___
> >> infinispan-dev mailing list
> >> infinispan-...@lists.jboss.org
> >> https://lists.jboss.org/mailman/listinfo/infinispan-dev
> > 
> > --
> > Galder Zamarreño
> > Sr. Software Engineer
> > Infinispan, JBoss Cache
> > 
> > 
> > ___
> > infinispan-dev mailing list
> > infinispan-...@lists.jboss.org
> > https://lists.jboss.org/mailman/listinfo/infinispan-dev
> 
> --
> Galder Zamarreño
> Sr. Software Engineer
> Infinispan, JBoss Cache
> 
> 
> _

Re: [hibernate-dev] [infinispan-dev] [jboss-as7-dev] AS7-4007 missing Infinispan dependency for clustered JPA second level cache

2012-03-06 Thread Paul Ferraro
- Original Message -
> From: "Scott Marlow" 
> To: "infinispan -Dev List" 
> Cc: hibernate-dev@lists.jboss.org, "jboss-as7-...@lists.jboss.org 
> Development" ,
> "Galder Zamarreño" 
> Sent: Tuesday, March 6, 2012 2:45:03 PM
> Subject: Re: [infinispan-dev] [jboss-as7-dev] AS7-4007 missing Infinispan 
> dependency for clustered JPA second level
> cache
> 
> On 03/06/2012 02:27 PM, Galder Zamarreño wrote:
> > So, to summarise all of this. What I suggest is this:
> >
> > - Short term:
> > The "quick fix" I suggest in
> > http://lists.jboss.org/pipermail/infinispan-dev/2012-March/010317.html
> 
> Do we want to try this (requires a new build of Infinispan I think)?
>  Or
> should applications workaround the issue until we can reach the
> medium/long term?
> 
> >
> > - Medium term:
> > Have a way to pass in marshalling configurations per cache manager
> > and per-cache (or an abstraction of it), which allows the right
> > class resolver to be passed in. (***)
> > https://issues.jboss.org/browse/ISPN-1367
> 
> ISPN-1367 is targeted to Infinispan 5.2, any idea of the target
> release
> date for that?  I'm curious as to which AS release it might align
> with.
> 
> >
> > - Long term:
> > https://issues.jboss.org/browse/ISPN-1413
> >
> > (***) I still don't fully understand how web apps don't have the
> > same issue as 2LC of not seeing Infinispan classes (Reminder:
> > we're not talking about the contents of the cache, but about the
> > Infinispan classes themselves).
> 
> https://github.com/jbossas/jboss-as/blob/master/web/src/main/java/org/jboss/as/web/deployment/JBossContextConfig.java
> appears to be wired to use Paul's ClassLoaderAwareClassResolver.

ClassLoaderAwareClassResolver is just a hack to workaround AS7-2496 (i.e. Weld 
still does TCCL switching).
The bottom line is, we still rely on ModularClassResolver to marshal/unmarshal 
session objects.

> >
> > On Mar 6, 2012, at 8:19 PM, Galder Zamarreño wrote:
> >
> >>
> >> On Mar 6, 2012, at 8:06 PM, David M. Lloyd wrote:
> >>
> >>> On 03/06/2012 01:02 PM, Galder Zamarreño wrote:
>  On Mar 6, 2012, at 6:31 PM, Paul Ferraro wrote:
>  
> > To work around this, we typically store MarshalledValues in the
> > cache - which are marshalled/unmarshalled using a marshalling
> > configuration specific to the application (e.g. via a
> > ModularClassResolver using the ModuleLoader of the deployment
> > unit).
> > https://github.com/jbossas/jboss-as/blob/master/clustering/api/src/main/java/org/jboss/as/clustering/MarshalledValue.java
> > https://github.com/jbossas/jboss-as/blob/master/clustering/api/src/main/java/org/jboss/as/clustering/SimpleMarshalledValue.java
> > https://github.com/jbossas/jboss-as/blob/master/clustering/api/src/main/java/org/jboss/as/clustering/HashableMarshalledValue.java
> 
>  Isn't a class resolver and a class loader, functionality wise,
>  doing the same thing? I wonder if a custom classloader could
>  not be built that delegates to a ModularClassResolver...
> >>>
> >>> No, not really.  A class loader loads a class, given a name.  But
> >>> a
> >>> class resolver loads a class given a name *and* stream
> >>> information.  The
> >>> modular class resolver reads the stream information to know which
> >>> class
> >>> loader houses the class in question.  This is critically
> >>> important
> >>> because it's possible (common even) for more than one class to
> >>> exist in
> >>> an AS instance with the same name.  And there is no single class
> >>> loader
> >>> which has visibility to all classes which could potentially be
> >>> stored in
> >>> a cache.
> >>>
> >>> Yes, accepting a class loader to use is a powerful feature.
> >>>  However it
> >>> *should* just be a convenience abstraction over a more
> >>> fundamental
> >>> feature which allows a class resolver to be set.
> >>
> >> Thanks for the clarification, makes sense.
> >>
> >> So, if I understand this correctly, Infinispan should really be
> >> enhanced to accept global and per-cache class resolvers, or more
> >> globally, as paul suggested below, marshalling configuration
> >> instances (or abstractions of them).
> >>
> >> I think https://issues.jboss.org/browse/ISPN-1367 should be
> >> reporpoused to do this.
> >>
> >>>
> > So, essentially Infinispan itself only ever has to
> > marshal/unmarshal a byte[] wrapper - so the AS has full
> > control over the marshalling process.
> >
> > I would recommend that the 2LC do something similar, and
> > include a mechanism for providing a MarshallingConfiguration
> > per persistence unit.
> 
>  Possibly…
> 
>  --
>  Galder Zamarreño
>  Sr. Software Engineer
>  Infinispan, JBoss Cache
> 
> >>>
> >>>
> >>> --
> >>> - DML
> >>> ___
> >>> infinispan-dev mailing list
> >>> infinispan-...@lists.jboss.org
> >>> https://lists.jboss.org/mailman/listinfo/infinispan-dev
> >>
> >> --
> >> Galder Zama

Re: [hibernate-dev] [infinispan-dev] [jboss-as7-dev] AS7-4007 missing Infinispan dependency for clustered JPA second level cache

2012-03-06 Thread Paul Ferraro
- Original Message -
> From: "David M. Lloyd" 
> To: "infinispan -Dev List" 
> Cc: hibernate-dev@lists.jboss.org, "jboss-as7-...@lists.jboss.org 
> Development" ,
> "Galder Zamarreño" 
> Sent: Tuesday, March 6, 2012 2:55:18 PM
> Subject: Re: [infinispan-dev] [jboss-as7-dev] AS7-4007 missing Infinispan 
> dependency for clustered JPA second level
> cache
> 
> On 03/06/2012 01:27 PM, Galder Zamarreño wrote:
> > (***) I still don't fully understand how web apps don't have the
> > same issue as 2LC of not seeing Infinispan classes (Reminder:
> > we're not talking about the contents of the cache, but about the
> > Infinispan classes themselves).
> 
> It's possible that someone saw the exception and said to themselves,
> "oh... well I'll just add Infinispan to all web apps", and then the
> patch slipped by the code review process.  Other problems will
> continue
> to lurk beneath the surface though.

No - web applications don't have this problem because web session clustering 
uses ModularClassResolver during marshalling/unmarshalling of sessions.

___
hibernate-dev mailing list
hibernate-dev@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/hibernate-dev

Re: [hibernate-dev] [infinispan-dev] [jboss-as7-dev] AS7-4007 missing Infinispan dependency for clustered JPA second level cache

2012-03-07 Thread Galder Zamarreño

On Mar 6, 2012, at 10:01 PM, Paul Ferraro wrote:

> - Original Message -
>> 
>> 
>> (***) I still don't fully understand how web apps don't have the same
>> issue as 2LC of not seeing Infinispan classes (Reminder: we're not
>> talking about the contents of the cache, but about the Infinispan
>> classes themselves).
> 
> To reiterate: in the case of web sessions, the cache instance for an 
> application is associated with the classloader of the 
> org.jboss.as.clustering.web.infinispan module.  The AS clustering code 
> shields Infinispan from direct interaction with application objects by 
> storing sessions as MarshalledValues which are eagerly marshalled into byte[] 
> and lazily unmarshalled using an application-specific 
> MarshallingConfiguration.
> This has been the case since AS5, if not earlier (albeit using JBoss 
> Serialization + JBoss Cache + TCCL manipulation).

Paul, that explains how you can deserialize the *contents of the cache*.

My question is different: I'm talking about how, the web app, can see 
*Infinispan classes*.

In Scott's issue, the web app uses Hibernate but during unmarshalling but it 
cannot locate Infinispan classes:

07:27:32,225 SEVERE [org.jgroups.blocks.RequestCorrelator] (OOB-20,null) failed 
unmarshalling buffer into return value: java.lang.ClassNotFoundException: 
org.infinispan.CacheException from [Module "deployment.stateful.war:main" from 
Service Module Loader]

I'm trying to understand how come it works for session repl, but it doesn't for 
2LC. It seems to me that you should be having the same problem if you cannot 
plug Infinispan with the ModuleClassResolver.

Let's talk on IRC...
--
Galder Zamarreño
Sr. Software Engineer
Infinispan, JBoss Cache


___
hibernate-dev mailing list
hibernate-dev@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/hibernate-dev


Re: [hibernate-dev] [infinispan-dev] [jboss-as7-dev] AS7-4007 missing Infinispan dependency for clustered JPA second level cache

2012-03-14 Thread Manik Surtani

On 6 Mar 2012, at 14:45, Scott Marlow wrote:

>> 
>> 
>> - Medium term:
>> Have a way to pass in marshalling configurations per cache manager and 
>> per-cache (or an abstraction of it), which allows the right class resolver 
>> to be passed in. (***)
>> https://issues.jboss.org/browse/ISPN-1367
> 
> ISPN-1367 is targeted to Infinispan 5.2, any idea of the target release 
> date for that?  I'm curious as to which AS release it might align with.

Definitely post EAP 6.

--
Manik Surtani
ma...@jboss.org
twitter.com/maniksurtani

Lead, Infinispan
http://www.infinispan.org



___
hibernate-dev mailing list
hibernate-dev@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/hibernate-dev


Re: [hibernate-dev] [infinispan-dev] [jboss-as7-dev] AS7-4007 missing Infinispan dependency for clustered JPA second level cache

2012-03-14 Thread Scott Marlow
On 03/14/2012 02:13 PM, Manik Surtani wrote:
>
> On 6 Mar 2012, at 14:45, Scott Marlow wrote:
>
>>>
>>>
>>> - Medium term:
>>> Have a way to pass in marshalling configurations per cache manager and 
>>> per-cache (or an abstraction of it), which allows the right class resolver 
>>> to be passed in. (***)
>>> https://issues.jboss.org/browse/ISPN-1367
>>
>> ISPN-1367 is targeted to Infinispan 5.2, any idea of the target release
>> date for that?  I'm curious as to which AS release it might align with.
>
> Definitely post EAP 6.

The ISPN-1367 jira changed a bit since I asked this question.  A few 
days ago, Galder said that he was working on addressing ISPN-1367 for AS 
7.1.2 (so we can specify the AS7 ModularClassResolver as a global 
configuration setting passed into Infinispan).

I probably asked the wrong question above (I don't really want to bring 
5.2 into As 7.1.2).  Can we fix ISPN-1367 in a 5.1.x.FINAL build, that 
could be brought into AS 7.1.2?

>
> --
> Manik Surtani
> ma...@jboss.org
> twitter.com/maniksurtani
>
> Lead, Infinispan
> http://www.infinispan.org
>
>
>
> ___
> hibernate-dev mailing list
> hibernate-dev@lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/hibernate-dev

___
hibernate-dev mailing list
hibernate-dev@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/hibernate-dev


Re: [hibernate-dev] [infinispan-dev] [jboss-as7-dev] AS7-4007 missing Infinispan dependency for clustered JPA second level cache

2012-03-16 Thread Galder Zamarreño

On Mar 14, 2012, at 7:52 PM, Scott Marlow wrote:

> On 03/14/2012 02:13 PM, Manik Surtani wrote:
>> 
>> On 6 Mar 2012, at 14:45, Scott Marlow wrote:
>> 
 
 
 - Medium term:
 Have a way to pass in marshalling configurations per cache manager and 
 per-cache (or an abstraction of it), which allows the right class resolver 
 to be passed in. (***)
 https://issues.jboss.org/browse/ISPN-1367
>>> 
>>> ISPN-1367 is targeted to Infinispan 5.2, any idea of the target release
>>> date for that?  I'm curious as to which AS release it might align with.
>> 
>> Definitely post EAP 6.
> 
> The ISPN-1367 jira changed a bit since I asked this question.  A few 
> days ago, Galder said that he was working on addressing ISPN-1367 for AS 
> 7.1.2 (so we can specify the AS7 ModularClassResolver as a global 
> configuration setting passed into Infinispan).
> 
> I probably asked the wrong question above (I don't really want to bring 
> 5.2 into As 7.1.2).  Can we fix ISPN-1367 in a 5.1.x.FINAL build, that 
> could be brought into AS 7.1.2?

yes

> 
>> 
>> --
>> Manik Surtani
>> ma...@jboss.org
>> twitter.com/maniksurtani
>> 
>> Lead, Infinispan
>> http://www.infinispan.org
>> 
>> 
>> 
>> ___
>> hibernate-dev mailing list
>> hibernate-dev@lists.jboss.org
>> https://lists.jboss.org/mailman/listinfo/hibernate-dev
> 
> ___
> infinispan-dev mailing list
> infinispan-...@lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/infinispan-dev

--
Galder Zamarreño
Sr. Software Engineer
Infinispan, JBoss Cache


___
hibernate-dev mailing list
hibernate-dev@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/hibernate-dev