Skip to main content



      Home
Home » Archived » BIRT » Cant startup the OSGI framework
Cant startup the OSGI framework [message #261632] Mon, 19 November 2007 06:23 Go to next message
Eclipse UserFriend
Originally posted by: peter.pmb.mine.nu

Hi again Birt users

I hope someone will be able to help me I am trying to get birt running in a WS web application in Geronimo v2.0.2 using
Birt v2.2.1.1 I have successfully fetched a ServlectContext object but for some reason the OSGI framework will not start up.

I have been following the servlet example on birt wiki http://wiki.eclipse.org/Servlet_Example_%28BIRT%29_2.1 I realize
that the example code is for birt 2.1 and I am therefore even more interested in getting some input from you all.

The layout is as described in the wiki example and below is a code snippet and the stack trace.

FYI I am running this on a ubuntu linux box and Geronimo is automatically extracting the war up on deployment don't know
if it has anything to do with things though ( and I doubt it ;) ).

thanks
Peter Petersson

EngineConfig config = new EngineConfig();
:
:
config.setEngineHome("");

IPlatformContext context = new PlatformServletContext(sc);
config.setPlatformContext(context);

try {
Platform.startup(config);
IReportEngineFactory factory = (IReportEngineFactory)
Platform.createFactoryObject(IReportEngineFactory.EXTENSION_ REPORT_ENGINE_FACTORY);
if(factory==null){logger.error("BirtEngine::getBirtEngine factory is null");}
birtEngine = factory.createReportEngine(config);
} catch (BirtException e) {
logger.error("BirtEngine::getBirtEngine ",e);
}
}
return birtEngine;

12:01:00,283 INFO [BirtEngine] BirtEngine::getBirtEngine logLevel=FINEST
12:01:00,392 ERROR [BirtEngine] BirtEngine::getBirtEngine
org.eclipse.birt.core.exception.BirtException: Cant startup the OSGI framework
at org.eclipse.birt.core.framework.Platform.startup(Platform.ja va:90)
at com.scandorama.ticket.reportgenrator.control.BirtEngine.getB irtEngine(BirtEngine.java:76)
at com.scandorama.ticket.reportgenrator.control.ReportGenerator .executeReport(ReportGenerator.java:91)
at com.scandorama.ticket.reportgenrator.control.ReportGenerator .createReport(ReportGenerator.java:63)
at com.scandorama.ticket.jws.TicketService.create(TicketService .java:95)
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.apache.axis2.jaxws.server.dispatcher.JavaBeanDispatcher. invokeService(JavaBeanDispatcher.java:163)
at org.apache.axis2.jaxws.server.dispatcher.JavaBeanDispatcher. invoke(JavaBeanDispatcher.java:90)
at org.apache.axis2.jaxws.server.EndpointController.invoke(Endp ointController.java:172)
at org.apache.axis2.jaxws.server.JAXWSMessageReceiver.receive(J AXWSMessageReceiver.java:113)
at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:1 45)
at org.apache.axis2.transport.http.HTTPTransportUtils.processHT TPPostRequest(HTTPTransportUtils.java:275)
at org.apache.geronimo.axis2.pojo.POJOWebServiceContainer.proce ssPOSTRequest(POJOWebServiceContainer.java:114)
at org.apache.geronimo.axis2.Axis2WebServiceContainer.doService 2(Axis2WebServiceContainer.java:248)
at org.apache.geronimo.axis2.Axis2WebServiceContainer.doService (Axis2WebServiceContainer.java:205)
at org.apache.geronimo.axis2.Axis2WebServiceContainer.invoke(Ax is2WebServiceContainer.java:167)
at org.apache.geronimo.webservices.WebServiceContainerInvoker.s ervice(WebServiceContainerInvoker.java:84)
at org.apache.geronimo.webservices.POJOWebServiceServlet.servic e(POJOWebServiceServlet.java:79)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFi lter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(App licationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(Standar dWrapperValve.java:230)
at org.apache.catalina.core.StandardContextValve.invoke(Standar dContextValve.java:175)
at org.apache.geronimo.tomcat.valve.DefaultSubjectValve.invoke( DefaultSubjectValve.java:56)
at org.apache.geronimo.tomcat.GeronimoStandardContext$SystemMet hodValve.invoke(GeronimoStandardContext.java:353)
at org.apache.geronimo.tomcat.valve.GeronimoBeforeAfterValve.in voke(GeronimoBeforeAfterValve.java:47)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHo stValve.java:128)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorRepo rtValve.java:104)
at org.apache.catalina.core.StandardEngineValve.invoke(Standard EngineValve.java:109)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogVa lve.java:563)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAd apter.java:261)
at org.apache.coyote.http11.Http11Processor.process(Http11Proce ssor.java:844)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHand ler.process(Http11Protocol.java:581)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoin t.java:447)
at java.lang.Thread.run(Thread.java:595)
Caused by: org.eclipse.birt.core.exception.BirtException: Can not start up OSGI - null
at org.eclipse.birt.core.framework.osgi.OSGILauncher.startup(OS GILauncher.java:169)
at org.eclipse.birt.core.framework.Platform.startup(Platform.ja va:78)
... 36 more
Re: Cant startup the OSGI framework [message #261661 is a reply to message #261632] Mon, 19 November 2007 11:26 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: peter.pmb.mine.nu

It seems the initPropertiesMethod.invoke( null, new Object[]{properties} ); method is throwing a exception and
the catch below is throwing it with PluginId="org.eclipse.birt.core".

I would be great full if anyone with knowledge of the OSGILauncher or what may cause the invoke method to throw a
exception (could not debug it) could shed some light over this !?
thanks
Peter Petersson


if ( initPropertiesMethod != null )
{
System.setProperty(
"osgi.framework.useSystemProperties", "false" ); //$NON-NLS-1$ //$NON-NLS-2$
properties.put( "osgi.framework.useSystemProperties", "false" );
====throws====>>>>>>>> initPropertiesMethod.invoke( null, new Object[]{properties} );
}
else
{
Iterator iter = properties.entrySet( ).iterator( );
while ( iter.hasNext( ) )
{
Map.Entry entry = (Map.Entry) iter.next( );
String key = (String) entry.getKey( );
String value = (String) entry.getValue( );
System.setProperty( key, value );
}
System.setProperty(
"osgi.framework.useSystemProperties", "true" ); //$NON-NLS-1$ //$NON-NLS-2$
}

Method runMethod = clazz.getMethod(
"startup", new Class[]{String[].class, Runnable.class} ); //$NON-NLS-1$
bundleContext = runMethod.invoke( null, new Object[]{new String[]{}, null} );
frameworkContextClassLoader = Thread.currentThread( )
.getContextClassLoader( );
}
catch ( Exception e )
{
throw new BirtException( PluginId, "Can not start up OSGI - {0}", e
.getLocalizedMessage( ) );
}


Peter Petersson wrote:
> Hi again Birt users
>
> I hope someone will be able to help me I am trying to get birt running
> in a WS web application in Geronimo v2.0.2 using Birt v2.2.1.1 I have
> successfully fetched a ServlectContext object but for some reason the
> OSGI framework will not start up.
>
> I have been following the servlet example on birt wiki
> http://wiki.eclipse.org/Servlet_Example_%28BIRT%29_2.1 I realize that
> the example code is for birt 2.1 and I am therefore even more interested
> in getting some input from you all.
>
> The layout is as described in the wiki example and below is a code
> snippet and the stack trace.
>
> FYI I am running this on a ubuntu linux box and Geronimo is
> automatically extracting the war up on deployment don't know if it has
> anything to do with things though ( and I doubt it ;) ).
>
> thanks
> Peter Petersson
>
> EngineConfig config = new EngineConfig();
> :
> :
> config.setEngineHome("");
>
> IPlatformContext context = new PlatformServletContext(sc);
> config.setPlatformContext(context);
>
> try {
> Platform.startup(config);
> IReportEngineFactory factory = (IReportEngineFactory)
>
> Platform.createFactoryObject(IReportEngineFactory.EXTENSION_ REPORT_ENGINE_FACTORY);
>
>
> if(factory==null){logger.error("BirtEngine::getBirtEngine factory is
> null");}
> birtEngine =
> factory.createReportEngine(config);
> } catch (BirtException e) {
> logger.error("BirtEngine::getBirtEngine ",e);
> }
> }
> return birtEngine;
>
> 12:01:00,283 INFO [BirtEngine] BirtEngine::getBirtEngine logLevel=FINEST
> 12:01:00,392 ERROR [BirtEngine] BirtEngine::getBirtEngine
> org.eclipse.birt.core.exception.BirtException: Cant startup the OSGI
> framework
> at
> org.eclipse.birt.core.framework.Platform.startup(Platform.ja va:90)
> at
> com.scandorama.ticket.reportgenrator.control.BirtEngine.getB irtEngine(BirtEngine.java:76)
>
> at
> com.scandorama.ticket.reportgenrator.control.ReportGenerator .executeReport(ReportGenerator.java:91)
>
> at
> com.scandorama.ticket.reportgenrator.control.ReportGenerator .createReport(ReportGenerator.java:63)
>
> at
> com.scandorama.ticket.jws.TicketService.create(TicketService .java:95)
> 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.apache.axis2.jaxws.server.dispatcher.JavaBeanDispatcher. invokeService(JavaBeanDispatcher.java:163)
>
> at
> org.apache.axis2.jaxws.server.dispatcher.JavaBeanDispatcher. invoke(JavaBeanDispatcher.java:90)
>
> at
> org.apache.axis2.jaxws.server.EndpointController.invoke(Endp ointController.java:172)
>
> at
> org.apache.axis2.jaxws.server.JAXWSMessageReceiver.receive(J AXWSMessageReceiver.java:113)
>
> at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:1 45)
> at
> org.apache.axis2.transport.http.HTTPTransportUtils.processHT TPPostRequest(HTTPTransportUtils.java:275)
>
> at
> org.apache.geronimo.axis2.pojo.POJOWebServiceContainer.proce ssPOSTRequest(POJOWebServiceContainer.java:114)
>
> at
> org.apache.geronimo.axis2.Axis2WebServiceContainer.doService 2(Axis2WebServiceContainer.java:248)
>
> at
> org.apache.geronimo.axis2.Axis2WebServiceContainer.doService (Axis2WebServiceContainer.java:205)
>
> at
> org.apache.geronimo.axis2.Axis2WebServiceContainer.invoke(Ax is2WebServiceContainer.java:167)
>
> at
> org.apache.geronimo.webservices.WebServiceContainerInvoker.s ervice(WebServiceContainerInvoker.java:84)
>
> at
> org.apache.geronimo.webservices.POJOWebServiceServlet.servic e(POJOWebServiceServlet.java:79)
>
> at
> org.apache.catalina.core.ApplicationFilterChain.internalDoFi lter(ApplicationFilterChain.java:290)
>
> at
> org.apache.catalina.core.ApplicationFilterChain.doFilter(App licationFilterChain.java:206)
>
> at
> org.apache.catalina.core.StandardWrapperValve.invoke(Standar dWrapperValve.java:230)
>
> at
> org.apache.catalina.core.StandardContextValve.invoke(Standar dContextValve.java:175)
>
> at
> org.apache.geronimo.tomcat.valve.DefaultSubjectValve.invoke( DefaultSubjectValve.java:56)
>
> at
> org.apache.geronimo.tomcat.GeronimoStandardContext$SystemMet hodValve.invoke(GeronimoStandardContext.java:353)
>
> at
> org.apache.geronimo.tomcat.valve.GeronimoBeforeAfterValve.in voke(GeronimoBeforeAfterValve.java:47)
>
> at
> org.apache.catalina.core.StandardHostValve.invoke(StandardHo stValve.java:128)
>
> at
> org.apache.catalina.valves.ErrorReportValve.invoke(ErrorRepo rtValve.java:104)
>
> at
> org.apache.catalina.core.StandardEngineValve.invoke(Standard EngineValve.java:109)
>
> at
> org.apache.catalina.valves.AccessLogValve.invoke(AccessLogVa lve.java:563)
> at
> org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAd apter.java:261)
> at
> org.apache.coyote.http11.Http11Processor.process(Http11Proce ssor.java:844)
> at
> org.apache.coyote.http11.Http11Protocol$Http11ConnectionHand ler.process(Http11Protocol.java:581)
>
> at
> org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoin t.java:447)
> at java.lang.Thread.run(Thread.java:595)
> Caused by: org.eclipse.birt.core.exception.BirtException: Can not start
> up OSGI - null
> at
> org.eclipse.birt.core.framework.osgi.OSGILauncher.startup(OS GILauncher.java:169)
>
> at
> org.eclipse.birt.core.framework.Platform.startup(Platform.ja va:78)
> ... 36 more
Re: Cant startup the OSGI framework [message #261770 is a reply to message #261661] Tue, 20 November 2007 10:39 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: jasonweathersby.alltel.net

Peter,

In your example do you have a configuration directory in the
web-inf/platform directory?

Jason

Peter Petersson wrote:
> It seems the initPropertiesMethod.invoke( null, new Object[]{properties}
> ); method is throwing a exception and
> the catch below is throwing it with PluginId="org.eclipse.birt.core".
>
> I would be great full if anyone with knowledge of the OSGILauncher or
> what may cause the invoke method to throw a exception (could not debug
> it) could shed some light over this !?
> thanks
> Peter Petersson
>
>
> if ( initPropertiesMethod != null )
> {
> System.setProperty(
> "osgi.framework.useSystemProperties", "false" );
> //$NON-NLS-1$ //$NON-NLS-2$
> properties.put( "osgi.framework.useSystemProperties",
> "false" );
> ====throws====>>>>>>>> initPropertiesMethod.invoke( null, new
> Object[]{properties} );
> }
> else
> {
> Iterator iter = properties.entrySet( ).iterator( );
> while ( iter.hasNext( ) )
> {
> Map.Entry entry = (Map.Entry) iter.next( );
> String key = (String) entry.getKey( );
> String value = (String) entry.getValue( );
> System.setProperty( key, value );
> }
> System.setProperty(
> "osgi.framework.useSystemProperties", "true" );
> //$NON-NLS-1$ //$NON-NLS-2$
> }
>
> Method runMethod = clazz.getMethod(
> "startup", new Class[]{String[].class,
> Runnable.class} ); //$NON-NLS-1$
> bundleContext = runMethod.invoke( null, new Object[]{new
> String[]{}, null} );
> frameworkContextClassLoader = Thread.currentThread( )
> .getContextClassLoader( );
> }
> catch ( Exception e )
> {
> throw new BirtException( PluginId, "Can not start up OSGI -
> {0}", e
> .getLocalizedMessage( ) );
> }
>
>
> Peter Petersson wrote:
>> Hi again Birt users
>>
>> I hope someone will be able to help me I am trying to get birt running
>> in a WS web application in Geronimo v2.0.2 using Birt v2.2.1.1 I have
>> successfully fetched a ServlectContext object but for some reason the
>> OSGI framework will not start up.
>>
>> I have been following the servlet example on birt wiki
>> http://wiki.eclipse.org/Servlet_Example_%28BIRT%29_2.1 I realize that
>> the example code is for birt 2.1 and I am therefore even more
>> interested in getting some input from you all.
>>
>> The layout is as described in the wiki example and below is a code
>> snippet and the stack trace.
>>
>> FYI I am running this on a ubuntu linux box and Geronimo is
>> automatically extracting the war up on deployment don't know if it has
>> anything to do with things though ( and I doubt it ;) ).
>>
>> thanks
>> Peter Petersson
>>
>> EngineConfig config = new EngineConfig();
>> :
>> :
>> config.setEngineHome("");
>>
>> IPlatformContext context = new PlatformServletContext(sc);
>> config.setPlatformContext(context);
>>
>> try {
>> Platform.startup(config);
>> IReportEngineFactory factory = (IReportEngineFactory)
>>
>> Platform.createFactoryObject(IReportEngineFactory.EXTENSION_ REPORT_ENGINE_FACTORY);
>>
>>
>> if(factory==null){logger.error("BirtEngine::getBirtEngine factory is
>> null");}
>> birtEngine =
>> factory.createReportEngine(config); } catch
>> (BirtException e) {
>> logger.error("BirtEngine::getBirtEngine ",e);
>> }
>> }
>> return birtEngine;
>>
>> 12:01:00,283 INFO [BirtEngine] BirtEngine::getBirtEngine logLevel=FINEST
>> 12:01:00,392 ERROR [BirtEngine] BirtEngine::getBirtEngine
>> org.eclipse.birt.core.exception.BirtException: Cant startup the OSGI
>> framework
>> at
>> org.eclipse.birt.core.framework.Platform.startup(Platform.ja va:90)
>> at
>> com.scandorama.ticket.reportgenrator.control.BirtEngine.getB irtEngine(BirtEngine.java:76)
>>
>> at
>> com.scandorama.ticket.reportgenrator.control.ReportGenerator .executeReport(ReportGenerator.java:91)
>>
>> at
>> com.scandorama.ticket.reportgenrator.control.ReportGenerator .createReport(ReportGenerator.java:63)
>>
>> at
>> com.scandorama.ticket.jws.TicketService.create(TicketService .java:95)
>> 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.apache.axis2.jaxws.server.dispatcher.JavaBeanDispatcher. invokeService(JavaBeanDispatcher.java:163)
>>
>> at
>> org.apache.axis2.jaxws.server.dispatcher.JavaBeanDispatcher. invoke(JavaBeanDispatcher.java:90)
>>
>> at
>> org.apache.axis2.jaxws.server.EndpointController.invoke(Endp ointController.java:172)
>>
>> at
>> org.apache.axis2.jaxws.server.JAXWSMessageReceiver.receive(J AXWSMessageReceiver.java:113)
>>
>> at
>> org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:1 45)
>> at
>> org.apache.axis2.transport.http.HTTPTransportUtils.processHT TPPostRequest(HTTPTransportUtils.java:275)
>>
>> at
>> org.apache.geronimo.axis2.pojo.POJOWebServiceContainer.proce ssPOSTRequest(POJOWebServiceContainer.java:114)
>>
>> at
>> org.apache.geronimo.axis2.Axis2WebServiceContainer.doService 2(Axis2WebServiceContainer.java:248)
>>
>> at
>> org.apache.geronimo.axis2.Axis2WebServiceContainer.doService (Axis2WebServiceContainer.java:205)
>>
>> at
>> org.apache.geronimo.axis2.Axis2WebServiceContainer.invoke(Ax is2WebServiceContainer.java:167)
>>
>> at
>> org.apache.geronimo.webservices.WebServiceContainerInvoker.s ervice(WebServiceContainerInvoker.java:84)
>>
>> at
>> org.apache.geronimo.webservices.POJOWebServiceServlet.servic e(POJOWebServiceServlet.java:79)
>>
>> at
>> org.apache.catalina.core.ApplicationFilterChain.internalDoFi lter(ApplicationFilterChain.java:290)
>>
>> at
>> org.apache.catalina.core.ApplicationFilterChain.doFilter(App licationFilterChain.java:206)
>>
>> at
>> org.apache.catalina.core.StandardWrapperValve.invoke(Standar dWrapperValve.java:230)
>>
>> at
>> org.apache.catalina.core.StandardContextValve.invoke(Standar dContextValve.java:175)
>>
>> at
>> org.apache.geronimo.tomcat.valve.DefaultSubjectValve.invoke( DefaultSubjectValve.java:56)
>>
>> at
>> org.apache.geronimo.tomcat.GeronimoStandardContext$SystemMet hodValve.invoke(GeronimoStandardContext.java:353)
>>
>> at
>> org.apache.geronimo.tomcat.valve.GeronimoBeforeAfterValve.in voke(GeronimoBeforeAfterValve.java:47)
>>
>> at
>> org.apache.catalina.core.StandardHostValve.invoke(StandardHo stValve.java:128)
>>
>> at
>> org.apache.catalina.valves.ErrorReportValve.invoke(ErrorRepo rtValve.java:104)
>>
>> at
>> org.apache.catalina.core.StandardEngineValve.invoke(Standard EngineValve.java:109)
>>
>> at
>> org.apache.catalina.valves.AccessLogValve.invoke(AccessLogVa lve.java:563)
>> at
>> org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAd apter.java:261)
>>
>> at
>> org.apache.coyote.http11.Http11Processor.process(Http11Proce ssor.java:844)
>>
>> at
>> org.apache.coyote.http11.Http11Protocol$Http11ConnectionHand ler.process(Http11Protocol.java:581)
>>
>> at
>> org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoin t.java:447)
>> at java.lang.Thread.run(Thread.java:595)
>> Caused by: org.eclipse.birt.core.exception.BirtException: Can not
>> start up OSGI - null
>> at
>> org.eclipse.birt.core.framework.osgi.OSGILauncher.startup(OS GILauncher.java:169)
>>
>> at
>> org.eclipse.birt.core.framework.Platform.startup(Platform.ja va:78)
>> ... 36 more
Re: Cant startup the OSGI framework [message #261790 is a reply to message #261661] Tue, 20 November 2007 11:39 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: peter.pmb.mine.nu

I have now found out exactly what is going wrong (I think) but I still need some help resolving the problem.

Via a System.getProperties call in the method setupOSGiProperties() (in
org.eclipse.birt.core.framework.osgi.OSGILauncher.java) a propertie that is not a String but a HashSet is set and
processed by the initPropertiesMethod.invoke( null, new Object[]{properties} ); method and the OSGILauncher throws a
exception a java.lang.ClassCastException that is beening masked to "Cant startup the OSGI framework".
In my case the offending key/value par is key="org.apache.activeio.journal.active.lockMap" value=HashSet<E>

As I understand it a system propertie should not be anything but a String but clearly not everyone share that view :) so
maybe a patch like "value instanceof String" check should be done also for system properties as it is done for the
osgiConfig properties? in Birt v2.2.1.2 ?

I should probably contact the Geronimo list to see if there is someway to remove/replace the HashSet propertie but if
someone here knows a solution please share it with me/us!

thanks
Peter Petersson


org.eclipse.birt.core.framework.osgi.OSGILauncher.java

public void startup( PlatformConfig config ) throws BirtException
{
if ( frameworkClassLoader != null )
{
logger.log( Level.WARNING, "Framework is already started" ); //$NON-NLS-1$
return;
}

platformConfig = config;
IPlatformContext context = config.getPlatformContext( );
if ( context == null )
{
throw new BirtException(
PluginId,
"PlatformContext is not setted - {0}", new Object[]{"PlatformConfig"} ); //$NON-NLS-1$
}

// process install.area
String root = context.getPlatform( );
platformDirectory = new File( root );
if ( !platformDirectory.exists( ) || !platformDirectory.isDirectory( ) )
{
throw new BirtException( PluginId,
"Could not start the Framework - {0}" + root, root ); //$NON-NLS-1$
}

String path = new File( platformDirectory, "plugins" ).toString( ); //$NON-NLS-1$
path = searchFor( "org.eclipse.osgi", path ); //$NON-NLS-1$
if ( path == null )
{
throw new BirtException(
PluginId,
"Could not find the Framework - {0}", "org.eclipse.osgi" ); //$NON-NLS-1$
}
try
{
osgiFramework = new File( path ).toURL( );
}
catch(MalformedURLException ex)
{
//cannot be here
}

ClassLoader original = Thread.currentThread( ).getContextClassLoader( );
try
{
ClassLoader loader = this.getClass( ).getClassLoader( );
frameworkClassLoader = new ChildFirstURLClassLoader(
new URL[]{osgiFramework}, loader );
// frameworkClassLoader = new OSGIClassLoader(
// new URL[]{frameworkUrl}, loader );

// Weblogic 8.1SP6 contains old version JS.JAR, we need
// set pref-web-inf to true, if we set it to true, the
// URL classloader still loads the JS in weblogic, so
// load the class explicitly.
try
{
loader.loadClass( "org.mozilla.javascript.Context" );
loader.loadClass( "org.mozilla.javascript.Scriptable" );
loader.loadClass( "org.mozilla.javascript.ScriptableObject" );
// frameworkClassLoader.loadClass(
// "org.mozilla.javascript.Context"
}
catch ( Exception ex )
{
}

Class clazz = frameworkClassLoader.loadClass( ECLIPSE_STARTER );

setupOSGiProperties();

Method initPropertiesMethod = clazz.getMethod(
"setInitialProperties", new Class[]{Map.class} ); //$NON-NLS-1$

if ( initPropertiesMethod != null )
{
System.setProperty(
"osgi.framework.useSystemProperties", "false" ); //$NON-NLS-1$ //$NON-NLS-2$
properties.put( "osgi.framework.useSystemProperties", "false" );
====throws==>> initPropertiesMethod.invoke( null, new Object[]{properties} );
}
else
{
Iterator iter = properties.entrySet( ).iterator( );
while ( iter.hasNext( ) )
{
Map.Entry entry = (Map.Entry) iter.next( );
String key = (String) entry.getKey( );
String value = (String) entry.getValue( );
System.setProperty( key, value );
}
System.setProperty(
"osgi.framework.useSystemProperties", "true" ); //$NON-NLS-1$ //$NON-NLS-2$
}

Method runMethod = clazz.getMethod(
"startup", new Class[]{String[].class, Runnable.class} ); //$NON-NLS-1$
bundleContext = runMethod.invoke( null, new Object[]{new String[]{}, null} );
frameworkContextClassLoader = Thread.currentThread( )
.getContextClassLoader( );
}
catch ( Exception e )
{
throw new BirtException( PluginId, "Can not start up OSGI - {0}", e
.getLocalizedMessage( ) );
}
finally
{
Thread.currentThread( ).setContextClassLoader( original );
}
}

private void setupOSGiProperties()
{
properties = new HashMap( );
//copy all system properties to the property.
Properties systemProperties = System.getProperties( );
if ( systemProperties != null )
{
for ( Iterator it = systemProperties.entrySet( ).iterator( ); it
.hasNext( ); )
{
Map.Entry entry = (Map.Entry) it.next( );
String key = (String) entry.getKey( );
Object value = entry.getValue( );
if ( !key.startsWith( "osgi." ) && !key.startsWith( "eclipse." )
&& !key.startsWith( "org.osgi." ) )
{
===Sets HashSet==>> properties.put( key, value );
}
else
{
properties.put( key, null );
}
}
}

//load the config.ini distribued with BIRT system.
File configFolder = new File( platformDirectory, CONFIG_FOLDER );
try
{
HashMap configProps = loadConfiguration( configFolder.toURL( ) );
properties.putAll( configProps );
}
catch(Exception ex){/* do nothing */}

//copy properties defined by the caller
Map osgiConfig = platformConfig.getOSGiConfig( );
if ( osgiConfig != null )
{
Iterator iter = osgiConfig.entrySet( ).iterator( );
while ( iter.hasNext( ) )
{
Map.Entry entry = (Map.Entry) iter.next( );
Object key = entry.getKey( );
Object value = entry.getValue( );
if ( key instanceof String )
{
if ( value == null || value instanceof String )
{
properties.put( key, value );
}
}
}
}
//set up the properied defined by BIRT
/* osgi.install.area, always using the one defined by BIRT_HOME. */
properties.put( PROP_OSGI_INSTALL_AREA, platformDirectory
.getAbsolutePath( ) ); //$NON-NLS-1$

/* setup the osgi framework, it is the osgi.jar in the platform/plugins */
properties.put( "osgi.framework", osgiFramework.toExternalForm( ) ); //$NON-NLS-1$//$NON-NLS-2$

/* setup the config area, it is the /configuration under platform */
String configArea = getProperty( properties, PROP_OSGI_CONFIGURATION_AREA );
if (configArea == null)
{
File configDirectory = new File (platformDirectory, CONFIG_FOLDER );
properties.put( PROP_OSGI_CONFIGURATION_AREA, configDirectory.getAbsolutePath( ) );
}

// instance.area, it is the workspace under platform
String instanceArea = getProperty( properties, PROP_OSGI_INSTANCE_AREA );
if ( instanceArea == null )
{
File workspaceDirectory = new File( platformDirectory, INSTANCE_FOLDER ); //$NON-NLS-1$
if ( !workspaceDirectory.exists( ) )
{
workspaceDirectory.mkdirs( );
}
properties.put( PROP_OSGI_INSTANCE_AREA, workspaceDirectory
.getAbsolutePath( ) ); //$NON-NLS-1$
}

properties.put( PROP_ECLIPSE_IGNOREAPP, "true" );//$NON-NLS-1$
properties.put( PROP_OSGI_NOSHUTDOWN, "true" ); //$NON-NLS-1$

//set -clean if the user doens't define it.
String clean = getProperty(properties, PROP_OSGI_CLEAN);
if (clean == null)
{
properties.put( PROP_OSGI_CLEAN, "true" );
}
}


Peter Petersson wrote:
> It seems the initPropertiesMethod.invoke( null, new Object[]{properties}
> ); method is throwing a exception and
> the catch below is throwing it with PluginId="org.eclipse.birt.core".
>
> I would be great full if anyone with knowledge of the OSGILauncher or
> what may cause the invoke method to throw a exception (could not debug
> it) could shed some light over this !?
> thanks
> Peter Petersson
>
>
> if ( initPropertiesMethod != null )
> {
> System.setProperty(
> "osgi.framework.useSystemProperties", "false" );
> //$NON-NLS-1$ //$NON-NLS-2$
> properties.put( "osgi.framework.useSystemProperties",
> "false" );
> ====throws====>>>>>>>> initPropertiesMethod.invoke( null, new
> Object[]{properties} );
> }
> else
> {
> Iterator iter = properties.entrySet( ).iterator( );
> while ( iter.hasNext( ) )
> {
> Map.Entry entry = (Map.Entry) iter.next( );
> String key = (String) entry.getKey( );
> String value = (String) entry.getValue( );
> System.setProperty( key, value );
> }
> System.setProperty(
> "osgi.framework.useSystemProperties", "true" );
> //$NON-NLS-1$ //$NON-NLS-2$
> }
>
> Method runMethod = clazz.getMethod(
> "startup", new Class[]{String[].class,
> Runnable.class} ); //$NON-NLS-1$
> bundleContext = runMethod.invoke( null, new Object[]{new
> String[]{}, null} );
> frameworkContextClassLoader = Thread.currentThread( )
> .getContextClassLoader( );
> }
> catch ( Exception e )
> {
> throw new BirtException( PluginId, "Can not start up OSGI -
> {0}", e
> .getLocalizedMessage( ) );
> }
>
>
> Peter Petersson wrote:
>> Hi again Birt users
>>
>> I hope someone will be able to help me I am trying to get birt running
>> in a WS web application in Geronimo v2.0.2 using Birt v2.2.1.1 I have
>> successfully fetched a ServlectContext object but for some reason the
>> OSGI framework will not start up.
>>
>> I have been following the servlet example on birt wiki
>> http://wiki.eclipse.org/Servlet_Example_%28BIRT%29_2.1 I realize that
>> the example code is for birt 2.1 and I am therefore even more
>> interested in getting some input from you all.
>>
>> The layout is as described in the wiki example and below is a code
>> snippet and the stack trace.
>>
>> FYI I am running this on a ubuntu linux box and Geronimo is
>> automatically extracting the war up on deployment don't know if it has
>> anything to do with things though ( and I doubt it ;) ).
>>
>> thanks
>> Peter Petersson
>>
>> EngineConfig config = new EngineConfig();
>> :
>> :
>> config.setEngineHome("");
>>
>> IPlatformContext context = new PlatformServletContext(sc);
>> config.setPlatformContext(context);
>>
>> try {
>> Platform.startup(config);
>> IReportEngineFactory factory = (IReportEngineFactory)
>>
>> Platform.createFactoryObject(IReportEngineFactory.EXTENSION_ REPORT_ENGINE_FACTORY);
>>
>>
>> if(factory==null){logger.error("BirtEngine::getBirtEngine factory is
>> null");}
>> birtEngine =
>> factory.createReportEngine(config); } catch
>> (BirtException e) {
>> logger.error("BirtEngine::getBirtEngine ",e);
>> }
>> }
>> return birtEngine;
>>
>> 12:01:00,283 INFO [BirtEngine] BirtEngine::getBirtEngine logLevel=FINEST
>> 12:01:00,392 ERROR [BirtEngine] BirtEngine::getBirtEngine
>> org.eclipse.birt.core.exception.BirtException: Cant startup the OSGI
>> framework
>> at
>> org.eclipse.birt.core.framework.Platform.startup(Platform.ja va:90)
>> at
>> com.scandorama.ticket.reportgenrator.control.BirtEngine.getB irtEngine(BirtEngine.java:76)
>>
>> at
>> com.scandorama.ticket.reportgenrator.control.ReportGenerator .executeReport(ReportGenerator.java:91)
>>
>> at
>> com.scandorama.ticket.reportgenrator.control.ReportGenerator .createReport(ReportGenerator.java:63)
>>
>> at
>> com.scandorama.ticket.jws.TicketService.create(TicketService .java:95)
>> 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.apache.axis2.jaxws.server.dispatcher.JavaBeanDispatcher. invokeService(JavaBeanDispatcher.java:163)
>>
>> at
>> org.apache.axis2.jaxws.server.dispatcher.JavaBeanDispatcher. invoke(JavaBeanDispatcher.java:90)
>>
>> at
>> org.apache.axis2.jaxws.server.EndpointController.invoke(Endp ointController.java:172)
>>
>> at
>> org.apache.axis2.jaxws.server.JAXWSMessageReceiver.receive(J AXWSMessageReceiver.java:113)
>>
>> at
>> org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:1 45)
>> at
>> org.apache.axis2.transport.http.HTTPTransportUtils.processHT TPPostRequest(HTTPTransportUtils.java:275)
>>
>> at
>> org.apache.geronimo.axis2.pojo.POJOWebServiceContainer.proce ssPOSTRequest(POJOWebServiceContainer.java:114)
>>
>> at
>> org.apache.geronimo.axis2.Axis2WebServiceContainer.doService 2(Axis2WebServiceContainer.java:248)
>>
>> at
>> org.apache.geronimo.axis2.Axis2WebServiceContainer.doService (Axis2WebServiceContainer.java:205)
>>
>> at
>> org.apache.geronimo.axis2.Axis2WebServiceContainer.invoke(Ax is2WebServiceContainer.java:167)
>>
>> at
>> org.apache.geronimo.webservices.WebServiceContainerInvoker.s ervice(WebServiceContainerInvoker.java:84)
>>
>> at
>> org.apache.geronimo.webservices.POJOWebServiceServlet.servic e(POJOWebServiceServlet.java:79)
>>
>> at
>> org.apache.catalina.core.ApplicationFilterChain.internalDoFi lter(ApplicationFilterChain.java:290)
>>
>> at
>> org.apache.catalina.core.ApplicationFilterChain.doFilter(App licationFilterChain.java:206)
>>
>> at
>> org.apache.catalina.core.StandardWrapperValve.invoke(Standar dWrapperValve.java:230)
>>
>> at
>> org.apache.catalina.core.StandardContextValve.invoke(Standar dContextValve.java:175)
>>
>> at
>> org.apache.geronimo.tomcat.valve.DefaultSubjectValve.invoke( DefaultSubjectValve.java:56)
>>
>> at
>> org.apache.geronimo.tomcat.GeronimoStandardContext$SystemMet hodValve.invoke(GeronimoStandardContext.java:353)
>>
>> at
>> org.apache.geronimo.tomcat.valve.GeronimoBeforeAfterValve.in voke(GeronimoBeforeAfterValve.java:47)
>>
>> at
>> org.apache.catalina.core.StandardHostValve.invoke(StandardHo stValve.java:128)
>>
>> at
>> org.apache.catalina.valves.ErrorReportValve.invoke(ErrorRepo rtValve.java:104)
>>
>> at
>> org.apache.catalina.core.StandardEngineValve.invoke(Standard EngineValve.java:109)
>>
>> at
>> org.apache.catalina.valves.AccessLogValve.invoke(AccessLogVa lve.java:563)
>> at
>> org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAd apter.java:261)
>>
>> at
>> org.apache.coyote.http11.Http11Processor.process(Http11Proce ssor.java:844)
>>
>> at
>> org.apache.coyote.http11.Http11Protocol$Http11ConnectionHand ler.process(Http11Protocol.java:581)
>>
>> at
>> org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoin t.java:447)
>> at java.lang.Thread.run(Thread.java:595)
>> Caused by: org.eclipse.birt.core.exception.BirtException: Can not
>> start up OSGI - null
>> at
>> org.eclipse.birt.core.framework.osgi.OSGILauncher.startup(OS GILauncher.java:169)
>>
>> at
>> org.eclipse.birt.core.framework.Platform.startup(Platform.ja va:78)
>> ... 36 more
Re: Cant startup the OSGI framework [message #261793 is a reply to message #261770] Tue, 20 November 2007 11:44 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: peter.pmb.mine.nu

Jason Weathersby wrote:
> Peter,
>
> In your example do you have a configuration directory in the
> web-inf/platform directory?

Thanks for your responce Jason, yes I have containing a config.ini file with the following content
----------------------------------------
#Product Runtime Configuration File
eclipse.product=org.eclipse.birt.report.engine.ReportEngineS DK
osgi.bundles=org.eclipse.equinox.common@2:start, org.eclipse.update.configurator@start, org.eclipse.birt.core@start
osgi.framework.extensions=org.eclipse.birt.api
osgi.bundles.defaultStartLevel=4
----------------------------------------

As you can see in my last/next post I have found out what is going on.
thanks
Peter Petersson
>
> Jason
>
> Peter Petersson wrote:
>> It seems the initPropertiesMethod.invoke( null, new
>> Object[]{properties} ); method is throwing a exception and
>> the catch below is throwing it with PluginId="org.eclipse.birt.core".
>>
>> I would be great full if anyone with knowledge of the OSGILauncher or
>> what may cause the invoke method to throw a exception (could not debug
>> it) could shed some light over this !?
>> thanks
>> Peter Petersson
>>
>>
>> if ( initPropertiesMethod != null )
>> {
>> System.setProperty(
>> "osgi.framework.useSystemProperties", "false"
>> ); //$NON-NLS-1$ //$NON-NLS-2$
>> properties.put( "osgi.framework.useSystemProperties",
>> "false" );
>> ====throws====>>>>>>>> initPropertiesMethod.invoke( null, new
>> Object[]{properties} );
>> }
>> else
>> {
>> Iterator iter = properties.entrySet( ).iterator( );
>> while ( iter.hasNext( ) )
>> {
>> Map.Entry entry = (Map.Entry) iter.next( );
>> String key = (String) entry.getKey( );
>> String value = (String) entry.getValue( );
>> System.setProperty( key, value );
>> }
>> System.setProperty(
>> "osgi.framework.useSystemProperties", "true"
>> ); //$NON-NLS-1$ //$NON-NLS-2$
>> }
>>
>> Method runMethod = clazz.getMethod(
>> "startup", new Class[]{String[].class,
>> Runnable.class} ); //$NON-NLS-1$
>> bundleContext = runMethod.invoke( null, new Object[]{new
>> String[]{}, null} );
>> frameworkContextClassLoader = Thread.currentThread( )
>> .getContextClassLoader( );
>> }
>> catch ( Exception e )
>> {
>> throw new BirtException( PluginId, "Can not start up OSGI
>> - {0}", e
>> .getLocalizedMessage( ) );
>> }
>>
>>
>> Peter Petersson wrote:
>>> Hi again Birt users
>>>
>>> I hope someone will be able to help me I am trying to get birt
>>> running in a WS web application in Geronimo v2.0.2 using Birt
>>> v2.2.1.1 I have successfully fetched a ServlectContext object but for
>>> some reason the OSGI framework will not start up.
>>>
>>> I have been following the servlet example on birt wiki
>>> http://wiki.eclipse.org/Servlet_Example_%28BIRT%29_2.1 I realize that
>>> the example code is for birt 2.1 and I am therefore even more
>>> interested in getting some input from you all.
>>>
>>> The layout is as described in the wiki example and below is a code
>>> snippet and the stack trace.
>>>
>>> FYI I am running this on a ubuntu linux box and Geronimo is
>>> automatically extracting the war up on deployment don't know if it
>>> has anything to do with things though ( and I doubt it ;) ).
>>>
>>> thanks
>>> Peter Petersson
>>>
>>> EngineConfig config = new EngineConfig();
>>> :
>>> :
>>> config.setEngineHome("");
>>>
>>> IPlatformContext context = new PlatformServletContext(sc);
>>> config.setPlatformContext(context);
>>>
>>> try {
>>> Platform.startup(config);
>>> IReportEngineFactory factory = (IReportEngineFactory)
>>>
>>> Platform.createFactoryObject(IReportEngineFactory.EXTENSION_ REPORT_ENGINE_FACTORY);
>>>
>>>
>>> if(factory==null){logger.error("BirtEngine::getBirtEngine factory is
>>> null");}
>>> birtEngine =
>>> factory.createReportEngine(config); } catch
>>> (BirtException e) {
>>> logger.error("BirtEngine::getBirtEngine ",e);
>>> }
>>> }
>>> return birtEngine;
>>>
>>> 12:01:00,283 INFO [BirtEngine] BirtEngine::getBirtEngine
>>> logLevel=FINEST
>>> 12:01:00,392 ERROR [BirtEngine] BirtEngine::getBirtEngine
>>> org.eclipse.birt.core.exception.BirtException: Cant startup the OSGI
>>> framework
>>> at
>>> org.eclipse.birt.core.framework.Platform.startup(Platform.ja va:90)
>>> at
>>> com.scandorama.ticket.reportgenrator.control.BirtEngine.getB irtEngine(BirtEngine.java:76)
>>>
>>> at
>>> com.scandorama.ticket.reportgenrator.control.ReportGenerator .executeReport(ReportGenerator.java:91)
>>>
>>> at
>>> com.scandorama.ticket.reportgenrator.control.ReportGenerator .createReport(ReportGenerator.java:63)

>>>
>>> at
>>> com.scandorama.ticket.jws.TicketService.create(TicketService .java:95)
>>> 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.apache.axis2.jaxws.server.dispatcher.JavaBeanDispatcher. invokeService(JavaBeanDispatcher.java:163)
>>>
>>> at
>>> org.apache.axis2.jaxws.server.dispatcher.JavaBeanDispatcher. invoke(JavaBeanDispatcher.java:90)
>>>
>>> at
>>> org.apache.axis2.jaxws.server.EndpointController.invoke(Endp ointController.java:172)
>>>
>>> at
>>> org.apache.axis2.jaxws.server.JAXWSMessageReceiver.receive(J AXWSMessageReceiver.java:113)
>>>
>>> at
>>> org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:1 45)
>>> at
>>> org.apache.axis2.transport.http.HTTPTransportUtils.processHT TPPostRequest(HTTPTransportUtils.java:275)
>>>
>>> at
>>> org.apache.geronimo.axis2.pojo.POJOWebServiceContainer.proce ssPOSTRequest(POJOWebServiceContainer.java:114)
>>>
>>> at
>>> org.apache.geronimo.axis2.Axis2WebServiceContainer.doService 2(Axis2WebServiceContainer.java:248)
>>>
>>> at
>>> org.apache.geronimo.axis2.Axis2WebServiceContainer.doService (Axis2WebServiceContainer.java:205)
>>>
>>> at
>>> org.apache.geronimo.axis2.Axis2WebServiceContainer.invoke(Ax is2WebServiceContainer.java:167)
>>>
>>> at
>>> org.apache.geronimo.webservices.WebServiceContainerInvoker.s ervice(WebServiceContainerInvoker.java:84)
>>>
>>> at
>>> org.apache.geronimo.webservices.POJOWebServiceServlet.servic e(POJOWebServiceServlet.java:79)
>>>
>>> at
>>> org.apache.catalina.core.ApplicationFilterChain.internalDoFi lter(ApplicationFilterChain.java:290)
>>>
>>> at
>>> org.apache.catalina.core.ApplicationFilterChain.doFilter(App licationFilterChain.java:206)
>>>
>>> at
>>> org.apache.catalina.core.StandardWrapperValve.invoke(Standar dWrapperValve.java:230)
>>>
>>> at
>>> org.apache.catalina.core.StandardContextValve.invoke(Standar dContextValve.java:175)
>>>
>>> at
>>> org.apache.geronimo.tomcat.valve.DefaultSubjectValve.invoke( DefaultSubjectValve.java:56)
>>>
>>> at
>>> org.apache.geronimo.tomcat.GeronimoStandardContext$SystemMet hodValve.invoke(GeronimoStandardContext.java:353)
>>>
>>> at
>>> org.apache.geronimo.tomcat.valve.GeronimoBeforeAfterValve.in voke(GeronimoBeforeAfterValve.java:47)
>>>
>>> at
>>> org.apache.catalina.core.StandardHostValve.invoke(StandardHo stValve.java:128)
>>>
>>> at
>>> org.apache.catalina.valves.ErrorReportValve.invoke(ErrorRepo rtValve.java:104)
>>>
>>> at
>>> org.apache.catalina.core.StandardEngineValve.invoke(Standard EngineValve.java:109)
>>>
>>> at
>>> org.apache.catalina.valves.AccessLogValve.invoke(AccessLogVa lve.java:563)
>>>
>>> at
>>> org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAd apter.java:261)
>>>
>>> at
>>> org.apache.coyote.http11.Http11Processor.process(Http11Proce ssor.java:844)
>>>
>>> at
>>> org.apache.coyote.http11.Http11Protocol$Http11ConnectionHand ler.process(Http11Protocol.java:581)
>>>
>>> at
>>> org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoin t.java:447)
>>> at java.lang.Thread.run(Thread.java:595)
>>> Caused by: org.eclipse.birt.core.exception.BirtException: Can not
>>> start up OSGI - null
>>> at
>>> org.eclipse.birt.core.framework.osgi.OSGILauncher.startup(OS GILauncher.java:169)
>>>
>>> at
>>> org.eclipse.birt.core.framework.Platform.startup(Platform.ja va:78)
>>> ... 36 more
Re: Cant startup the OSGI framework [message #261800 is a reply to message #261790] Tue, 20 November 2007 11:53 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: peter.pmb.mine.nu

Here is a Geronimo GIRA on the matter apparently it is a ActiveMQ propertie.

http://www.mail-archive.com/dev@geronimo.apache.org/msg47532 .html

I will now seek help on the Geronimo list to see if I somehow can remove the offending propertie.

thanks
Peter

Peter Petersson wrote:
> I have now found out exactly what is going wrong (I think) but I still
> need some help resolving the problem.
>
> Via a System.getProperties call in the method setupOSGiProperties() (in
> org.eclipse.birt.core.framework.osgi.OSGILauncher.java) a propertie that
> is not a String but a HashSet is set and processed by the
> initPropertiesMethod.invoke( null, new Object[]{properties} ); method
> and the OSGILauncher throws a exception a java.lang.ClassCastException
> that is beening masked to "Cant startup the OSGI framework".
> In my case the offending key/value par is
> key="org.apache.activeio.journal.active.lockMap" value=HashSet<E>
>
> As I understand it a system propertie should not be anything but a
> String but clearly not everyone share that view :) so maybe a patch like
> "value instanceof String" check should be done also for system
> properties as it is done for the osgiConfig properties? in Birt v2.2.1.2 ?
>
> I should probably contact the Geronimo list to see if there is someway
> to remove/replace the HashSet propertie but if someone here knows a
> solution please share it with me/us!
>
> thanks
> Peter Petersson
>
>
> org.eclipse.birt.core.framework.osgi.OSGILauncher.java
>
> public void startup( PlatformConfig config ) throws BirtException
> {
> if ( frameworkClassLoader != null )
> {
> logger.log( Level.WARNING, "Framework is already started" );
> //$NON-NLS-1$
> return;
> }
>
> platformConfig = config;
> IPlatformContext context = config.getPlatformContext( );
> if ( context == null )
> {
> throw new BirtException(
> PluginId,
> "PlatformContext is not setted - {0}", new
> Object[]{"PlatformConfig"} ); //$NON-NLS-1$
> }
>
> // process install.area
> String root = context.getPlatform( );
> platformDirectory = new File( root );
> if ( !platformDirectory.exists( ) ||
> !platformDirectory.isDirectory( ) )
> {
> throw new BirtException( PluginId,
> "Could not start the Framework - {0}" + root, root
> ); //$NON-NLS-1$
> }
>
> String path = new File( platformDirectory, "plugins" ).toString(
> ); //$NON-NLS-1$
> path = searchFor( "org.eclipse.osgi", path ); //$NON-NLS-1$
> if ( path == null )
> {
> throw new BirtException(
> PluginId,
> "Could not find the Framework - {0}",
> "org.eclipse.osgi" ); //$NON-NLS-1$
> }
> try
> {
> osgiFramework = new File( path ).toURL( );
> }
> catch(MalformedURLException ex)
> {
> //cannot be here
> }
>
> ClassLoader original = Thread.currentThread(
> ).getContextClassLoader( );
> try
> {
> ClassLoader loader = this.getClass( ).getClassLoader( );
> frameworkClassLoader = new ChildFirstURLClassLoader(
> new URL[]{osgiFramework}, loader );
> // frameworkClassLoader = new OSGIClassLoader(
> // new URL[]{frameworkUrl}, loader );
>
> // Weblogic 8.1SP6 contains old version JS.JAR, we need
> // set pref-web-inf to true, if we set it to true, the
> // URL classloader still loads the JS in weblogic, so
> // load the class explicitly.
> try
> {
> loader.loadClass( "org.mozilla.javascript.Context" );
> loader.loadClass( "org.mozilla.javascript.Scriptable" );
> loader.loadClass(
> "org.mozilla.javascript.ScriptableObject" );
> // frameworkClassLoader.loadClass(
> // "org.mozilla.javascript.Context"
> }
> catch ( Exception ex )
> {
> }
>
> Class clazz = frameworkClassLoader.loadClass(
> ECLIPSE_STARTER );
>
> setupOSGiProperties();
>
> Method initPropertiesMethod = clazz.getMethod(
> "setInitialProperties", new Class[]{Map.class} );
> //$NON-NLS-1$
>
> if ( initPropertiesMethod != null )
> {
> System.setProperty(
> "osgi.framework.useSystemProperties", "false" );
> //$NON-NLS-1$ //$NON-NLS-2$
> properties.put( "osgi.framework.useSystemProperties",
> "false" );
> ====throws==>> initPropertiesMethod.invoke( null, new
> Object[]{properties} );
> }
> else
> {
> Iterator iter = properties.entrySet( ).iterator( );
> while ( iter.hasNext( ) )
> {
> Map.Entry entry = (Map.Entry) iter.next( );
> String key = (String) entry.getKey( );
> String value = (String) entry.getValue( );
> System.setProperty( key, value );
> }
> System.setProperty(
> "osgi.framework.useSystemProperties", "true" );
> //$NON-NLS-1$ //$NON-NLS-2$
> }
>
> Method runMethod = clazz.getMethod(
> "startup", new Class[]{String[].class,
> Runnable.class} ); //$NON-NLS-1$
> bundleContext = runMethod.invoke( null, new Object[]{new
> String[]{}, null} );
> frameworkContextClassLoader = Thread.currentThread( )
> .getContextClassLoader( );
> }
> catch ( Exception e )
> {
> throw new BirtException( PluginId, "Can not start up OSGI -
> {0}", e
> .getLocalizedMessage( ) );
> }
> finally
> {
> Thread.currentThread( ).setContextClassLoader( original );
> }
> }
>
> private void setupOSGiProperties()
> {
> properties = new HashMap( );
> //copy all system properties to the property.
> Properties systemProperties = System.getProperties( );
> if ( systemProperties != null )
> {
> for ( Iterator it = systemProperties.entrySet( ).iterator(
> ); it
> .hasNext( ); )
> {
> Map.Entry entry = (Map.Entry) it.next( );
> String key = (String) entry.getKey( );
> Object value = entry.getValue( );
> if ( !key.startsWith( "osgi." ) && !key.startsWith(
> "eclipse." )
> && !key.startsWith( "org.osgi." ) )
> {
> ===Sets HashSet==>> properties.put( key, value );
> }
> else
> {
> properties.put( key, null );
> }
> }
> }
>
> //load the config.ini distribued with BIRT system.
> File configFolder = new File( platformDirectory, CONFIG_FOLDER );
> try
> {
> HashMap configProps = loadConfiguration( configFolder.toURL(
> ) );
> properties.putAll( configProps );
> }
> catch(Exception ex){/* do nothing */}
>
> //copy properties defined by the caller
> Map osgiConfig = platformConfig.getOSGiConfig( );
> if ( osgiConfig != null )
> {
> Iterator iter = osgiConfig.entrySet( ).iterator( );
> while ( iter.hasNext( ) )
> {
> Map.Entry entry = (Map.Entry) iter.next( );
> Object key = entry.getKey( );
> Object value = entry.getValue( );
> if ( key instanceof String )
> {
> if ( value == null || value instanceof String )
> {
> properties.put( key, value );
> }
> }
> }
> }
> //set up the properied defined by BIRT
> /* osgi.install.area, always using the one defined by BIRT_HOME. */
> properties.put( PROP_OSGI_INSTALL_AREA, platformDirectory
> .getAbsolutePath( ) ); //$NON-NLS-1$
>
> /* setup the osgi framework, it is the osgi.jar in the
> platform/plugins */
> properties.put( "osgi.framework", osgiFramework.toExternalForm(
> ) ); //$NON-NLS-1$//$NON-NLS-2$
>
> /* setup the config area, it is the /configuration under
> platform */
> String configArea = getProperty( properties,
> PROP_OSGI_CONFIGURATION_AREA );
> if (configArea == null)
> {
> File configDirectory = new File (platformDirectory,
> CONFIG_FOLDER );
> properties.put( PROP_OSGI_CONFIGURATION_AREA,
> configDirectory.getAbsolutePath( ) );
> }
>
> // instance.area, it is the workspace under platform
> String instanceArea = getProperty( properties,
> PROP_OSGI_INSTANCE_AREA );
> if ( instanceArea == null )
> {
> File workspaceDirectory = new File( platformDirectory,
> INSTANCE_FOLDER ); //$NON-NLS-1$
> if ( !workspaceDirectory.exists( ) )
> {
> workspaceDirectory.mkdirs( );
> }
> properties.put( PROP_OSGI_INSTANCE_AREA, workspaceDirectory
> .getAbsolutePath( ) ); //$NON-NLS-1$
> }
>
> properties.put( PROP_ECLIPSE_IGNOREAPP, "true" );//$NON-NLS-1$
> properties.put( PROP_OSGI_NOSHUTDOWN, "true" ); //$NON-NLS-1$
>
> //set -clean if the user doens't define it.
> String clean = getProperty(properties, PROP_OSGI_CLEAN);
> if (clean == null)
> {
> properties.put( PROP_OSGI_CLEAN, "true" );
> }
> }
>
>
> Peter Petersson wrote:
>> It seems the initPropertiesMethod.invoke( null, new
>> Object[]{properties} ); method is throwing a exception and
>> the catch below is throwing it with PluginId="org.eclipse.birt.core".
>>
>> I would be great full if anyone with knowledge of the OSGILauncher or
>> what may cause the invoke method to throw a exception (could not debug
>> it) could shed some light over this !?
>> thanks
>> Peter Petersson
>>
>>
>> if ( initPropertiesMethod != null )
>> {
>> System.setProperty(
>> "osgi.framework.useSystemProperties", "false"
>> ); //$NON-NLS-1$ //$NON-NLS-2$
>> properties.put( "osgi.framework.useSystemProperties",
>> "false" );
>> ====throws====>>>>>>>> initPropertiesMethod.invoke( null, new
>> Object[]{properties} );
>> }
>> else
>> {
>> Iterator iter = properties.entrySet( ).iterator( );
>> while ( iter.hasNext( ) )
>> {
>> Map.Entry entry = (Map.Entry) iter.next( );
>> String key = (String) entry.getKey( );
>> String value = (String) entry.getValue( );
>> System.setProperty( key, value );
>> }
>> System.setProperty(
>> "osgi.framework.useSystemProperties", "true"
>> ); //$NON-NLS-1$ //$NON-NLS-2$
>> }
>>
>> Method runMethod = clazz.getMethod(
>> "startup", new Class[]{String[].class,
>> Runnable.class} ); //$NON-NLS-1$
>> bundleContext = runMethod.invoke( null, new Object[]{new
>> String[]{}, null} );
>> frameworkContextClassLoader = Thread.currentThread( )
>> .getContextClassLoader( );
>> }
>> catch ( Exception e )
>> {
>> throw new BirtException( PluginId, "Can not start up OSGI
>> - {0}", e
>> .getLocalizedMessage( ) );
>> }
>>
>>
>> Peter Petersson wrote:
>>> Hi again Birt users
>>>
>>> I hope someone will be able to help me I am trying to get birt
>>> running in a WS web application in Geronimo v2.0.2 using Birt
>>> v2.2.1.1 I have successfully fetched a ServlectContext object but for
>>> some reason the OSGI framework will not start up.
>>>
>>> I have been following the servlet example on birt wiki
>>> http://wiki.eclipse.org/Servlet_Example_%28BIRT%29_2.1 I realize that
>>> the example code is for birt 2.1 and I am therefore even more
>>> interested in getting some input from you all.
>>>
>>> The layout is as described in the wiki example and below is a code
>>> snippet and the stack trace.
>>>
>>> FYI I am running this on a ubuntu linux box and Geronimo is
>>> automatically extracting the war up on deployment don't know if it
>>> has anything to do with things though ( and I doubt it ;) ).
>>>
>>> thanks
>>> Peter Petersson
>>>
>>> EngineConfig config = new EngineConfig();
>>> :
>>> :
>>> config.setEngineHome("");
>>>
>>> IPlatformContext context = new PlatformServletContext(sc);
>>> config.setPlatformContext(context);
>>>
>>> try {
>>> Platform.startup(config);
>>> IReportEngineFactory factory = (IReportEngineFactory)
>>>
>>> Platform.createFactoryObject(IReportEngineFactory.EXTENSION_ REPORT_ENGINE_FACTORY);
>>>
>>>
>>> if(factory==null){logger.error("BirtEngine::getBirtEngine factory is
>>> null");}
>>> birtEngine =
>>> factory.createReportEngine(config); } catch
>>> (BirtException e) {
>>> logger.error("BirtEngine::getBirtEngine ",e);
>>> }
>>> }
>>> return birtEngine;
>>>
>>> 12:01:00,283 INFO [BirtEngine] BirtEngine::getBirtEngine
>>> logLevel=FINEST
>>> 12:01:00,392 ERROR [BirtEngine] BirtEngine::getBirtEngine
>>> org.eclipse.birt.core.exception.BirtException: Cant startup the OSGI
>>> framework
>>> at
>>> org.eclipse.birt.core.framework.Platform.startup(Platform.ja va:90)
>>> at
>>> com.scandorama.ticket.reportgenrator.control.BirtEngine.getB irtEngine(BirtEngine.java:76)
>>>
>>> at
>>> com.scandorama.ticket.reportgenrator.control.ReportGenerator .executeReport(ReportGenerator.java:91)
>>>
>>> at
>>> com.scandorama.ticket.reportgenrator.control.ReportGenerator .createReport(ReportGenerator.java:63)
>>>
>>> at
>>> com.scandorama.ticket.jws.TicketService.create(TicketService .java:95)
>>> 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.apache.axis2.jaxws.server.dispatcher.JavaBeanDispatcher. invokeService(JavaBeanDispatcher.java:163)
>>>
>>> at
>>> org.apache.axis2.jaxws.server.dispatcher.JavaBeanDispatcher. invoke(JavaBeanDispatcher.java:90)
>>>
>>> at
>>> org.apache.axis2.jaxws.server.EndpointController.invoke(Endp ointController.java:172)
>>>
>>> at
>>> org.apache.axis2.jaxws.server.JAXWSMessageReceiver.receive(J AXWSMessageReceiver.java:113)
>>>
>>> at
>>> org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:1 45)
>>> at
>>> org.apache.axis2.transport.http.HTTPTransportUtils.processHT TPPostRequest(HTTPTransportUtils.java:275)
>>>
>>> at
>>> org.apache.geronimo.axis2.pojo.POJOWebServiceContainer.proce ssPOSTRequest(POJOWebServiceContainer.java:114)
>>>
>>> at
>>> org.apache.geronimo.axis2.Axis2WebServiceContainer.doService 2(Axis2WebServiceContainer.java:248)
>>>
>>> at
>>> org.apache.geronimo.axis2.Axis2WebServiceContainer.doService (Axis2WebServiceContainer.java:205)
>>>
>>> at
>>> org.apache.geronimo.axis2.Axis2WebServiceContainer.invoke(Ax is2WebServiceContainer.java:167)
>>>
>>> at
>>> org.apache.geronimo.webservices.WebServiceContainerInvoker.s ervice(WebServiceContainerInvoker.java:84)
>>>
>>> at
>>> org.apache.geronimo.webservices.POJOWebServiceServlet.servic e(POJOWebServiceServlet.java:79)
>>>
>>> at
>>> org.apache.catalina.core.ApplicationFilterChain.internalDoFi lter(ApplicationFilterChain.java:290)
>>>
>>> at
>>> org.apache.catalina.core.ApplicationFilterChain.doFilter(App licationFilterChain.java:206)
>>>
>>> at
>>> org.apache.catalina.core.StandardWrapperValve.invoke(Standar dWrapperValve.java:230)
>>>
>>> at
>>> org.apache.catalina.core.StandardContextValve.invoke(Standar dContextValve.java:175)
>>>
>>> at
>>> org.apache.geronimo.tomcat.valve.DefaultSubjectValve.invoke( DefaultSubjectValve.java:56)
>>>
>>> at
>>> org.apache.geronimo.tomcat.GeronimoStandardContext$SystemMet hodValve.invoke(GeronimoStandardContext.java:353)
>>>
>>> at
>>> org.apache.geronimo.tomcat.valve.GeronimoBeforeAfterValve.in voke(GeronimoBeforeAfterValve.java:47)
>>>
>>> at
>>> org.apache.catalina.core.StandardHostValve.invoke(StandardHo stValve.java:128)
>>>
>>> at
>>> org.apache.catalina.valves.ErrorReportValve.invoke(ErrorRepo rtValve.java:104)
>>>
>>> at
>>> org.apache.catalina.core.StandardEngineValve.invoke(Standard EngineValve.java:109)
>>>
>>> at
>>> org.apache.catalina.valves.AccessLogValve.invoke(AccessLogVa lve.java:563)
>>>
>>> at
>>> org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAd apter.java:261)
>>>
>>> at
>>> org.apache.coyote.http11.Http11Processor.process(Http11Proce ssor.java:844)
>>>
>>> at
>>> org.apache.coyote.http11.Http11Protocol$Http11ConnectionHand ler.process(Http11Protocol.java:581)
>>>
>>> at
>>> org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoin t.java:447)
>>> at java.lang.Thread.run(Thread.java:595)
>>> Caused by: org.eclipse.birt.core.exception.BirtException: Can not
>>> start up OSGI - null
>>> at
>>> org.eclipse.birt.core.framework.osgi.OSGILauncher.startup(OS GILauncher.java:169)
>>>
>>> at
>>> org.eclipse.birt.core.framework.Platform.startup(Platform.ja va:78)
>>> ... 36 more
Re: Cant startup the OSGI framework [message #261818 is a reply to message #261800] Tue, 20 November 2007 14:53 Go to previous message
Eclipse UserFriend
Originally posted by: peter.pmb.mine.nu

Just for the record: Problem solved

Workaround was to set "-Dorg.apache.activeio.journal.active.DisableLocking=true" in JAVA_OPTS read by Geronimo.
Newer version (5.0) of ActiveMQ has fixed the problem.

Cheers
Peter Petersson

Peter Petersson wrote:
> Here is a Geronimo GIRA on the matter apparently it is a ActiveMQ
> propertie.
>
> http://www.mail-archive.com/dev@geronimo.apache.org/msg47532 .html
>
> I will now seek help on the Geronimo list to see if I somehow can remove
> the offending propertie.
>
> thanks
> Peter
>
> Peter Petersson wrote:
>> I have now found out exactly what is going wrong (I think) but I still
>> need some help resolving the problem.
>>
>> Via a System.getProperties call in the method setupOSGiProperties()
>> (in org.eclipse.birt.core.framework.osgi.OSGILauncher.java) a
>> propertie that is not a String but a HashSet is set and processed by
>> the initPropertiesMethod.invoke( null, new Object[]{properties} );
>> method and the OSGILauncher throws a exception a
>> java.lang.ClassCastException that is beening masked to "Cant startup
>> the OSGI framework".
>> In my case the offending key/value par is
>> key="org.apache.activeio.journal.active.lockMap" value=HashSet<E>
>>
>> As I understand it a system propertie should not be anything but a
>> String but clearly not everyone share that view :) so maybe a patch
>> like "value instanceof String" check should be done also for system
>> properties as it is done for the osgiConfig properties? in Birt
>> v2.2.1.2 ?
>>
>> I should probably contact the Geronimo list to see if there is someway
>> to remove/replace the HashSet propertie but if someone here knows a
>> solution please share it with me/us!
>>
>> thanks
>> Peter Petersson
>>
>>
>> org.eclipse.birt.core.framework.osgi.OSGILauncher.java
>>
>> public void startup( PlatformConfig config ) throws BirtException
>> {
>> if ( frameworkClassLoader != null )
>> {
>> logger.log( Level.WARNING, "Framework is already started"
>> ); //$NON-NLS-1$
>> return;
>> }
>> platformConfig = config;
>> IPlatformContext context = config.getPlatformContext( );
>> if ( context == null )
>> {
>> throw new BirtException(
>> PluginId,
>> "PlatformContext is not setted - {0}", new
>> Object[]{"PlatformConfig"} ); //$NON-NLS-1$
>> }
>>
>> // process install.area
>> String root = context.getPlatform( );
>> platformDirectory = new File( root );
>> if ( !platformDirectory.exists( ) ||
>> !platformDirectory.isDirectory( ) )
>> {
>> throw new BirtException( PluginId,
>> "Could not start the Framework - {0}" + root, root
>> ); //$NON-NLS-1$
>> }
>>
>> String path = new File( platformDirectory, "plugins"
>> ).toString( ); //$NON-NLS-1$
>> path = searchFor( "org.eclipse.osgi", path ); //$NON-NLS-1$
>> if ( path == null )
>> {
>> throw new BirtException(
>> PluginId,
>> "Could not find the Framework - {0}",
>> "org.eclipse.osgi" ); //$NON-NLS-1$
>> }
>> try
>> {
>> osgiFramework = new File( path ).toURL( );
>> }
>> catch(MalformedURLException ex)
>> {
>> //cannot be here
>> }
>> ClassLoader original = Thread.currentThread(
>> ).getContextClassLoader( );
>> try
>> {
>> ClassLoader loader = this.getClass( ).getClassLoader( );
>> frameworkClassLoader = new ChildFirstURLClassLoader(
>> new URL[]{osgiFramework}, loader );
>> // frameworkClassLoader = new OSGIClassLoader(
>> // new URL[]{frameworkUrl}, loader );
>>
>> // Weblogic 8.1SP6 contains old version JS.JAR, we need
>> // set pref-web-inf to true, if we set it to true, the
>> // URL classloader still loads the JS in weblogic, so
>> // load the class explicitly.
>> try
>> {
>> loader.loadClass( "org.mozilla.javascript.Context" );
>> loader.loadClass( "org.mozilla.javascript.Scriptable" );
>> loader.loadClass(
>> "org.mozilla.javascript.ScriptableObject" );
>> // frameworkClassLoader.loadClass(
>> // "org.mozilla.javascript.Context"
>> }
>> catch ( Exception ex )
>> {
>> }
>>
>> Class clazz = frameworkClassLoader.loadClass(
>> ECLIPSE_STARTER );
>>
>> setupOSGiProperties();
>>
>> Method initPropertiesMethod = clazz.getMethod(
>> "setInitialProperties", new Class[]{Map.class} );
>> //$NON-NLS-1$
>> if ( initPropertiesMethod != null )
>> {
>> System.setProperty(
>> "osgi.framework.useSystemProperties", "false"
>> ); //$NON-NLS-1$ //$NON-NLS-2$
>> properties.put( "osgi.framework.useSystemProperties",
>> "false" );
>> ====throws==>> initPropertiesMethod.invoke( null, new
>> Object[]{properties} );
>> }
>> else
>> {
>> Iterator iter = properties.entrySet( ).iterator( );
>> while ( iter.hasNext( ) )
>> {
>> Map.Entry entry = (Map.Entry) iter.next( );
>> String key = (String) entry.getKey( );
>> String value = (String) entry.getValue( );
>> System.setProperty( key, value );
>> }
>> System.setProperty(
>> "osgi.framework.useSystemProperties", "true"
>> ); //$NON-NLS-1$ //$NON-NLS-2$
>> }
>>
>> Method runMethod = clazz.getMethod(
>> "startup", new Class[]{String[].class,
>> Runnable.class} ); //$NON-NLS-1$
>> bundleContext = runMethod.invoke( null, new Object[]{new
>> String[]{}, null} );
>> frameworkContextClassLoader = Thread.currentThread( )
>> .getContextClassLoader( );
>> }
>> catch ( Exception e )
>> {
>> throw new BirtException( PluginId, "Can not start up OSGI
>> - {0}", e
>> .getLocalizedMessage( ) );
>> }
>> finally
>> {
>> Thread.currentThread( ).setContextClassLoader( original );
>> }
>> }
>>
>> private void setupOSGiProperties()
>> {
>> properties = new HashMap( );
>> //copy all system properties to the property.
>> Properties systemProperties = System.getProperties( );
>> if ( systemProperties != null )
>> {
>> for ( Iterator it = systemProperties.entrySet( ).iterator(
>> ); it
>> .hasNext( ); )
>> {
>> Map.Entry entry = (Map.Entry) it.next( );
>> String key = (String) entry.getKey( );
>> Object value = entry.getValue( );
>> if ( !key.startsWith( "osgi." ) && !key.startsWith(
>> "eclipse." )
>> && !key.startsWith( "org.osgi." ) )
>> {
>> ===Sets HashSet==>> properties.put( key, value );
>> }
>> else
>> {
>> properties.put( key, null );
>> }
>> }
>> }
>>
>> //load the config.ini distribued with BIRT system.
>> File configFolder = new File( platformDirectory, CONFIG_FOLDER );
>> try
>> {
>> HashMap configProps = loadConfiguration(
>> configFolder.toURL( ) );
>> properties.putAll( configProps );
>> }
>> catch(Exception ex){/* do nothing */}
>> //copy properties defined by the caller
>> Map osgiConfig = platformConfig.getOSGiConfig( );
>> if ( osgiConfig != null )
>> {
>> Iterator iter = osgiConfig.entrySet( ).iterator( );
>> while ( iter.hasNext( ) )
>> {
>> Map.Entry entry = (Map.Entry) iter.next( );
>> Object key = entry.getKey( );
>> Object value = entry.getValue( );
>> if ( key instanceof String )
>> {
>> if ( value == null || value instanceof String )
>> {
>> properties.put( key, value );
>> }
>> }
>> }
>> }
>> //set up the properied defined by BIRT
>> /* osgi.install.area, always using the one defined by
>> BIRT_HOME. */
>> properties.put( PROP_OSGI_INSTALL_AREA, platformDirectory
>> .getAbsolutePath( ) ); //$NON-NLS-1$
>>
>> /* setup the osgi framework, it is the osgi.jar in the
>> platform/plugins */
>> properties.put( "osgi.framework",
>> osgiFramework.toExternalForm( ) ); //$NON-NLS-1$//$NON-NLS-2$
>>
>> /* setup the config area, it is the /configuration under
>> platform */
>> String configArea = getProperty( properties,
>> PROP_OSGI_CONFIGURATION_AREA );
>> if (configArea == null)
>> {
>> File configDirectory = new File (platformDirectory,
>> CONFIG_FOLDER );
>> properties.put( PROP_OSGI_CONFIGURATION_AREA,
>> configDirectory.getAbsolutePath( ) );
>> }
>> // instance.area, it is the workspace under platform
>> String instanceArea = getProperty( properties,
>> PROP_OSGI_INSTANCE_AREA );
>> if ( instanceArea == null )
>> {
>> File workspaceDirectory = new File( platformDirectory,
>> INSTANCE_FOLDER ); //$NON-NLS-1$
>> if ( !workspaceDirectory.exists( ) )
>> {
>> workspaceDirectory.mkdirs( );
>> }
>> properties.put( PROP_OSGI_INSTANCE_AREA, workspaceDirectory
>> .getAbsolutePath( ) ); //$NON-NLS-1$
>> }
>>
>> properties.put( PROP_ECLIPSE_IGNOREAPP, "true" );//$NON-NLS-1$
>> properties.put( PROP_OSGI_NOSHUTDOWN, "true" ); //$NON-NLS-1$
>> //set -clean if the user doens't define it.
>> String clean = getProperty(properties, PROP_OSGI_CLEAN);
>> if (clean == null)
>> {
>> properties.put( PROP_OSGI_CLEAN, "true" );
>> }
>> }
>>
>>
>> Peter Petersson wrote:
>>> It seems the initPropertiesMethod.invoke( null, new
>>> Object[]{properties} ); method is throwing a exception and
>>> the catch below is throwing it with PluginId="org.eclipse.birt.core".
>>>
>>> I would be great full if anyone with knowledge of the OSGILauncher or
>>> what may cause the invoke method to throw a exception (could not
>>> debug it) could shed some light over this !?
>>> thanks
>>> Peter Petersson
>>>
>>>
>>> if ( initPropertiesMethod != null )
>>> {
>>> System.setProperty(
>>> "osgi.framework.useSystemProperties", "false"
>>> ); //$NON-NLS-1$ //$NON-NLS-2$
>>> properties.put( "osgi.framework.useSystemProperties",
>>> "false" );
>>> ====throws====>>>>>>>> initPropertiesMethod.invoke( null, new
>>> Object[]{properties} );
>>> }
>>> else
>>> {
>>> Iterator iter = properties.entrySet( ).iterator( );
>>> while ( iter.hasNext( ) )
>>> {
>>> Map.Entry entry = (Map.Entry) iter.next( );
>>> String key = (String) entry.getKey( );
>>> String value = (String) entry.getValue( );
>>> System.setProperty( key, value );
>>> }
>>> System.setProperty(
>>> "osgi.framework.useSystemProperties", "true"
>>> ); //$NON-NLS-1$ //$NON-NLS-2$
>>> }
>>>
>>> Method runMethod = clazz.getMethod(
>>> "startup", new Class[]{String[].class,
>>> Runnable.class} ); //$NON-NLS-1$
>>> bundleContext = runMethod.invoke( null, new Object[]{new
>>> String[]{}, null} );
>>> frameworkContextClassLoader = Thread.currentThread( )
>>> .getContextClassLoader( );
>>> }
>>> catch ( Exception e )
>>> {
>>> throw new BirtException( PluginId, "Can not start up OSGI
>>> - {0}", e
>>> .getLocalizedMessage( ) );
>>> }
>>>
>>>
>>> Peter Petersson wrote:
>>>> Hi again Birt users
>>>>
>>>> I hope someone will be able to help me I am trying to get birt
>>>> running in a WS web application in Geronimo v2.0.2 using Birt
>>>> v2.2.1.1 I have successfully fetched a ServlectContext object but
>>>> for some reason the OSGI framework will not start up.
>>>>
>>>> I have been following the servlet example on birt wiki
>>>> http://wiki.eclipse.org/Servlet_Example_%28BIRT%29_2.1 I realize
>>>> that the example code is for birt 2.1 and I am therefore even more
>>>> interested in getting some input from you all.
>>>>
>>>> The layout is as described in the wiki example and below is a code
>>>> snippet and the stack trace.
>>>>
>>>> FYI I am running this on a ubuntu linux box and Geronimo is
>>>> automatically extracting the war up on deployment don't know if it
>>>> has anything to do with things though ( and I doubt it ;) ).
>>>>
>>>> thanks
>>>> Peter Petersson
>>>>
>>>> EngineConfig config = new EngineConfig();
>>>> :
>>>> :
>>>> config.setEngineHome("");
>>>>
>>>> IPlatformContext context = new PlatformServletContext(sc);
>>>> config.setPlatformContext(context);
>>>>
>>>> try {
>>>> Platform.startup(config);
>>>> IReportEngineFactory factory = (IReportEngineFactory)
>>>>
>>>> Platform.createFactoryObject(IReportEngineFactory.EXTENSION_ REPORT_ENGINE_FACTORY);
>>>>
>>>>
>>>> if(factory==null){logger.error("BirtEngine::getBirtEngine factory is
>>>> null");}
>>>> birtEngine =
>>>> factory.createReportEngine(config); }
>>>> catch (BirtException e) {
>>>> logger.error("BirtEngine::getBirtEngine ",e);
>>>> }
>>>> }
>>>> return birtEngine;
>>>>
>>>> 12:01:00,283 INFO [BirtEngine] BirtEngine::getBirtEngine
>>>> logLevel=FINEST
>>>> 12:01:00,392 ERROR [BirtEngine] BirtEngine::getBirtEngine
>>>> org.eclipse.birt.core.exception.BirtException: Cant startup the OSGI
>>>> framework
>>>> at
>>>> org.eclipse.birt.core.framework.Platform.startup(Platform.ja va:90)
>>>> at
>>>> com.scandorama.ticket.reportgenrator.control.BirtEngine.getB irtEngine(BirtEngine.java:76)
>>>>
>>>> at
>>>> com.scandorama.ticket.reportgenrator.control.ReportGenerator .executeReport(ReportGenerator.java:91)
>>>>
>>>> at
>>>> com.scandorama.ticket.reportgenrator.control.ReportGenerator .createReport(ReportGenerator.java:63)
>>>>
>>>> at
>>>> com.scandorama.ticket.jws.TicketService.create(TicketService .java:95)
>>>> 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.apache.axis2.jaxws.server.dispatcher.JavaBeanDispatcher. invokeService(JavaBeanDispatcher.java:163)
>>>>
>>>> at
>>>> org.apache.axis2.jaxws.server.dispatcher.JavaBeanDispatcher. invoke(JavaBeanDispatcher.java:90)
>>>>
>>>> at
>>>> org.apache.axis2.jaxws.server.EndpointController.invoke(Endp ointController.java:172)
>>>>
>>>> at
>>>> org.apache.axis2.jaxws.server.JAXWSMessageReceiver.receive(J AXWSMessageReceiver.java:113)
>>>>
>>>> at
>>>> org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:1 45)
>>>> at
>>>> org.apache.axis2.transport.http.HTTPTransportUtils.processHT TPPostRequest(HTTPTransportUtils.java:275)
>>>>
>>>> at
>>>> org.apache.geronimo.axis2.pojo.POJOWebServiceContainer.proce ssPOSTRequest(POJOWebServiceContainer.java:114)
>>>>
>>>> at
>>>> org.apache.geronimo.axis2.Axis2WebServiceContainer.doService 2(Axis2WebServiceContainer.java:248)
>>>>
>>>> at
>>>> org.apache.geronimo.axis2.Axis2WebServiceContainer.doService (Axis2WebServiceContainer.java:205)

>>>>
>>>> at
>>>> org.apache.geronimo.axis2.Axis2WebServiceContainer.invoke(Ax is2WebServiceContainer.java:167)
>>>>
>>>> at
>>>> org.apache.geronimo.webservices.WebServiceContainerInvoker.s ervice(WebServiceContainerInvoker.java:84)
>>>>
>>>> at
>>>> org.apache.geronimo.webservices.POJOWebServiceServlet.servic e(POJOWebServiceServlet.java:79)
>>>>
>>>> at
>>>> org.apache.catalina.core.ApplicationFilterChain.internalDoFi lter(ApplicationFilterChain.java:290)
>>>>
>>>> at
>>>> org.apache.catalina.core.ApplicationFilterChain.doFilter(App licationFilterChain.java:206)
>>>>
>>>> at
>>>> org.apache.catalina.core.StandardWrapperValve.invoke(Standar dWrapperValve.java:230)
>>>>
>>>> at
>>>> org.apache.catalina.core.StandardContextValve.invoke(Standar dContextValve.java:175)
>>>>
>>>> at
>>>> org.apache.geronimo.tomcat.valve.DefaultSubjectValve.invoke( DefaultSubjectValve.java:56)
>>>>
>>>> at
>>>> org.apache.geronimo.tomcat.GeronimoStandardContext$SystemMet hodValve.invoke(GeronimoStandardContext.java:353)
>>>>
>>>> at
>>>> org.apache.geronimo.tomcat.valve.GeronimoBeforeAfterValve.in voke(GeronimoBeforeAfterValve.java:47)
>>>>
>>>> at
>>>> org.apache.catalina.core.StandardHostValve.invoke(StandardHo stValve.java:128)
>>>>
>>>> at
>>>> org.apache.catalina.valves.ErrorReportValve.invoke(ErrorRepo rtValve.java:104)
>>>>
>>>> at
>>>> org.apache.catalina.core.StandardEngineValve.invoke(Standard EngineValve.java:109)
>>>>
>>>> at
>>>> org.apache.catalina.valves.AccessLogValve.invoke(AccessLogVa lve.java:563)
>>>>
>>>> at
>>>> org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAd apter.java:261)
>>>>
>>>> at
>>>> org.apache.coyote.http11.Http11Processor.process(Http11Proce ssor.java:844)
>>>>
>>>> at
>>>> org.apache.coyote.http11.Http11Protocol$Http11ConnectionHand ler.process(Http11Protocol.java:581)
>>>>
>>>> at
>>>> org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoin t.java:447)
>>>> at java.lang.Thread.run(Thread.java:595)
>>>> Caused by: org.eclipse.birt.core.exception.BirtException: Can not
>>>> start up OSGI - null
>>>> at
>>>> org.eclipse.birt.core.framework.osgi.OSGILauncher.startup(OS GILauncher.java:169)
>>>>
>>>> at
>>>> org.eclipse.birt.core.framework.Platform.startup(Platform.ja va:78)
>>>> ... 36 more
Previous Topic:Problem While Rendering Report from Report design file
Next Topic:BIRT OutOfMemoryError
Goto Forum:
  


Current Time: Thu May 08 15:43:37 EDT 2025

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

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

Back to the top