Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » BIRT » Security Exception(java.lang.SecurityException: class "org.mozilla.javascript.ContextFactory"'s signer information does not match signer information of other classes in the same package)
Security Exception [message #1014604] Tue, 26 February 2013 06:22 Go to next message
SenthilKumar Rajendran is currently offline SenthilKumar RajendranFriend
Messages: 3
Registered: February 2013
Junior Member
Hi, I'm new to BIRT,

I'm trying to generate the report and populate it in a jsp through servlets using struts framework.

I'm using the "birt-runtime-2_6_2".

I got the exception " org.eclipse.birt.report.engine.api.EngineException: Can't create data engine.
at org.eclipse.birt.report.engine.executor.ExecutionContext.openDataEngine(ExecutionContext.java:874)

Caused by: java.lang.SecurityException: class "org.mozilla.javascript.ContextFactory"'s signer information does not match signer information of other classes in the same package "


while I try to call the task.run();


Trace:
*****

org.eclipse.birt.report.engine.api.EngineException: Can't create data engine.
at org.eclipse.birt.report.engine.executor.ExecutionContext.openDataEngine(ExecutionContext.java:874)
at org.eclipse.birt.report.engine.executor.ExecutionContext.getDataEngine(ExecutionContext.java:886)
at org.eclipse.birt.report.engine.executor.ReportExecutor.execute(ReportExecutor.java:122)
at org.eclipse.birt.report.engine.internal.executor.wrap.WrappedReportExecutor.execute(WrappedReportExecutor.java:60)
at org.eclipse.birt.report.engine.internal.executor.dup.SuppressDuplciateReportExecutor.execute(SuppressDuplciateReportExecutor.java:42)
at org.eclipse.birt.report.engine.internal.executor.wrap.WrappedReportExecutor.execute(WrappedReportExecutor.java:60)
at org.eclipse.birt.report.engine.internal.executor.l18n.LocalizedReportExecutor.execute(LocalizedReportExecutor.java:61)
at org.eclipse.birt.report.engine.api.impl.RunAndRenderTask.doRun(RunAndRenderTask.java:178)
at org.eclipse.birt.report.engine.api.impl.RunAndRenderTask.run(RunAndRenderTask.java:77)
at com.albridge.dashboard.web.action.report.BirtReportGeneratorAction.renderReport(BirtReportGeneratorAction.java:192)
at com.albridge.dashboard.web.action.report.BirtReportGeneratorAction.generateReport(BirtReportGeneratorAction.java:126)
at com.albridge.dashboard.web.action.report.BirtReportGeneratorAction.execute(BirtReportGeneratorAction.java:101)
at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:421)
at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:226)
at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1164)
at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:397)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:743)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:225)
at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:127)
at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:283)
at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:175)
at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3214)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:121)
at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:1983)
at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:1890)
at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1344)
at weblogic.work.ExecuteThread.execute(ExecuteThread.java:209)
at weblogic.work.ExecuteThread.run(ExecuteThread.java:181)
Caused by: java.lang.SecurityException: class "org.mozilla.javascript.ContextFactory"'s signer information does not match signer information of other classes in the same package
at java.lang.ClassLoader.checkCerts(ClassLoader.java:775)
at java.lang.ClassLoader.preDefineClass(ClassLoader.java:487)
at java.lang.ClassLoader.defineClass(ClassLoader.java:614)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:260)
at java.net.URLClassLoader.access$100(URLClassLoader.java:56)
at java.net.URLClassLoader$1.run(URLClassLoader.java:195)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:268)
at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
at org.eclipse.birt.core.framework.osgi.OSGILauncher$ChildFirstURLClassLoader.loadClass(OSGILauncher.java:688)
at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
at org.eclipse.osgi.internal.loader.SystemBundleLoader.findLocalClass(SystemBundleLoader.java:117)
at org.eclipse.osgi.internal.loader.SingleSourcePackage.loadClass(SingleSourcePackage.java:33)
at org.eclipse.osgi.internal.loader.MultiSourcePackage.loadClass(MultiSourcePackage.java:31)
at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:466)
at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:422)
at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:410)
at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(DefaultClassLoader.java:107)
at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
at org.eclipse.birt.report.model.simpleapi.ReportDesign.initFunctions(ReportDesign.java:368)
at org.eclipse.birt.report.model.simpleapi.ReportDesign.<init>(ReportDesign.java:82)
at org.eclipse.birt.report.model.simpleapi.ElementUtil.getElement(ElementUtil.java:59)
at org.eclipse.birt.report.model.api.impl.SimpleElementFactory.getElement(SimpleElementFactory.java:279)
at org.eclipse.birt.report.engine.executor.ExecutionContext.registerDesign(ExecutionContext.java:1345)
at org.eclipse.birt.report.engine.executor.ExecutionContext.initializeScriptContext(ExecutionContext.java:375)
at org.eclipse.birt.report.engine.executor.ExecutionContext.getScriptContext(ExecutionContext.java:1088)
at org.eclipse.birt.report.engine.adapter.ModelDteApiAdapter.<init>(ModelDteApiAdapter.java:177)
at org.eclipse.birt.report.engine.data.dte.AbstractDataEngine.<init>(AbstractDataEngine.java:107)
at org.eclipse.birt.report.engine.data.dte.DteDataEngine.<init>(DteDataEngine.java:85)
at org.eclipse.birt.report.engine.data.DataEngineFactory.createDataEngine(DataEngineFactory.java:100)
at org.eclipse.birt.report.engine.executor.ExecutionContext.openDataEngine(ExecutionContext.java:869)
... 29 more

