Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » BIRT » Problems with running Java Handler(probebly somting foolish on my side )
icon5.gif  Problems with running Java Handler [message #631720] Fri, 08 October 2010 14:24 Go to next message
Martijn Cremer is currently offline Martijn Cremer
Messages: 77
Registered: January 2010
Location: Breda
Member

Good day,

Im just starting to use BIRT after using Eclipse technolegies like RAP its getting use to this system. Up 2 now it all worked as I expected. I have been using Intergrating and Extending BIRT book as a guide. And it worked like a charm.

Now only one thing seems to be failing when I try my tests.

I created a repport with some variables:

    <parameters>
        <scalar-parameter name="REPORT_ID" id="419" extends="SMARTAPPS.NL.REPORT_ID"/>
        <scalar-parameter name="DATABASE_NAME" id="420" extends="SMARTAPPS.NL.DATABASE_NAME"/>
        <scalar-parameter name="REPORT_NAME" id="421" extends="SMARTAPPS.NL.REPORT_NAME"/>
        <scalar-parameter name="ADVISEUR_ID" id="422" extends="SMARTAPPS.NLT.ADVISEUR_ID"/>
        <scalar-parameter name="DATUM_START" id="423" extends="SMARTAPPS.NL.DATUM_START"/>
        <scalar-parameter name="DATUM_EIND" id="424" extends="SMARTAPPS.NL.DATUM_EIND"/>
    </parameters>


Now I wanted to test how the handlers work so I created a simpel Handler:

import java.util.Date;

import org.eclipse.birt.report.engine.api.script.IReportContext;
import org.eclipse.birt.report.engine.api.script.element.IReportDesign;
import org.eclipse.birt.report.engine.api.script.eventadapter.ReportEventAdapter;
import org.eclipse.birt.report.model.api.ReportDesignHandle;
import org.eclipse.birt.report.model.api.activity.SemanticException;

/**
 * @author Martijn Cremer 
 * Test of a Report Event handler (for smartapps Algemeen)
 */
public class ReportEventHandler extends ReportEventAdapter {

	@Override
	public void beforeFactory(IReportDesign report, IReportContext reportContext) {

		@SuppressWarnings("deprecation")
		final Date date = new Date(2001, 01, 01);
		if ((Date) reportContext.getPageVariable("DATUM_START") == date) {
			final ReportDesignHandle rdh = (ReportDesignHandle) reportContext.getReportRunnable().getDesignHandle();
			try {
				rdh.findElement("VOORBLAD_REPPORT_ID").drop();
			} catch (final SemanticException e) {
				e.printStackTrace();
			}

		}

	}
}


Now when I run it in Eclipse BIRT and BIRT Designer Professional i get the following error when I run my report:

 
Description	Resource	Path	Location	Type
org.eclipse.birt.report.engine.api.EngineException: Class nl.smartapps.algemeen.handler.ReportEventHandler not found.
	at  org.eclipse.birt.report.engine.executor.EventHandlerManager. getInstance(EventHandlerManager.java:81)
	at  org.eclipse.birt.report.engine.executor.EventHandlerManager. getInstance(EventHandlerManager.java:49)
	at  org.eclipse.birt.report.engine.script.internal.ScriptExecuto r.getInstance(ScriptExecutor.java:104)
	at  org.eclipse.birt.report.engine.script.internal.ReportScriptE xecutor.handleAfterFactory(ReportScriptExecutor.java:103)
	at  org.eclipse.birt.report.engine.api.impl.EngineTask.closeFact ory(EngineTask.java:1771)
	at  org.eclipse.birt.report.engine.api.impl.RunAndRenderTask.doR un(RunAndRenderTask.java:186)
	at  org.eclipse.birt.report.engine.api.impl.RunAndRenderTask.run (RunAndRenderTask.java:77)
	at  org.eclipse.birt.report.service.ReportEngineService.runAndRe nderReport(ReportEngineService.java:920)
	at  org.eclipse.birt.report.service.BirtViewerReportService.runA ndRenderReport(BirtViewerReportService.java:973)
	at  org.eclipse.birt.report.service.actionhandler.BirtGetPageAll ActionHandler.__execute(BirtGetPageAllActionHandler.java:131 )
	at  org.eclipse.birt.report.service.actionhandler.AbstractBaseAc tionHandler.execute(AbstractBaseActionHandler.java:90)
	at  org.eclipse.birt.report.soapengine.processor.AbstractBaseDoc umentProcessor.__executeAction(AbstractBaseDocumentProcessor .java:47)
	at  org.eclipse.birt.report.soapengine.processor.AbstractBaseCom ponentProcessor.executeAction(AbstractBaseComponentProcessor .java:143)
	at  org.eclipse.birt.report.soapengine.processor.BirtDocumentPro cessor.handleGetPageAll(BirtDocumentProcessor.java:183)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
	at java.lang.reflect.Method.invoke(Unknown Source)
	at  org.eclipse.birt.report.soapengine.processor.AbstractBaseCom ponentProcessor.process(AbstractBaseComponentProcessor.java: 112)
	at  org.eclipse.birt.report.soapengine.endpoint.BirtSoapBindingI mpl.getUpdatedObjects(BirtSoapBindingImpl.java:66)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
	at java.lang.reflect.Method.invoke(Unknown Source)
	at  org.apache.axis.providers.java.RPCProvider.invokeMethod(RPCP rovider.java:397)
	at  org.apache.axis.providers.java.RPCProvider.processMessage(RP CProvider.java:186)
	at  org.apache.axis.providers.java.JavaProvider.invoke(JavaProvi der.java:323)
	at  org.apache.axis.strategies.InvocationStrategy.visit(Invocati onStrategy.java:32)
	at  org.apache.axis.SimpleChain.doVisiting(SimpleChain.java:118)
	at org.apache.axis.SimpleChain.invoke(SimpleChain.java:83)
	at  org.apache.axis.handlers.soap.SOAPService.invoke(SOAPService .java:454)
	at  org.apache.axis.server.AxisServer.invoke(AxisServer.java:281 )
	at  org.apache.axis.transport.http.AxisServlet.doPost(AxisServle t.java:699)
	at  org.eclipse.birt.report.servlet.BirtSoapMessageDispatcherSer vlet.doPost(BirtSoapMessageDispatcherServlet.java:265)
	at  javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
	at  org.apache.axis.transport.http.AxisServletBase.service(AxisS ervletBase.java:327)
	at  javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
	at  org.eclipse.birt.report.servlet.BirtSoapMessageDispatcherSer vlet.service(BirtSoapMessageDispatcherServlet.java:122)
	at  org.eclipse.equinox.http.registry.internal.ServletManager$Se rvletWrapper.service(ServletManager.java:180)
	at  org.eclipse.equinox.http.servlet.internal.ServletRegistratio n.service(ServletRegistration.java:61)
	at  org.eclipse.equinox.http.servlet.internal.ProxyServlet.proce ssAlias(ProxyServlet.java:126)
	at  org.eclipse.equinox.http.servlet.internal.ProxyServlet.servi ce(ProxyServlet.java:60)
	at  javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
	at  org.eclipse.equinox.http.jetty.internal.HttpServerManager$In ternalHttpServiceServlet.service(HttpServerManager.java:318)
	at  org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder .java:511)
	at  org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandl er.java:390)
	at  org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandl er.java:182)
	at  org.mortbay.jetty.handler.ContextHandler.handle(ContextHandl er.java:765)
	at  org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapp er.java:152)
	at org.mortbay.jetty.Server.handle(Server.java:326)
	at  org.mortbay.jetty.HttpConnection.handleRequest(HttpConnectio n.java:542)
	at  org.mortbay.jetty.HttpConnection$RequestHandler.content(Http Connection.java:939)
	at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:756)
	at  org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java: 212)
	at  org.mortbay.jetty.HttpConnection.handle(HttpConnection.java: 404)
	at  org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEn dPoint.java:409)
	at  org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThr eadPool.java:582)
