protected void handleRequest(final PortletRequest request, final PortletResponse response) throws PortletException, IOException {
ClassLoader contextClassLoader = Thread.currentThread().getContextClassLoader();
Thread.currentThread().setContextClassLoader(getClass().getClassLoader());
CURRENT_REQUEST.set(request);
try {
ProcessToolRegistry registry = (ProcessToolRegistry) getPortletConfig().getPortletContext()
.getAttribute(ProcessToolRegistry.class.getName());
if (registry == null) {
if (getApplication() != null) {
getApplication().getMainWindow().addComponent(new Label(
"Aperte Workflow is being installed. Please refresh your page."
));
}
Logger.getLogger(ProcessToolVaadinApplicationPortlet2.class.getSimpleName()).severe(ProcessToolRegistry.class.getName() + " not found in servlet context");
//throw new ProcessToolException(ProcessToolRegistry.class.getName() + " not found in servlet context");
return;
}
registry.withProcessToolContext(new ProcessToolContextCallback() {
@Override
public void withContext(ProcessToolContext ctx) {
ProcessToolContext.Util.setThreadProcessToolContext(ctx);
try {
try {