Skip to main content



      Home
Home » Archived » BIRT » Integration in JBoss app possible?
Integration in JBoss app possible? [message #249077] Fri, 20 July 2007 00:21 Go to next message
Eclipse UserFriend
Is it possible to integrate the BIRT Engine API into an application
deployed on JBoss?

I have installed the BIRT 2.2.0 "platform" files (copied from the BIRT
Viewer) in a directory outside of a JBoss controlled directory. I
configured IRT following:

http://www.eclipse.org/birt/phoenix/deploy/reportEngineAPI.p hp

My code:

private static EngineConfig config = null;

public void create(String filepath, OutputStream outputStream, String
format, Map<String, String> params){
try{
if(config == null) {
config = new EngineConfig();
config.setEngineHome("C:\\var\\itsolut\\birt\\platform");
// config.setEngineHome("/var/itsolut/birt/platform");
config.setLogConfig(".", Level.FINEST);

IPlatformContext context = new PlatformFileContext(config);

config.setPlatformContext(context);

try {
Platform.startup(config);
}
catch (BirtException e) {
throw new RuntimeException("Could not start the platform",
e);
}
}

IReportEngineFactory factory = (IReportEngineFactory)
Platform.createFactoryObject(
IReportEngineFactory.EXTENSION_REPORT_ENGINE_FACTORY );
IReportEngine engine = factory.createReportEngine( config );
engine.changeLogLevel( Level.WARNING );

InputStream stream = new FileInputStream(filepath);

IReportRunnable design = engine.openReportDesign(stream);

// here is where the exception (below) is thrown

</snip>

I am getting the following exception:
Caused by: java.lang.NoClassDefFoundError:
com/ibm/icu/text/SimpleDateFormat
at
org.eclipse.birt.report.model.metadata.DateTimePropertyType. <clinit>(DateTimePropertyType.java:61)
at
org.eclipse.birt.report.model.metadata.MetaDataDictionary.<init >(MetaDataDictionary.java:257)
at
org.eclipse.birt.report.model.metadata.MetaDataDictionary.<clinit >(MetaDataDictionary.java:112)
at
org.eclipse.birt.report.model.api.impl.DesignEngineImpl.newS essionHandle(DesignEngineImpl.java:127)
at
org.eclipse.birt.report.model.api.DesignEngine.newSessionHan dle(DesignEngine.java:108)
at
org.eclipse.birt.report.engine.parser.ReportParser.getDesign Handle(ReportParser.java:142)
at
org.eclipse.birt.report.engine.api.impl.ReportEngineHelper.o penReportDesign(ReportEngineHelper.java:243)
at
org.eclipse.birt.report.engine.api.impl.ReportEngineHelper.o penReportDesign(ReportEngineHelper.java:179)
at
org.eclipse.birt.report.engine.api.impl.ReportEngineHelper.o penReportDesign(ReportEngineHelper.java:156)
at
org.eclipse.birt.report.engine.api.impl.ReportEngine.openRep ortDesign(ReportEngine.java:278)
at
com.itsolut.core.component.BIRTManager.create(BIRTManager.ja va:69)
at
com.itsolut.core.action.common.BirtReportGenerator.generate( BirtReportGenerator.java:93)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAcce ssorImpl.java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMe thodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at
org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodIn vocation.java:112)
at
org.jboss.ejb3.interceptor.InvocationContextImpl.proceed(Inv ocationContextImpl.java:166)
... 111 more


Thoughts?

Thanks in advance,
Chris....
Re: Integration in JBoss app possible? [message #249180 is a reply to message #249077] Fri, 20 July 2007 10:57 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: jasonweathersby.alltel.net

Chris,

Can you try to deploy the viewer as a test?
Take a look at the JBoss notes here
http://www.eclipse.org/birt/phoenix/deploy/viewerSetup.php

Jason

Chris Hane wrote:
>
> Is it possible to integrate the BIRT Engine API into an application
> deployed on JBoss?
>
> I have installed the BIRT 2.2.0 "platform" files (copied from the BIRT
> Viewer) in a directory outside of a JBoss controlled directory. I
> configured IRT following:
>
> http://www.eclipse.org/birt/phoenix/deploy/reportEngineAPI.p hp
>
> My code:
>
> private static EngineConfig config = null;
>
> public void create(String filepath, OutputStream outputStream, String
> format, Map<String, String> params){
> try{
> if(config == null) {
> config = new EngineConfig();
> config.setEngineHome("C:\\var\\itsolut\\birt\\platform");
> // config.setEngineHome("/var/itsolut/birt/platform");
> config.setLogConfig(".", Level.FINEST);
> IPlatformContext context = new PlatformFileContext(config);
> config.setPlatformContext(context);
> try {
> Platform.startup(config);
> }
> catch (BirtException e) {
> throw new RuntimeException("Could not start the platform",
> e);
> }
> } IReportEngineFactory factory =
> (IReportEngineFactory) Platform.createFactoryObject(
> IReportEngineFactory.EXTENSION_REPORT_ENGINE_FACTORY );
> IReportEngine engine = factory.createReportEngine( config );
> engine.changeLogLevel( Level.WARNING );
> InputStream stream = new FileInputStream(filepath);
> IReportRunnable design = engine.openReportDesign(stream);
> // here is where the exception (below) is thrown
>
> </snip> I am getting the following exception:
> Caused by: java.lang.NoClassDefFoundError:
> com/ibm/icu/text/SimpleDateFormat
> at
> org.eclipse.birt.report.model.metadata.DateTimePropertyType. <clinit>(DateTimePropertyType.java:61)
>
> at
> org.eclipse.birt.report.model.metadata.MetaDataDictionary.<init >(MetaDataDictionary.java:257)
>
> at
> org.eclipse.birt.report.model.metadata.MetaDataDictionary.<clinit >(MetaDataDictionary.java:112)
>
> at
> org.eclipse.birt.report.model.api.impl.DesignEngineImpl.newS essionHandle(DesignEngineImpl.java:127)
>
> at
> org.eclipse.birt.report.model.api.DesignEngine.newSessionHan dle(DesignEngine.java:108)
>
> at
> org.eclipse.birt.report.engine.parser.ReportParser.getDesign Handle(ReportParser.java:142)
>
> at
> org.eclipse.birt.report.engine.api.impl.ReportEngineHelper.o penReportDesign(ReportEngineHelper.java:243)
>
> at
> org.eclipse.birt.report.engine.api.impl.ReportEngineHelper.o penReportDesign(ReportEngineHelper.java:179)
>
> at
> org.eclipse.birt.report.engine.api.impl.ReportEngineHelper.o penReportDesign(ReportEngineHelper.java:156)
>
> at
> org.eclipse.birt.report.engine.api.impl.ReportEngine.openRep ortDesign(ReportEngine.java:278)
>
> at
> com.itsolut.core.component.BIRTManager.create(BIRTManager.ja va:69)
> at
> com.itsolut.core.action.common.BirtReportGenerator.generate( BirtReportGenerator.java:93)
>
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAcce ssorImpl.java:39)
>
> at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMe thodAccessorImpl.java:25)
>
> at java.lang.reflect.Method.invoke(Method.java:585)
> at
> org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodIn vocation.java:112)
>
> at
> org.jboss.ejb3.interceptor.InvocationContextImpl.proceed(Inv ocationContextImpl.java:166)
>
> ... 111 more
>
>
> Thoughts?
>
> Thanks in advance,
> Chris....
>
Re: Integration in JBoss app possible? [message #249201 is a reply to message #249180] Fri, 20 July 2007 13:01 Go to previous messageGo to next message
Eclipse UserFriend
Jason,

Thanks for the reply.

I didn't try to deploy the viewer; but I did get the BIRT Engine to run in
my application so I can generate reports (only tried the PDF version for
now).

When I deployed just on Tomcat, I had to include 3 jars in my app:
coreapi.jar
engineapi.jar
modelapi.jar

In addition to these three, JBOSS ear files need two more files:
com.ibm.icu.jar
js.jar

Once I included these in the ear (not the war contained in the ear)
proper, everything now works.

Altough, I'm not sure why I need these two additional jars? I would have
thought the classes that need these jars would be in the platform only and
accessed via the OSGI mechanism used to deploy BIRT.

Chris....
Re: Integration in JBoss app possible? [message #249367 is a reply to message #249201] Mon, 23 July 2007 09:32 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: jasonweathersby.alltel.net

BIRT makes use of all the jars in the ReportEngine/lib directory.
For example js.jar is used for scripting in BIRT.

Jason

Chris Hane wrote:
> Jason,
> Thanks for the reply.
>
> I didn't try to deploy the viewer; but I did get the BIRT Engine to run
> in my application so I can generate reports (only tried the PDF version
> for now).
>
> When I deployed just on Tomcat, I had to include 3 jars in my app:
> coreapi.jar
> engineapi.jar
> modelapi.jar
>
> In addition to these three, JBOSS ear files need two more files:
> com.ibm.icu.jar
> js.jar
>
> Once I included these in the ear (not the war contained in the ear)
> proper, everything now works.
>
> Altough, I'm not sure why I need these two additional jars? I would
> have thought the classes that need these jars would be in the platform
> only and accessed via the OSGI mechanism used to deploy BIRT.
>
> Chris....
>
Re: Integration in JBoss app possible? [message #249375 is a reply to message #249367] Mon, 23 July 2007 11:50 Go to previous message
Eclipse UserFriend
ok - that makes sense. I was hoping that the number of libraries that I
had to include directly in my application would be smaller. Right now it
looks like it is going to come out to 9MB.

I was hoping more of those would have been included in the "platform"
directory which is a 1 time upload and configuration per JBoss instance
whereas the other libraries must be included in every application.

Thanks for the info.

Chris....
Previous Topic:Traditional Chinese missing in runtime lang pack for viewer
Next Topic:BIRT 2.2, hidden columns, and Excel emitter
Goto Forum:
  


Current Time: Thu May 08 11:37:53 EDT 2025

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

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

Back to the top