01: /*
02: * Copyright 2004 The Apache Software Foundation.
03: *
04: * Licensed under the Apache License, Version 2.0 (the "License");
05: * you may not use this file except in compliance with the License.
06: * You may obtain a copy of the License at
07: *
08: * http://www.apache.org/licenses/LICENSE-2.0
09: *
10: * Unless required by applicable law or agreed to in writing, software
11: * distributed under the License is distributed on an "AS IS" BASIS,
12: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13: * See the License for the specific language governing permissions and
14: * limitations under the License.
15: */
16: package org.apache.myfaces.shared_impl.util;
17:
18: import java.io.IOException;
19: import java.io.InputStream;
20: import java.io.ObjectInputStream;
21: import java.io.ObjectStreamClass;
22:
23: /**
24: * Tried to deploy v0.4.2 on JBoss 3.2.1 and had a classloading problem again.
25: * The problem seemed to be with JspInfo, line 98. We are using an
26: * ObjectInputStream Class, which then cannot find the classes to deserialize
27: * the input stream. The solution appears to be to subclass ObjectInputStream
28: * (eg. CustomInputStream), and specify a different class-loading mechanism.
29: *
30: * @author Robert Gothan <robert@funkyjazz.net> (latest modification by $Author: schof $)
31: * @version $Revision: 382015 $ $Date: 2006-03-01 08:47:11 -0500 (Wed, 01 Mar 2006) $
32: */
33: public class MyFacesObjectInputStream extends ObjectInputStream {
34: public MyFacesObjectInputStream(InputStream in) throws IOException {
35: super (in);
36: }
37:
38: protected Class resolveClass(ObjectStreamClass desc)
39: throws ClassNotFoundException, IOException {
40: try {
41: return ClassUtils.classForName(desc.getName());
42: } catch (ClassNotFoundException e) {
43: return super.resolveClass(desc);
44: }
45: }
46: }
|