Eclipse Galileo Birt(Eclipse Galileo Birt)

315 IT屋

While clicking on the Preview button or running the report in the web viewer Following ERROR is arising.

org.eclipse.birt.report.presentation.aggregation.layout.RunFragment cannot be cast to org.eclipse.birt.report.presentation.aggregation.IFragment

Caused by:

java.lang.ClassCastException: org.eclipse.birt.report.presentation.aggregation.layout.RunFragment cannot be cast to org.eclipse.birt.report.presentation.aggregation.IFragment at org.apache.jsp.webcontent.birt.pages.layout.RunFragment_jsp._jspService(RunFragment_jsp.java:63) at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97) at javax.servlet.http.HttpServlet.service(HttpServlet.java:820) at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:332) at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314) at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264) at javax.servlet.http.HttpServlet.service(HttpServlet.java:820) at org.eclipse.equinox.jsp.jasper.JspServlet.service(JspServlet.java:112) at javax.servlet.http.HttpServlet.service(HttpServlet.java:820) at org.eclipse.equinox.http.registry.internal.ServletManager$ServletWrapper.service(ServletManager.java:180) at org.eclipse.equinox.http.servlet.internal.ServletRegistration.handleRequest(ServletRegistration.java:90) at org.eclipse.equinox.http.servlet.internal.ProxyServlet.processAlias(ProxyServlet.java:111) at org.eclipse.equinox.http.servlet.internal.ProxyServlet.service(ProxyServlet.java:75) at javax.servlet.http.HttpServlet.service(HttpServlet.java:820) at org.eclipse.equinox.http.jetty.internal.HttpServerManager$InternalHttpServiceServlet.service(HttpServerManager.java:318) at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:502) at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:380) at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:181) at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:765) at org.mortbay.jetty.servlet.Dispatcher.include(Dispatcher.java:192) at org.eclipse.equinox.http.servlet.internal.RequestDispatcherAdaptor.include(RequestDispatcherAdaptor.java:37) at org.eclipse.birt.report.presentation.aggregation.layout.FramesetFragment.service(FramesetFragment.java:98) at org.eclipse.birt.report.servlet.ViewerServlet.__doGet(ViewerServlet.java:181) at org.eclipse.birt.report.servlet.BirtSoapMessageDispatcherServlet.doGet(BirtSoapMessageDispatcherServlet.java:160) at javax.servlet.http.HttpServlet.service(HttpServlet.java:707) at org.apache.axis.transport.http.AxisServletBase.service(AxisServletBase.java:327) at javax.servlet.http.HttpServlet.service(HttpServlet.java:820) at org.eclipse.birt.report.servlet.BirtSoapMessageDispatcherServlet.service(BirtSoapMessageDispatcherServlet.java:122) at org.eclipse.equinox.http.registry.internal.ServletManager$ServletWrapper.service(ServletManager.java:180) at org.eclipse.equinox.http.servlet.internal.ServletRegistration.handleRequest(ServletRegistration.java:90) at org.eclipse.equinox.http.servlet.internal.ProxyServlet.processAlias(ProxyServlet.java:111) at org.eclipse.equinox.http.servlet.internal.ProxyServlet.service(ProxyServlet.java:59) at javax.servlet.http.HttpServlet.service(HttpServlet.java:820) at org.eclipse.equinox.http.jetty.internal.HttpServerManager$InternalHttpServiceServlet.service(HttpServerManager.java:318) at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:502) at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:380) at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:181) at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:765) at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152) at org.mortbay.jetty.Server.handle(Server.java:324) at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:535) at org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:865) at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:540) at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:213) at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404) at org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:409) at org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:520)

What are the reasons behind it and its solutions

解决方案

The two classes come from different classloaders. One is probably from OSGi, the other from the classloader of your app or your app container.

Try to print the values of IFragment.class.getClassLoader() and RunFragment.class.getClassLoader() to see if they are the same. If not, clean up your classloaders :-)

Check out the FAQ and this (seemingly unrelated) FAQ item.

