#1 2015-04-29 15:30:08

awilcox
Member
Registered: 2015-03-02

Error running report via scheduler but not manually

I've created a ParameterSetReplacementProviderHook that makes use of the following call to retrieve the ReportServer URL:

GLOBALS.getRsService(ReportServerService.class).getServerInfo().getBaseURL();

This works if I run a report manually, but if a report is a scheduled report, when it tries to run the error below is thrown. Is this expected behaviour, and if so, can you suggest an alternate way to retrieve the ReportServer URL?


Apr 29, 2015 11:17:10 AM net.datenwerke.rs.core.service.reportmanager.ReportExecutorServiceImpl execute
WARNING: com.google.inject.ProvisionException: Guice provision errors:

1) Error in custom provider, com.google.inject.OutOfScopeException: Cannot access scoped object. Either we are not currently inside an HTTP Servlet request, or you may have forgotten to apply com.google.inject.servlet.GuiceFilter as a servlet filter for this request.
  at net.datenwerke.rs.core.service.reportserver.ServerInfoContainer.class(ServerInfoContainer.java:17)
  while locating net.datenwerke.rs.core.service.reportserver.ServerInfoContainer

1 error
net.datenwerke.rs.core.service.reportmanager.exceptions.ReportExecutorRuntimeException: com.google.inject.ProvisionException: Guice provision errors:

1) Error in custom provider, com.google.inject.OutOfScopeException: Cannot access scoped object. Either we are not currently inside an HTTP Servlet request, or you may have forgotten to apply com.google.inject.servlet.GuiceFilter as a servlet filter for this request.
  at net.datenwerke.rs.core.service.reportserver.ServerInfoContainer.class(ServerInfoContainer.java:17)
  while locating net.datenwerke.rs.core.service.reportserver.ServerInfoContainer

1 error
    at net.datenwerke.rs.birt.service.reportengine.BirtReportEngine.executeReport(BirtReportEngine.java:83)
    at net.datenwerke.rs.birt.service.reportengine.BirtReportEngine.doExecute(BirtReportEngine.java:70)
    at net.datenwerke.rs.core.service.reportmanager.engine.ReportEngine.execute(ReportEngine.java:127)
    at net.datenwerke.rs.core.service.reportmanager.ReportExecutorServiceImpl.execute(ReportExecutorServiceImpl.java:186)
    at net.datenwerke.rs.core.service.reportmanager.ReportExecutorServiceImpl.execute(ReportExecutorServiceImpl.java:119)
    at net.datenwerke.rs.core.service.reportmanager.ReportExecutorServiceImpl.execute(ReportExecutorServiceImpl.java:106)
    at net.datenwerke.rs.core.service.reportmanager.ReportExecutorServiceImpl.execute(ReportExecutorServiceImpl.java:101)
    at net.datenwerke.rs.scheduler.service.scheduler.jobs.report.ReportExecuteJob.doExecute(ReportExecuteJob.java:121)
    at net.datenwerke.scheduler.service.scheduler.entities.AbstractJob.execute(AbstractJob.java:185)
    at net.datenwerke.scheduler.service.scheduler.tasks.SchedulerTask.executeJob(SchedulerTask.java:527)
    at net.datenwerke.scheduler.service.scheduler.tasks.SchedulerTask.safeCall(SchedulerTask.java:206)
    at net.datenwerke.scheduler.service.scheduler.tasks.SchedulerTask.call(SchedulerTask.java:101)
    at net.datenwerke.scheduler.service.scheduler.tasks.SchedulerTask.call(SchedulerTask.java:1)
    at java.util.concurrent.FutureTask.run(FutureTask.java:262)
    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: com.google.inject.ProvisionException: Guice provision errors:

1) Error in custom provider, com.google.inject.OutOfScopeException: Cannot access scoped object. Either we are not currently inside an HTTP Servlet request, or you may have forgotten to apply com.google.inject.servlet.GuiceFilter as a servlet filter for this request.
  at net.datenwerke.rs.core.service.reportserver.ServerInfoContainer.class(ServerInfoContainer.java:17)
  while locating net.datenwerke.rs.core.service.reportserver.ServerInfoContainer

1 error
    at com.google.inject.internal.InjectorImpl$4.get(InjectorImpl.java:987)
    at net.datenwerke.rs.core.service.reportserver.ReportServerServiceImpl.getServerInfo(ReportServerServiceImpl.java:41)
    at net.datenwerke.rs.core.service.reportserver.ReportServerService$getServerInfo.call(Unknown Source)
    at Script72$1$2.provideReplacements(Script72.groovy:52)
    at net.datenwerke.rs.core.service.reportmanager.parameters.ParameterSet.getParameterMap(ParameterSet.java:101)
    at net.datenwerke.rs.core.service.reportmanager.parameters.ParameterSet.getParameterMapSimple(ParameterSet.java:119)
    at net.datenwerke.rs.birt.service.reportengine.sandbox.BirtEngineEnvironment.call(BirtEngineEnvironment.java:92)
    at net.datenwerke.rs.birt.service.reportengine.BirtReportEngine.executeReport(BirtReportEngine.java:81)
    ... 16 more
Caused by: com.google.inject.OutOfScopeException: Cannot access scoped object. Either we are not currently inside an HTTP Servlet request, or you may have forgotten to apply com.google.inject.servlet.GuiceFilter as a servlet filter for this request.
    at com.google.inject.servlet.GuiceFilter.getContext(GuiceFilter.java:135)
    at com.google.inject.servlet.GuiceFilter.getRequest(GuiceFilter.java:121)
    at com.google.inject.servlet.ServletScopes$2$1.get(ServletScopes.java:114)
    at com.google.inject.internal.InternalFactoryToProviderAdapter.get(InternalFactoryToProviderAdapter.java:40)
    at com.google.inject.internal.InjectorImpl$4$1.call(InjectorImpl.java:978)
    at com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:1024)
    at com.google.inject.internal.InjectorImpl$4.get(InjectorImpl.java:974)
    ... 23 more

Offline

#2 2015-04-29 15:44:22

Arno Mittelbach
datenwerke
Registered: 2012-02-14

Re: Error running report via scheduler but not manually

Hi,

I am afraid, this is expected behavior. The problem is that the scheduler is not part of an HTTP request and hence for the scheduler there is no (Base)URL. My suggestion would be to store the URL in a global variable. In this way you also don't need the ParameterSetReplacementProviderHook since you have direct access to global constants.

Hope this helps,
Arno

Offline

#3 2015-04-29 17:04:41

awilcox
Member
Registered: 2015-03-02

Re: Error running report via scheduler but not manually

Hi Arno,

Thanks for the suggestion. I tried retrieving the URL as part of a startup script so I could store it in a global constant, but then realized the HTTP request is not available in a startup script either. I suppose I could put it in an onlogin script instead and just only create the global constant if it doesn't already exist.

Offline

Board footer

Powered by FluxBB