[infinispan-dev] Failure looking up the river marshaller under AS 7 environment

David M. Lloyd david.lloyd at redhat.com
Tue May 31 23:56:59 EDT 2011


This issue is caused by users who put a writeObject() or readObject() 
method on their class, and never write/read the class' serializable 
fields.  This is a violation of spec [2][3] which causes undefined 
behavior in some cases and thus it has always been forbidden with JBMAR.

However, it has been pointed out that a lot of classes actually rely on 
the specific behavior of the Sun JDK (which is to read/write fields in 
the default way and hope for the best), hence I have a JIRA issue [1] 
which is not yet resolved.

Unfortunately I don't currently have time to devote to this and won't 
for a while.  If anyone is sufficiently annoyed by this that they want 
to volunteer to fix it, I can walk someone through the code and test suite.

[1] https://issues.jboss.org/browse/JBMAR-120
[2] 
http://download.oracle.com/javase/6/docs/platform/serialization/spec/output.html#861
[3] 
http://download.oracle.com/javase/6/docs/platform/serialization/spec/input.html#2971

On 05/31/2011 10:39 PM, "이희승 (Trustin Lee)" wrote:
> With Marshalling.getProvidedMarshallerFactory(), I was able to look up
> the RiverMarshallerFactory.  However, another exception is raised while
> exchanging the topology view (java.io.NotActiveException: Fields were
> never written):
>
>       http://pastebin.com/5zVj2FwG
>
> It seems like it has a problem with marshalling an ImmortalCacheEntry?
>
> On 06/01/2011 11:38 AM, "이희승 (Trustin Lee)" wrote:
>> Using Marshalling.getProvidedMarshallerFactory() sounds like a better
>> solution. Let me create a JIRA issue and send a pull request soon.
>>
>> On 06/01/2011 01:47 AM, David M. Lloyd wrote:
>>> Easiest solution is:
>>>
>>> Marshalling.getProvidedMarshallerFactory("river");
>>>
>>> This will always use the JBMAR class loader. Otherwise you would have
>>> to make sure that the module from which you load the "river" protocol
>>> imports the river module like this:
>>> <dependencies>
>>> ...
>>> <module name="org.jboss.marshalling.river" services="import"/>
>>> ...
>>> </dependencies>
>>>
>>> ... and then use your own class loader.
>>>
>>> On 05/31/2011 10:13 AM, Galder Zamarreño wrote:
>>>> The marshaller is a global component, so it'd have to be at the
>>>> GlobalConfiguration.
>>>>
>>>> Let's bounce some ideas tomorrow on IRC.
>>>>
>>>> On May 31, 2011, at 5:07 PM, 이희승 (Trustin Lee) wrote:
>>>>
>>>>> The problem is that the marshaller lookup code exists in Infinispan
>>>>> unlike other subsystems. We need to make it configurable. Where would
>>>>> be the best place to expose the property in Infinispan? For
>>>>> EmbeddedCachaManager, it is so simple because we have Configuration and
>>>>> GlobalConfiguration, but I'm not sure about the others.
>>>>>
>>>>> On 05/31/2011 11:38 PM, Galder Zamarreño wrote:
>>>>>> In fact, a quick grep on AS7 shows:
>>>>>>
>>>>>> ./host-controller/src/main/java/org/jboss/as/host/controller/ManagedServer.java:
>>>>>> MARSHALLER_FACTORY = Marshalling.getMarshallerFactory("river",
>>>>>> Module.getModuleFromCallerModuleLoader(ModuleIdentifier.fromString("org.jboss.marshalling.river")).getClassLoader());
>>>>>>
>>>>>> ./protocol/src/main/java/org/jboss/as/protocol/ProtocolUtils.java:
>>>>>> MARSHALLER_FACTORY = Marshalling.getMarshallerFactory("river",
>>>>>> ProtocolUtils.class.getClassLoader());
>>>>>> ./server/src/main/java/org/jboss/as/server/DomainServerMain.java:
>>>>>> final MarshallerFactory factory =
>>>>>> Marshalling.getMarshallerFactory("river",
>>>>>> DomainServerMain.class.getClassLoader());
>>>>>>
>>>>>> We might need different mechanisms depending on the env.
>>>>>>
>>>>>> On May 31, 2011, at 11:28 AM, Galder Zamarreño wrote:
>>>>>>
>>>>>>> They're in diff jars and most likely in different JBoss Modules.
>>>>>>>
>>>>>>> Trustin, AS7 uses JBoss Marshalling, so maybe have a look in their
>>>>>>> code to see how they instantiate the marshaller factory - that
>>>>>>> might give you the clues here :)
>>>>>>>
>>>>>>> Cheers,
>>>>>>>
>>>>>>> On May 31, 2011, at 10:20 AM, Dan Berindei wrote:
>>>>>>>
>>>>>>>> We don't use the TCCL to load the MarshallerFactory:
>>>>>>>>
>>>>>>>> factory = Marshalling.getMarshallerFactory("river",
>>>>>>>> Marshalling.class.getClassLoader());
>>>>>>>>
>>>>>>>> Maybe the Marshalling class and the RiverMarshallerFactory
>>>>>>>> classes are
>>>>>>>> in different modules?
>>>>>>>>
>>>>>>>> Dan
>>>>>>>>
>>>>>>>>
>>>>>>>> On Tue, May 31, 2011 at 10:14 AM, "이희승 (Trustin
>>>>>>>> Lee)"<trustin at gmail.com>  wrote:
>>>>>>>>> Hi folks,
>>>>>>>>>
>>>>>>>>> I'm trying to run Infinispan under AS 7 (i.e. JBoss Modules). I
>>>>>>>>> succeeded to run an EmbeddedCacheManager, HotRodServer, and
>>>>>>>>> MemcachedServer. However, it fails when a new node joins the
>>>>>>>>> cluser:
>>>>>>>>>
>>>>>>>>> http://pastebin.com/pGfxSWJP
>>>>>>>>>
>>>>>>>>> The root cause of the failure is that GenericJBossMarshaller
>>>>>>>>> fails to
>>>>>>>>> find the RiverMarshallerFactory. So, I set the TCCL, but it
>>>>>>>>> didn't help
>>>>>>>>> at all. Even setting the TCCL to
>>>>>>>>> RiverMarshallerFactory.class.getClassLoader() doesn't seem to
>>>>>>>>> help. Any
>>>>>>>>> clues?
>>>>>>>>>
>>>>>>>>> Cheers
>>>>>>>>>
>>>>>>>>> --
>>>>>>>>> Trustin Lee, http://gleamynode.net/
>>>>>>>>> _______________________________________________
>>>>>>>>> infinispan-dev mailing list
>>>>>>>>> infinispan-dev at lists.jboss.org
>>>>>>>>> https://lists.jboss.org/mailman/listinfo/infinispan-dev
>>>>>>>>>
>>>>>>>>
>>>>>>>> _______________________________________________
>>>>>>>> infinispan-dev mailing list
>>>>>>>> infinispan-dev at 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-dev at 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-dev at lists.jboss.org
>>>>>> https://lists.jboss.org/mailman/listinfo/infinispan-dev
>>>>>
>>>>>
>>>>> --
>>>>> Trustin Lee, http://gleamynode.net/
>>>>> _______________________________________________
>>>>> infinispan-dev mailing list
>>>>> infinispan-dev at 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-dev at lists.jboss.org
>>>> https://lists.jboss.org/mailman/listinfo/infinispan-dev
>>>
>>>
>>
>>
>
>


-- 
- DML


More information about the infinispan-dev mailing list