Aug 20th, 2010, 03:43 AM
Hoeller, How JndiObjectFactoryBean avoid ClassCastException?
I binded a custom service(a pojo) to the JNDI context in one Web Application.
Then I get the reference to the service from the JNDI context from the other Web Application.
Because the current classloader in JSP is different from the classloader of the binding service from JNDI.
So when I cast the type in JSP, ClassCastException is thrown.
But when I use JndiObjectFactoryBean to access the service from the JNDI, It works well.
I don't understand how it can avoid the ClassCastException?
Last edited by wangyin; Aug 21st, 2010 at 01:32 AM.
Aug 21st, 2010, 01:33 AM
Aug 24th, 2010, 12:30 AM
Tags for this Thread