Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » BIRT » No Context associated with current Thread
No Context associated with current Thread [message #193548] Mon, 02 October 2006 10:39 Go to next message
Julio Muñoz is currently offline Julio MuñozFriend
Messages: 31
Registered: July 2009
Member
Hi everybody,

I'm creating a new worker thread to generate a pdf document, but when I
run the task to generate the report, i get this error on the log file of
birt:

org.eclipse.birt.report.engine.executor.ExecutionContext evaluate
GRAVE: No Context associated with current Thread
java.lang.RuntimeException: No Context associated with current Thread
at org.mozilla.javascript.Context.getContext(Context.java:2309)
at
org.mozilla.javascript.SecurityController.createLoader(Secur ityController.java:133)
at org.mozilla.javascript.optimizer.Codegen.defineClass(Codegen .java:119)
at
org.mozilla.javascript.optimizer.Codegen.createScriptObject( Codegen.java:78)
at org.mozilla.javascript.Context.compileImpl(Context.java:2391 )
at org.mozilla.javascript.Context.compileString(Context.java:13 72)
at org.mozilla.javascript.Context.compileString(Context.java:13 61)
at org.eclipse.birt.core.script.ScriptContext.eval(ScriptContex t.java:221)
at
org.eclipse.birt.report.engine.executor.ExecutionContext.eva luate(ExecutionContext.java:565)
at
org.eclipse.birt.report.engine.executor.ExecutionContext.eva luate(ExecutionContext.java:534)
at
org.eclipse.birt.report.engine.executor.DataItemExecutor.exe cute(DataItemExecutor.java:90)
at
org.eclipse.birt.report.engine.internal.executor.l18n.Locali zedReportItemExecutor.execute(LocalizedReportItemExecutor.ja va:35)
at
org.eclipse.birt.report.engine.layout.content.BlockStackingE xecutor.getNextChild(BlockStackingExecutor.java:47)
at
org.eclipse.birt.report.engine.layout.pdf.PDFBlockStackingLM .traverseChildren(PDFBlockStackingLM.java:72)
at
org.eclipse.birt.report.engine.layout.pdf.PDFStackingLM.layo utChildren(PDFStackingLM.java:130)
at
org.eclipse.birt.report.engine.layout.pdf.PDFAbstractLM.layo ut(PDFAbstractLM.java:134)
at
org.eclipse.birt.report.engine.layout.pdf.PDFRowLM.traverseC hildren(PDFRowLM.java:88)
at
org.eclipse.birt.report.engine.layout.pdf.PDFStackingLM.layo utChildren(PDFStackingLM.java:130)
at
org.eclipse.birt.report.engine.layout.pdf.PDFAbstractLM.layo ut(PDFAbstractLM.java:134)
at
org.eclipse.birt.report.engine.layout.pdf.PDFBlockStackingLM .layoutChildNode(PDFBlockStackingLM.java:95)
at
org.eclipse.birt.report.engine.layout.pdf.PDFBlockStackingLM .traverseChildren(PDFBlockStackingLM.java:75)
at
org.eclipse.birt.report.engine.layout.pdf.PDFTableLM.travers eChildren(PDFTableLM.java:135)
at
org.eclipse.birt.report.engine.layout.pdf.PDFStackingLM.layo utChildren(PDFStackingLM.java:130)
at
org.eclipse.birt.report.engine.layout.pdf.PDFAbstractLM.layo ut(PDFAbstractLM.java:134)
at
org.eclipse.birt.report.engine.layout.pdf.PDFBlockStackingLM .layoutChildNode(PDFBlockStackingLM.java:95)
at
org.eclipse.birt.report.engine.layout.pdf.PDFBlockStackingLM .traverseChildren(PDFBlockStackingLM.java:75)
at
org.eclipse.birt.report.engine.layout.pdf.PDFStackingLM.layo utChildren(PDFStackingLM.java:130)
at
org.eclipse.birt.report.engine.layout.pdf.PDFAbstractLM.layo ut(PDFAbstractLM.java:134)
at
org.eclipse.birt.report.engine.layout.pdf.PDFRowLM.traverseC hildren(PDFRowLM.java:88)
at
org.eclipse.birt.report.engine.layout.pdf.PDFStackingLM.layo utChildren(PDFStackingLM.java:130)
at
org.eclipse.birt.report.engine.layout.pdf.PDFAbstractLM.layo ut(PDFAbstractLM.java:134)
at
org.eclipse.birt.report.engine.layout.pdf.PDFBlockStackingLM .layoutChildNode(PDFBlockStackingLM.java:95)
at
org.eclipse.birt.report.engine.layout.pdf.PDFBlockStackingLM .traverseChildren(PDFBlockStackingLM.java:75)
at
org.eclipse.birt.report.engine.layout.pdf.PDFTableLM.travers eChildren(PDFTableLM.java:135)
at
org.eclipse.birt.report.engine.layout.pdf.PDFStackingLM.layo utChildren(PDFStackingLM.java:130)
at
org.eclipse.birt.report.engine.layout.pdf.PDFAbstractLM.layo ut(PDFAbstractLM.java:134)
at
org.eclipse.birt.report.engine.layout.pdf.PDFBlockStackingLM .layoutChildNode(PDFBlockStackingLM.java:95)
at
org.eclipse.birt.report.engine.layout.pdf.PDFBlockStackingLM .traverseChildren(PDFBlockStackingLM.java:75)
at
org.eclipse.birt.report.engine.layout.pdf.PDFStackingLM.layo utChildren(PDFStackingLM.java:130)
at
org.eclipse.birt.report.engine.layout.pdf.PDFPageLM.layout(P DFPageLM.java:198)
at
org.eclipse.birt.report.engine.layout.pdf.PDFReportLayoutEng ine.layoutReport(PDFReportLayoutEngine.java:55)
at
org.eclipse.birt.report.engine.layout.pdf.PDFReportLayoutEng ine.layout(PDFReportLayoutEngine.java:68)
at
org.eclipse.birt.report.engine.api.impl.RunAndRenderTask.run (RunAndRenderTask.java:187)
at
com.audatex.axn.hubserviceobjects.printService.core.printEng ine.PrintTask$PrintWorkerThread.run(PrintTask.java:471)
at java.lang.Thread.run(Thread.java:595)


that's the code i execute:

Thread printThread = new Thread(new PrintWorkerThread(task));

printThread.start();

and the runnable class is:

public class PrintWorkerThread implements Runnable {
IRunAndRenderTask task = null;

public PrintWorkerThread(IRunAndRenderTask task) {
this.task = task;
}

public void run() {
try {
task.run();
}
catch (EngineException ex) {
ex.printStackTrace();
}
}
}

any idea of what's wrong?.

thanks in advance!!
regards
Julio Muñoz
Re: No Context associated with current Thread [message #197352 is a reply to message #193548] Tue, 24 October 2006 09:33 Go to previous messageGo to next message
Tomas Vala is currently offline Tomas ValaFriend
Messages: 41
Registered: July 2009
Member
Hi,

I am experiencing the same problem. Did anyone succeeded with using worker
thread at all?

Cheers,
Tomas

"Julio" <julio_munoz@audatex.es> p
Re: No Context associated with current Thread [message #197360 is a reply to message #197352] Tue, 24 October 2006 10:05 Go to previous message
Tomas Vala is currently offline Tomas ValaFriend
Messages: 41
Registered: July 2009
Member
Ok, figured out myself :-) Javascript context has to be iniatilized for each
individual thread as shown below, then running print task from worker thread
works.

org.mozilla.javascript.Context.enter();
<BIRT print task...>
org.mozilla.javascript.Context.exit();

Tomas

"Tomas Vala" <tomas.vala@samo.cz> p
Previous Topic:dataset rows as table columns?
Next Topic:Custom report designer formPage
Goto Forum:
  


Current Time: Thu Mar 28 11:22:08 GMT 2024

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

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

Back to the top