OSGI platform failing to start [message #693390] |
Wed, 06 July 2011 11:28 |
vrush Mising name Messages: 51 Registered: July 2009 Location: Pune |
Member |
|
|
Hi,
I'm creating a swt/jface viewer to display BIRT graphs. I could do it with a browser RCP but still struggling for viewer as I need an instance of chart but OSGI platform is failing to start.
Here is a code snippet,
IReportEngine engine = null;
EngineConfig config = null;
// Configure the Engine and start the Platform
config = new EngineConfig();
config.setEngineHome("C:/birt-runtime-3_7_0/ReportEngine");
// set log config using ( null, Level ) if you do not want a log file
config.setLogConfig(null, Level.FINE);
//start birt platform and create factories
Platform.startup(config);
Leading to errors,
org.eclipse.birt.core.exception.BirtException: error.CannotStartupOSGIPlatform
at org.eclipse.birt.core.framework.Platform.startup(Platform.java:92)
Please provide some pointers or if any help docs.
Response awaited.
Thanks in advance,
Vrushali.
|
|
|
Re: OSGI platform failing to start [message #693692 is a reply to message #693390] |
Thu, 07 July 2011 02:27 |
|
In BIRT 3.7 the runtime is POJO based and you do not set birt home
unless you are using the plugins that are supplied with the designer or
framework. If you want to use the runtime/ReportEngine you need to add
the jars in ReportEngine/lib to your classpath. If you are going to use
the designer plugins you should be able to add them to your eclipse app
and set birt home to "". The approach you are using should work fine
for 2.6.2 or earlier.
Jason
On 7/6/2011 7:28 AM, vrush wrote:
> Hi,
>
> I'm creating a swt/jface viewer to display BIRT graphs. I could do it
> with a browser RCP but still struggling for viewer as I need an instance
> of chart but OSGI platform is failing to start.
>
> Here is a code snippet,
>
> IReportEngine engine = null;
> EngineConfig config = null;
>
> // Configure the Engine and start the Platform
> config = new EngineConfig();
> config.setEngineHome("C:/birt-runtime-3_7_0/ReportEngine");
> // set log config using ( null, Level ) if you do not want a log file
> config.setLogConfig(null, Level.FINE);
>
> //start birt platform and create factories
> Platform.startup(config);
>
>
> Leading to errors,
>
>
> org.eclipse.birt.core.exception.BirtException:
> error.CannotStartupOSGIPlatform
> at org.eclipse.birt.core.framework.Platform.startup(Platform.java:92)
>
>
> Please provide some pointers or if any help docs.
> Response awaited.
>
> Thanks in advance,
> Vrushali.
|
|
|
|
Re: OSGI platform failing to start [message #694484 is a reply to message #693712] |
Fri, 08 July 2011 17:33 |
|
Vrushali,
Are the birt plugins in your app? If so you either have to remove them
and use only the pojo runtime or use the plugins which does not require
a platform startup as they will already be started. If you use the pojo
runtime, make sure all the libs in the reportengine/lib directory are in
your build path. If you can stub out a small app and email it to me I
will add it for you. My email is jasonweathersby at windstream dot net.
Jason
On 7/7/2011 12:22 AM, vrush wrote:
>
> Thanks Jason for your reply. I've added birt-runtime/ReportEngine path
> to build path and supplied the same as
> config.setEngineHome("C:/birt-runtime-3_7_0/ReportEngine");
>
> But still an error remains the same.
>
> Newbie to BIRT so good chances of me missing anything obvious. Please
> suggest if there are steps missing.
>
> Thanks,
> Vrushali.
|
|
|
Re: OSGI platform failing to start [message #694487 is a reply to message #693712] |
Fri, 08 July 2011 17:33 |
|
Vrushali,
Are the birt plugins in your app? If so you either have to remove them
and use only the pojo runtime or use the plugins which does not require
a platform startup as they will already be started. If you use the pojo
runtime, make sure all the libs in the reportengine/lib directory are in
your build path. If you can stub out a small app and email it to me I
will add it for you. My email is jasonweathersby at windstream dot net.
Jason
On 7/7/2011 12:22 AM, vrush wrote:
>
> Thanks Jason for your reply. I've added birt-runtime/ReportEngine path
> to build path and supplied the same as
> config.setEngineHome("C:/birt-runtime-3_7_0/ReportEngine");
>
> But still an error remains the same.
>
> Newbie to BIRT so good chances of me missing anything obvious. Please
> suggest if there are steps missing.
>
> Thanks,
> Vrushali.
|
|
|
Re: OSGI platform failing to start [message #694581 is a reply to message #694487] |
Fri, 08 July 2011 22:05 |
|
Hello Jason,
I'm having the same problem as the Vrushali.
I'm trying to migrate Birt from version 2.6 to version 3.7 ..
but is experiencing the following error when initializing the app on JBoss 4.2:
ERROR [STDERR] org.eclipse.birt.core.exception.BirtException: Cannot startup the OSGI framework
ERROR [STDERR] at org.eclipse.birt.core.framework.Platform.startup (Platform.java: 90)
...
ERROR [STDERR] Caused by: org.eclipse.birt.core.exception.BirtException: Could not start the Framework -
ERROR [STDERR] at org.eclipse.birt.core.framework.osgi.OSGILauncher.startup (OSGILauncher.java: 87)
ERROR [STDERR] at org.eclipse.birt.core.framework.Platform.startup (Platform.java: 78)
I configured my app based on the example of the birt runtime WebViewerExample 3.7:
- Removed WEB_INF dir / platform version 2.6
- I copied the new libs for WEB_INF dir / lib
- Updated the web.xml with the additional settings for the birt
- I copied the files / dir WebViewerExample below:
- I copied the dir webcontent
WEB_INF:
- Viewer.properties
- Server-config.wsdd
- Jrun.web.xml
- /Tlds
The error still occurs on startup when loading the server deploy the application ..
Thanks,
Robson
|
|
|
Re: OSGI platform failing to start [message #694586 is a reply to message #694581] |
Fri, 08 July 2011 22:20 |
|
Did you remove the configuration directory as well?
Verify you do not have any 2.6 libs left in your web-inf/lib directory.
Jason
On 7/8/2011 6:05 PM, Robson R Ferreira wrote:
> Hello Jason,
>
> I'm having the same problem as the Vrushali.
> I'm trying to migrate Birt from version 2.6 to version 3.7 ..
>
> but is experiencing the following error when initializing the app on
> JBoss 4.2:
>
> ERROR [STDERR] org.eclipse.birt.core.exception.BirtException: Cannot
> startup the OSGI framework
> ERROR [STDERR] at org.eclipse.birt.core.framework.Platform.startup
> (Platform.java: 90)
> ...
> ERROR [STDERR] Caused by: org.eclipse.birt.core.exception.BirtException:
> Could not start the Framework -
> ERROR [STDERR] at
> org.eclipse.birt.core.framework.osgi.OSGILauncher.startup
> (OSGILauncher.java: 87)
> ERROR [STDERR] at org.eclipse.birt.core.framework.Platform.startup
> (Platform.java: 78)
>
> I configured my app based on the example of the birt runtime
> WebViewerExample 3.7:
>
> - Removed WEB_INF dir / platform version 2.6
> - I copied the new libs for WEB_INF dir / lib
> - Updated the web.xml with the additional settings for the birt
> - I copied the files / dir WebViewerExample below:
> - I copied the dir webcontent
> WEB_INF:
> - Viewer.properties
> - Server-config.wsdd
> - Jrun.web.xml
> - /Tlds
>
> The error still occurs on startup when loading the server deploy the
> application ..
>
> Thanks,
> Robson
>
|
|
|
Re: OSGI platform failing to start [message #695319 is a reply to message #694586] |
Mon, 11 July 2011 13:47 |
|
Hello Jason,
I checked the libs the app .. removed some old libs that were still in the project, but still
continues with the same error!
I Debugs the source code and the error occurs at this point:
09:32:08,710 ERROR [STDERR] org.eclipse.birt.core.exception.BirtException: Cant startup the OSGI framework
09:32:08,713 ERROR [STDERR] at org.eclipse.birt.core.framework.Platform.startup(Platform.java:90)
09:32:08,715 ERROR [STDERR] at org.eclipse.birt.report.service.ReportEngineService.setEngineContext(ReportEngineService.java:328)
09:32:08,716 ERROR [STDERR] at org.eclipse.birt.report.service.BirtViewerReportService.setContext(BirtViewerReportService.java:1022)
09:32:08,717 ERROR [STDERR] at org.eclipse.birt.report.listener.ViewerServletContextListener.contextInitialized(ViewerServletContextListener.java:62)
...
09:32:08,790 ERROR [STDERR] Caused by: org.eclipse.birt.core.exception.BirtException: Could not start the Framework - C:\jboss-4.2.2.GA\server\default\.\deploy\jdoctor.ear\jdoctor_web.war\WEB-INF\platformC:\jboss-4.2.2.GA\server\default\.\deploy\jdoctor.ear\jdoctor_web.war\WEB-INF\platform
09:32:08,791 ERROR [STDERR] at org.eclipse.birt.core.framework.osgi.OSGILauncher.startup(OSGILauncher.java:87)
09:32:08,791 ERROR [STDERR] at org.eclipse.birt.core.framework.Platform.startup(Platform.java:78)
Do you have any idea what might be?
Att,
Robson
|
|
|
Re: OSGI platform failing to start [message #695411 is a reply to message #695319] |
Mon, 11 July 2011 17:08 |
|
Hello Jason,
I wonder if this is a bug in the update version of birt.
I am using the following implementation for loading birt, but the error still occurs in the JBoss start when load this class ..
public class BirtEngine {
private static IReportEngine birtEngine = null;
private static Properties configProps = new Properties();
private static final String CONFIGFILE = "BirtConfig.properties";
public static synchronized void initBirtConfig() {
BirtEngine.loadEngineProps();
}
public static synchronized IReportEngine getBirtEngine( ServletContext sc ) {
if ( BirtEngine.birtEngine == null ) {
EngineConfig config = new EngineConfig();
if ( BirtEngine.configProps != null ) {
String logLevel = BirtEngine.configProps.getProperty( "logLevel" );
Level level = Level.OFF;
if ( "SEVERE".equalsIgnoreCase( logLevel ) ) {
level = Level.SEVERE;
} else if ( "WARNING".equalsIgnoreCase( logLevel ) ) {
level = Level.WARNING;
} else if ( "INFO".equalsIgnoreCase( logLevel ) ) {
level = Level.INFO;
} else if ( "CONFIG".equalsIgnoreCase( logLevel ) ) {
level = Level.CONFIG;
} else if ( "FINE".equalsIgnoreCase( logLevel ) ) {
level = Level.FINE;
} else if ( "FINER".equalsIgnoreCase( logLevel ) ) {
level = Level.FINER;
} else if ( "FINEST".equalsIgnoreCase( logLevel ) ) {
level = Level.FINEST;
} else if ( "OFF".equalsIgnoreCase( logLevel ) ) {
level = Level.OFF;
}
config.setLogConfig( BirtEngine.configProps.getProperty( "logDirectory" ), level );
}
config.setEngineHome( "" );
IPlatformContext context = new PlatformServletContext( sc );
config.setPlatformContext( context );
try {
Platform.startup( config ); // TODO error occurs here
} catch ( BirtException e ) {
e.printStackTrace();
}
IReportEngineFactory factory = (IReportEngineFactory) Platform
.createFactoryObject( IReportEngineFactory.EXTENSION_REPORT_ENGINE_FACTORY );
BirtEngine.birtEngine = factory.createReportEngine( config );
if ( Contexts.getApplicationContext() != null ) {
Contexts.getApplicationContext().set( "birtEngine", birtEngine );
}
}
return BirtEngine.birtEngine;
}
@SuppressWarnings( "deprecation" )
public static synchronized void destroyBirtEngine() {
if ( BirtEngine.birtEngine == null ) {
return;
}
BirtEngine.birtEngine.shutdown();
Platform.shutdown();
BirtEngine.birtEngine = null;
}
@Override
public Object clone() throws CloneNotSupportedException {
throw new CloneNotSupportedException();
}
private static void loadEngineProps() {
try {
// Config File must be in classpath
ClassLoader cl = Thread.currentThread().getContextClassLoader();
InputStream in = null;
in = cl.getResourceAsStream( BirtEngine.CONFIGFILE );
BirtEngine.configProps.load( in );
in.close();
} catch ( IOException e ) {
e.printStackTrace();
}
}
Att,
Robson
|
|
|
Re: OSGI platform failing to start [message #695595 is a reply to message #695411] |
Tue, 12 July 2011 05:14 |
|
I just tried this with JBOSS 5.0.1 and it worked fine for me.
I have one jar with my code in it and the jars from the 3.7 runtime
download/reportengine/lib directory in the web-inf/lib directory with
the exception of
org.apache.xerces_2.9.0.v201101211617
which should not be in the web-inf/lib
Jason
On 7/11/2011 1:08 PM, Robson R Ferreira wrote:
> Hello Jason, I wonder if this is a bug in the update version of birt.
>
> I am using the following implementation for loading birt, but the error
> still occurs in the JBoss start when load this class ..
> public class BirtEngine {
>
> private static IReportEngine birtEngine = null;
> private static Properties configProps = new Properties();
> private static final String CONFIGFILE = "BirtConfig.properties";
>
> public static synchronized void initBirtConfig() {
> BirtEngine.loadEngineProps();
> }
>
> public static synchronized IReportEngine getBirtEngine( ServletContext
> sc ) {
> if ( BirtEngine.birtEngine == null ) {
> EngineConfig config = new EngineConfig();
> if ( BirtEngine.configProps != null ) {
> String logLevel = BirtEngine.configProps.getProperty( "logLevel" );
> Level level = Level.OFF;
> if ( "SEVERE".equalsIgnoreCase( logLevel ) ) {
> level = Level.SEVERE;
> } else if ( "WARNING".equalsIgnoreCase( logLevel ) ) {
> level = Level.WARNING;
> } else if ( "INFO".equalsIgnoreCase( logLevel ) ) {
> level = Level.INFO;
> } else if ( "CONFIG".equalsIgnoreCase( logLevel ) ) {
> level = Level.CONFIG;
> } else if ( "FINE".equalsIgnoreCase( logLevel ) ) {
> level = Level.FINE;
> } else if ( "FINER".equalsIgnoreCase( logLevel ) ) {
> level = Level.FINER;
> } else if ( "FINEST".equalsIgnoreCase( logLevel ) ) {
> level = Level.FINEST;
> } else if ( "OFF".equalsIgnoreCase( logLevel ) ) {
> level = Level.OFF;
> }
>
> config.setLogConfig( BirtEngine.configProps.getProperty( "logDirectory"
> ), level );
> }
>
> config.setEngineHome( "" );
> IPlatformContext context = new PlatformServletContext( sc );
> config.setPlatformContext( context );
>
> try {
> Platform.startup( config ); // TODO error occurs here
> } catch ( BirtException e ) {
> e.printStackTrace();
> }
>
> IReportEngineFactory factory = (IReportEngineFactory) Platform
> .createFactoryObject(
> IReportEngineFactory.EXTENSION_REPORT_ENGINE_FACTORY );
> BirtEngine.birtEngine = factory.createReportEngine( config );
> if ( Contexts.getApplicationContext() != null ) {
> Contexts.getApplicationContext().set( "birtEngine", birtEngine );
> }
>
> }
> return BirtEngine.birtEngine;
> }
>
> @SuppressWarnings( "deprecation" )
> public static synchronized void destroyBirtEngine() {
> if ( BirtEngine.birtEngine == null ) {
> return;
> }
> BirtEngine.birtEngine.shutdown();
> Platform.shutdown();
> BirtEngine.birtEngine = null;
> }
>
> @Override
> public Object clone() throws CloneNotSupportedException {
> throw new CloneNotSupportedException();
> }
>
> private static void loadEngineProps() {
> try {
> // Config File must be in classpath
> ClassLoader cl = Thread.currentThread().getContextClassLoader();
> InputStream in = null;
> in = cl.getResourceAsStream( BirtEngine.CONFIGFILE );
> BirtEngine.configProps.load( in );
> in.close();
>
> } catch ( IOException e ) {
> e.printStackTrace();
> }
> }
>
>
> Att,
> Robson
|
|
|
|
Powered by
FUDForum. Page generated in 0.03953 seconds