Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » BIRT » Birt 2.5.1 Generating Reports inside other Webapplication
Birt 2.5.1 Generating Reports inside other Webapplication [message #514666] Tue, 16 February 2010 04:38 Go to next message
Ronny Karallus is currently offline Ronny Karallus
Messages: 4
Registered: February 2010
Junior Member
Hello everybody,

I am currently trying to integrate the BIRT ReportEngine to an existing Java Webapplication. Everything worked fine in an older version of the webapp, that used the same version of the libraries that were used within BIRT. My problem is that I need to migrate to a new version. Now, when I try to create a report with BIRT my application throws a LinkageError:

[appserver0] java.lang.LinkageError: loader constraints violated when linking org/w3c/dom/TypeInfo class
[appserver0] at org.apache.xerces.dom.CoreDocumentImpl.createElement(Unknown Source)
[appserver0] at org.eclipse.birt.report.engine.parser.HTMLTextParser.parseHT ML(HTMLTextParser.java:141)
[appserver0] at org.eclipse.birt.report.engine.parser.TextParser.parse(TextP arser.java:111)
[appserver0] at org.eclipse.birt.report.engine.layout.pdf.util.HTML2Content. processForeignData(HTML2Content.java:437)

[appserver0] at org.eclipse.birt.report.engine.layout.pdf.util.HTML2Content. html2Content(HTML2Content.java:418)
[appserver0] at org.eclipse.birt.report.engine.nLayout.LayoutEngine.startFor eign(LayoutEngine.java:627)
[appserver0] at org.eclipse.birt.report.engine.emitter.ContentEmitterUtil.st artContent(ContentEmitterUtil.java:77)
[appserver0] at org.eclipse.birt.report.engine.nLayout.LayoutEngine.visitCon tent(LayoutEngine.java:592)
[appserver0] at org.eclipse.birt.report.engine.nLayout.LayoutEngine.visitChi ldren(LayoutEngine.java:616)
[appserver0] at org.eclipse.birt.report.engine.nLayout.RegionLayoutEngine.la yout(RegionLayoutEngine.java:31)
[appserver0] at org.eclipse.birt.report.engine.nLayout.area.impl.PageArea.la youtFooter(PageArea.java:481)
[appserver0] at org.eclipse.birt.report.engine.nLayout.area.impl.PageArea.in itialize(PageArea.java:249)
[appserver0] at org.eclipse.birt.report.engine.nLayout.area.impl.RootArea.cr eateNewPage(RootArea.java:91)
[appserver0] at org.eclipse.birt.report.engine.nLayout.area.impl.RootArea.in itialize(RootArea.java:82)
[appserver0] at org.eclipse.birt.report.engine.nLayout.LayoutEngine.setConta iner(LayoutEngine.java:340)
[appserver0] at org.eclipse.birt.report.engine.nLayout.LayoutEngine._startCo ntainer(LayoutEngine.java:380)
[appserver0] at org.eclipse.birt.report.engine.nLayout.LayoutEngine.startCon tainer(LayoutEngine.java:334)
[appserver0] at org.eclipse.birt.report.engine.emitter.ContentEmitterAdapter .startPage(ContentEmitterAdapter.java:65)

[appserver0] at org.eclipse.birt.report.engine.nLayout.LayoutEngine.startPag e(LayoutEngine.java:502)
[appserver0] at org.eclipse.birt.report.engine.emitter.CompositeContentEmitt er.startPage(CompositeContentEmitter.java
:290)
[appserver0] at org.eclipse.birt.report.engine.emitter.ContentEmitterUtil.st artContent(ContentEmitterUtil.java:47)
[appserver0] at org.eclipse.birt.report.engine.layout.html.buffer.PageNode.s tart(PageNode.java:49)
[appserver0] at org.eclipse.birt.report.engine.layout.html.buffer.HTMLPageBu ffer.startContent(HTMLPageBuffer.java:113
)
[appserver0] at org.eclipse.birt.report.engine.layout.html.buffer.TableBreak Buffer.startContent(TableBreakBuffer.java
:286)
[appserver0] at org.eclipse.birt.report.engine.layout.html.HTMLLeafItemLM.st art(HTMLLeafItemLM.java:67)
[appserver0] at org.eclipse.birt.report.engine.layout.html.HTMLAbstractLM.la yout(HTMLAbstractLM.java:136)
[appserver0] at org.eclipse.birt.report.engine.layout.html.HTMLBlockStacking LM.layoutNodes(HTMLBlockStackingLM.java:7
0)
[appserver0] at org.eclipse.birt.report.engine.layout.html.HTMLPageLM.layout (HTMLPageLM.java:90)
[appserver0] at org.eclipse.birt.report.engine.layout.html.HTMLReportLayoutE ngine.layout(HTMLReportLayoutEngine.java:
99)
[appserver0] at org.eclipse.birt.report.engine.api.impl.RunAndRenderTask.doR un(RunAndRenderTask.java:170)
[appserver0] at org.eclipse.birt.report.engine.api.impl.RunAndRenderTask.run (RunAndRenderTask.java:75)
... (more)

As you can see the problem can be isolated to XML processing. My Web Application uses Axis2 and all libraries necessary, e.g. Xerces 2.8.1. However, I think the problem is, that there are 2 versions of the TypeInfo (and several other classes) in my classloading hierarchy, 1 from the webapp the other from the ReportEngine.

Does anybody have an idea how to fix this problem? I already played around a little with classloading but that did not lead to a solution

My BIRT Report Runtime Version is 2.5.1

Help is highly appreciated.

Regards
Ronny
Re: Birt 2.5.1 Generating Reports inside other Webapplication [message #514755 is a reply to message #514666] Tue, 16 February 2010 09:44 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason Weathersby
Messages: 9167
Registered: July 2009
Senior Member

Ronny,

Are you using the jars in the lib folder of the WebViewer or the
ReportEngine?

Jason

Ronny Karallus wrote:
> Hello everybody,
>
> I am currently trying to integrate the BIRT ReportEngine to an existing
> Java Webapplication. Everything worked fine in an older version of the
> webapp, that used the same version of the libraries that were used
> within BIRT. My problem is that I need to migrate to a new version. Now,
> when I try to create a report with BIRT my application throws a
> LinkageError:
>
> [appserver0] java.lang.LinkageError: loader constraints violated when
> linking org/w3c/dom/TypeInfo class
> [appserver0] at
> org.apache.xerces.dom.CoreDocumentImpl.createElement(Unknown Source)
> [appserver0] at
> org.eclipse.birt.report.engine.parser.HTMLTextParser.parseHT
> ML(HTMLTextParser.java:141)
> [appserver0] at
> org.eclipse.birt.report.engine.parser.TextParser.parse(TextP
> arser.java:111)
> [appserver0] at
> org.eclipse.birt.report.engine.layout.pdf.util.HTML2Content.
> processForeignData(HTML2Content.java:437)
>
> [appserver0] at
> org.eclipse.birt.report.engine.layout.pdf.util.HTML2Content.
> html2Content(HTML2Content.java:418)
> [appserver0] at
> org.eclipse.birt.report.engine.nLayout.LayoutEngine.startFor
> eign(LayoutEngine.java:627)
> [appserver0] at
> org.eclipse.birt.report.engine.emitter.ContentEmitterUtil.st
> artContent(ContentEmitterUtil.java:77)
> [appserver0] at
> org.eclipse.birt.report.engine.nLayout.LayoutEngine.visitCon
> tent(LayoutEngine.java:592)
> [appserver0] at
> org.eclipse.birt.report.engine.nLayout.LayoutEngine.visitChi
> ldren(LayoutEngine.java:616)
> [appserver0] at
> org.eclipse.birt.report.engine.nLayout.RegionLayoutEngine.la
> yout(RegionLayoutEngine.java:31)
> [appserver0] at
> org.eclipse.birt.report.engine.nLayout.area.impl.PageArea.la
> youtFooter(PageArea.java:481)
> [appserver0] at
> org.eclipse.birt.report.engine.nLayout.area.impl.PageArea.in
> itialize(PageArea.java:249)
> [appserver0] at
> org.eclipse.birt.report.engine.nLayout.area.impl.RootArea.cr
> eateNewPage(RootArea.java:91)
> [appserver0] at
> org.eclipse.birt.report.engine.nLayout.area.impl.RootArea.in
> itialize(RootArea.java:82)
> [appserver0] at
> org.eclipse.birt.report.engine.nLayout.LayoutEngine.setConta
> iner(LayoutEngine.java:340)
> [appserver0] at
> org.eclipse.birt.report.engine.nLayout.LayoutEngine._startCo
> ntainer(LayoutEngine.java:380)
> [appserver0] at
> org.eclipse.birt.report.engine.nLayout.LayoutEngine.startCon
> tainer(LayoutEngine.java:334)
> [appserver0] at
> org.eclipse.birt.report.engine.emitter.ContentEmitterAdapter
> .startPage(ContentEmitterAdapter.java:65)
>
> [appserver0] at
> org.eclipse.birt.report.engine.nLayout.LayoutEngine.startPag
> e(LayoutEngine.java:502)
> [appserver0] at
> org.eclipse.birt.report.engine.emitter.CompositeContentEmitt
> er.startPage(CompositeContentEmitter.java
> :290)
> [appserver0] at
> org.eclipse.birt.report.engine.emitter.ContentEmitterUtil.st
> artContent(ContentEmitterUtil.java:47)
> [appserver0] at
> org.eclipse.birt.report.engine.layout.html.buffer.PageNode.s
> tart(PageNode.java:49)
> [appserver0] at
> org.eclipse.birt.report.engine.layout.html.buffer.HTMLPageBu
> ffer.startContent(HTMLPageBuffer.java:113
> )
> [appserver0] at
> org.eclipse.birt.report.engine.layout.html.buffer.TableBreak
> Buffer.startContent(TableBreakBuffer.java
> :286)
> [appserver0] at
> org.eclipse.birt.report.engine.layout.html.HTMLLeafItemLM.st
> art(HTMLLeafItemLM.java:67)
> [appserver0] at
> org.eclipse.birt.report.engine.layout.html.HTMLAbstractLM.la
> yout(HTMLAbstractLM.java:136)
> [appserver0] at
> org.eclipse.birt.report.engine.layout.html.HTMLBlockStacking
> LM.layoutNodes(HTMLBlockStackingLM.java:7
> 0)
> [appserver0] at
> org.eclipse.birt.report.engine.layout.html.HTMLPageLM.layout
> (HTMLPageLM.java:90)
> [appserver0] at
> org.eclipse.birt.report.engine.layout.html.HTMLReportLayoutE
> ngine.layout(HTMLReportLayoutEngine.java:
> 99)
> [appserver0] at
> org.eclipse.birt.report.engine.api.impl.RunAndRenderTask.doR
> un(RunAndRenderTask.java:170)
> [appserver0] at
> org.eclipse.birt.report.engine.api.impl.RunAndRenderTask.run
> (RunAndRenderTask.java:75)
> .. (more)
>
> As you can see the problem can be isolated to XML processing. My Web
> Application uses Axis2 and all libraries necessary, e.g. Xerces 2.8.1.
> However, I think the problem is, that there are 2 versions of the
> TypeInfo (and several other classes) in my classloading hierarchy, 1
> from the webapp the other from the ReportEngine.
>
> Does anybody have an idea how to fix this problem? I already played
> around a little with classloading but that did not lead to a solution
>
> My BIRT Report Runtime Version is 2.5.1
>
> Help is highly appreciated.
>
> Regards
> Ronny


Jason Weathersby

BIRT Exchange
Re: Birt 2.5.1 Generating Reports inside other Webapplication [message #514772 is a reply to message #514755] Tue, 16 February 2010 10:31 Go to previous messageGo to next message
Ronny Karallus is currently offline Ronny Karallus
Messages: 4
Registered: February 2010
Junior Member
Jason,

I downloaded the Birt 2.5.1. Runtime Release.

What I did is basically:
- unpacked the ReportEngine directory to a custom folder
- copy the libraries from ReportEngine/lib to my webapplication lib folder (so I can use the ReportEngine in the application)
- added a part in my webapplication where the ReportEngine Configuration is initialized from a property file. This basically sets the BIRT_HOME.

private void init()
    {
        File configFile = 
            new File(
                    FileUtils.getClusterConfigDirectory(), 
                    "reportengine.properties"
                    );
        
        this.config = new EngineConfig();
        
        Properties configuration = new Properties();
        try {
            configuration.load(new FileInputStream(configFile));
            
            for(Object key : configuration.keySet())
            {
                if(IPlatformConfig.BIRT_HOME.equals(key))
                {
                    File home = new File(
                                FileUtils.getHomeDirectory(),
                                configuration.getProperty(key.toString())
                            );
                    
                    if(home.exists() && home.canRead())
                    {
                        this.config.setEngineHome(home.getAbsolutePath());
                    }
                    else
                    {
                        Logger.error(this, 
                                "ReportEngine root folder could not be initialized for folder "
                                +home.getAbsolutePath()
                                );
                    }
                }
                else if(key != null)
                {
                    this.config.setProperty(
                            key.toString(), 
                            configuration.getProperty(key.toString())
                            );
                }
            }
            
        } catch (FileNotFoundException e) {
            Logger.error(this, "Error reading report engine configuration", e);
        } catch (IOException e) {
            Logger.error(this, "Error reading report engine configuration", e);
        }
    }


- added a custom part in my Webapplication that loads the report, initializes the parameters, sets the output format (word, pdf, xls) and generates the report. The main part that does the report generation is:

class ReportExecutionCallable implements Callable<Void>
{
    private final Report report;

    private final Collection<ReportParameter> parameters;

    private final ReportOutputFormat format;

    private final OutputStream out;

    public ReportExecutionCallable(Report report,
            Collection<ReportParameter> parameters, ReportOutputFormat format,
            OutputStream out)
    {
        if (report == null)
        {
            throw new IllegalArgumentException("Can't create report execution "
                    + "callable for report = null.");
        }

        if (out == null)
        {
            throw new IllegalArgumentException("Can't create report execution "
                    + "callable. The output stream that the report "
                    + "should be written to is null.");
        }

        this.report = report;
        this.parameters = (parameters == null) ? new ArrayList<ReportParameter>()
                : parameters;
        this.format = (format == null) ? report.getDefaultOutputFormat()
                : format;
        this.out = out;
    }

    public Void call() throws Exception
    {
        IReportEngine reportEngine = MyReportEngineConfig.getInstance()
                .getReportEngine();

        String reportFile = ReportingUtils.getReportFilePath(report);
        IReportRunnable design = reportEngine.openReportDesign(reportFile);

        IRunAndRenderTask task = reportEngine.createRunAndRenderTask(design);

        RenderOption renderOption = new RenderOption();
        renderOption.setOutputFormat(format.getFormatterName());
        renderOption.setOutputStream(out);

        task.setRenderOption(renderOption);

        Map<String, Object> parametersMap = new HashMap<String, Object>();

        Collection<ReportParameter> reportParameters = report
                .getReportParameters();

        addToParametersMap(reportParameters, parametersMap);
        addToParametersMap(parameters, parametersMap);

        task.setParameterValues(parametersMap);

        if (!task.validateParameters())
        {
            throw new IllegalArgumentException(
                    "Report parameter validation failed.");
        }

        task.run();

        task.close();

        return null;
    }

    private void addToParametersMap(Collection<ReportParameter> parameters,
            Map<String, Object> parametersMap)
    {
        for (ReportParameter parameter : parameters)
        {
            // TODO parameter value might not be a string
            parametersMap.put(parameter.getName(), parameter.getValue());
        }
    }
}


Hope this helps to understand my problem.

Regards
Ronny

[Updated on: Tue, 16 February 2010 15:54]

Report message to a moderator

Re: Birt 2.5.1 Generating Reports inside other Webapplication [message #514797 is a reply to message #514772] Tue, 16 February 2010 11:40 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason Weathersby
Messages: 9167
Registered: July 2009
Senior Member

Ronny,

You can also make the report engine as part of the web app.
Take a look at:
http://wiki.eclipse.org/Servlet_Example_%28BIRT%29_2.1


In your example can you try:

config.getAppContext().put(EngineConstants.APPCONTEXT_CLASSL OADER_KEY,
whateverthenameofyourclassis.class.getClassLoader());

Jason

Ronny Karallus wrote:
> Jason,
>
> I downloaded the Birt 2.5.1. Runtime Release.
> What I did is basically:
> - unpacked the ReportEngine directory to a custom folder
> - copy the libraries from ReportEngine/lib to my webapplication lib
> folder (so I can use the ReportEngine in the application)
> - added a part in my webapplication where the ReportEngine Configuration
> is initialized from a property file. This basically sets the BIRT_HOME.
>
> private void init()
> {
> File configFile = new File(
> FileUtils.getClusterConfigDirectory(),
> "reportengine.properties"
> );
> this.config = new EngineConfig();
> Properties configuration = new Properties();
> try {
> configuration.load(new FileInputStream(configFile));
> for(Object key : configuration.keySet())
> {
> if(IPlatformConfig.BIRT_HOME.equals(key))
> {
> File home = new File(
> FileUtils.getHomeDirectory(),
> configuration.getProperty(key.toString())
> );
> if(home.exists() && home.canRead())
> {
> this.config.setEngineHome(home.getAbsolutePath());
> }
> else
> {
> Logger.error(this,
> "ReportEngine root folder could not be initialized for folder "
> +home.getAbsolutePath()
> );
> }
> }
> else if(key != null)
> {
> this.config.setProperty(
> key.toString(),
> configuration.getProperty(key.toString())
> );
> }
> }
> } catch (FileNotFoundException e) {
> Logger.error(this, "Error reading report engine
> configuration", e);
> } catch (IOException e) {
> Logger.error(this, "Error reading report engine
> configuration", e);
> }
> }
>
> - added a custom part in my Webapplication that loads the report,
> initializes the parameters, sets the output format (word, pdf, xls) and
> generates the report.
>
> class ReportExecutionCallable implements Callable<Void>
> {
> private final Report report;
>
> private final Collection<ReportParameter> parameters;
>
> private final ReportOutputFormat format;
>
> private final OutputStream out;
>
> public ReportExecutionCallable(Report report,
> Collection<ReportParameter> parameters, ReportOutputFormat
> format,
> OutputStream out)
> {
> if (report == null)
> {
> throw new IllegalArgumentException("Can't create report
> execution "
> + "callable for report = null.");
> }
>
> if (out == null)
> {
> throw new IllegalArgumentException("Can't create report
> execution "
> + "callable. The output stream that the report "
> + "should be written to is null.");
> }
>
> this.report = report;
> this.parameters = (parameters == null) ? new
> ArrayList<ReportParameter>()
> : parameters;
> this.format = (format == null) ? report.getDefaultOutputFormat()
> : format;
> this.out = out;
> }
>
> public Void call() throws Exception
> {
> IReportEngine reportEngine = MyReportEngineConfig.getInstance()
> .getReportEngine();
>
> String reportFile = ReportingUtils.getReportFilePath(report);
> IReportRunnable design = reportEngine.openReportDesign(reportFile);
>
> IRunAndRenderTask task =
> reportEngine.createRunAndRenderTask(design);
>
> RenderOption renderOption = new RenderOption();
> renderOption.setOutputFormat(format.getFormatterName());
> renderOption.setOutputStream(out);
>
> task.setRenderOption(renderOption);
>
> Map<String, Object> parametersMap = new HashMap<String, Object>();
>
> Collection<ReportParameter> reportParameters = report
> .getReportParameters();
>
> addToParametersMap(reportParameters, parametersMap);
> addToParametersMap(parameters, parametersMap);
>
> task.setParameterValues(parametersMap);
>
> if (!task.validateParameters())
> {
> throw new IllegalArgumentException(
> "Report parameter validation failed.");
> }
>
> task.run();
>
> task.close();
>
> return null;
> }
>
> private void addToParametersMap(Collection<ReportParameter> parameters,
> Map<String, Object> parametersMap)
> {
> for (ReportParameter parameter : parameters)
> {
> // TODO parameter value might not be a string
> parametersMap.put(parameter.getName(), parameter.getValue());
> }
> }
> }
>
> Hope this helps to unserstand my problem.
>
> Regards
> Ronny


Jason Weathersby

BIRT Exchange
Re: Birt 2.5.1 Generating Reports inside other Webapplication [message #514914 is a reply to message #514797] Wed, 17 February 2010 03:21 Go to previous messageGo to next message
Ronny Karallus is currently offline Ronny Karallus
Messages: 4
Registered: February 2010
Junior Member
Jason,

I had a look at your proposal. Unfortunately the servlet example is not usable for me, because the webapp I am using has an application structure beyond servlets. However, I think I did basically the same as written in the example (expect that I cannot use the folder structure as in the example).

I also tried to set the classloader using
this.config.getAppContext().put(EngineConstants.APPCONTEXT_C LASSLOADER_KEY, ClassLoader.getSystemClassLoader());
This lead to no change. The error is still the same.

However, I am not sure how this should help. From my point of view the problem is, that the Classloader is "inherited" from my Webapplication. So all libraries within my webapp (including the conflicting library) are in the classpath of the reporting engine. This is normally the default behaviour, if the ReportEngine does not have an own classloader (that does not have a parent) ... as far as I understand.

However, what I tried is to delete the conflicting jar from the reportengine (javax.xml_1.3.4.v200902170245.jar). This seems to work. I can now execute my hello world report (which does basically write a hello world text field).

If I try to execute a report that accesses the DB it leads to a new error (which is not bound to linkage anymore). Does anyone have an idea why this may occur? (I copied my JDBC driver to the ReportEngine\plugins\org.eclipse.birt.report.data.oda.jdbc_2 .5.1.v20090821\drivers
directory):
[appserver0] SEVERE: Cannot find or process the ODA data source extension configuration.
[appserver0] java.lang.IllegalArgumentException: org.eclipse.birt.report.data.oda.jdbc
[appserver0] at org.eclipse.datatools.connectivity.oda.util.manifest.Manifes tExplorer.getExtensionManifest(ManifestExplorer.java:200)
[appserver0] at org.eclipse.birt.data.engine.odaconsumer.Driver.doGetDriverM anifest(Driver.java:147)
[appserver0] at org.eclipse.birt.data.engine.odaconsumer.Driver.findDataSour ceExtensionConfig(Driver.java:123)
[appserver0] at org.eclipse.birt.data.engine.odaconsumer.Driver.getDriverExt ensionConfig(Driver.java:78)
[appserver0] at org.eclipse.birt.data.engine.odaconsumer.Driver.getExtension Config(Driver.java:60)
[appserver0] at org.eclipse.birt.data.engine.odaconsumer.Driver.getDriverHel per(Driver.java:93)
[appserver0] at org.eclipse.birt.data.engine.odaconsumer.DriverManager.getDr iverHelper(DriverManager.java:98)
[appserver0] at org.eclipse.birt.data.engine.odaconsumer.ConnectionManager.o penConnection(ConnectionManager.java:151)
[appserver0] at org.eclipse.birt.data.engine.executor.DataSource.newConnecti on(DataSource.java:193)
[appserver0] at org.eclipse.birt.data.engine.executor.DataSource.open(DataSo urce.java:181)
[appserver0] at org.eclipse.birt.data.engine.impl.DataSourceRuntime.openOdiD ataSource(DataSourceRuntime.java:209)
[appserver0] at org.eclipse.birt.data.engine.impl.QueryExecutor.openDataSour ce(QueryExecutor.java:396)
[appserver0] at org.eclipse.birt.data.engine.impl.QueryExecutor.prepareExecu tion(QueryExecutor.java:315)
[appserver0] at org.eclipse.birt.data.engine.impl.PreparedQuery.doPrepare(Pr eparedQuery.java:448)
[appserver0] at org.eclipse.birt.data.engine.impl.PreparedDataSourceQuery.pr oduceQueryResults(PreparedDataSourceQuery.java:190)
[appserver0] at org.eclipse.birt.data.engine.impl.PreparedDataSourceQuery.ex ecute(PreparedDataSourceQuery.java:178)
[appserver0] at org.eclipse.birt.data.engine.impl.PreparedOdaDSQuery.execute (PreparedOdaDSQuery.java:144)
[appserver0] at org.eclipse.birt.report.data.adapter.impl.DataRequestSession Impl.execute(DataRequestSessionImpl.java:511)
[appserver0] at org.eclipse.birt.report.engine.data.dte.DteDataEngine.doExec uteQuery(DteDataEngine.java:139)
[appserver0] at org.eclipse.birt.report.engine.data.dte.AbstractDataEngine.e xecute(AbstractDataEngine.java:254)
[appserver0] at org.eclipse.birt.report.engine.executor.ExtendedGenerateExec utor.executeQueries(ExtendedGenerateExecutor.java:205)
[appserver0] at org.eclipse.birt.report.engine.executor.ExtendedGenerateExec utor.execute(ExtendedGenerateExecutor.java:65)
[appserver0] at org.eclipse.birt.report.engine.executor.ExtendedItemExecutor .execute(ExtendedItemExecutor.java:62)
[appserver0] at org.eclipse.birt.report.engine.internal.executor.dup.Suppres sDuplicateItemExecutor.execute(SuppressDuplicateItemExecutor .java:43)
[appserver0] at org.eclipse.birt.report.engine.internal.executor.wrap.Wrappe dReportItemExecutor.execute(WrappedReportItemExecutor.java:4 6)
[appserver0] at org.eclipse.birt.report.engine.internal.executor.l18n.Locali zedReportItemExecutor.execute(LocalizedReportItemExecutor.ja va:34)
[appserver0] at org.eclipse.birt.report.engine.layout.html.HTMLBlockStacking LM.layoutNodes(HTMLBlockStackingLM.java:65)
[appserver0] at org.eclipse.birt.report.engine.layout.html.HTMLPageLM.layout (HTMLPageLM.java:90)
[appserver0] at org.eclipse.birt.report.engine.layout.html.HTMLReportLayoutE ngine.layout(HTMLReportLayoutEngine.java:99)
[appserver0] at org.eclipse.birt.report.engine.api.impl.RunAndRenderTask.doR un(RunAndRenderTask.java:170)
[appserver0] at org.eclipse.birt.report.engine.api.impl.RunAndRenderTask.run (RunAndRenderTask.java:75)
...
[appserver0] Caused by: org.eclipse.birt.data.engine.core.DataException: Cannot find or process the org.eclipse.birt.report.data.oda.jdbc driver's data source extension configuration.
[appserver0] org.eclipse.birt.report.data.oda.jdbc
[appserver0] at org.eclipse.birt.data.engine.odaconsumer.Driver.throwConfigE xception(Driver.java:176)
[appserver0] at org.eclipse.birt.data.engine.odaconsumer.Driver.doGetDriverM anifest(Driver.java:165)
[appserver0] at org.eclipse.birt.data.engine.odaconsumer.Driver.findDataSour ceExtensionConfig(Driver.java:123)
[appserver0] at org.eclipse.birt.data.engine.odaconsumer.Driver.getDriverExt ensionConfig(Driver.java:78)
[appserver0] at org.eclipse.birt.data.engine.odaconsumer.Driver.getExtension Config(Driver.java:60)
[appserver0] at org.eclipse.birt.data.engine.odaconsumer.Driver.getDriverHel per(Driver.java:93)
[appserver0] at org.eclipse.birt.data.engine.odaconsumer.DriverManager.getDr iverHelper(DriverManager.java:98)
[appserver0] at org.eclipse.birt.data.engine.odaconsumer.ConnectionManager.o penConnection(ConnectionManager.java:151)
[appserver0] at org.eclipse.birt.data.engine.executor.DataSource.newConnecti on(DataSource.java:193)
[appserver0] at org.eclipse.birt.data.engine.executor.DataSource.open(DataSo urce.java:181)
[appserver0] at org.eclipse.birt.data.engine.impl.DataSourceRuntime.openOdiD ataSource(DataSourceRuntime.java:209)
[appserver0] at org.eclipse.birt.data.engine.impl.QueryExecutor.openDataSour ce(QueryExecutor.java:396)
[appserver0] at org.eclipse.birt.data.engine.impl.QueryExecutor.prepareExecu tion(QueryExecutor.java:315)
[appserver0] at org.eclipse.birt.data.engine.impl.PreparedQuery.doPrepare(Pr eparedQuery.java:448)
[appserver0] at org.eclipse.birt.data.engine.impl.PreparedDataSourceQuery.pr oduceQueryResults(PreparedDataSourceQuery.java:190)
[appserver0] at org.eclipse.birt.data.engine.impl.PreparedDataSourceQuery.ex ecute(PreparedDataSourceQuery.java:178)
[appserver0] at org.eclipse.birt.data.engine.impl.PreparedOdaDSQuery.execute (PreparedOdaDSQuery.java:144)
[appserver0] at org.eclipse.birt.report.data.adapter.impl.DataRequestSession Impl.execute(DataRequestSessionImpl.java:511)
[appserver0] ... 20 more
[appserver0] Caused by: java.lang.IllegalArgumentException: org.eclipse.birt.report.data.oda.jdbc
[appserver0] at org.eclipse.datatools.connectivity.oda.util.manifest.Manifes tExplorer.getExtensionManifest(ManifestExplorer.java:200)
[appserver0] at org.eclipse.birt.data.engine.odaconsumer.Driver.doGetDriverM anifest(Driver.java:147)
[appserver0] ... 36 more
Re: Birt 2.5.1 Generating Reports inside other Webapplication [message #515149 is a reply to message #514914] Wed, 17 February 2010 16:45 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason Weathersby
Messages: 9167
Registered: July 2009
Senior Member

Did you leave the parent classloader setting in the code after you
deleted the javax.xml plugin? The problem is that the jdbc oda plugin
depends on the org.apache.xerces plugin which depends on the javax.xml
plugin. What jar in your application is the javax.xml plugin
conflicting with?

Jason

Ronny Karallus wrote:
> Jason,
>
> I had a look at your proposal. Unfortunately the servlet example is not
> usable for me, because the webapp I am using has an application
> structure beyond servlets. However, I think I did basically the same as
> written in the example (expect that I cannot use the folder structure as
> in the example).
>
> I also tried to set the classloader using
> this.config.getAppContext().put(EngineConstants.APPCONTEXT_C
> LASSLOADER_KEY, ClassLoader.getSystemClassLoader());
> This lead to no change. The error is still the same.
>
> However, I am not sure how this should help. From my point of view the
> problem is, that the Classloader is "inherited" from my Webapplication.
> So all libraries within my webapp (including the conflicting library)
> are in the classpath of the reporting engine. This is normally the
> default behaviour, if the ReportEngine does not have an own classloader
> (that does not have a parent) ... as far as I understand.
>
> However, what I tried is to delete the conflicting jar from the
> reportengine (javax.xml_1.3.4.v200902170245.jar). This seems to work. I
> can now execute my hello world report (which does basically write a
> hello world text field).
> If I try to execute a report that accesses the DB it leads to a new
> error (which is not bound to linkage anymore). Does anyone have an idea
> why this may occur? (I copied my JDBC driver to the
> ReportEngine\plugins\org.eclipse.birt.report.data.oda.jdbc_2
> .5.1.v20090821\drivers
> directory):
> [appserver0] SEVERE: Cannot find or process the ODA data source
> extension configuration.
> [appserver0] java.lang.IllegalArgumentException:
> org.eclipse.birt.report.data.oda.jdbc
> [appserver0] at
> org.eclipse.datatools.connectivity.oda.util.manifest.Manifes
> tExplorer.getExtensionManifest(ManifestExplorer.java:200)
> [appserver0] at
> org.eclipse.birt.data.engine.odaconsumer.Driver.doGetDriverM
> anifest(Driver.java:147)
> [appserver0] at
> org.eclipse.birt.data.engine.odaconsumer.Driver.findDataSour
> ceExtensionConfig(Driver.java:123)
> [appserver0] at
> org.eclipse.birt.data.engine.odaconsumer.Driver.getDriverExt
> ensionConfig(Driver.java:78)
> [appserver0] at
> org.eclipse.birt.data.engine.odaconsumer.Driver.getExtension
> Config(Driver.java:60)
> [appserver0] at
> org.eclipse.birt.data.engine.odaconsumer.Driver.getDriverHel
> per(Driver.java:93)
> [appserver0] at
> org.eclipse.birt.data.engine.odaconsumer.DriverManager.getDr
> iverHelper(DriverManager.java:98)
> [appserver0] at
> org.eclipse.birt.data.engine.odaconsumer.ConnectionManager.o
> penConnection(ConnectionManager.java:151)
> [appserver0] at
> org.eclipse.birt.data.engine.executor.DataSource.newConnecti
> on(DataSource.java:193)
> [appserver0] at
> org.eclipse.birt.data.engine.executor.DataSource.open(DataSo urce.java:181)
> [appserver0] at
> org.eclipse.birt.data.engine.impl.DataSourceRuntime.openOdiD
> ataSource(DataSourceRuntime.java:209)
> [appserver0] at
> org.eclipse.birt.data.engine.impl.QueryExecutor.openDataSour
> ce(QueryExecutor.java:396)
> [appserver0] at
> org.eclipse.birt.data.engine.impl.QueryExecutor.prepareExecu
> tion(QueryExecutor.java:315)
> [appserver0] at
> org.eclipse.birt.data.engine.impl.PreparedQuery.doPrepare(Pr
> eparedQuery.java:448)
> [appserver0] at
> org.eclipse.birt.data.engine.impl.PreparedDataSourceQuery.pr
> oduceQueryResults(PreparedDataSourceQuery.java:190)
> [appserver0] at
> org.eclipse.birt.data.engine.impl.PreparedDataSourceQuery.ex
> ecute(PreparedDataSourceQuery.java:178)
> [appserver0] at
> org.eclipse.birt.data.engine.impl.PreparedOdaDSQuery.execute
> (PreparedOdaDSQuery.java:144)
> [appserver0] at
> org.eclipse.birt.report.data.adapter.impl.DataRequestSession
> Impl.execute(DataRequestSessionImpl.java:511)
> [appserver0] at
> org.eclipse.birt.report.engine.data.dte.DteDataEngine.doExec
> uteQuery(DteDataEngine.java:139)
> [appserver0] at
> org.eclipse.birt.report.engine.data.dte.AbstractDataEngine.e
> xecute(AbstractDataEngine.java:254)
> [appserver0] at
> org.eclipse.birt.report.engine.executor.ExtendedGenerateExec
> utor.executeQueries(ExtendedGenerateExecutor.java:205)
> [appserver0] at
> org.eclipse.birt.report.engine.executor.ExtendedGenerateExec
> utor.execute(ExtendedGenerateExecutor.java:65)
> [appserver0] at
> org.eclipse.birt.report.engine.executor.ExtendedItemExecutor
> .execute(ExtendedItemExecutor.java:62)
> [appserver0] at
> org.eclipse.birt.report.engine.internal.executor.dup.Suppres
> sDuplicateItemExecutor.execute(SuppressDuplicateItemExecutor .java:43)
> [appserver0] at
> org.eclipse.birt.report.engine.internal.executor.wrap.Wrappe
> dReportItemExecutor.execute(WrappedReportItemExecutor.java:4 6)
> [appserver0] at
> org.eclipse.birt.report.engine.internal.executor.l18n.Locali
> zedReportItemExecutor.execute(LocalizedReportItemExecutor.ja va:34)
> [appserver0] at
> org.eclipse.birt.report.engine.layout.html.HTMLBlockStacking
> LM.layoutNodes(HTMLBlockStackingLM.java:65)
> [appserver0] at
> org.eclipse.birt.report.engine.layout.html.HTMLPageLM.layout
> (HTMLPageLM.java:90)
> [appserver0] at
> org.eclipse.birt.report.engine.layout.html.HTMLReportLayoutE
> ngine.layout(HTMLReportLayoutEngine.java:99)
> [appserver0] at
> org.eclipse.birt.report.engine.api.impl.RunAndRenderTask.doR
> un(RunAndRenderTask.java:170)
> [appserver0] at
> org.eclipse.birt.report.engine.api.impl.RunAndRenderTask.run
> (RunAndRenderTask.java:75)
> ..
> [appserver0] Caused by: org.eclipse.birt.data.engine.core.DataException:
> Cannot find or process the org.eclipse.birt.report.data.oda.jdbc
> driver's data source extension configuration.
> [appserver0] org.eclipse.birt.report.data.oda.jdbc
> [appserver0] at
> org.eclipse.birt.data.engine.odaconsumer.Driver.throwConfigE
> xception(Driver.java:176)
> [appserver0] at
> org.eclipse.birt.data.engine.odaconsumer.Driver.doGetDriverM
> anifest(Driver.java:165)
> [appserver0] at
> org.eclipse.birt.data.engine.odaconsumer.Driver.findDataSour
> ceExtensionConfig(Driver.java:123)
> [appserver0] at
> org.eclipse.birt.data.engine.odaconsumer.Driver.getDriverExt
> ensionConfig(Driver.java:78)
> [appserver0] at
> org.eclipse.birt.data.engine.odaconsumer.Driver.getExtension
> Config(Driver.java:60)
> [appserver0] at
> org.eclipse.birt.data.engine.odaconsumer.Driver.getDriverHel
> per(Driver.java:93)
> [appserver0] at
> org.eclipse.birt.data.engine.odaconsumer.DriverManager.getDr
> iverHelper(DriverManager.java:98)
> [appserver0] at
> org.eclipse.birt.data.engine.odaconsumer.ConnectionManager.o
> penConnection(ConnectionManager.java:151)
> [appserver0] at
> org.eclipse.birt.data.engine.executor.DataSource.newConnecti
> on(DataSource.java:193)
> [appserver0] at
> org.eclipse.birt.data.engine.executor.DataSource.open(DataSo urce.java:181)
> [appserver0] at
> org.eclipse.birt.data.engine.impl.DataSourceRuntime.openOdiD
> ataSource(DataSourceRuntime.java:209)
> [appserver0] at
> org.eclipse.birt.data.engine.impl.QueryExecutor.openDataSour
> ce(QueryExecutor.java:396)
> [appserver0] at
> org.eclipse.birt.data.engine.impl.QueryExecutor.prepareExecu
> tion(QueryExecutor.java:315)
> [appserver0] at
> org.eclipse.birt.data.engine.impl.PreparedQuery.doPrepare(Pr
> eparedQuery.java:448)
> [appserver0] at
> org.eclipse.birt.data.engine.impl.PreparedDataSourceQuery.pr
> oduceQueryResults(PreparedDataSourceQuery.java:190)
> [appserver0] at
> org.eclipse.birt.data.engine.impl.PreparedDataSourceQuery.ex
> ecute(PreparedDataSourceQuery.java:178)
> [appserver0] at
> org.eclipse.birt.data.engine.impl.PreparedOdaDSQuery.execute
> (PreparedOdaDSQuery.java:144)
> [appserver0] at
> org.eclipse.birt.report.data.adapter.impl.DataRequestSession
> Impl.execute(DataRequestSessionImpl.java:511)
> [appserver0] ... 20 more
> [appserver0] Caused by: java.lang.IllegalArgumentException:
> org.eclipse.birt.report.data.oda.jdbc
> [appserver0] at
> org.eclipse.datatools.connectivity.oda.util.manifest.Manifes
> tExplorer.getExtensionManifest(ManifestExplorer.java:200)
> [appserver0] at
> org.eclipse.birt.data.engine.odaconsumer.Driver.doGetDriverM
> anifest(Driver.java:147)
> [appserver0] ... 36 more


Jason Weathersby

BIRT Exchange
Re: Birt 2.5.1 Generating Reports inside other Webapplication [message #515209 is a reply to message #515149] Thu, 18 February 2010 03:29 Go to previous messageGo to next message
Ronny Karallus is currently offline Ronny Karallus
Messages: 4
Registered: February 2010
Junior Member
I tried it both ways (with and without setting the classloader explicitly)

Edit: I see your point with the plugin dependency. Thats seems to be the cause for the error Sad

[Updated on: Thu, 18 February 2010 06:06]

Report message to a moderator

Re: Birt 2.5.1 Generating Reports inside other Webapplication [message #515324 is a reply to message #515209] Thu, 18 February 2010 03:54 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason Weathersby
Messages: 9167
Registered: July 2009
Senior Member

Ronny,

I believe the oda mechanism is using Xerces to parse the xml config file
.. Can you open a bug for this as I can not reproduce the issue.

Jason

Ronny Karallus wrote:
> I tried it both ways (with and without setting the classloader explicitly)
>
> The javax.xml Jar is conflicting with the xmlbeans-2.3.0 (thats my
> guess) Jar, which also contains org.w3c.dom.TypeInfo. I don't know if it
> is really necessary because JDK 5 rt.jar already contains all classes
> contained within that jar?
>
> When I am trying to run the "Hello World" report with the javax.xml JAR,
> it fails with the LinkageError, if I remove it, it works fine. Are you
> sure the exception from my posting above is caused by missing
> dependencies? Wouldn't the exception than be another one (something like
> LinkageError, InstantiationException or something?)


Jason Weathersby

BIRT Exchange
Re: Birt 2.5.1 Generating Reports inside other Webapplication [message #725920 is a reply to message #515324] Fri, 16 September 2011 03:40 Go to previous message
raghav  is currently offline raghav
Messages: 2
Registered: September 2011
Junior Member
Hi

I am also facing same issue. is there any solution for this issue??
Previous Topic:how to prevent table break into two pages?
Next Topic:BIRT 3.7 internal browser
Goto Forum:
  


Current Time: Sun Apr 20 17:55:42 EDT 2014

Powered by FUDForum. Page generated in 0.01990 seconds