diff --git a/jme3-core/src/main/java/com/jme3/export/SavableClassUtil.java b/jme3-core/src/main/java/com/jme3/export/SavableClassUtil.java index 23542230f..d41e6bb92 100644 --- a/jme3-core/src/main/java/com/jme3/export/SavableClassUtil.java +++ b/jme3-core/src/main/java/com/jme3/export/SavableClassUtil.java @@ -34,6 +34,7 @@ package com.jme3.export; import com.jme3.animation.Animation; import com.jme3.effect.shapes.*; import com.jme3.material.MatParamTexture; + import java.io.IOException; import java.lang.reflect.Field; import java.util.ArrayList; @@ -187,16 +188,21 @@ public class SavableClassUtil { if (loaders == null) { return fromName(className); } - + String newClassName = remapClass(className); - synchronized(loaders) { - for (ClassLoader classLoader : loaders){ + synchronized (loaders) { + for (ClassLoader classLoader : loaders) { + final Class loadedClass; try { - return (Savable) classLoader.loadClass(newClassName).newInstance(); + loadedClass = classLoader.loadClass(newClassName); + } catch (final ClassNotFoundException e) { + continue; + } + try { + return (Savable) loadedClass.newInstance(); } catch (InstantiationException e) { } catch (IllegalAccessException e) { } - } } diff --git a/jme3-core/src/plugins/java/com/jme3/asset/plugins/ClasspathLocator.java b/jme3-core/src/plugins/java/com/jme3/asset/plugins/ClasspathLocator.java index dbeff428a..14e57790e 100644 --- a/jme3-core/src/plugins/java/com/jme3/asset/plugins/ClasspathLocator.java +++ b/jme3-core/src/plugins/java/com/jme3/asset/plugins/ClasspathLocator.java @@ -37,6 +37,7 @@ import java.io.File; import java.io.IOException; import java.net.URISyntaxException; import java.net.URL; +import java.util.List; import java.util.logging.Logger; /** @@ -90,6 +91,17 @@ public class ClasspathLocator implements AssetLocator { }else{ url = Thread.currentThread().getContextClassLoader().getResource(name); } + + if (url == null) { + final List classLoaders = manager.getClassLoaders(); + for (final ClassLoader classLoader : classLoaders) { + url = classLoader.getResource(name); + if(url != null) { + break; + } + } + } + if (url == null) return null;