Sample Code:
***********

try {
final String reportName = req.getParameter("ReportName");

Thread.currentThread().setContextClassLoader(originalClassLoader);

// Birt is already up and running.
// Check if the classloader is different from the one in use.
if (originalClassLoader != null && !originalClassLoader.equals(Platform.getContextClassLoader())) {
// The given classloader is different from the one in use.
LOGGER.info("Updating class loader for the OSGi platform.");
Platform.setContextClassLoader(originalClassLoader);
birtReportEngine.getConfig().getAppContext().put(EngineConstants.APPCONTEXT_CLASSLOADER_KEY, originalClassLoader);
} else {
if (LOGGER.isLoggable(Level.FINE)) {
LOGGER.warning("Keep using previous class loader for the OSGi platform.");
}
}

// Open report design
IReportRunnable design = birtReportEngine.openReportDesign( sc.getResource("/Reports" +"/"+reportName).getPath() );

// create task to run and render report
final IRunAndRenderTask task = birtReportEngine.createRunAndRenderTask(design);
task.getAppContext().put(EngineConstants.APPCONTEXT_CLASSLOADER_KEY, originalClassLoader);

// task.getAppContext().put("BIRT_VIEWER_HTTPSERVLET_REQUEST", req);

HTMLRenderContext renderContext = new HTMLRenderContext();

//setup image directory
renderContext.setBaseImageURL(req.getContextPath()+"/images");
renderContext.setBaseURL("http://" + req.getRemoteAddr() + ":" + req.getServerPort());
renderContext.setImageDirectory(sc.getResource("/images").getPath());

HashMap<String, HTMLRenderContext> contextMap = new HashMap<String, HTMLRenderContext>();
contextMap.put( EngineConstants.APPCONTEXT_HTML_RENDER_CONTEXT, renderContext );

// Set parameter values and validate
task.setParameterValue("stackId", stackId);
task.setParameterValue("startDate", startDate);
task.setParameterValue("limit", limit);

task.setAppContext( contextMap );

task.validateParameters();

// Build the output options and set the response content type.
IRenderOption options = buildOptions(req, resp, sc);

task.setRenderOption(options);

// run report
task.run();
task.close();
} catch (EngineException e) {
e.printStackTrace();
LOGGER.severe(e.getMessage());
throw new ServletException(e);
} catch (IOException e) {
e.printStackTrace();
LOGGER.severe(e.getMessage());
throw new ServletException(e);
}




Additional Input:
****************

I have specified the lib files in my class path which is located in the "birt-runtime-2_6_2\ReportEngine\lib"


