classWriter.addLine("com.ponysdk.core.service.PonyServiceRegistry.registerPonyService(context.getBean(" + GeneratorHelper.getServiceFullClassName(domain) + ".class));");
classWriter.unindentBlock();
classWriter.addLine("}catch(org.springframework.beans.factory.NoSuchBeanDefinitionException e){");
classWriter.indentBlock();
classWriter.addLine("log.warn(\"No service defined for " + domain.getName() + "\");");
classWriter.unindentBlock();
classWriter.addLine("}");
classWriter.addLine("catch(Exception e){");
classWriter.indentBlock();
classWriter.addLine("String errorMessage = \"Error when starting service " + domain.getName() + "\";");
classWriter.addLine("log.error(errorMessage, e);");