Announcement Announcement Module
Collapse
No announcement yet.
Context initialization failed *** No default constructor found;java.lang.NoSuchMethod Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Context initialization failed *** No default constructor found;java.lang.NoSuchMethod

    I am building a proto type using Spring (2.0.6) and Hibernate (3.2). I have 3 beans to start with, An Entity, Manager and a Mapper. I am deploying the WAR on WebLogic. I get the error message indicating that Mapper object has no default constructor while I have a default constructor.

    Following is the error from WebLogs console
    Code:
    ERROR 2007-08-01 12:49:30,169 [ContextLoader]: Context initialization failed
    org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'deviceMapper' defined in ServletContext resource [/WEB-INF/applicationContext-hibernate.xml]: Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [com.axeda.drm.services.device.DeviceMapper]: No default constructor found; nested exception is java.lang.NoSuchMethodException: com.axeda.drm.services.device.DeviceMapper.<init>()
    Caused by: 
    org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [com.axeda.drm.services.device.DeviceMapper]: No default constructor found; nested exception is java.lang.NoSuchMethodException: com.axeda.drm.services.device.DeviceMapper.<init>()
    Caused by: 
    java.lang.NoSuchMethodException: com.axeda.drm.services.device.DeviceMapper.<init>()
    	at java.lang.Class.getConstructor0(Class.java:2678)
    	at java.lang.Class.getDeclaredConstructor(Class.java:1953)
    	at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:54)
    	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateBean(AbstractAutowireCapableBeanFactory.java:756)
    	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:721)
    	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:384)
    	at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:251)
    	at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:156)
    	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:248)
    	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:160)
    	at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:287)
    	at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:352)
    	at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:244)
    	at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:187)
    	at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:49)
    	at weblogic.servlet.internal.EventsManager$FireContextListenerAction.run(EventsManager.java:375)
    	at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
    	at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:121)
    	at weblogic.servlet.internal.EventsManager.notifyContextCreatedEvent(EventsManager.java:83)
    	at weblogic.servlet.internal.WebAppServletContext.preloadResources(WebAppServletContext.java:1591)
    	at weblogic.servlet.internal.WebAppServletContext.start(WebAppServletContext.java:2734)
    	at weblogic.servlet.internal.WebAppModule.startContexts(WebAppModule.java:892)
    	at weblogic.servlet.internal.WebAppModule.start(WebAppModule.java:336)
    	at weblogic.application.internal.flow.ModuleStateDriver$3.next(ModuleStateDriver.java:204)
    	at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:26)
    	at weblogic.application.internal.flow.ModuleStateDriver.start(ModuleStateDriver.java:60)
    	at weblogic.application.internal.flow.ScopedModuleDriver.start(ScopedModuleDriver.java:200)
    	at weblogic.application.internal.flow.ModuleListenerInvoker.start(ModuleListenerInvoker.java:117)
    	at weblogic.application.internal.flow.ModuleStateDriver$3.next(ModuleStateDriver.java:204)
    	at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:26)
    	at weblogic.application.internal.flow.ModuleStateDriver.start(ModuleStateDriver.java:60)
    	at weblogic.application.internal.flow.StartModulesFlow.activate(StartModulesFlow.java:26)
    	at weblogic.application.internal.BaseDeployment$2.next(BaseDeployment.java:641)
    	at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:26)
    	at weblogic.application.internal.BaseDeployment.activate(BaseDeployment.java:229)
    	at weblogic.application.internal.DeploymentStateChecker.activate(DeploymentStateChecker.java:154)
    	at weblogic.deploy.internal.targetserver.AppContainerInvoker.activate(AppContainerInvoker.java:80)
    	at weblogic.deploy.internal.targetserver.operations.AbstractOperation.activate(AbstractOperation.java:565)
    	at weblogic.deploy.internal.targetserver.operations.ActivateOperation.activateDeployment(ActivateOperation.java:136)
    	at weblogic.deploy.internal.targetserver.operations.ActivateOperation.doCommit(ActivateOperation.java:104)
    	at weblogic.deploy.internal.targetserver.operations.AbstractOperation.commit(AbstractOperation.java:320)
    	at weblogic.deploy.internal.targetserver.DeploymentManager.handleDeploymentCommit(DeploymentManager.java:815)
    	at weblogic.deploy.internal.targetserver.DeploymentManager.activateDeploymentList(DeploymentManager.java:1222)
    	at weblogic.deploy.internal.targetserver.DeploymentManager.handleCommit(DeploymentManager.java:433)
    	at weblogic.deploy.internal.targetserver.DeploymentServiceDispatcher.commit(DeploymentServiceDispatcher.java:161)
    	at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer.doCommitCallback(DeploymentReceiverCallbackDeliverer.java:181)
    	at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer.access$100(DeploymentReceiverCallbackDeliverer.java:12)
    	at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer$2.run(DeploymentReceiverCallbackDeliverer.java:67)
    	at weblogic.work.ServerWorkManagerImpl$WorkAdapterImpl.run(ServerWorkManagerImpl.java:518)
    	at weblogic.work.ExecuteThread.execute(ExecuteThread.java:209)
    	at weblogic.work.ExecuteThread.run(ExecuteThread.java:181)

  • #2
    Please, post signature of the constuctor(s) of DeviceMapper class
    and your context (or, at leasr, definition of the "deviceMapper" bean).

    Seems that they do not match.

    Regards,
    Oleksandr

    Comment


    • #3
      I found that the problem was that I had another JAR file on my path with DeviceMapper and DeviceManager classes. I also was missing cgilib. After i fixed them it all works fine so far.

      Comment

      Working...
      X