Please help me to fix this issue.
Re: Security Exception [message #1014804 is a reply to message #1014604] Tue, 26 February 2013 13:47 Go to previous messageGo to next message
SenthilKumar Rajendran is currently offline SenthilKumar RajendranFriend
Messages: 3
Registered: February 2013
Junior Member
Hi, I need the urgent fix on this. Please help...
Re: Security Exception [message #1014948 is a reply to message #1014804] Tue, 26 February 2013 22:20 Go to previous messageGo to next message
Michael Williams is currently offline Michael WilliamsFriend
Messages: 1925
Registered: July 2009
Senior Member

You might make sure you don't have duplicate jars or different versions of the same jar within your classpath anywhere.

Michael

Developer Evangelist, Silanis
Re: Security Exception [message #1015176 is a reply to message #1014948] Wed, 27 February 2013 16:30 Go to previous message
SenthilKumar Rajendran is currently offline SenthilKumar RajendranFriend
Messages: 3
Registered: February 2013
Junior Member
Hi, I got fixed that exception "Caused by: java.lang.SecurityException: class "org.mozilla.javascript.ContextFactory"'s signer information does not match signer information of other classes in the same package "

by changing the MANIFEST.MF file. After fixing this I got new Exception, Below I have included the trace.

Before Update the MANIFEST.MF file ( So many class name got truncated to next line in this file)
**********************************
Name: org/mozilla/javascript/SecurityUtiliti
es.class
SHA1-Digest: EJ8SlwwxmXy2xb3SLYBfSz+wB6g=

After Update the MANIFEST.MF file
*********************************
Name: org/mozilla/javascript/SecurityUtilities.class
SHA1-Digest: EJ8SlwwxmXy2xb3SLYBfSz+wB6g=

following are the list of jar files which is used in my classpath,

C:\Data\bea9.2\patch_weblogic920\profiles\default\sys_manifest_classpath\weblogic_patch.jar;
C:\Data\bea9.2\JDK150~1\lib\tools.jar;
C:\Data\bea9.2\WEBLOG~1\server\lib\weblogic_sp.jar;
C:\Data\bea9.2\WEBLOG~1\server\lib\weblogic.jar;
C:\Data\bea9.2\WEBLOG~1\server\lib\webservices.jar;
C:\Data\bea9.2\jdk150_04\jre\lib\rt.jar;
C:\Data\bea9.2\weblogic92\server\lib\ojdbc14.jar;
C:\Data\BIRT\birt-runtime-2_6_2\birt-runtime-2_6_2\ReportEngine\plugins\org.eclipse.birt.report.data.oda.jdbc_2.6.2.r262_v20110127\drivers\ojdbc5.jar;
C:\Data\AWR\EXT_LIB\log4j-1.2.13.jar;
C:\Data\BIRT\birt-runtime-2_6_2\birt-runtime-2_6_2\ReportEngine\lib\coreapi.jar;
C:\Data\BIRT\birt-runtime-2_6_2\birt-runtime-2_6_2\ReportEngine\lib\engineapi.jar;
C:\Data\BIRT\birt-runtime-2_6_2\birt-runtime-2_6_2\ReportEngine\lib\com.ibm.icu_4.2.1.v20100412.jar;
C:\Data\BIRT\birt-runtime-2_6_2\birt-runtime-2_6_2\ReportEngine\lib\js.jar;
C:\Data\BIRT\birt-runtime-2_6_2\birt-runtime-2_6_2\ReportEngine\lib\modelapi.jar;
C:\Data\BIRT\birt-runtime-2_6_2\birt-runtime-2_6_2\ReportEngine\lib\chartengineapi.jar;
C:\Data\BIRT\birt-runtime-2_6_2\birt-runtime-2_6_2\ReportEngine\lib\chartexamplescoreapi.jar;
C:\Data\BIRT\birt-runtime-2_6_2\birt-runtime-2_6_2\ReportEngine\lib\chartitemapi.jar;
C:\Data\BIRT\birt-runtime-2_6_2\birt-runtime-2_6_2\ReportEngine\lib\crosstabcoreapi.jar;
C:\Data\BIRT\birt-runtime-2_6_2\birt-runtime-2_6_2\ReportEngine\lib\dataadapterapi.jar;
C:\Data\BIRT\birt-runtime-2_6_2\birt-runtime-2_6_2\ReportEngine\lib\dataaggregationapi.jar;
C:\Data\BIRT\birt-runtime-2_6_2\birt-runtime-2_6_2\ReportEngine\lib\dataextraction.jar;
C:\Data\BIRT\birt-runtime-2_6_2\birt-runtime-2_6_2\ReportEngine\lib\dteapi.jar;
C:\Data\BIRT\birt-runtime-2_6_2\birt-runtime-2_6_2\ReportEngine\lib\emitterconfig.jar;
C:\Data\BIRT\birt-runtime-2_6_2\birt-runtime-2_6_2\ReportEngine\lib\flute.jar;
C:\Data\BIRT\birt-runtime-2_6_2\birt-runtime-2_6_2\ReportEngine\lib\modelapi.jar;
C:\Data\BIRT\birt-runtime-2_6_2\birt-runtime-2_6_2\ReportEngine\lib\modelodaapi.jar;
C:\Data\BIRT\birt-runtime-2_6_2\birt-runtime-2_6_2\ReportEngine\lib\odadesignapi.jar;
C:\Data\BIRT\birt-runtime-2_6_2\birt-runtime-2_6_2\ReportEngine\lib\org.apache.commons.codec_1.3.0.v20100518-1140.jar;
C:\Data\BIRT\birt-runtime-2_6_2\birt-runtime-2_6_2\ReportEngine\lib\org.eclipse.emf.common_2.6.0.v20100914-1218.jar;
C:\Data\BIRT\birt-runtime-2_6_2\birt-runtime-2_6_2\ReportEngine\lib\org.eclipse.emf.ecore.xmi_2.5.0.v20100521-1846.jar;
C:\Data\BIRT\birt-runtime-2_6_2\birt-runtime-2_6_2\ReportEngine\lib\org.eclipse.emf.ecore_2.6.1.v20100914-1218.jar;
C:\Data\BIRT\birt-runtime-2_6_2\birt-runtime-2_6_2\ReportEngine\lib\org.w3c.css.sac_1.3.0.v200805290154.jar;
C:\Data\BIRT\birt-runtime-2_6_2\birt-runtime-2_6_2\ReportEngine\lib\scriptapi.jar;
C:\Data\BIRT\birt-runtime-2_6_2\birt-runtime-2_6_2\ReportEngine\lib\viewservlets.jar;
C:\Data\BIRT\birt-runtime-2_6_2\birt-runtime-2_6_2\ReportEngine\lib\axis.jar;
C:\Data\BIRT\birt-runtime-2_6_2\birt-runtime-2_6_2\ReportEngine\lib\axis-ant.jar;
C:\Data\BIRT\birt-runtime-2_6_2\birt-runtime-2_6_2\ReportEngine\lib\commons-discovery-0.2.jar;
C:\Data\BIRT\birt-runtime-2_6_2\birt-runtime-2_6_2\ReportEngine\lib\javax.wsdl_1.5.1.v201005080630.jar;
C:\Data\BIRT\birt-runtime-2_6_2\birt-runtime-2_6_2\ReportEngine\lib\jaxrpc.jar;
C:\Data\BIRT\birt-runtime-2_6_2\birt-runtime-2_6_2\ReportEngine\lib\saaj.jar;



New Exception :
***************


java.lang.NoSuchMethodError: org.mozilla.javascript.Context.enter(Lorg/mozilla/javascript/Context;Lorg/mozilla/javascript/ContextFactory;)Lorg/mozilla/javascript/Context;
at org.mozilla.javascript.ContextFactory.enterContext(ContextFactory.java:588)
at org.mozilla.javascript.ContextFactory.enterContext(ContextFactory.java:551)
at org.eclipse.birt.report.model.simpleapi.ReportDesign.initFunctions(ReportDesign.java:368)
at org.eclipse.birt.report.model.simpleapi.ReportDesign.<init>(ReportDesign.java:82)
at org.eclipse.birt.report.model.simpleapi.ElementUtil.getElement(ElementUtil.java:59)
at org.eclipse.birt.report.model.api.impl.SimpleElementFactory.getElement(SimpleElementFactory.java:279)
at org.eclipse.birt.report.engine.script.internal.ReportScriptExecutor.handleBeforeFactory(ReportScriptExecutor.java:62)
at org.eclipse.birt.report.engine.api.impl.EngineTask.startFactory(EngineTask.java:1804)
at org.eclipse.birt.report.engine.api.impl.RunAndRenderTask.doRun(RunAndRenderTask.java:100)
at org.eclipse.birt.report.engine.api.impl.RunAndRenderTask.run(RunAndRenderTask.java:77)
at com.albridge.dashboard.web.action.report.BirtReportGeneratorAction.renderReport(BirtReportGeneratorAction.java:189)
at com.albridge.dashboard.web.action.report.BirtReportGeneratorAction.generateReport(BirtReportGeneratorAction.java:114)
at com.albridge.dashboard.web.action.report.BirtReportGeneratorAction.execute(BirtReportGeneratorAction.java:88)
at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:421)
at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:226)
at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1164)
at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:397)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:743)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:225)
at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:127)
at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:283)
at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:175)
at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3214)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:121)
at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:1983)
at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:1890)
at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1344)
at weblogic.work.ExecuteThread.execute(ExecuteThread.java:209)
at weblogic.work.ExecuteThread.run(ExecuteThread.java:181)

I'm trying to find the fix for this issue, Please give me your suggestion.

Thanks for your valuable support.
Previous Topic:Internet Explorer: Border in my simple report
Next Topic:Render TOC in Java code in my application
Goto Forum:
  


Current Time: Thu Feb 09 01:01:57 GMT 2023

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

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

Back to the top