#1 2016-04-22 13:17:49

andy
Member
From: Rickmansworth, UK
Registered: 2015-06-24

BIRT libraries in 3.0

Hi,

We are users of ReportServer 2.2 and are evaluating the Enterprise version of 3.0.1.
The upgrade seemed to go smoothly, but I cannot get the following error message for any BIRT report which uses libraries.

The report could not be executed: net.datenwerke.security.service.security.exceptions.ViolatedSecurityException
[...]
Caused by: net.datenwerke.security.service.security.exceptions.ViolatedSecurityException at net.datenwerke.rs.terminal.service.terminal.vfs.hooks.TreeBasedVirtualFileSystem.checkRead(TreeBasedVirtualFileSystem.java:407) at net.datenwerke.rs.terminal.service.terminal.vfs.hooks.TreeBasedVirtualFileSystem.getLocation(TreeBasedVirtualFileSystem.java:83) at net.datenwerke.rs.terminal.service.terminal.vfs.VirtualFileSystemDeamon.getLocation(VirtualFileSystemDeamon.java:142) at net.datenwerke.rs.terminal.service.terminal.vfs.VirtualFileSystemDeamon.getAbsoluteLocation(VirtualFileSystemDeamon.java:104) at net.datenwerke.rs.terminal.service.terminal.vfs.VirtualFileSystemDeamon.getLocation(VirtualFileSystemDeamon.java:80) at net.datenwerke.rs.terminal.service.terminal.vfs.hookers.VfsObjectResolver.getParentLocation(VfsObjectResolver.java:81) at net.datenwerke.rs.terminal.service.terminal.vfs.hookers.VfsObjectResolver.consumes(VfsObjectResolver.java:23) at net.datenwerke.rs.terminal.service.terminal.objresolver.ObjectResolverDeamon.getObjects(ObjectResolverDeamon.java:60) at net.datenwerke.rs.terminal.service.terminal.objresolver.ObjectResolverDeamon.getObjects(ObjectResolverDeamon.java:88) at net.datenwerke.rs.terminal.service.terminal.objresolver.ObjectResolverDeamon.getObjects(ObjectResolverDeamon.java:84) at net.datenwerke.rs.terminal.service.terminal.TerminalServiceImpl.getObjectsByLocation(TerminalServiceImpl.java:101) at net.datenwerke.rs.terminal.service.terminal.TerminalServiceImpl.getObjectByLocation(TerminalServiceImpl.java:112) at net.datenwerke.rs.fileserver.service.fileserver.FileServerServiceImpl.getNodeByPath(FileServerServiceImpl.java:67) at net.datenwerke.rs.fileserver.service.fileserver.FileServerServiceImpl.getNodeByPath(FileServerServiceImpl.java:56) at net.datenwerke.rs.fileserver.service.fileserver.rsfs.RsfsUrlStreamHandler$1.connect(RsfsUrlStreamHandler.java:67) at net.datenwerke.rs.fileserver.service.fileserver.rsfs.RsfsUrlStreamHandler$1.getInputStream(RsfsUrlStreamHandler.java:46) at java.net.URL.openStream(URL.java:1048) at org.eclipse.birt.report.model.core.LayoutModule.loadLibrary(LayoutModule.java:392) at org.eclipse.birt.report.model.core.LayoutModule.loadLibrarySilently(LayoutModule.java:469) at org.eclipse.birt.report.model.parser.IncludedLibrariesStructureListState$IncludedLibraryStructureState.end(IncludedLibrariesStructureListState.java:145) at org.eclipse.birt.report.model.util.XMLParserHandler.endElement(XMLParserHandler.java:186) at org.apache.xerces.parsers.AbstractSAXParser.endElement(Unknown Source) at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanEndElement(Unknown Source) at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source) at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source) at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source) at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source) at org.apache.xerces.parsers.XMLParser.parse(Unknown Source) at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source) at org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source) at org.apache.xerces.jaxp.SAXParserImpl.parse(Unknown Source) at org.eclipse.birt.report.model.parser.ModuleReader.readModule(ModuleReader.java:98) at org.eclipse.birt.report.model.parser.DesignReader.read(DesignReader.java:88) at org.eclipse.birt.report.model.core.DesignSessionImpl.openDesign(DesignSessionImpl.java:309) at org.eclipse.birt.report.model.api.SessionHandleImpl.openDesign(SessionHandleImpl.java:294) at org.eclipse.birt.report.model.api.SessionHandle.openDesign(SessionHandle.java:1) at org.eclipse.birt.report.engine.parser.ReportParser.getDesignHandle(ReportParser.java:158) at org.eclipse.birt.report.engine.api.impl.ReportEngineHelper.getReportDesignHandle(ReportEngineHelper.java:255) at org.eclipse.birt.report.engine.api.impl.ReportEngineHelper.openReportDesign(ReportEngineHelper.java:274) at org.eclipse.birt.report.engine.api.impl.ReportEngineHelper.openReportDesign(ReportEngineHelper.java:184) at org.eclipse.birt.report.engine.api.impl.ReportEngineHelper.openReportDesign(ReportEngineHelper.java:161) at org.eclipse.birt.report.engine.api.impl.ReportEngine.openReportDesign(ReportEngine.java:352) at net.datenwerke.rs.birt.service.reportengine.sandbox.BirtEngineEnvironment.call(BirtEngineEnvironment.java:84) at net.datenwerke.rs.birt.service.reportengine.BirtReportEngine.executeReport(BirtReportEngine.java:79) ... 58 more
[...]

