javax.servlet.ServletException: org.springframework.beans.factory.BeanCreationException: Error creat
Marcel Jacome
Greenhorn
Joined: Feb 06, 2009
Posts: 26
posted
0
Hi guys , i am having this error displayed when i run a struts/spring/hibernate app on Jboss 4.2.2 GA.
the action-servlet.xml is
The app was running fine about two days ago , there haven't been any changes to the code. I dont know if it has anything to do with a new jvm i installed the day before the app failed. The jvm is jrockit 4.0.1. Please help !!!
David Newton
Author
Rancher
Joined: Sep 29, 2008
Posts: 12612
posted
0
But the error is occurring in a different context file, no?
Marcel Jacome
Greenhorn
Joined: Feb 06, 2009
Posts: 26
posted
0
Thanks David for your reply, the xml i posted is indeed from the correct file , the correct name is iess-action-servlet.xml not action-servlet.xml.
Additionally, i deployed the file in a different computer but get the same error. My IDE is Eclipse Ganymede , i even tried Galileo.
I installed jdk 1.6 last friday. Upon starting Jboss on Monday , there was this error condition about port 1099 already being used ,after solving that (by shutting down Jboss and restarting the system), this BeanCreationException took over. This really baffles me.
Thanks for your help.
Marcel Jacome
Greenhorn
Joined: Feb 06, 2009
Posts: 26
posted
0
I switched back to jdk 1.5 , but nothing has changed. it keeps giving me this error:
org.springframework.beans.factory.BeanCreationException: Error creating bean with name '/seg' defined in ServletContext resource [/WEB-INF/iess-action-servlet.xml]: Can't resolve reference to bean 'servicioFondoReserva' while setting property 'servicioFondoReserva'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'servicioFondoReserva' defined in ServletContext resource [/WEB-INF/iess-application-context.xml]: Can't resolve reference to bean 'servicioFondoReservaTarget' while setting property 'target'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'servicioFondoReservaTarget' defined in ServletContext resource [/WEB-INF/iess-application-context.xml]: Can't resolve reference to bean 'gestorFondosReserva' while setting property 'gestorFondosReserva'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'gestorFondosReserva' defined in ServletContext resource [/WEB-INF/iess-application-context.xml]: Can't resolve reference to bean 'gestorSolicitud' while setting property 'gestorSolicitud'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'gestorSolicitud' defined in ServletContext resource [/WEB-INF/iess-application-context.xml]: Instantiation of bean failed; nested exception is org.springframework.beans.FatalBeanException: Could not instantiate class [ec.gov.iess.gestor.fondoreserva.impl.GestorSolicitudImpl]; constructor threw exception; nested exception is java.lang.ClassCastException: $Proxy236
Has anyone had this problem before?? . It is the first time it's happened to me. I have searched all over the internet but found no solution.
Is there something i should check??
Mark Secrist
Ranch Hand
Joined: Jul 01, 2003
Posts: 89
posted
0
The root of the problem would seem to be in the constructor for the GestorSolicitudImpl class. What's going on there?
Marcel Jacome
Greenhorn
Joined: Feb 06, 2009
Posts: 26
posted
0
Thanks Mark for your reply , the constructor looks like this
Thanks again.
Mark Secrist
Ranch Hand
Joined: Jul 01, 2003
Posts: 89
posted
0
I have a hunch this may be where your problem is
I assume parameter passed to the getServiceBean method is a JNDI reference and you are implementing the ServiceLocator pattern to retrieve a registered service interface. It's possible that the object returned doesn't implement the 'RegistroCivilServicio' interface. Does your service locator cast the instance to that type? If so, maybe you can do an instanceof test and produce a better exception message.
I've generally found that there is a lot of 'noise' in the exception stack around the lifecycle of the bean creation that sometimes makes it difficult to locate the exact problem.
Marcel Jacome
Greenhorn
Joined: Feb 06, 2009
Posts: 26
posted
0
Thank you Mark , removing an attribute (duplicate="preserve") from build.xml and rebuilding solved the problem , which is weird.
Marcel Jacome
Greenhorn
Joined: Feb 06, 2009
Posts: 26
posted
0
Problem came back again , but Mark gave me a clue as to the serviceLocator pattern in the problem class. And he hit it right in the nail !!!
What i did was comment the protected variable and move the declaration inside the methods that needed it and voila.
Thank you very much Mark.
subject: javax.servlet.ServletException: org.springframework.beans.factory.BeanCreationException: Error creat