hello,

i try to implement a generic type of instantiating the genericManager.
for this i need to call the getBean Method from the BeanFactory:

Resource res = new FileSystemResource(".../WEB-INF/ applicationContext.xml");
BeanFactory factory = new XmlBeanFactory(res);
GenericManager<MyClass,Long> x = (GenericManager<MyClass,Long>) factory.getBean("&myClassManager");

i know that this is not the way of IOC but for my generic approach this is the only way i guess. the MyClass should than be changed via reflection and also the getBean parameter. the tree lines above work so far but the genericManager has the bean property sessionFactory.
it than gives me the exception:
is org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'sessionFactory' is defined.


at this post someone calls the method autowireBeanProperties which has the third parameter for boolean dependencyCheck
http://stackoverflow.com/questions/812415/why-is-springs-applicationcontext-getbean-considered-bad/1388938#1388938

but i don't understand that right ...

is there a better way to do this??
thanks



Nils M. Petersohn
snackycracky.wordpress.com
xing.com/profile/Nils_Petersohn
myspace.com/electrash
twitter.com/snackycracky
facebook.com/nils.petersohn

n...@schoenhouse.de
0049 (0)177 6311074
skype: nilz_berlin
icq: 99510895

Ebertystr. 47
10249 Berlin

Reply via email to