Our libraries are stored on the filesystem in /resources/birt and reportengines.cf is unchanged from 2.2:
      <library>
         <folder>
           <path>/resources/birt</path>
         </folder>
      </library>

Could you help me find what's wrong?

Kind Regards, Andy

Offline

#2 2016-04-22 13:36:20

Arno Mittelbach
datenwerke
Registered: 2012-02-14

Re: BIRT libraries in 3.0

Hi Andy,

read access is checked on the library files. You would need to grant read rights to the user executing the BIRT report, or make the folder web accessible.

Cheers,
Arno

Offline

#3 2016-04-22 13:47:06

andy
Member
From: Rickmansworth, UK
Registered: 2015-06-24

Re: BIRT libraries in 3.0

Hi Arno,

Thanks for your reply. I've tried to rule out permissions problems as best I can:
- Running the report as root
- Enabling web access on the "birt" directory (and "resources" for good measure)
- The "birt" directory inherits r-x-g permissions for our group "Users"

With all this done I still get the same error (whereas it works on 2.2).
Is there anything else I can try?

Kind Regards,
Andy

Offline

#4 2016-04-22 14:47:28

Arno Mittelbach
datenwerke
Registered: 2012-02-14

Re: BIRT libraries in 3.0

Hi Andy,

this is a bit of a wild guess. Could you check whether you have a rsfileserver.jar in the WEB-INF/lib directory? (This should not be there, but the stacktrace looks somewhat off).

Arno

Offline

#5 2016-04-22 15:55:56

andy
Member
From: Rickmansworth, UK
Registered: 2015-06-24

Re: BIRT libraries in 3.0

Hi Arno,

rsfileserver.jar isn't present

XXX@integration:/srv/tomcat/webapps/reportserver-3.0.1/WEB-INF/lib$ ls rs*
rs-schemaupdate-1.0.jar

I tried creating a fresh database using the SQL provided but had the same symptoms.
I'd removed some of the backtrace provided earlier (that's what the [...] was supposed to indicate).. In case it helps a full backtrace is below:

