Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EclipseLink » Webstart much slower since EL 2.0(seems to be more classloader searching while init of the EntityManager)
Webstart much slower since EL 2.0 [message #504220] Thu, 17 December 2009 18:09 Go to next message
Reinhard is currently offline ReinhardFriend
Messages: 6
Registered: December 2009
Junior Member
Hi,
A webstart app with swing used to include EL 1.2.0.
Since the update to EL 2.0 the init process of the EntityManager is much slower the first time.
The webstart console shows me a lot of classloader requests to an unknown resource but I do not know which resource.

There a abount 50 searches compared to 3 in EL 1.2.0!
Maybe this change is by accident?
Re: Webstart much slower since EL 2.0 [message #504403 is a reply to message #504220] Fri, 18 December 2009 17:28 Go to previous message
Reinhard is currently offline ReinhardFriend
Messages: 6
Registered: December 2009
Junior Member
After some debugging the issue is a litte bit clearer:
While searching for persistence units the factory tries to load the jar file containing persistence.xml as HttpInputStream.

I think this requires a special treatment when JNLPs DownloadEngine is at work. Here is my workaround:

    public static File getLocalCachedFile(URL url) {
    	Class<?> downloadEngineClass = null;
    	Method downloadEngineMethod = null;
    	try {
    		downloadEngineClass = Class.forName("com.sun.deploy.net.DownloadEngine");
    		downloadEngineMethod = downloadEngineClass.getMethod("getCachedFile", URL.class, String.class, boolean.class, boolean.class, String.class);
		} catch (Throwable e) {
	        logger.error("getLocalCachedFile dynamic", e);
	        return null;
		}
    	File f = null;
    	try {
    		return (File)downloadEngineMethod.invoke(null, url, null, Boolean.FALSE, Boolean.FALSE, null);
			// orig: f = DownloadEngine.getCachedFile(url, null, false, false, null);
		} catch (Exception e) {
	        logger.error("getLocalCachedFile", e);
		}
		return f;
	}

    public static boolean isDownloadServiceURL(URL url) {
		if (url.getProtocol().startsWith("http") 
				&& getLocalCachedFile(url) != null)
			return true;
		return false;
	}



The EL code in org.eclipse.persistence.internal.jpa.deployment.ArchiveFacto ryImpl is patched like this:

        } else if (JpaTools.isDownloadServiceURL(url)) {
        	File f = JpaTools.getLocalCachedFile(url);
    		if (f != null)
            	result = new JarFileArchive(new JarFile(f));
    		else
    			return new URLArchive(url);
        } else if (isJarInputStream(url)){


How to deal with this in a clean way?
Previous Topic:Deadlock in cache under load
Next Topic:[MOXy] Mapping element to boolean field
Goto Forum:
  


Current Time: Sat Dec 20 05:22:39 GMT 2014

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

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