Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why doesn't Websphere like BIRT?

I am trying to start a deployment of a project to Websphere and I get the following error trail. (Shortened)

ERROR org.springframework.web.context.ContextLoader - Context initialization failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'birtView' defined in ServletContext resource [/WEB-INF/applicationContext.xml]: Cannot resolve reference to bean 'birtEngine' while setting bean property 'birtEngine'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'birtEngine': FactoryBean threw exception on object creation; nested exception is java.lang.RuntimeException: Could not start the Birt engine!
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'birtEngine': FactoryBean threw exception on object creation; nested exception is java.lang.RuntimeException: Could not start the Birt engine!
Caused by: java.lang.RuntimeException: Could not start the Birt engine!
Caused by: org.eclipse.birt.core.exception.BirtException: error.CannotStartupOSGIPlatform
Caused by: org.eclipse.birt.core.framework.FrameworkException: Cant register the ExtensionRegistry classpath
Caused by: org.eclipse.core.runtime.CoreException: Extension registry provider is already set.

The solution to the 3rd from bottom error as I have found online was to delete the following line of code.

config.setEngineHome("C:/birt-runtime-3_7_0/ReportEngine");

However, this is not present and unnecessary for our setup. It(the BIRT specific code used) is very similar to this example online:

http://www.springsource.org/BusinessIntelligenceWithSpringAndBIRT

The BirtView and BirtEngineFactory are the only relevant parts to my project. I have gone to this Bug Page and forum entry and tried the code addition. It did not work. The project starts up and works on Tomcat 6x without any issue.

http://www.eclipse.org/forums/index.php/m/727929/

https://bugs.eclipse.org/bugs/show_bug.cgi?id=351052

I have the class loader order in Web Sphere set to "Classes loaded with application class loader first." as in the example in the link below.

http://wiki.eclipse.org/BirtPOJO_Viewer_WebSphere_Deployment

I still get the same set of errors and I'm not sure what else I should be doing. I know it is a bit hard to ask this without posting code, but would someone have an idea as to what I should look for? Thanks.

like image 494
user1281598 Avatar asked Nov 05 '12 21:11

user1281598


1 Answers

I had exactly the same error as yours. I am using BIRT 3.7.2 and IBM WAS 8.5

With reference to the bug detailed below, org.eclipse.core.runtime.CoreException when restarting the ReportEngine

and the actual reason of the bug, specified below, ServiceLauncher.shutdown() doesn't release default RegistryProvider

I added the following line before the Platform.startup(..) call RegistryProviderFactory.releaseDefault();

After this, BIRT reports are working fine.

But, I'm doubtful, as to whether this will break anything in WAS's runtime or not. The reason for this is ...

As explained in the bug, this exception occurs when Platform start-up is attempted for a second time. Here, on Platform.shutdown(), the RegistryProvider is not released, and hence the exception.

Now, in my case, IBM Websphere 8.5 internally uses OSGi and hence starts OSGi Platform. Hence, when our application attempts to start the Platform again (the second start), the exception occurs. My concern here is, this should not break anything with WAS’s runtime (as it uses OSGi internally).

The Registry Provider is not null, as its set by BIRT runtime, so, the only problem here can be of Class Version mismatch i.e., WAS’s Registry Provider and BIRTs Registry Provider, if different, then version clashes.

I'm not sure of the solution i have used. Experts, please guide.

like image 162
Prasanna Mondkar Avatar answered Oct 09 '22 13:10

Prasanna Mondkar