Error: An error occurred during report execution.
The report could not be executed: net.datenwerke.security.service.security.exceptions.ViolatedSecurityException
To get help please contact an administrator.
Details
net.datenwerke.rs.core.service.reportmanager.exceptions.ReportExecutorException: The report could not be executed: net.datenwerke.security.service.security.exceptions.ViolatedSecurityException at net.datenwerke.rs.core.service.reportmanager.ReportExecutorServiceImpl.execute(ReportExecutorServiceImpl.java:218) at net.datenwerke.rs.core.service.reportmanager.ReportExecutorServiceImpl.execute(ReportExecutorServiceImpl.java:119) at net.datenwerke.rs.core.server.reportexport.ReportExportServlet.exeucteReport(ReportExportServlet.java:545) at net.datenwerke.rs.core.server.reportexport.ReportExportServlet.doExportReport(ReportExportServlet.java:417) at net.datenwerke.rs.core.server.reportexport.ReportExportServlet.exportReport(ReportExportServlet.java:347) at net.datenwerke.rs.core.server.reportexport.ReportExportServlet.exportReportViaSession(ReportExportServlet.java:340) at net.datenwerke.rs.core.server.reportexport.ReportExportServlet.doGet(ReportExportServlet.java:169) at net.datenwerke.rs.core.server.reportexport.ReportExportServlet$$EnhancerByGuice$$e767a3c0.CGLIB$doGet$0() at net.datenwerke.rs.core.server.reportexport.ReportExportServlet$$EnhancerByGuice$$e767a3c0$$FastClassByGuice$$348a1973.invoke() at com.google.inject.internal.cglib.proxy.$MethodProxy.invokeSuper(MethodProxy.java:228) at com.google.inject.internal.InterceptorStackCallback$InterceptedMethodInvocation.proceed(InterceptorStackCallback.java:72) at com.google.inject.persist.jpa.JpaLocalTxnInterceptor.invoke(JpaLocalTxnInterceptor.java:66) at com.google.inject.internal.InterceptorStackCallback$InterceptedMethodInvocation.proceed(InterceptorStackCallback.java:72) at net.datenwerke.security.service.security.aop.SecurityCheckInterceptor.invoke(SecurityCheckInterceptor.java:109) at com.google.inject.internal.InterceptorStackCallback$InterceptedMethodInvocation.proceed(InterceptorStackCallback.java:72) at com.google.inject.internal.InterceptorStackCallback.intercept(InterceptorStackCallback.java:52) at net.datenwerke.rs.core.server.reportexport.ReportExportServlet$$EnhancerByGuice$$e767a3c0.doGet() at javax.servlet.http.HttpServlet.service(HttpServlet.java:621) at javax.servlet.http.HttpServlet.service(HttpServlet.java:722) at net.datenwerke.rs.core.server.reportexport.ReportExportServlet$$EnhancerByGuice$$e767a3c0.CGLIB$service$17() at net.datenwerke.rs.core.server.reportexport.ReportExportServlet$$EnhancerByGuice$$e767a3c0$$FastClassByGuice$$348a1973.invoke() at com.google.inject.internal.cglib.proxy.$MethodProxy.invokeSuper(MethodProxy.java:228) at com.google.inject.internal.InterceptorStackCallback$InterceptedMethodInvocation.proceed(InterceptorStackCallback.java:72) at net.datenwerke.security.service.security.aop.SecurityCheckInterceptor.invoke(SecurityCheckInterceptor.java:109) at com.google.inject.internal.InterceptorStackCallback$InterceptedMethodInvocation.proceed(InterceptorStackCallback.java:72) at com.google.inject.internal.InterceptorStackCallback.intercept(InterceptorStackCallback.java:52) at net.datenwerke.rs.core.server.reportexport.ReportExportServlet$$EnhancerByGuice$$e767a3c0.service() at com.google.inject.servlet.ServletDefinition.doService(ServletDefinition.java:263) at com.google.inject.servlet.ServletDefinition.service(ServletDefinition.java:178) at com.google.inject.servlet.ManagedServletPipeline.service(ManagedServletPipeline.java:91) at com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocation.java:62) at com.google.inject.persist.PersistFilter.doFilter(PersistFilter.java:89) at com.google.inject.servlet.FilterDefinition.doFilter(FilterDefinition.java:163) at com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocation.java:58) at com.google.inject.servlet.FilterDefinition.doFilter(FilterDefinition.java:168) at com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocation.java:58) at com.google.inject.servlet.FilterDefinition.doFilter(FilterDefinition.java:168) at com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocation.java:58) at com.google.inject.servlet.ManagedFilterPipeline.dispatch(ManagedFilterPipeline.java:118) at com.google.inject.servlet.GuiceFilter.doFilter(GuiceFilter.java:113) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:224) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:169) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:168) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:98) at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:927) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407) at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:987) at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:579) at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:307) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) at java.lang.Thread.run(Thread.java:745) 
Caused by: net.datenwerke.rs.core.service.reportmanager.exceptions.ReportExecutorRuntimeException: net.datenwerke.security.service.security.exceptions.ViolatedSecurityException at net.datenwerke.rs.birt.service.reportengine.BirtReportEngine.executeReport(BirtReportEngine.java:81) at net.datenwerke.rs.birt.service.reportengine.BirtReportEngine.doExecute(BirtReportEngine.java:67) at net.datenwerke.rs.core.service.reportmanager.engine.ReportEngine.execute(ReportEngine.java:148) at net.datenwerke.rs.core.service.reportmanager.ReportExecutorServiceImpl.execute(ReportExecutorServiceImpl.java:186) ... 55 more 
Caused by: net.datenwerke.security.service.security.exceptions.ViolatedSecurityException at net.datenwerke.rs.terminal.service.terminal.vfs.hooks.TreeBasedVirtualFileSystem.checkRead(TreeBasedVirtualFileSystem.java:407) at net.datenwerke.rs.terminal.service.terminal.vfs.hooks.TreeBasedVirtualFileSystem.getLocation(TreeBasedVirtualFileSystem.java:83) at net.datenwerke.rs.terminal.service.terminal.vfs.VirtualFileSystemDeamon.getLocation(VirtualFileSystemDeamon.java:142) at net.datenwerke.rs.terminal.service.terminal.vfs.VirtualFileSystemDeamon.getAbsoluteLocation(VirtualFileSystemDeamon.java:104) at net.datenwerke.rs.terminal.service.terminal.vfs.VirtualFileSystemDeamon.getLocation(VirtualFileSystemDeamon.java:80) at net.datenwerke.rs.terminal.service.terminal.vfs.hookers.VfsObjectResolver.getParentLocation(VfsObjectResolver.java:81) at net.datenwerke.rs.terminal.service.terminal.vfs.hookers.VfsObjectResolver.consumes(VfsObjectResolver.java:23) at net.datenwerke.rs.terminal.service.terminal.objresolver.ObjectResolverDeamon.getObjects(ObjectResolverDeamon.java:60) at net.datenwerke.rs.terminal.service.terminal.objresolver.ObjectResolverDeamon.getObjects(ObjectResolverDeamon.java:88) at net.datenwerke.rs.terminal.service.terminal.objresolver.ObjectResolverDeamon.getObjects(ObjectResolverDeamon.java:84) at net.datenwerke.rs.terminal.service.terminal.TerminalServiceImpl.getObjectsByLocation(TerminalServiceImpl.java:101) at net.datenwerke.rs.terminal.service.terminal.TerminalServiceImpl.getObjectByLocation(TerminalServiceImpl.java:112) at net.datenwerke.rs.fileserver.service.fileserver.FileServerServiceImpl.getNodeByPath(FileServerServiceImpl.java:67) at net.datenwerke.rs.fileserver.service.fileserver.FileServerServiceImpl.getNodeByPath(FileServerServiceImpl.java:56) at net.datenwerke.rs.fileserver.service.fileserver.rsfs.RsfsUrlStreamHandler$1.connect(RsfsUrlStreamHandler.java:67) at net.datenwerke.rs.fileserver.service.fileserver.rsfs.RsfsUrlStreamHandler$1.getInputStream(RsfsUrlStreamHandler.java:46) at java.net.URL.openStream(URL.java:1048) at org.eclipse.birt.report.model.core.LayoutModule.loadLibrary(LayoutModule.java:392) at org.eclipse.birt.report.model.core.LayoutModule.loadLibrarySilently(LayoutModule.java:469) at org.eclipse.birt.report.model.parser.IncludedLibrariesStructureListState$IncludedLibraryStructureState.end(IncludedLibrariesStructureListState.java:145) at org.eclipse.birt.report.model.util.XMLParserHandler.endElement(XMLParserHandler.java:186) at org.apache.xerces.parsers.AbstractSAXParser.endElement(Unknown Source) at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanEndElement(Unknown Source) at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source) at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source) at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source) at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source) at org.apache.xerces.parsers.XMLParser.parse(Unknown Source) at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source) at org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source) at org.apache.xerces.jaxp.SAXParserImpl.parse(Unknown Source) at org.eclipse.birt.report.model.parser.ModuleReader.readModule(ModuleReader.java:98) at org.eclipse.birt.report.model.parser.DesignReader.read(DesignReader.java:88) at org.eclipse.birt.report.model.core.DesignSessionImpl.openDesign(DesignSessionImpl.java:309) at org.eclipse.birt.report.model.api.SessionHandleImpl.openDesign(SessionHandleImpl.java:294) at org.eclipse.birt.report.model.api.SessionHandle.openDesign(SessionHandle.java:1) at org.eclipse.birt.report.engine.parser.ReportParser.getDesignHandle(ReportParser.java:158) at org.eclipse.birt.report.engine.api.impl.ReportEngineHelper.getReportDesignHandle(ReportEngineHelper.java:255) at org.eclipse.birt.report.engine.api.impl.ReportEngineHelper.openReportDesign(ReportEngineHelper.java:274) at org.eclipse.birt.report.engine.api.impl.ReportEngineHelper.openReportDesign(ReportEngineHelper.java:184) at org.eclipse.birt.report.engine.api.impl.ReportEngineHelper.openReportDesign(ReportEngineHelper.java:161) at org.eclipse.birt.report.engine.api.impl.ReportEngine.openReportDesign(ReportEngine.java:352) at net.datenwerke.rs.birt.service.reportengine.sandbox.BirtEngineEnvironment.call(BirtEngineEnvironment.java:84) at net.datenwerke.rs.birt.service.reportengine.BirtReportEngine.executeReport(BirtReportEngine.java:79) ... 58 more

Fetching the required library using a URL works whether the user (root) is logged in or not.

http://XXX/reportserver3/reportserver/fileServerAccess?id=3518

Do you know what else I can try?

Kind Regards,

Andy

Offline

#6 2016-04-22 16:06:48

Arno Mittelbach
datenwerke
Registered: 2012-02-14

Re: BIRT libraries in 3.0

Hi Andy,

I just did some additional testing and I cannot reproduce the problem on a fresh ReportServer installation. While still my best guess is that there are some old libraries still in the WEB-INF lib directory (see above) there is one more thing to test. The following script tests the rsfs URL handler which is internally used to retrieve the BIRT libraries. It attempts to read the first line of a file called tmp/test.txt. For this, please create a folder tmp in the fileserver and put some dummy file called test.txt there. Then upload the following script (to somewhere beneath the bin folder) and execute it.

"rsfs://localhost/tmp/test.txt".toURL().withReader { reader -> 
	tout.println(reader.readLine());
}
null;

If this throws an error instead of retrieving the first line, we might get an indication of what is wrong.

Cheers,
Arno

Offline

#7 2016-04-22 16:14:12

Arno Mittelbach
datenwerke
Registered: 2012-02-14

Re: BIRT libraries in 3.0

Hi Andy,

here is one more script to test .. this one attempts to actually load the library (change test.rptlibrary to your library's name). It does exactly the same as the BIRT engine, so it should also fail and maybe give us an idea of what is off:

import net.datenwerke.rs.fileserver.service.fileserver.FileServerService

def service = GLOBALS.getInstance(FileServerService.class)

service.getNodeByPath("/resources/birt/test.rptlibrary", false);

Offline

#8 2016-04-22 16:24:19

andy
Member
From: Rickmansworth, UK
Registered: 2015-06-24

Re: BIRT libraries in 3.0

Hi Arno,

Here's the result of your test.

reportserver$ exec test.groovy
Script execution failed.
error message: javax.script.ScriptException: net.datenwerke.security.service.security.exceptions.ViolatedSecurityException (net.datenwerke.security.service.security.exceptions.ViolatedSecurityException)
script arguments:
file: test.groovy (id: 5440, line 1)
line number: 1
line: "rsfs://localhost/tmp/test.txt".toURL().withReader { reader ->
reportserver$

BUT, your comments about an old library reminded me I'm testing 3.0.1 from the same Tomcat instance as our 2.2 deployment. I'm new to Tomcat and had assumed this was a sensible thing to do, but after a quickly removing 2.2 from Tomcat your test works!

reportserver$ exec test.groovy
Line 1

I'll try to learn more about this topic but for now I can continue testing. Thanks for your help and your hard work on 3.0!

Offline

#9 2016-04-22 16:36:36

Arno Mittelbach
datenwerke
Registered: 2012-02-14

Re: BIRT libraries in 3.0

Hi Andy,

this should indeed explain it. Tomcat is not good in shielding web applications from another (all applications are running in a single java virtual machine and classes/libraries from one web app may overwrite classes from another). This becomes problematic if two web applications are using similar libraries but in different versions. I'd usually always recommend to only have one web application running within Tomcat unless the web applications have been designed (or tested) to work properly together.

Cheers,
Arno

Offline

Board footer

Powered by FluxBB