You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@geronimo.apache.org by "Simon Godik (JIRA)" <ji...@apache.org> on 2010/04/16 08:37:26 UTC

[jira] Updated: (GERONIMO-5256) in special cases wadi clustering thread fails to load web application classes

     [ https://issues.apache.org/jira/browse/GERONIMO-5256?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Simon Godik updated GERONIMO-5256:
----------------------------------

    Attachment: geronimo-wadi-cl-bug.logs.tar.gz
                geronimo-wadi-cl-bug-war.tar.gz

test application and logs attached

> in special cases wadi clustering thread fails to load web application classes
> -----------------------------------------------------------------------------
>
>                 Key: GERONIMO-5256
>                 URL: https://issues.apache.org/jira/browse/GERONIMO-5256
>             Project: Geronimo
>          Issue Type: Bug
>      Security Level: public(Regular issues) 
>    Affects Versions: 2.1.4
>         Environment: redhat 5.4, suse 11.2
>            Reporter: Simon Godik
>         Attachments: geronimo-wadi-cl-bug-war.tar.gz, geronimo-wadi-cl-bug.logs.tar.gz
>
>
> If object placed in a http session implements java.io.Externalizable and is loading web-app specific classes from the readExternal() method with the thread context classloader (which is org.apache.geronimo.configs/wadi-clustering/2.1.4/car classloader) class loading fails. This happens on the receiving side when session is replicated from the owning cluster member to the peer cluster member over wadi transport and is consumed by the wadi thread.
> This came about because some web frameworks load classes from the readExternal() method with TC classloader.
> I have a fix for this but it is not generic, so I'm not submitting it.
> Not sure how to attach files, so code and logs below:
> Code and log below.
> 	public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
> 		this.state = (String) in.readObject();
> 		
> 		try {
> 			Class<?> clazz = Thread.currentThread().getContextClassLoader().loadClass("org.bpma.cluster.VerySpecial");
> 			this.verySpecial = (VerySpecial) clazz.newInstance();
> 			this.verySpecial.setHello("hello, very special!!!");
> 			
> 			System.out.println("VERY-SPECIAL LOADED FROM THE TC-CL");
> 			System.out.flush();
> 		} catch (InstantiationException e) {
> 			e.printStackTrace();
> 		} catch (IllegalAccessException e) {
> 			e.printStackTrace();
> 		}
> 	}
> Caused by: org.codehaus.wadi.core.WADIRuntimeException: java.lang.ClassNotFoundException: org.bpma.cluster.VerySpecial in classloader org.apache.geronimo.configs/wadi-clustering/2.1.4/car
>         at org.codehaus.wadi.replication.manager.basic.SessionStateHandler.resto
> reFromFullState(SessionStateHandler.java:78)
>         at org.codehaus.wadi.replication.storage.memory.SyncMemoryReplicaStorage
> .mergeCreate(SyncMemoryReplicaStorage.java:83)
>         ... 20 more
> Caused by: java.lang.ClassNotFoundException: org.bpma.cluster.VerySpecial in cla
> ssloader org.apache.geronimo.configs/wadi-clustering/2.1.4/car
>         at org.apache.geronimo.kernel.config.MultiParentClassLoader.loadOptimize
> dClass(MultiParentClassLoader.java:438)
>         at org.apache.geronimo.kernel.config.MultiParentClassLoader.loadClass(Mu
> ltiParentClassLoader.java:280)
>         at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
>         at org.bpma.cluster.TcLoading.readExternal(TcLoading.java:35)
>         at java.io.ObjectInputStream.readExternalData(ObjectInputStream.java:179
> 2)
>         at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1
> 751)
>         at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1329)
>         at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:19
> 47)
>         at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1871)
>         at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1
> 753)
>         at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1329)
>         at java.io.ObjectInputStream.readObject(ObjectInputStream.java:351)
>         at org.codehaus.wadi.core.session.DistributableAttributesMemento.readExt
> ernal(DistributableAttributesMemento.java:36)
>         at org.codehaus.wadi.core.session.DistributableSessionMemento.readExtern
> al(DistributableSessionMemento.java:31)
>         at org.codehaus.wadi.core.eviction.SimpleEvictable.readExternal(SimpleEv
> ictable.java:91)
>         at org.codehaus.wadi.core.util.Utils.setContent(Utils.java:78)
>         at org.codehaus.wadi.replication.manager.basic.SessionStateHandler.resto
> reFromFullState(SessionStateHandler.java:76)
>         ... 21 more

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira