Home
Analytics
BIRT 2.6 and IBM WebSphere - "Can not startup the OSGI framework"
Siva Raj
Hi, I have integrated BIRT (version 2.3.2) with our web application , it fails to start up on WebSphere with Java 2 security enabled. ..
The log file also contains the stacktrace:
[11/10/10 9:11:16:793 EST] 000003b6 SecurityManag W SECJ0314W: Current Java 2 Security policy reported a potential violation of Java 2 Security Permission. Please refer to InfoCenter for further information.
Permission:
* : Access denied (java.util.PropertyPermission * read,write)
Code:
org.eclipse.osgi.framework.internal.core.FrameworkProperties in {file:/c:/tempReport/BIRT-TEMP/birtplatform/plugins/org.eclipse.osgi_3.4.3.R34x_v20081215-1030.jar}
Stack Trace:
java.security.AccessControlException: Access denied (java.util.PropertyPermission * read,write)
at java.security.AccessController.checkPermission(AccessController.java:108)
at java.lang.SecurityManager.checkPermission(SecurityManager.java:558)
at com.ibm.ws.security.core.SecurityManager.checkPermission(SecurityManager.java:212)
at java.lang.SecurityManager.checkPropertiesAccess(SecurityManager.java:1278)
at java.lang.System.getProperties(System.java:311)
at org.eclipse.osgi.framework.internal.core.FrameworkProperties.<clinit>(FrameworkProperties.java:28)
at java.lang.J9VMInternals.initializeImpl(Native Method)
at java.lang.J9VMInternals.initialize(J9VMInternals.java:196)
at org.eclipse.core.runtime.adaptor.EclipseStarter.setInitialProperties(EclipseStarter.java:1586)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:79)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:618)
I can't give all read/write to all(*) propertypermission in was.policy file.
Could someone please help ?
Find more posts tagged with
Comments
JasonW
Take a look at this thread:
http://www.birt-exchange.org/org/forum/index.php/topic/20613-birt-26-and-ibm-websphere-can-not-startup-the-osgi-framework/page__s__bba98c3c4358fde62f99fb477955f271
Jason
Siva Raj
Thanks for the quick reply
I tried that fix and still got the same error
In the other post, they are getting different access denied issue.
I am getting "* : Access denied (java.util.PropertyPermission * read,write)"
JasonW
can you post the stacktrace?
Jason
Siva Raj
Sure, here is the complete stacktrace..
Code Base Location:
[11/10/10 10:48:58:418 EST] 00000c7e SecurityManag W SECJ0314W: Current Java 2 Security policy reported a potential violation of Java 2 Security Permission. Please refer to InfoCenter for further information.
Permission:
* : Access denied (java.util.PropertyPermission * read,write)
Code:
org.eclipse.osgi.framework.internal.core.FrameworkProperties in {file:/c:/tempReport/BIRT-TEMP/birtplatform/plugins/org.eclipse.osgi_3.4.3.R34x_v20081215-1030.jar}
Stack Trace:
java.security.AccessControlException: Access denied (java.util.PropertyPermission * read,write)
at java.security.AccessController.checkPermission(AccessController.java:108)
at java.lang.SecurityManager.checkPermission(SecurityManager.java:558)
at com.ibm.ws.security.core.SecurityManager.checkPermission(SecurityManager.java:212)
at java.lang.SecurityManager.checkPropertiesAccess(SecurityManager.java:1278)
at java.lang.System.getProperties(System.java:311)
at org.eclipse.osgi.framework.internal.core.FrameworkProperties.<clinit>(FrameworkProperties.java:28)
at java.lang.J9VMInternals.initializeImpl(Native Method)
at java.lang.J9VMInternals.initialize(J9VMInternals.java:196)
at org.eclipse.core.runtime.adaptor.EclipseStarter.setInitialProperties(EclipseStarter.java:1586)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:79)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:618)
at com.ibm.tivoli.maximo.report.birt.bridge.launcher.FrameworkLauncher.start(FrameworkLauncher.java:267)
at com.ibm.tivoli.maximo.report.birt.servlet.MXWebAppOSGiFrameworkLauncher.start(MXWebAppOSGiFrameworkLauncher.java:71)
at com.ibm.tivoli.maximo.report.birt.bridge.launcher.BridgeServlet.init(BridgeServlet.java:75)
at javax.servlet.GenericServlet.init(GenericServlet.java:256)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.init(ServletWrapper.java:226)
at com.ibm.ws.wswebcontainer.servlet.ServletWrapper.init(ServletWrapper.java:320)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.initialize(ServletWrapper.java:1305)
at com.ibm.ws.wswebcontainer.servlet.ServletWrapper.initialize(ServletWrapper.java:153)
at com.ibm.wsspi.webcontainer.extension.WebExtensionProcessor.createServletWrapper(WebExtensionProcessor.java:99)
at com.ibm.ws.webcontainer.webapp.WebApp.getServletWrapper(WebApp.java:887)
at com.ibm.ws.webcontainer.webapp.WebApp.getServletWrapper(WebApp.java:809)
at com.ibm.ws.webcontainer.webapp.WebApp.initializeTargetMappings(WebApp.java:527)
at com.ibm.ws.webcontainer.webapp.WebApp.commonInitializationFinish(WebApp.java:364)
at com.ibm.ws.wswebcontainer.webapp.WebApp.initialize(WebApp.java:292)
at com.ibm.ws.wswebcontainer.webapp.WebGroup.addWebApplication(WebGroup.java:92)
at com.ibm.ws.wswebcontainer.VirtualHost.addWebApplication(VirtualHost.java:157)
at com.ibm.ws.wswebcontainer.WebContainer.addWebApp(WebContainer.java:671)
at com.ibm.ws.wswebcontainer.WebContainer.addWebApplication(WebContainer.java:624)
at com.ibm.ws.webcontainer.component.WebContainerImpl.install(WebContainerImpl.java:335)
at com.ibm.ws.webcontainer.component.WebContainerImpl.start(WebContainerImpl.java:551)
at com.ibm.ws.runtime.component.ApplicationMgrImpl.start(ApplicationMgrImpl.java:1274)
at com.ibm.ws.runtime.component.DeployedApplicationImpl.fireDeployedObjectStart(DeployedApplicationImpl.java:1138)
at com.ibm.ws.runtime.component.DeployedModuleImpl.start(DeployedModuleImpl.java:569)
at com.ibm.ws.runtime.component.DeployedApplicationImpl.start(DeployedApplicationImpl.java:817)
at com.ibm.ws.runtime.component.ApplicationMgrImpl.startApplication(ApplicationMgrImpl.java:921)
at com.ibm.ws.runtime.component.ApplicationMgrImpl$1.run(ApplicationMgrImpl.java:1461)
at com.ibm.ws.security.auth.ContextManagerImpl.runAs(ContextManagerImpl.java:4132)
at com.ibm.ws.security.auth.ContextManagerImpl.runAsSystem(ContextManagerImpl.java:4229)
at com.ibm.ws.security.core.SecurityContext.runAsSystem(SecurityContext.java:245)
at com.ibm.ws.runtime.component.ApplicationMgrImpl.startApplication(ApplicationMgrImpl.java:1466)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:79)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:618)
at sun.reflect.misc.Trampoline.invoke(MethodUtil.java:62)
at sun.reflect.GeneratedMethodAccessor34.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:618)
at sun.reflect.misc.MethodUtil.invoke(MethodUtil.java:265)
at javax.management.modelmbean.RequiredModelMBean.invokeMethod(RequiredModelMBean.java:1092)
at javax.management.modelmbean.RequiredModelMBean.invoke(RequiredModelMBean.java:973)
at com.sun.jmx.mbeanserver.DynamicMetaDataImpl.invoke(DynamicMetaDataImpl.java:231)
at com.sun.jmx.mbeanserver.MetaDataImpl.invoke(MetaDataImpl.java:238)
at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:833)
at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:802)
at com.ibm.ws.management.AdminServiceImpl$1.run(AdminServiceImpl.java:1106)
at java.security.AccessController.doPrivileged(AccessController.java:246)
at com.ibm.ws.security.util.AccessController.doPrivileged(AccessController.java:125)
at com.ibm.ws.management.AdminServiceImpl.invoke(AdminServiceImpl.java:999)
at com.ibm.ws.management.connector.AdminServiceDelegator.invoke(AdminServiceDelegator.java:139)
at sun.reflect.GeneratedMethodAccessor43.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:618)
at com.ibm.ws.management.connector.soap.SOAPConnector.invoke(SOAPConnector.java:361)
at com.ibm.ws.management.connector.soap.SOAPConnector.service(SOAPConnector.java:215)
at com.ibm.ws.management.connector.soap.SOAPConnection.handleRequest(SOAPConnection.java:55)
at com.ibm.ws.http.HttpConnection.readAndHandleRequest(HttpConnection.java:680)
at com.ibm.ws.http.HttpConnection.run(HttpConnection.java:484)
at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1473)
Code Base Location:
JasonW
Are you using the viewer or the re api? If you are using the api are you using a PlatformServletContext? If you are this tries to create an instance of OSGi in the temp directory. Just wondering if this could be the problem.
Jason
Siva Raj
We are using the API.. i will try to create an instance of OSGi in the temp directory.. <br />
<br />
I have put the wrong BIRT version in the topic. <br />
<br />
We are not using BIRT 2.6. We are using <span style='font-size: 18px;'><strong class='bbc'>BIRT 2.3.2</strong></span><br />
<br />
<strong class='bbc'>Is it possible to install BIRT 2.3.2 in the Java 2 security enabled Websphere Application Server ? </strong>
JasonW
I believe others have gotten 2.3.2 to work in this fashion.
Jason
btotyi
<blockquote class='ipsBlockquote' data-author="'Siva Raj'" data-cid="70243" data-time="1289515919" data-date="11 November 2010 - 03:51 PM"><p>
We are using the API.. i will try to create an instance of OSGi in the temp directory.. <br />
<br />
I have put the wrong BIRT version in the topic. <br />
<br />
We are not using BIRT 2.6. We are using <span style='font-size: 18px;'><strong class='bbc'>BIRT 2.3.2</strong></span><br />
<br />
<strong class='bbc'>Is it possible to install BIRT 2.3.2 in the Java 2 security enabled Websphere Application Server ? </strong><br /></p></blockquote>
<br />
Put the was.policy file into the web application META-INF folder with following content :<br />
<br />
grant codeBase "file:${webComponent}" {<br />
permission java.security.AllPermission;<br />
};
Siva Raj
<blockquote class='ipsBlockquote' data-author="'btotyi'" data-cid="70263" data-time="1289573175" data-date="12 November 2010 - 07:46 AM"><p>
Put the was.policy file into the web application META-INF folder with following content :<br />
<br />
grant codeBase "file:${webComponent}" {<br />
permission java.security.AllPermission;<br />
};<br /></p></blockquote>
<br />
<br />
Thanks for the reply.<br />
<br />
As this is the production server, our customer can't allow to give AllPermission.
Siva Raj
<blockquote class='ipsBlockquote' data-author="'JasonW'" data-cid="70261" data-time="1289572209" data-date="12 November 2010 - 07:30 AM"><p>
I believe others have gotten 2.3.2 to work in this fashion.<br />
<br />
Jason<br /></p></blockquote>
<br />
Jason, Thanks for the reply <br />
<br />
We are not using PlatformServletContext, Below is the code to start the OSGi framework, <br />
<br />
private static final String SERVLET_BRIDGE_ENABLED = "org.eclipse.equinox.servlet.bridge.enabled";<br />
private static final String WS_DELIM = " \t\n\r\f"; <br />
protected static final String FILE_SCHEME = "file:"; <br />
protected static final String FRAMEWORK_BUNDLE_NAME = "org.eclipse.osgi"; <br />
protected static final String STARTER = "org.eclipse.core.runtime.adaptor.EclipseStarter"; <br />
protected static final String NULL_IDENTIFIER = "
@null"
;; <br />
protected static final String OSGI_FRAMEWORK = "osgi.framework"; <br />
protected static final String OSGI_INSTANCE_AREA = "osgi.instance.area"; <br />
protected static final String OSGI_CONFIGURATION_AREA = "osgi.configuration.area"; <br />
protected static final String OSGI_INSTALL_AREA = "osgi.install.area"; <br />
protected static final String RESOURCE_BASE = "/WEB-INF/birt/platform/"; <br />
protected static final String LAUNCH_INI = "launch.ini"; <br />
<br />
<br />
<br />
ClassLoader original = Thread.currentThread().getContextClassLoader();<br />
oldValue = System.getProperty("osgi.framework.useSystemProperties");<br />
<br />
System.setProperty("osgi.framework.useSystemProperties", "false");<br />
setProperty = true;<br />
<br />
URL[] osgiURLArray = {new URL((String) initalPropertyMap.get(OSGI_FRAMEWORK))};<br />
<br />
frameworkClassLoader = new ChildFirstURLClassLoader(osgiURLArray, this.getClass().getClassLoader());<br />
<br />
<br />
<br />
Class clazz = frameworkClassLoader.loadClass(STARTER);<br />
<br />
Method setInitialProperties = clazz.getMethod("setInitialProperties", new Class[] {Map.class}); <br />
setInitialProperties.invoke(null, new Object[] {initalPropertyMap});<br />
<br />
Method runMethod = clazz.getMethod("run", new Class[] {String[].class, Runnable.class}); <br />
runMethod.invoke(null, new Object[] {args, null}); <br />
frameworkContextClassLoader = Thread.currentThread().getContextClassLoader();<br />
<br />
<br />
<br />
I am getting the access denied error, when it calls the setInitialProperties.invoke()<br />
<br />
Permission:<br />
<br />
* : Access denied (java.util.PropertyPermission * read,write)<br />
<br />
<br />
Code:<br />
<br />
org.eclipse.osgi.framework.internal.core.FrameworkProperties in {file:/c:/tempReport/BIRT-TEMP/birtplatform/plugins/org.eclipse.osgi_3.4.3.R34x_v20081215-1030.jar}<br />
<br />
<br />
<br />
Stack Trace:<br />
<br />
java.security.AccessControlException: Access denied (java.util.PropertyPermission * read,write)<br />
at java.security.AccessController.checkPermission(AccessController.java:108)<br />
at java.lang.SecurityManager.checkPermission(SecurityManager.java:558)<br />
at com.ibm.ws.security.core.SecurityManager.checkPermission(SecurityManager.java:212)<br />
at java.lang.SecurityManager.checkPropertiesAccess(SecurityManager.java:1278)<br />
at java.lang.System.getProperties(System.java:311)<br />
at org.eclipse.osgi.framework.internal.core.FrameworkProperties.<clinit>(FrameworkProperties.java:28)<br />
at java.lang.J9VMInternals.initializeImpl(Native Method)<br />
at java.lang.J9VMInternals.initialize(J9VMInternals.java:196)<br />
at org.eclipse.core.runtime.adaptor.EclipseStarter.setInitialProperties(EclipseStarter.java:1586)<br />
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)<br />
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:79)<br />
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)<br />
at java.lang.reflect.Method.invoke(Method.java:618)<br />
at com.ibm.tivoli.maximo.report.birt.bridge.launcher.FrameworkLauncher.start(FrameworkLauncher.java:267)
JasonW
Are you calling the code above or are you using the org.eclipse.birt.core.framework.Platform.java class to start it up?
Can you give read permission to all?
Jason
Siva Raj
We are using the above code to start the OSGi framework.
We use org.eclipse.core.runtime.adaptor.EclipseStarter class to start
We can't give read permission to all, as per our customer requirements. They have very strict rule on that.
JasonW
Can you open a bug for this. I believe the dev team has access to an instance of WebSphere?
Jason
sgeovar
Hi
I have integrated Birt in my web application deployed in weblogic.
Birt plugin has many jars.
Is it possible to customize or reduce the jars because my application doesn't need all these jars.
or is it possible to use the plugin zip file ( which contains runtime jars) without unzipping it ?
Thanks
JasonW
You can remove plugins for items you do not use. Like emitter plugins, charting, crosstab items etc. You should also be able to war the ExampleWebViewer and deploy it.
Jason
Siva Raj
Hi, <br />
<br />
I am trying to integrate BIRT version 2.6.0 to a prototype application and deploying in Java 2 security enabled Websphere APplication Server. I have used the following BIRT sample integration servlet as my base.. <br />
<br />
<a class='bbc_url' href='
http://wiki.eclipse.org/Servlet_Example_(BIRT)_2.1'>http://wiki.eclipse.org/Servlet_Example_(BIRT)_2.1</a><br
/>
<br />
I created the EAR file and deployed in Java 2 security enabled Websphere Application server..<br />
<br />
When i try to run the report, i am getting the following error in log, <br />
<br />
<br />
Permission:<br />
<br />
ibm.signalhandling.sigchain : Access denied (java.util.PropertyPermission ibm.signalhandling.sigchain write)<br />
<br />
<br />
Code:<br />
<br />
org.eclipse.osgi.framework.internal.core.FrameworkProperties in {file:/C:/Program%20Files/IBM/WebSphere/AppServer/profiles/ctgAppSrv01/installedApps/ctgCell01/BIRTTestEAR.ear/BIRTTest.war/WEB-INF/platform/plugins/org.eclipse.osgi_3.6.0.v20100517.jar}<br />
<br />
<br />
<br />
Stack Trace:<br />
<br />
java.security.AccessControlException: Access denied (java.util.PropertyPermission ibm.signalhandling.sigchain write)<br />
at java.security.AccessController.checkPermission(AccessController.java:108)<br />
at java.lang.SecurityManager.checkPermission(SecurityManager.java:558)<br />
at com.ibm.ws.security.core.SecurityManager.checkPermission(SecurityManager.java:212)<br />
at org.eclipse.osgi.framework.internal.core.FrameworkProperties.setProperty(FrameworkProperties.java:57)<br />
at org.eclipse.core.runtime.adaptor.EclipseStarter.setInitialProperties(EclipseStarter.java:1433)<br />
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)<br />
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:79)<br />
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)<br />
at java.lang.reflect.Method.invoke(Method.java:618)<br />
at org.eclipse.birt.core.framework.osgi.OSGILauncher.doStartup(OSGILauncher.java:173)<br />
at org.eclipse.birt.core.framework.osgi.OSGILauncher.access$0(OSGILauncher.java:94)<br />
at org.eclipse.birt.core.framework.osgi.OSGILauncher$1.run(OSGILauncher.java:79)<br />
at java.security.AccessController.doPrivileged(AccessController.java:246)<br />
at org.eclipse.birt.core.framework.osgi.OSGILauncher.startup(OSGILauncher.java:75)<br />
at org.eclipse.birt.core.framework.Platform.startup(Platform.java:79)<br />
at com.birt.test.BirtEngine.getBirtEngine(BirtEngine.java:85)<br />
at com.birt.test.BirtReport.init(BirtReport.java:130)<br />
at com.ibm.ws.webcontainer.servlet.ServletWrapper.init(ServletWrapper.java:226)<br />
at com.ibm.ws.wswebcontainer.servlet.ServletWrapper.init(ServletWrapper.java:320)<br />
at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:434)<br />
at com.ibm.ws.wswebcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:481)<br />
at com.ibm.ws.webcontainer.webapp.WebApp.handleRequest(WebApp.java:3453)<br />
at com.ibm.ws.webcontainer.webapp.WebGroup.handleRequest(WebGroup.java:267)<br />
at com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:815)<br />
at com.ibm.ws.wswebcontainer.WebContainer.handleRequest(WebContainer.java:1466)<br />
at com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java:119)<br />
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:458)<br />
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewInformation(HttpInboundLink.java:387)<br />
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.ready(HttpInboundLink.java:267)<br />
at com.ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.sendToDiscriminators(NewConnectionInitialReadCallback.java:214)<br />
at com.ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.complete(NewConnectionInitialReadCallback.java:113)<br />
at com.ibm.ws.tcp.channel.impl.AioReadCompletionListener.futureCompleted(AioReadCompletionListener.java:165)<br />
at com.ibm.io.async.AbstractAsyncFuture.invokeCallback(AbstractAsyncFuture.java:217)<br />
at com.ibm.io.async.AsyncChannelFuture.fireCompletionActions(AsyncChannelFuture.java:161)<br />
at com.ibm.io.async.AsyncFuture.completed(AsyncFuture.java:136)<br />
at com.ibm.io.async.ResultHandler.complete(ResultHandler.java:196)<br />
at com.ibm.io.async.ResultHandler.runEventProcessingLoop(ResultHandler.java:751)<br />
at com.ibm.io.async.ResultHandler$2.run(ResultHandler.java:881)<br />
at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1473)<br />
<br />
<br />
<br />
<span style='font-size: 14px;'><strong class='bbc'>I did add the following line in my was.policy file,<br />
<br />
permission java.util.PropertyPermission "ibm.signalhandling.sigchain", "read,write";<br />
<br />
But, still i am getting the error. <br />
<br />
Please help. Thanks</strong></span><br />
<br />
<br />
<strong class='bbc'>Here is the BirtEngine.java.. </strong><br />
<br />
<br />
<br />
import java.io.InputStream;<br />
import java.io.IOException;<br />
import java.util.Properties;<br />
import java.util.logging.Level;<br />
<br />
import org.eclipse.birt.report.engine.api.EngineConfig;<br />
import org.eclipse.birt.report.engine.api.EngineConstants;<br />
import org.eclipse.birt.report.engine.api.IReportEngine;<br />
import javax.servlet.*;<br />
import org.eclipse.birt.core.framework.PlatformServletContext;<br />
import org.eclipse.birt.core.framework.IPlatformContext;<br />
import org.eclipse.birt.core.framework.Platform;<br />
import org.eclipse.birt.core.exception.BirtException;<br />
import org.eclipse.birt.report.engine.api.IReportEngineFactory;<br />
import org.eclipse.birt.report.engine.api.ReportEngine;<br />
import javax.servlet.http.HttpServletRequest;<br />
<br />
public class BirtEngine {<br />
<br />
private static IReportEngine birtEngine = null;<br />
<br />
private static Properties configProps = new Properties();<br />
<br />
private final static String configFile = "BirtConfig.properties";<br />
<br />
public static synchronized void initBirtConfig() {<br />
loadEngineProps();<br />
}<br />
<br />
public static synchronized IReportEngine getBirtEngine(ServletContext sc) {<br />
if (birtEngine == null) <br />
{<br />
EngineConfig config = new EngineConfig();<br />
if( configProps != null){<br />
String logLevel = configProps.getProperty("logLevel");<br />
Level level = Level.OFF;<br />
if ("SEVERE".equalsIgnoreCase(logLevel)) <br />
{<br />
level = Level.SEVERE;<br />
} else if ("WARNING".equalsIgnoreCase(logLevel))<br />
{<br />
level = Level.WARNING;<br />
} else if ("INFO".equalsIgnoreCase(logLevel)) <br />
{<br />
level = Level.INFO;<br />
} else if ("CONFIG".equalsIgnoreCase(logLevel))<br />
{<br />
level = Level.CONFIG;<br />
} else if ("FINE".equalsIgnoreCase(logLevel)) <br />
{<br />
level = Level.FINE;<br />
} else if ("FINER".equalsIgnoreCase(logLevel)) <br />
{<br />
level = Level.FINER;<br />
} else if ("FINEST".equalsIgnoreCase(logLevel)) <br />
{<br />
level = Level.FINEST;<br />
} else if ("OFF".equalsIgnoreCase(logLevel)) <br />
{<br />
level = Level.OFF;<br />
}<br />
<br />
config.setLogConfig(configProps.getProperty("logDirectory"), level);<br />
}<br />
<br />
config.setEngineHome("");<br />
config.getAppContext().put(EngineConstants.APPCONTEXT_CLASSLOADER_KEY, BirtEngine.class.getClassLoader()); <br />
<br />
<br />
IPlatformContext context = new PlatformServletContext( sc );<br />
config.setPlatformContext( context );<br />
<br />
<br />
//Create the report engine<br />
//birtEngine = new ReportEngine( config );<br />
//ReportEngine engine = new ReportEngine( null );<br />
<br />
<br />
try<br />
{<br />
Platform.startup( config );<br />
}<br />
catch ( BirtException e )<br />
{<br />
e.printStackTrace( );<br />
}<br />
<br />
IReportEngineFactory factory = (IReportEngineFactory) Platform<br />
.createFactoryObject( IReportEngineFactory.EXTENSION_REPORT_ENGINE_FACTORY );<br />
birtEngine = factory.createReportEngine( config );<br />
<br />
<br />
}<br />
return birtEngine;<br />
}<br />
<br />
public static synchronized void destroyBirtEngine() {<br />
if (birtEngine == null) {<br />
return;<br />
} <br />
birtEngine.destroy();<br />
Platform.shutdown();<br />
birtEngine = null;<br />
}<br />
<br />
public Object clone() throws CloneNotSupportedException {<br />
throw new CloneNotSupportedException();<br />
}<br />
<br />
private static void loadEngineProps() {<br />
try {<br />
//Config File must be in classpath<br />
ClassLoader cl = Thread.currentThread ().getContextClassLoader();<br />
InputStream in = null;<br />
in = cl.getResourceAsStream (configFile);<br />
configProps.load(in);<br />
in.close();<br />
<br />
<br />
} catch (IOException e) {<br />
e.printStackTrace();<br />
}<br />
<br />
}<br />
<br />
}
JasonW
Can you log a bug for this?
Jason
Siva Raj
Thanks Mason,
Could you point me to a link to open a bug against BIRT ?
From the following thread, it looks like, he was able to run the BIRT engine with java 2 security enabled WAS instance..
http://www.birt-exchange.org/org/forum/index.php/topic/20613-birt-26-and-ibm-websphere-can-not-startup-the-osgi-framework/page__s__bba98c3c4358fde62f99fb477955f271
Am i doing something different ?
JasonW
In your web-inf/platform/configuration directory is there write permission?
Jason
Siva Raj
Yes, i do.
I also have the permission set in was.policy file
permission java.io.FilePermission "${app.installed.path}${/}-", "read,write";
JasonW
Did you try adding
osgi.configuration.area=c:/birtconfigarea and make sure this directory is writeable.
to your configuration.ini and setting it as a writeable location?
Jason