e.printStackTrace();
System.exit(1);
throw new IllegalStateException(); // not reached
}
final MarshallerFactory factory;
try {
factory = Marshalling.getMarshallerFactory("river", Module.getModuleFromDefaultLoader(ModuleIdentifier.fromString("org.jboss.marshalling.river")).getClassLoader());
} catch (ModuleLoadException e) {
throw new IllegalStateException("Failed to start server", e);
}
final Unmarshaller unmarshaller;
final ByteInput byteInput;
try {
final MarshallingConfiguration configuration = new MarshallingConfiguration();
configuration.setVersion(2);
configuration.setClassTable(ModularClassTable.getInstance());
unmarshaller = factory.createUnmarshaller(configuration);
byteInput = Marshalling.createByteInput(initialInput);
unmarshaller.start(byteInput);
final ServerTask task = unmarshaller.readObject(ServerTask.class);
unmarshaller.finish();
task.run(Arrays.<ServiceActivator>asList(new ServiceActivator() {