Bug 123523 Previewing a scripted data set mapped to a java event handler throws NPE
When previewing a scripted data set we try to get a class loader from the ExecutionContext. (See ScriptExecutor.getClassUsingCustomClassPath). The context will be null in this case. The reason for using the context is to use cached class loaders when possible. Need to use some other mechanism to get the class loader if the context is null. We can either provide an external map to use as cache, or not bother with caching at all.
engine/org.eclipse.birt.report.engine/src/org/eclipse/birt/report/engine/executor/ExecutionContext.java
scriptContext
				.eval( "function unregisterGlobal(name) { _jsContext.unregisterGlobalBean(name); }" );
	}
	protected void initailizeScriptContext( Context cx, Scriptable scope )
	{
		scriptContext.getContext( ).setWrapFactory( new WrapFactory( )
		{
			protected IJavascriptWrapper coreWrapper = new CoreJavaScriptWrapper( );
			/**
			 * wrapper an java object to javascript object.
			 */
			public Object wrap( Context cx, Scriptable scope, Object obj,
					Class staticType )
			{
				Object object = coreWrapper.wrap( cx, scope, obj, staticType );
				if ( object != obj )
				{
					return object;
				}
				return super.wrap( cx, scope, obj, staticType );
			}
		} );
		new CoreJavaScriptInitializer( ).initialize( cx, scope );
	}
	/**
	 * get the report engine. In that engine, we create the context.
	 * 
	 * @return the report engine used to create the context.
	 */
	public ReportEngine getEngine( )