The origin of the error? This little piece of code:
public synchronized Object deepCopy(Object oldObj) throws Exception {I will not comment the weird "catch e throw e" fragment, but this was the most expensive way to follow the Prototype pattern (deep copy variant) I ever seen. You don't need to be an extreme Java programmer to notice this code will fail on the first non-serializable class found by oos.writeObject. Now, guess what was the exception I got?
ObjectOutputStream oos = null;
ObjectInputStream ois = null;
try {
ByteArrayOutputStream bos =
new ByteArrayOutputStream(); // A
oos = new ObjectOutputStream(bos); // B
// serialize and pass the object
oos.writeObject(oldObj); // C
oos.flush(); // D
ByteArrayInputStream bin =
new ByteArrayInputStream(bos.toByteArray()); // E
ois = new ObjectInputStream(bin); // F
// return the new object
return ois.readObject(); // G
} catch (Exception e) {
throw e;
} finally {
if (oos != null) oos.close();
if (ois != null) ois.close();
}
}
java.io.NotSerializableException: org.apache.log4j.LevelAfter digging into the code, I discovered that GS team knows the use of transient keyword, but didn't used it on BasePortletComponent.java, line 42:
protected Log log = LogFactory.getLog(PortletPageFactory.class);How this works on Tomcat is a mistery to me. Changing it to a final static attribute and adding some dependencies of dependencies (Jackrabbit needs Lucene and yet another logging implementation - SLF4J), made it work, but not as expected.
Result: an installation page with some really ugly URL rewrite techniques.
<link ... href="/tmp54563GridSphere-exp.war/...css" ...>The second one is a side-effect of using my own build script. The first one (along with cool design patterns) gives GridSphere an one-way ticket to my attic.
<img src="/@GRIDSPHERE_DEPLOY@/...png" ...>
No comments:
Post a Comment