Caused by: java.lang.ClassNotFoundException: nl.smartapps.algemeen.handler.ReportEventHandler
	at  org.eclipse.birt.core.framework.URLClassLoader.findClass1(UR LClassLoader.java:185)
	at  org.eclipse.birt.core.framework.URLClassLoader$1.run(URLClas sLoader.java:154)
	at  org.eclipse.birt.core.framework.URLClassLoader$1.run(URLClas sLoader.java:1)
	at java.security.AccessController.doPrivileged(Native Method)
	at  org.eclipse.birt.core.framework.URLClassLoader.findClass(URL ClassLoader.java:149)
	at java.lang.ClassLoader.loadClass(Unknown Source)
	at java.lang.ClassLoader.loadClass(Unknown Source)
	at  org.eclipse.birt.report.engine.executor.ApplicationClassLoad er.loadClass(ApplicationClassLoader.java:79)
	at  org.eclipse.birt.report.engine.executor.EventHandlerManager. getInstance(EventHandlerManager.java:76)
	... 56 more
	smartappsAlgemeen.rptdesign	/smartappsBIRT Algemeen	line 2	BIRT Viewer Problem


What am I doing wrong?
I put the Java project containing the handler in the same workbench. As all the documentation i found and read told me. I'm probably missing somting very simple.


hm. I've lost a machine.. literally _lost_. it responds to ping, it works completely, I just can't figure out where in my apartment it is.

[Updated on: Fri, 08 October 2010 14:45]

Report message to a moderator

