Hi!
I'm trying to modularize an application using classloaders.
I override the filter getClassLoader method and return an
URLClassLoader. Seams working well, except that @Inject's are not working.
I found this in Injector.java:
protected void inject(final Object object, final IFieldValueFactory
factory)
{
final Class<?> clazz = object.getClass();
Field[] fields = null;
// try cache
fields = cache.get(clazz);
And in ClassMetaCache.java:
public T get(final Class<?> key)
{
ConcurrentHashMap<String, T> container =
getClassLoaderCache(key.getClassLoader(), false);
if (container == null)
{
return null;
}
else
{
return container.get(key(key));
}
}
private ConcurrentHashMap<String, T> getClassLoaderCache(final
ClassLoader classLoader,
final boolean create)
{
So it's passing false for the parameter create of getClassLoaderCache,
then not working correctly.
I don't know about ClassMetaCache, but shouldn't the Guice Injector make
a call that in the end calls getClassLoaderCache with create=true?
Should I file a Jira for this?
Adriano