点击预览按钮或在网络浏览器中运行报告按照错误发生。




org.eclipse.birt.report.presentation.aggregation.layout.RunFragment不能转换为org.eclipse.birt.report.presentation.aggregation.Fragment




导致:




java.lang.ClassCastException:org.eclipse.birt.report.presentation.aggregation.layout .RunFragment不能被转换为org.eclipse.birt.report.presentation.aggregation.IFragment
在org.apache.jsp.webcontent.birt.pages.layout.RunFragment_jsp._jspService(RunFragment_jsp.java:63)
在org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
在javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
在org.apache .jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:332)
在org.apache.jasper.servlet.JspServlet.serviceJspFile(Jsp Servlet.java:314)
在org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
在javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
在org.eclipse.equinox.jsp.jasper.JspServlet.service(JspServlet.java:112)
在javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
在org.eclipse.equinox.http.registry.internal.ServletManager $ ServletWrapper.service(ServletManager.java:180)
在org.eclipse.equinox.http.servlet.internal.ServletRegistration.handleRequest(ServletRegistration.java:在org.eclipse.equinox.http.servlet.internal.ProxyServlet.service()中的
ProxyServlet.java:75)
在javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
在org.eclipse.equinox.http.jetty.internal.HttpServerManager $ InternalHttpServiceServlet.service( HttpServerManager.java:318)
at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:502)
在org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:380)
在org.mortbay。 jetty.servlet.SessionHandler.handle(SessionHandler.java:181)
在org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:765)
在org.mortbay.jetty.servlet。 Dispatcher.include(Dispatcher.java:192)
在org.eclipse.equinox.http.servlet.internal.RequestDispatcherAdaptor.include(RequestDispatcherAdaptor.java:37)
在org.eclipse.birt.report。 presentation.aggregation.layout.FramesetFragment.service(FramesetFragment.java:98)
在org.eclipse.birt.report.servlet.ViewerServlet .__ doGet(ViewerServlet.java:181)
在org.eclipse。 birt.report.servlet.BirtSoapMessageDispatcherServlet.doGet(BirtSoapMessageDispatcherServlet.java:160)
在javax.servlet.http.HttpServlet.service(HttpServlet.java:707)
在org.apache.axis.transport。 http.Axis ServletBase.service(AxisServletBase.java:327)
在javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
在org.eclipse.birt.report.servlet.BirtSoapMessageDispatcherServlet.service( BirtSoapMessageDispatcherServlet.java:122)
在org.eclipse.equinox.http.registry.internal.ServletManager $ ServletWrapper.service(ServletManager.java:180)
在org.eclipse.equinox.http.servlet。 internal.ServletRegistration.handleRequest(ServletRegistration.java:90)
在org.eclipse.equinox.http.servlet.internal.ProxyServlet.processAlias(ProxyServlet.java:111)
在org.eclipse.equinox。 java.util.service jetty.internal.HttpServerManager $ InternalHttpServiceServlet.service(HttpServerManager.java:318)
在org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:502)
在org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:380)
在org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:181)
在org.mortbay .jetty.handler.ContextHandler.handle(ContextHandler.java:765)
在org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
在org.mortbay.jetty.Server .handle(Server.java:324)
在org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:535)
在org.mortbay.jetty.HttpConnection $ RequestHandler.headerComplete(HttpConnection.java :865)
在org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:540)
在org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:213)
在org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404)
在org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:409)
在org.mortbay.thread。 QueuedThreadPool $ PoolThread.run(QueuedThreadPool.java:52 0)




背后的原因及其解决方案


< div class ="h2_lin">解决方案

这两个类来自不同的类加载器。一个可能来自OSGi,另一个来自您的应用程序或应用程序容器的类加载器。



尝试打印 IFragment.class的值。 getClassLoader()和 RunFragment.class.getClassLoader()来查看它们是否相同。如果没有,请清理您的类加载器: - )



查看常见问题这个(看似无关的)FAQ项目


本文地址:IT屋 » Eclipse Galileo Birt