factory = Marshalling.getMarshallerFactory("river", Marshalling.class.getClassLoader());
if (factory == null)
throw new IllegalStateException(
"River marshaller factory not found. Verify that the JBoss Marshalling River jar archive is in the classpath.");
configuration = new MarshallingConfiguration();
configuration.setCreator(new SunReflectiveCreator());
configuration.setExceptionListener(new DebuggingExceptionListener());
// ContextClassResolver provides same functionality as MarshalledValueInputStream
configuration.setClassResolver(new DefaultContextClassResolver(appClassLoader));
configuration.setClassExternalizerFactory(new SerializeWithExtFactory());