06-17-2015 02:00 AM
06-17-2015 03:24 AM
06-17-2015 07:17 AM
public class GetExtendedPersonsServiceGet extends AbstractWebScript {
private ExtendedPersonService extendedPersonService;
@Override
public void execute(WebScriptRequest req, WebScriptResponse res) throws IOException {
Map<String, List<JsonStructure>> extendedPersons = extendedPersonService.getExtendedPersons();
res.setContentType("application/json");
res.getWriter().write(new Gson().toJson(extendedPersons));
}
public ExtendedPersonService getExtendedPersonService() {
return extendedPersonService;
}
public void setExtendedPersonService(ExtendedPersonService extendedPersonService) {
this.extendedPersonService = extendedPersonService;
}
}
try{
Map<String, List<JsonStructure>> extendedPersons = extendedPersonService.getExtendedPersons();
res.setContentType("application/json");
res.getWriter().write(new Gson().toJson(extendedPersons));
}catch(Exception ex){
res.getWriter().write("ERROR: " + ex.getMessage());
}
06-18-2015 04:23 AM
<?xml version='1.0' encoding='UTF-8'?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:aop="http://www.springframework.org/schema/aop"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-3.2.xsd
http://www.springframework.org/schema/aop
http://www.springframework.org/schema/aop/spring-aop-3.2.xsd ">
<aop:aspectj-autoproxy />
<bean id="exceptionHandlerAspect" class="xxx.ExceptionHandler" />
</beans>
@Aspect
public class ExceptionHandler {
@AfterThrowing(pointcut="execution(* xxx.webscript.*.execute(..))", throwing = "ex")
public void handleError(Throwable ex) {
System.out.println("I DID IT: " + ex.getMessage());
}
}
Caused by: org.springframework.beans.factory.BeanCreationException: Error creati
ng bean with name 'retryingTransactionHelper' defined in class path resource [al
fresco/core-services-context.xml]: Cannot resolve reference to bean 'transaction
Service' while setting bean property 'transactionService'; nested exception is o
rg.springframework.beans.factory.BeanCreationException: Error creating bean with
name 'transactionService' defined in class path resource [alfresco/core-service
s-context.xml]: Cannot resolve reference to bean 'transactionManager' while sett
ing bean property 'transactionManager'; nested exception is org.springframework.
beans.factory.BeanCreationException: Error creating bean with name 'transactionM
anager' defined in class path resource [alfresco/hibernate-context.xml]: Invocat
ion of init method failed; nested exception is org.alfresco.error.AlfrescoRuntim
eException: 05180000 A transaction has not be started for method 'getConnectionP
rovider' on org.hibernate.engine.SessionFactoryImplementor
at org.springframework.beans.factory.support.BeanDefinitionValueResolver
.resolveReference(BeanDefinitionValueResolver.java:334)
at org.springframework.beans.factory.support.BeanDefinitionValueResolver
.resolveValueIfNecessary(BeanDefinitionValueResolver.java:108)
at org.springframework.beans.factory.support.AbstractAutowireCapableBean
Factory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1418)
at org.springframework.beans.factory.support.AbstractAutowireCapableBean
Factory.populateBean(AbstractAutowireCapableBeanFactory.java:1159)
at org.springframework.beans.factory.support.AbstractAutowireCapableBean
Factory.doCreateBean(AbstractAutowireCapableBeanFactory.java:519)
at org.springframework.beans.factory.support.AbstractAutowireCapableBean
Factory.createBean(AbstractAutowireCapableBeanFactory.java:458)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getOb
ject(AbstractBeanFactory.java:293)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistr
y.getSingleton(DefaultSingletonBeanRegistry.java:223)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBe
an(AbstractBeanFactory.java:290)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean
(AbstractBeanFactory.java:191)
at org.springframework.beans.factory.support.BeanDefinitionValueResolver
.resolveReference(BeanDefinitionValueResolver.java:328)
… 48 more
06-18-2015 06:26 AM
06-18-2015 07:30 AM
06-18-2015 08:51 AM
throw new WebScriptException(HttpServletResponse.SC_BAD_REQUEST, "Mandatory parameters not provided");
06-19-2015 02:33 AM
Tags
Find what you came for
We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.