Re: Problems with running Java Handler [message #631760 is a reply to message #631720] Fri, 08 October 2010 15:43 Go to previous message
Jason Weathersby is currently offline Jason Weathersby
Messages: 9167
Registered: July 2009
Senior Member

Take a look at this blogpost:
http://birtworld.blogspot.com/2009/12/birt-designer-classpat h-changes.html

Jason


On 10/8/2010 10:24 AM, Martijn Cremer wrote:
> Good day,
>
> Im just starting to use BIRT after using Eclipse technolegies like RAP
> its getting use to this system. Up 2 now it all worked as I expected. I
> have been using Intergrating and Extending BIRT book as a guide. And it
> worked like a charm.
>
> Now only one thing seems to be failing when I try my tests.
>
> I created a repport with some variables:
>
> <parameters>
> <scalar-parameter name="REPORT_ID" id="419"
> extends="THADIR.NET.REPORT_ID"/>
> <scalar-parameter name="DATABASE_NAME" id="420"
> extends="THADIR.NET.DATABASE_NAME"/>
> <scalar-parameter name="REPORT_NAME" id="421"
> extends="THADIR.NET.REPORT_NAME"/>
> <scalar-parameter name="ADVISEUR_ID" id="422"
> extends="THADIR.NET.ADVISEUR_ID"/>
> <scalar-parameter name="DATUM_START" id="423"
> extends="THADIR.NET.DATUM_START"/>
> <scalar-parameter name="DATUM_EIND" id="424"
> extends="THADIR.NET.DATUM_EIND"/>
> </parameters>
>
>
> Now I wanted to test how the handlers work so I created a simpel Handler:
>
>
> import java.util.Date;
>
> import org.eclipse.birt.report.engine.api.script.IReportContext;
> import org.eclipse.birt.report.engine.api.script.element.IReportDes ign;
> import
> org.eclipse.birt.report.engine.api.script.eventadapter.Repor tEventAdapter;
> import org.eclipse.birt.report.model.api.ReportDesignHandle;
> import org.eclipse.birt.report.model.api.activity.SemanticException ;
>
> /**
> * @author Martijn Cremer * Test of a Report Event handler (for ZLM
> Algemeen)
> */
> public class ReportEventHandler extends ReportEventAdapter {
>
> @Override
> public void beforeFactory(IReportDesign report, IReportContext
> reportContext) {
>
> @SuppressWarnings("deprecation")
> final Date date = new Date(2001, 01, 01);
> if ((Date) reportContext.getPageVariable("DATUM_START") == date) {
> final ReportDesignHandle rdh = (ReportDesignHandle)
> reportContext.getReportRunnable().getDesignHandle();
> try {
> rdh.findElement("VOORBLAD_REPPORT_ID").drop();
> } catch (final SemanticException e) {
> e.printStackTrace();
> }
>
> }
>
> }
> }
>
>
> Now when I run it in Eclipse BIRT and BIRT Designer Professional i get
> the following error when I run my report:
>
> <pre>
> Description Resource Path Location Type
> org.eclipse.birt.report.engine.api.EngineException: Class
> net.thadir.algemeen.handler.ReportEventHandler not found.
> at org.eclipse.birt.report.engine.executor.EventHandlerManager.
> getInstance(EventHandlerManager.java:81)
> at org.eclipse.birt.report.engine.executor.EventHandlerManager.
> getInstance(EventHandlerManager.java:49)
> at org.eclipse.birt.report.engine.script.internal.ScriptExecuto
> r.getInstance(ScriptExecutor.java:104)
> at org.eclipse.birt.report.engine.script.internal.ReportScriptE
> xecutor.handleAfterFactory(ReportScriptExecutor.java:103)
> at org.eclipse.birt.report.engine.api.impl.EngineTask.closeFact
> ory(EngineTask.java:1771)
> at org.eclipse.birt.report.engine.api.impl.RunAndRenderTask.doR
> un(RunAndRenderTask.java:186)
> at org.eclipse.birt.report.engine.api.impl.RunAndRenderTask.run
> (RunAndRenderTask.java:77)
> at org.eclipse.birt.report.service.ReportEngineService.runAndRe
> nderReport(ReportEngineService.java:920)
> at org.eclipse.birt.report.service.BirtViewerReportService.runA
> ndRenderReport(BirtViewerReportService.java:973)
> at org.eclipse.birt.report.service.actionhandler.BirtGetPageAll
> ActionHandler.__execute(BirtGetPageAllActionHandler.java:131 )
> at org.eclipse.birt.report.service.actionhandler.AbstractBaseAc
> tionHandler.execute(AbstractBaseActionHandler.java:90)
> at org.eclipse.birt.report.soapengine.processor.AbstractBaseDoc
> umentProcessor.__executeAction(AbstractBaseDocumentProcessor .java:47)
> at org.eclipse.birt.report.soapengine.processor.AbstractBaseCom
> ponentProcessor.executeAction(AbstractBaseComponentProcessor .java:143)
> at org.eclipse.birt.report.soapengine.processor.BirtDocumentPro
> cessor.handleGetPageAll(BirtDocumentProcessor.java:183)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
> at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
> at java.lang.reflect.Method.invoke(Unknown Source)
> at org.eclipse.birt.report.soapengine.processor.AbstractBaseCom
> ponentProcessor.process(AbstractBaseComponentProcessor.java: 112)
> at org.eclipse.birt.report.soapengine.endpoint.BirtSoapBindingI
> mpl.getUpdatedObjects(BirtSoapBindingImpl.java:66)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
> at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
> at java.lang.reflect.Method.invoke(Unknown Source)
> at org.apache.axis.providers.java.RPCProvider.invokeMethod(RPCP
> rovider.java:397)
> at org.apache.axis.providers.java.RPCProvider.processMessage(RP
> CProvider.java:186)
> at org.apache.axis.providers.java.JavaProvider.invoke(JavaProvi
> der.java:323)
> at org.apache.axis.strategies.InvocationStrategy.visit(Invocati
> onStrategy.java:32)
> at org.apache.axis.SimpleChain.doVisiting(SimpleChain.java:118)
> at org.apache.axis.SimpleChain.invoke(SimpleChain.java:83)
> at org.apache.axis.handlers.soap.SOAPService.invoke(SOAPService .java:454)
> at org.apache.axis.server.AxisServer.invoke(AxisServer.java:281 )
> at org.apache.axis.transport.http.AxisServlet.doPost(AxisServle t.java:699)
> at org.eclipse.birt.report.servlet.BirtSoapMessageDispatcherSer
> vlet.doPost(BirtSoapMessageDispatcherServlet.java:265)
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
> at org.apache.axis.transport.http.AxisServletBase.service(AxisS
> ervletBase.java:327)
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
> at org.eclipse.birt.report.servlet.BirtSoapMessageDispatcherSer
> vlet.service(BirtSoapMessageDispatcherServlet.java:122)
> at org.eclipse.equinox.http.registry.internal.ServletManager$Se
> rvletWrapper.service(ServletManager.java:180)
> at org.eclipse.equinox.http.servlet.internal.ServletRegistratio
> n.service(ServletRegistration.java:61)
> at org.eclipse.equinox.http.servlet.internal.ProxyServlet.proce
> ssAlias(ProxyServlet.java:126)
> at org.eclipse.equinox.http.servlet.internal.ProxyServlet.servi
> ce(ProxyServlet.java:60)
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
> at org.eclipse.equinox.http.jetty.internal.HttpServerManager$In
> ternalHttpServiceServlet.service(HttpServerManager.java:318)
> at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder .java:511)
> at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandl
> er.java:390)
> at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandl
> er.java:182)
> at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandl
> er.java:765)
> at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapp
> er.java:152)
> at org.mortbay.jetty.Server.handle(Server.java:326)
> at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnectio n.java:542)
> at org.mortbay.jetty.HttpConnection$RequestHandler.content(Http
> Connection.java:939)
> at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:756)
> at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java: 212)
> at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java: 404)
> at org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEn
> dPoint.java:409)
> at org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThr
> eadPool.java:582)
> Caused by: java.lang.ClassNotFoundException:
> net.thadir.algemeen.handler.ReportEventHandler
> at org.eclipse.birt.core.framework.URLClassLoader.findClass1(UR
> LClassLoader.java:185)
> at org.eclipse.birt.core.framework.URLClassLoader$1.run(URLClas
> sLoader.java:154)
> at org.eclipse.birt.core.framework.URLClassLoader$1.run(URLClas
> sLoader.java:1)
> at java.security.AccessController.doPrivileged(Native Method)
> at org.eclipse.birt.core.framework.URLClassLoader.findClass(URL
> ClassLoader.java:149)
> at java.lang.ClassLoader.loadClass(Unknown Source)
> at java.lang.ClassLoader.loadClass(Unknown Source)
> at org.eclipse.birt.report.engine.executor.ApplicationClassLoad
> er.loadClass(ApplicationClassLoader.java:79)
> at org.eclipse.birt.report.engine.executor.EventHandlerManager.
> getInstance(EventHandlerManager.java:76)
> ... 56 more
> ZLM Algemeen.rptdesign /ZLM BIRT Algemeen line 2 BIRT Viewer Problem
> </pre>
>
> What am I doing wrong? I put the Java project containing the handler in
> the same workbench. As all the documentation i found and read told me.
> I'm probably missing somting very simple.
Previous Topic:Print and print preview with embedded html elements
Next Topic:Resizing problem
Goto Forum:
  


Current Time: Sat Oct 25 17:49:39 GMT 2014

Powered by FUDForum. Page generated in 0.01631 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software