CUBA Reports jsoup in Groovy

Hello, I created a groovy-based dataset which invokes a bean. When I run the report, i get the following error message:

11:19:26.736 ERROR [http-nio-8080-exec-77/app-core/admin] com.haulmont.cuba.core.sys.ServiceInterceptor - Invoking String,Integer,String,String) from another service
11:19:27.921 DEBUG [scheduler-4] - Expiring locks
11:19:31.817 WARN  [http-nio-8080-exec-77/app-core/admin] com.haulmont.cuba.core.sys.ServiceInterceptor - Open transaction left in GenevaService.ConnectToGeneva(..)
11:19:31.831 ERROR [http-nio-8080-exec-77/app-core/admin] com.haulmont.cuba.core.sys.ServiceInterceptor - Invoking String,String) from another service
11:19:32.968 INFO  [http-nio-8080-exec-77/app-core/admin] - Invoking executeGSQL...
11:19:34.704 WARN  [http-nio-8080-exec-77/app-core/admin] com.haulmont.cuba.core.sys.ServiceInterceptor - Open transaction left in GenevaService.executeGSQL(..)
11:19:34.717 ERROR [http-nio-8080-exec-77/app-core/admin] com.haulmont.cuba.core.sys.ServiceInterceptor - Invoking List from another service
11:19:35.282 ERROR [http-nio-8080-exec-77/app-core/admin] com.haulmont.cuba.core.sys.ServiceInterceptor - Exception: 
	at ~[app-core-0.1-SNAPSHOT.jar:na]
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_65]
	at sun.reflect.NativeMethodAccessorImpl.invoke( ~[na:1.8.0_65]
	at sun.reflect.DelegatingMethodAccessorImpl.invoke( ~[na:1.8.0_65]
	at java.lang.reflect.Method.invoke( ~[na:1.8.0_65]
	at [spring-aop-4.2.0.RELEASE.jar:4.2.0.RELEASE]
	at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint( [spring-aop-4.2.0.RELEASE.jar:4.2.0.RELEASE]

Now, the error refers to jsoup. When I re-assemble the project and redeploy, sometimes the report runs and sometimes it doesn’t. By re-assembling and deploying, I get lucky half the time. I know that jsoup is included at the web tier but I wonder why I’m getting those errors on the middle tier (in my bean).


Hi Francis,
You mention that Jsoup is included at web tier - does it mean that it is defined as dependency for web module?
Report queries are executed on the middle tier, so you should add your libraries as dependencies of the core module.

And look at the first error message in your log: “Invoking … from another service”. It probably does not cause problems in this case, but better use regular managed beans instead of services when calling code from inside middleware. See warning here:

sorry Jsoup is not included in the web tier. I now created a managed bean and this is where I reference Jsoup. and it’s giving me the error above. When i run the same code from a console app, it runs fine so something is telling me that it’s either not using the correct version of jsoup or that i need to reference my version somewhere.

Here’s my code:

for(int i = 0; i < data.size(); i++)
            HashMap<String,Object> record = new HashMap<>();
            StringBuilder sb = new StringBuilder();
            Elements nodeData = data.get(i).children();
            for(Element node : nodeData)
                String nodeValue = node.text();
                String nodename = node.nodeName();

and it generates the error at the line: Elements nodeData = data.get(i).children();

Please check that you have only one Jsoup JAR in tomcat/shared/lib and this is the version that you specified in dependencies.