其他分享
首页 > 其他分享> > spring – 为什么Websphere不喜欢BIRT?

spring – 为什么Websphere不喜欢BIRT?

作者:互联网

我正在尝试开始向Websphere部署项目,我得到以下错误跟踪. (缩短)

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.

我在网上找到的第三个来自底部错误的解决方案是删除以下代码行.

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

但是,这不存在,也不需要我们的设置.
它(使用的BIRT特定代码)与此在线示例非常相似:

http://www.springsource.org/BusinessIntelligenceWithSpringAndBIRT

BirtView和BirtEngineFactory是我项目的唯一相关部分.
我已经去了这个Bug页面和论坛条目,并尝试添加代码.那没起效.该项目启动并在Tomcat 6x上运行没有任何问题.

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

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

我将Web Sphere中的类加载器顺序设置为“首先加载了应用程序类加载器的类”.如下面链接中的示例所示.

http://wiki.eclipse.org/BirtPOJO_Viewer_WebSphere_Deployment

我仍然得到同样的错误,我不确定我还应该做些什么.
我知道在没有发布代码的情况下提出这个问题有点难,但是有人会对我应该寻找什么有所了解吗?
谢谢.

解决方法:

我和你的错误完全相同.我使用的是BIRT 3.7.2和IBM WAS 8.5

参考下面详述的错误,
org.eclipse.core.runtime.CoreException when restarting the ReportEngine

以及下面指定的bug的实际原因,
ServiceLauncher.shutdown() doesn’t release default RegistryProvider

我在Platform.startup(..)调用之前添加了以下行
   RegistryProviderFactory.releaseDefault();

在此之后,BIRT报告工作正常.

但是,我怀疑这是否会破坏WAS运行时的任何内容.
原因是……

如错误中所述,当第二次尝试启动平台时会发生此异常.在这里,在Platform.shutdown()上,RegistryProvider没有被释放,因此也是例外.

现在,就我而言,IBM Websphere 8.5内部使用OSGi,因此启动了OSGi平台.
因此,当我们的应用程序再次尝试启动平台(第二次启动)时,会发生异常.
我关注的是,这不应该破坏WAS运行时的任何东西(因为它在内部使用OSGi).

注册表提供程序不是空的,因为它是由BIRT运行时设置的,所以,这里唯一的问题可能是类版本不匹配,即WAS的注册表提供程序和BIRT注册表提供程序,如果不同,则版本冲突.

我不确定我用过的解决方案.
专家,请指导.

标签:spring,websphere,birt
来源: https://codeday.me/bug/20190625/1287591.html