Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
G Atar
Context initialization failed. Error creating bean
December 9, 2010 8:24 AM
Answer

G Atar

Rank: New Member

Posts: 4

Join Date: November 10, 2010

Recent Posts

hi all,

I am working with Liferay 6.0.5 and Service Builder.

As soon as I am deploying my war in liferay I get the following error:

  1ERROR [org.springframework.web.context.ContextLoader] (HDScanner) Context initialization failed
  2org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'com.example.customer.service.CustomerDtlsLocalService' defined in ServletContext resource [/WEB-INF/classes/META-INF/portlet-spring.xml]: Initialization of bean failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'com.example.customer.service.CustomerDtlsService' defined in ServletContext resource [/WEB-INF/classes/META-INF/portlet-spring.xml]: Initialization of bean failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'com.example.customer.service.persistence.CustomerDtlsPersistence' defined in ServletContext resource [/WEB-INF/classes/META-INF/portlet-spring.xml]: Instantiation of bean failed; nested exception is java.lang.ExceptionInInitializerError
  3        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:527)
  4        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)
  5        at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:291)
  6        at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
  7        at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:288)
  8        at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:190)
  9        at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:575)
 10        at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:895)
 11        at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:425)
 12        at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:276)
 13        at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:197)
 14        at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:47)
 15        at com.liferay.portal.spring.context.PortletContextLoaderListener.contextInitialized(PortletContextLoaderListener.java:71)
 16        at com.liferay.portal.kernel.servlet.PortalClassLoaderServletContextListener.doPortalInit(PortalClassLoaderServletContextListener.java:91)
 17        at com.liferay.portal.kernel.util.BasePortalLifecycle.portalInit(BasePortalLifecycle.java:42)
 18        at com.liferay.portal.kernel.util.PortalLifecycleUtil.register(PortalLifecycleUtil.java:52)
 19        at com.liferay.portal.kernel.util.BasePortalLifecycle.registerPortalLifecycle(BasePortalLifecycle.java:50)
 20        at com.liferay.portal.kernel.servlet.PortalClassLoaderServletContextListener.contextInitialized(PortalClassLoaderServletContextListener.java:52)
 21        at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3910)
 22        at org.apache.catalina.core.StandardContext.start(StandardContext.java:4393)
 23        at org.jboss.web.tomcat.service.deployers.TomcatDeployment.performDeployInternal(TomcatDeployment.java:310)
 24        at org.jboss.web.tomcat.service.deployers.TomcatDeployment.performDeploy(TomcatDeployment.java:142)
 25        at org.jboss.web.deployers.AbstractWarDeployment.start(AbstractWarDeployment.java:461)
 26        at org.jboss.web.deployers.WebModule.startModule(WebModule.java:118)
 27        at org.jboss.web.deployers.WebModule.start(WebModule.java:97)
 28        at sun.reflect.GeneratedMethodAccessor285.invoke(Unknown Source)
 29        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
 30        at java.lang.reflect.Method.invoke(Method.java:597)
 31        at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:157)
 32        at org.jboss.mx.server.Invocation.dispatch(Invocation.java:96)
 33        at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
 34        at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
 35        at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:668)
 36        at org.jboss.system.microcontainer.ServiceProxy.invoke(ServiceProxy.java:206)
 37        at $Proxy38.start(Unknown Source)
 38        at org.jboss.system.microcontainer.StartStopLifecycleAction.installAction(StartStopLifecycleAction.java:42)
 39        at org.jboss.system.microcontainer.StartStopLifecycleAction.installAction(StartStopLifecycleAction.java:37)
 40        at org.jboss.dependency.plugins.action.SimpleControllerContextAction.simpleInstallAction(SimpleControllerContextAction.java:62)
 41        at org.jboss.dependency.plugins.action.AccessControllerContextAction.install(AccessControllerContextAction.java:71)
 42        at org.jboss.dependency.plugins.AbstractControllerContextActions.install(AbstractControllerContextActions.java:51)
 43        at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:348)
 44        at org.jboss.system.microcontainer.ServiceControllerContext.install(ServiceControllerContext.java:286)
 45        at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:1631)
 46        at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:934)
 47        at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1082)
 48        at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:984)
 49        at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:822)
 50        at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:553)
 51        at org.jboss.system.ServiceController.doChange(ServiceController.java:688)
 52        at org.jboss.system.ServiceController.start(ServiceController.java:460)
 53        at org.jboss.system.deployers.ServiceDeployer.start(ServiceDeployer.java:163)
 54        at org.jboss.system.deployers.ServiceDeployer.deploy(ServiceDeployer.java:99)
 55        at org.jboss.system.deployers.ServiceDeployer.deploy(ServiceDeployer.java:46)
 56        at org.jboss.deployers.spi.deployer.helpers.AbstractSimpleRealDeployer.internalDeploy(AbstractSimpleRealDeployer.java:62)
 57        at org.jboss.deployers.spi.deployer.helpers.AbstractRealDeployer.deploy(AbstractRealDeployer.java:50)
 58        at org.jboss.deployers.plugins.deployers.DeployerWrapper.deploy(DeployerWrapper.java:171)
 59        at org.jboss.deployers.plugins.deployers.DeployersImpl.doDeploy(DeployersImpl.java:1439)
 60        at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:1157)
 61        at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:1178)
 62        at org.jboss.deployers.plugins.deployers.DeployersImpl.install(DeployersImpl.java:1098)
 63        at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:348)
 64        at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:1631)
 65        at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:934)
 66        at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1082)
 67        at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:984)
 68        at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:822)
 69        at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:553)
 70        at org.jboss.deployers.plugins.deployers.DeployersImpl.process(DeployersImpl.java:781)
 71        at org.jboss.deployers.plugins.main.MainDeployerImpl.process(MainDeployerImpl.java:702)
 72        at org.jboss.system.server.profileservice.repository.MainDeployerAdapter.process(MainDeployerAdapter.java:117)
 73        at org.jboss.system.server.profileservice.hotdeploy.HDScanner.scan(HDScanner.java:362)
 74        at org.jboss.system.server.profileservice.hotdeploy.HDScanner.run(HDScanner.java:255)
 75        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
 76        at java.util.concurrent.FutureTask$Sync.innerRunAndReset(FutureTask.java:317)
 77        at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:150)
 78        at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$101(ScheduledThreadPoolExecutor.java:98)
 79        at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.runPeriodic(ScheduledThreadPoolExecutor.java:181)
 80        at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:205)
 81        at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
 82        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
 83        at java.lang.Thread.run(Thread.java:619)
 84Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'com.example.customer.service.CustomerDtlsService' defined in ServletContext resource [/WEB-INF/classes/META-INF/portlet-spring.xml]: Initialization of bean failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'com.example.customer.service.persistence.CustomerDtlsPersistence' defined in ServletContext resource [/WEB-INF/classes/META-INF/portlet-spring.xml]: Instantiation of bean failed; nested exception is java.lang.ExceptionInInitializerError
 85        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:527)
 86        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)
 87        at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:291)
 88        at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
 89        at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:288)
 90        at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:190)
 91        at com.liferay.portal.spring.annotation.BeanReferenceAnnotationBeanPostProcessor._autoInject(BeanReferenceAnnotationBeanPostProcessor.java:95)
 92        at com.liferay.portal.spring.annotation.BeanReferenceAnnotationBeanPostProcessor._autoInject(BeanReferenceAnnotationBeanPostProcessor.java:117)
 93        at com.liferay.portal.spring.annotation.BeanReferenceAnnotationBeanPostProcessor.postProcessBeforeInitialization(BeanReferenceAnnotationBeanPostProcessor.java:49)
 94        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyBeanPostProcessorsBeforeInitialization(AbstractAutowireCapableBeanFactory.java:394)
 95        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1405)
 96        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:519)
 97        ... 80 more
 98Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'com.example.customer.service.persistence.CustomerDtlsPersistence' defined in ServletContext resource [/WEB-INF/classes/META-INF/portlet-spring.xml]: Instantiation of bean failed; nested exception is java.lang.ExceptionInInitializerError
 99        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateBean(AbstractAutowireCapableBeanFactory.java:955)
100        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:901)
101        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:485)
102        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)
103        at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:291)
104        at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
105        at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:288)
106        at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:190)
107        at com.liferay.portal.spring.annotation.BeanReferenceAnnotationBeanPostProcessor._autoInject(BeanReferenceAnnotationBeanPostProcessor.java:95)
108        at com.liferay.portal.spring.annotation.BeanReferenceAnnotationBeanPostProcessor._autoInject(BeanReferenceAnnotationBeanPostProcessor.java:117)
109        at com.liferay.portal.spring.annotation.BeanReferenceAnnotationBeanPostProcessor.postProcessBeforeInitialization(BeanReferenceAnnotationBeanPostProcessor.java:49)
110        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyBeanPostProcessorsBeforeInitialization(AbstractAutowireCapableBeanFactory.java:394)
111        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1405)
112        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:519)
113        ... 91 more
114Caused by: java.lang.ExceptionInInitializerError
115        at com.example.customer.model.impl.CustomerDtlsModelImpl.<clinit>(CustomerDtlsModelImpl.java:56)
116        at com.example.customer.service.persistence.CustomerDtlsPersistenceImpl.<clinit>(CustomerDtlsPersistenceImpl.java:61)
117        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
118        at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
119        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
120        at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
121        at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:126)
122        at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:71)
123        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateBean(AbstractAutowireCapableBeanFactory.java:948)
124        ... 104 more
125Caused by: java.lang.NullPointerException
126        at com.liferay.portal.configuration.ConfigurationImpl.getFileName(ConfigurationImpl.java:336)
127        at com.liferay.portal.configuration.ConfigurationImpl.<init>(ConfigurationImpl.java:121)
128        at com.liferay.portal.configuration.ConfigurationImpl.<init>(ConfigurationImpl.java:61)
129        at com.liferay.portal.configuration.ConfigurationFactoryImpl.getConfiguration(ConfigurationFactoryImpl.java:28)
130        at com.liferay.portal.kernel.configuration.ConfigurationFactoryUtil.getConfiguration(ConfigurationFactoryUtil.java:25)
131        at com.liferay.util.service.ServiceProps.<init>(ServiceProps.java:65)
132        at com.liferay.util.service.ServiceProps.<clinit>(ServiceProps.java:69)
133        ... 113 more
1342010-12-09 16:05:12,047 ERROR [com.liferay.portal.kernel.servlet.PortalClassLoaderServletContextListener] (HDScanner) org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'com.example.customer.service.CustomerDtlsLocalService' defined in ServletContext resource [/WEB-INF/classes/META-INF/portlet-spring.xml]: Initialization of bean failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'com.example.customer.service.CustomerDtlsService' defined in ServletContext resource [/WEB-INF/classes/META-INF/portlet-spring.xml]: Initialization of bean failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'com.example.customer.service.persistence.CustomerDtlsPersistence' defined in ServletContext resource [/WEB-INF/classes/META-INF/portlet-spring.xml]: Instantiation of bean failed; nested exception is java.lang.ExceptionInInitializerError
135org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'com.example.customer.service.CustomerDtlsLocalService' defined in ServletContext resource [/WEB-INF/classes/META-INF/portlet-spring.xml]: Initialization of bean failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'com.example.customer.service.CustomerDtlsService' defined in ServletContext resource [/WEB-INF/classes/META-INF/portlet-spring.xml]: Initialization of bean failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'com.example.customer.service.persistence.CustomerDtlsPersistence' defined in ServletContext resource [/WEB-INF/classes/META-INF/portlet-spring.xml]: Instantiation of bean failed; nested exception is java.lang.ExceptionInInitializerError
136        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:527)
137        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)
138        at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:291)
139        at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
140        at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:288)
141        at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:190)
142        at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:575)
143        at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:895)
144        at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:425)
145        at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:276)
146        at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:197)
147        at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:47)
148        at com.liferay.portal.spring.context.PortletContextLoaderListener.contextInitialized(PortletContextLoaderListener.java:71)
149        at com.liferay.portal.kernel.servlet.PortalClassLoaderServletContextListener.doPortalInit(PortalClassLoaderServletContextListener.java:91)
150        at com.liferay.portal.kernel.util.BasePortalLifecycle.portalInit(BasePortalLifecycle.java:42)
151        at com.liferay.portal.kernel.util.PortalLifecycleUtil.register(PortalLifecycleUtil.java:52)
152        at com.liferay.portal.kernel.util.BasePortalLifecycle.registerPortalLifecycle(BasePortalLifecycle.java:50)
153        at com.liferay.portal.kernel.servlet.PortalClassLoaderServletContextListener.contextInitialized(PortalClassLoaderServletContextListener.java:52)
154        at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3910)
155        at org.apache.catalina.core.StandardContext.start(StandardContext.java:4393)
156        at org.jboss.web.tomcat.service.deployers.TomcatDeployment.performDeployInternal(TomcatDeployment.java:310)
157        at org.jboss.web.tomcat.service.deployers.TomcatDeployment.performDeploy(TomcatDeployment.java:142)
158        at org.jboss.web.deployers.AbstractWarDeployment.start(AbstractWarDeployment.java:461)
159        at org.jboss.web.deployers.WebModule.startModule(WebModule.java:118)
160        at org.jboss.web.deployers.WebModule.start(WebModule.java:97)
161        at sun.reflect.GeneratedMethodAccessor285.invoke(Unknown Source)
162        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
163        at java.lang.reflect.Method.invoke(Method.java:597)
164        at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:157)
165        at org.jboss.mx.server.Invocation.dispatch(Invocation.java:96)
166        at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
167        at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
168        at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:668)
169        at org.jboss.system.microcontainer.ServiceProxy.invoke(ServiceProxy.java:206)
170        at $Proxy38.start(Unknown Source)
171        at org.jboss.system.microcontainer.StartStopLifecycleAction.installAction(StartStopLifecycleAction.java:42)
172        at org.jboss.system.microcontainer.StartStopLifecycleAction.installAction(StartStopLifecycleAction.java:37)
173        at org.jboss.dependency.plugins.action.SimpleControllerContextAction.simpleInstallAction(SimpleControllerContextAction.java:62)
174        at org.jboss.dependency.plugins.action.AccessControllerContextAction.install(AccessControllerContextAction.java:71)
175        at org.jboss.dependency.plugins.AbstractControllerContextActions.install(AbstractControllerContextActions.java:51)
176        at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:348)
177        at org.jboss.system.microcontainer.ServiceControllerContext.install(ServiceControllerContext.java:286)
178        at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:1631)
179        at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:934)
180        at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1082)
181        at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:984)
182        at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:822)
183        at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:553)
184        at org.jboss.system.ServiceController.doChange(ServiceController.java:688)
185        at org.jboss.system.ServiceController.start(ServiceController.java:460)
186        at org.jboss.system.deployers.ServiceDeployer.start(ServiceDeployer.java:163)
187        at org.jboss.system.deployers.ServiceDeployer.deploy(ServiceDeployer.java:99)
188        at org.jboss.system.deployers.ServiceDeployer.deploy(ServiceDeployer.java:46)
189        at org.jboss.deployers.spi.deployer.helpers.AbstractSimpleRealDeployer.internalDeploy(AbstractSimpleRealDeployer.java:62)
190        at org.jboss.deployers.spi.deployer.helpers.AbstractRealDeployer.deploy(AbstractRealDeployer.java:50)
191        at org.jboss.deployers.plugins.deployers.DeployerWrapper.deploy(DeployerWrapper.java:171)
192        at org.jboss.deployers.plugins.deployers.DeployersImpl.doDeploy(DeployersImpl.java:1439)
193        at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:1157)
194        at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:1178)
195        at org.jboss.deployers.plugins.deployers.DeployersImpl.install(DeployersImpl.java:1098)
196        at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:348)
197        at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:1631)
198        at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:934)
199        at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1082)
200        at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:984)
201        at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:822)
202        at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:553)
203        at org.jboss.deployers.plugins.deployers.DeployersImpl.process(DeployersImpl.java:781)
204        at org.jboss.deployers.plugins.main.MainDeployerImpl.process(MainDeployerImpl.java:702)
205        at org.jboss.system.server.profileservice.repository.MainDeployerAdapter.process(MainDeployerAdapter.java:117)
206        at org.jboss.system.server.profileservice.hotdeploy.HDScanner.scan(HDScanner.java:362)
207        at org.jboss.system.server.profileservice.hotdeploy.HDScanner.run(HDScanner.java:255)
208        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
209        at java.util.concurrent.FutureTask$Sync.innerRunAndReset(FutureTask.java:317)
210        at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:150)
211        at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$101(ScheduledThreadPoolExecutor.java:98)
212        at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.runPeriodic(ScheduledThreadPoolExecutor.java:181)
213        at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:205)
214        at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
215        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
216        at java.lang.Thread.run(Thread.java:619)
217Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'com.example.customer.service.CustomerDtlsService' defined in ServletContext resource [/WEB-INF/classes/META-INF/portlet-spring.xml]: Initialization of bean failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'com.example.customer.service.persistence.CustomerDtlsPersistence' defined in ServletContext resource [/WEB-INF/classes/META-INF/portlet-spring.xml]: Instantiation of bean failed; nested exception is java.lang.ExceptionInInitializerError
218        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:527)
219        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)
220        at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:291)
221        at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
222        at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:288)
223        at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:190)
224        at com.liferay.portal.spring.annotation.BeanReferenceAnnotationBeanPostProcessor._autoInject(BeanReferenceAnnotationBeanPostProcessor.java:95)
225        at com.liferay.portal.spring.annotation.BeanReferenceAnnotationBeanPostProcessor._autoInject(BeanReferenceAnnotationBeanPostProcessor.java:117)
226        at com.liferay.portal.spring.annotation.BeanReferenceAnnotationBeanPostProcessor.postProcessBeforeInitialization(BeanReferenceAnnotationBeanPostProcessor.java:49)
227        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyBeanPostProcessorsBeforeInitialization(AbstractAutowireCapableBeanFactory.java:394)
228        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1405)
229        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:519)
230        ... 80 more
231Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'com.example.customer.service.persistence.CustomerDtlsPersistence' defined in ServletContext resource [/WEB-INF/classes/META-INF/portlet-spring.xml]: Instantiation of bean failed; nested exception is java.lang.ExceptionInInitializerError
232        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateBean(AbstractAutowireCapableBeanFactory.java:955)
233        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:901)
234        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:485)
235        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)
236        at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:291)
237        at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
238        at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:288)
239        at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:190)
240        at com.liferay.portal.spring.annotation.BeanReferenceAnnotationBeanPostProcessor._autoInject(BeanReferenceAnnotationBeanPostProcessor.java:95)
241        at com.liferay.portal.spring.annotation.BeanReferenceAnnotationBeanPostProcessor._autoInject(BeanReferenceAnnotationBeanPostProcessor.java:117)
242        at com.liferay.portal.spring.annotation.BeanReferenceAnnotationBeanPostProcessor.postProcessBeforeInitialization(BeanReferenceAnnotationBeanPostProcessor.java:49)
243        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyBeanPostProcessorsBeforeInitialization(AbstractAutowireCapableBeanFactory.java:394)
244        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1405)
245        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:519)
246        ... 91 more
247Caused by: java.lang.ExceptionInInitializerError
248        at com.example.customer.model.impl.CustomerDtlsModelImpl.<clinit>(CustomerDtlsModelImpl.java:56)
249        at com.example.customer.service.persistence.CustomerDtlsPersistenceImpl.<clinit>(CustomerDtlsPersistenceImpl.java:61)
250        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
251        at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
252        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
253        at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
254        at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:126)
255        at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:71)
256        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateBean(AbstractAutowireCapableBeanFactory.java:948)
257        ... 104 more
258Caused by: java.lang.NullPointerException
259        at com.liferay.portal.configuration.ConfigurationImpl.getFileName(ConfigurationImpl.java:336)
260        at com.liferay.portal.configuration.ConfigurationImpl.<init>(ConfigurationImpl.java:121)
261        at com.liferay.portal.configuration.ConfigurationImpl.<init>(ConfigurationImpl.java:61)
262        at com.liferay.portal.configuration.ConfigurationFactoryImpl.getConfiguration(ConfigurationFactoryImpl.java:28)
263        at com.liferay.portal.kernel.configuration.ConfigurationFactoryUtil.getConfiguration(ConfigurationFactoryUtil.java:25)
264        at com.liferay.util.service.ServiceProps.<init>(ServiceProps.java:65)
265        at com.liferay.util.service.ServiceProps.<clinit>(ServiceProps.java:69)
266        ... 113 more



I have looked to many forums about this errors, but almost every forum say that you must add or delete specific libraries, but that all doesn't work by me.

My web.xml looks like this:

 1<?xml version="1.0" encoding="UTF-8"?>
 2<web-app version="2.5" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
 3    <context-param>
 4        <param-name>contextClass</param-name>
 5        <param-value>com.liferay.portal.spring.context.PortletApplicationContext</param-value>
 6    </context-param>
 7    <context-param>
 8        <param-name>portalContextConfigLocation</param-name>
 9        <param-value>/WEB-INF/classes/META-INF/portlet-spring.xml,/WEB-INF/classes/META-INF/dynamic-data-source-spring.xml,/WEB-INF/classes/META-INF/base-spring.xml,/WEB-INF/classes/META-INF/hibernate-spring.xml,/WEB-INF/classes/META-INF/infrastructure-spring.xml,/WEB-INF/classes/META-INF/portlet-hbm.xml</param-value>
10    </context-param>
11    <listener>
12        <listener-class>com.liferay.portal.kernel.spring.context.PortletContextLoaderListener</listener-class>
13    </listener>
14    <servlet>
15        <servlet-name>action</servlet-name>
16        <servlet-class>org.apache.struts.action.ActionServlet</servlet-class>
17        <init-param>
18            <param-name>config</param-name>
19            <param-value>/WEB-INF/struts-config.xml</param-value>
20        </init-param>
21    </servlet>
22    <servlet-mapping>
23        <servlet-name>action</servlet-name>
24        <url-pattern>*.do</url-pattern>
25    </servlet-mapping>
26        <jsp-config>
27        <taglib>
28            <taglib-uri>/WEB-INF/struts-bean.tld</taglib-uri>
29            <taglib-location>/WEB-INF/beans/struts-bean.tld</taglib-location>
30        </taglib>
31        <taglib>
32            <taglib-uri>/WEB-INF/struts-html.tld</taglib-uri>
33            <taglib-location>/WEB-INF/beans/struts-html.tld</taglib-location>
34        </taglib>
35        <taglib>
36            <taglib-uri>/WEB-INF/struts-logic.tld</taglib-uri>
37            <taglib-location>/WEB-INF/beans/struts-logic.tld</taglib-location>
38        </taglib>
39        <taglib>
40            <taglib-uri>/WEB-INF/struts-nested.tld</taglib-uri>
41            <taglib-location>/WEB-INF/beans/struts-nested.tld</taglib-location>
42        </taglib>
43        <taglib>
44            <taglib-uri>/WEB-INF/struts-tiles.tld</taglib-uri>
45            <taglib-location>/WEB-INF/beans/struts-tiles.tld</taglib-location>
46        </taglib>
47    </jsp-config>
48</web-app>


Can somebody help me to resolve the issue?

Thanks in advance.
Alexandre FILLATRE
RE: Context initialization failed. Error creating bean
December 12, 2010 1:22 PM
Answer

Alexandre FILLATRE

Rank: Junior Member

Posts: 65

Join Date: December 2, 2010

Recent Posts

Hi G Atar,

The following lines seem to indicate that the portal is trying to loader a property file that does not exist :
258 Caused by: java.lang.NullPointerException
259 at com.liferay.portal.configuration.ConfigurationImpl.getFileName(ConfigurationImpl.java:336)


I suggest you run your server in debug mode and put a breakpoint there to see what file it is. Plus you'll be able to see the classloader (first method param) which will tell you if you're in the right place.

That should help.

Regards,
Alexandre FILLATRE
G Atar
RE: Context initialization failed. Error creating bean
December 13, 2010 1:34 AM
Answer

G Atar

Rank: New Member

Posts: 4

Join Date: November 10, 2010

Recent Posts

hi Alexandre FILLATRE,

Thanks for your reaction.

But I can't debug, because he first make the project in a war file and then add it to Liferay. When it add the war file to Liferay, that is when I get the error.

Futher you say, I have to put a breakpunt there, but I can't set a breakpoint on this point:

258 Caused by: java.lang.NullPointerException
259 at com.liferay.portal.configuration.ConfigurationImpl.getFileName(ConfigurationImpl.java:336)


because it is inside a library.

Do you know a other way to do it or can you help me with the other problems?

Thanks in advance.

Regards,
G Atar
Alexandre FILLATRE
RE: Context initialization failed. Error creating bean
December 13, 2010 1:38 AM
Answer

Alexandre FILLATRE

Rank: Junior Member

Posts: 65

Join Date: December 2, 2010

Recent Posts

You need to get portal sources in sourceforge.
Then you can set a breakpoint, and debug it while the war is being deployed. In order to catch it, fully launch the portal, and when it's up, then drop your war in the deploy folder. You'll catch the breakpoint this way.

Did you configure any file ending with ".properties" in your spring files ? I can't help more without seeing there content.

Regards,
Alexandre FILLATRE
G Atar
RE: Context initialization failed. Error creating bean
December 13, 2010 3:56 AM
Answer

G Atar

Rank: New Member

Posts: 4

Join Date: November 10, 2010

Recent Posts

Hi Alexandre FILLATRE,

Here is my service.properties:

 1##
 2## Properties Override
 3##
 4
 5    #
 6    # Specify where to get the overridden properties. Updates should not be made
 7    # on this file but on the overridden version of this file.
 8    #
 9    include-and-override=service-ext.properties
10
11##
12## Build
13##
14
15    build.namespace=customer
16    build.number=1
17    build.date=1291717812954
18    build.auto.upgrade=true
19##
20## Spring
21##
22
23    #
24    # Input a list of comma delimited Spring configurations. These will be
25    # loaded after the bean definitions specified in the
26    # portalContextConfigLocation parameter in web.xml.
27    #


The portalContextConfigLocation is defined in the web.xml, that I have send in my first post.

In the first error he say this:

2 org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'com.example.customer.service.CustomerDtlsLocalService' defined in ServletContext resource [/WEB-INF/classes/META-INF/portlet-spring.xml]


So here is also my portlet-spring.xml.

portlet-spring.xml:

 1<?xml version="1.0" encoding="UTF-8"?>
 2
 3<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" default-destroy-method="destroy" default-init-method="afterPropertiesSet" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd">
 4    <bean id="com.example.customer.service.CustomerDtlsLocalService" class="com.example.customer.service.impl.CustomerDtlsLocalServiceImpl" />
 5    <bean id="com.example.customer.service.CustomerDtlsLocalServiceUtil" class="com.example.customer.service.CustomerDtlsLocalServiceUtil">
 6        <property name="service" ref="com.example.customer.service.CustomerDtlsLocalService" />
 7    </bean>
 8    <bean id="com.example.customer.service.CustomerDtlsService" class="com.example.customer.service.impl.CustomerDtlsServiceImpl" />
 9    <bean id="com.example.customer.service.CustomerDtlsServiceUtil" class="com.example.customer.service.CustomerDtlsServiceUtil">
10        <property name="service" ref="com.example.customer.service.CustomerDtlsService" />
11    </bean>
12    <bean id="com.example.customer.service.persistence.CustomerDtlsPersistence" class="com.example.customer.service.persistence.CustomerDtlsPersistenceImpl" parent="basePersistence" />
13</beans>


I hope I have given you enough information with this to help me. If you need more just say it.

Regards,
G Atar
jarah varad
RE: Context initialization failed. Error creating bean
December 29, 2010 7:26 AM
Answer

jarah varad

Rank: New Member

Posts: 5

Join Date: November 18, 2010

Recent Posts

Hi G Atar,

I have exact same issue. My portlet works on one liferay instance and doesnt work on other instance I have. (both are liferay 6.0.5).

Please let me know if you were able to resolve this problem.

Thanks a ton
vk
G Atar
RE: Context initialization failed. Error creating bean
January 3, 2011 6:03 AM
Answer

G Atar

Rank: New Member

Posts: 4

Join Date: November 10, 2010

Recent Posts

hi vk vk,

After a while I found out that one of my .properties didn't exist in my .war file, while before compiling he was in the source file. Much people say he can/must be there, but apparently not by me.

I fixed the problem by setting that .properties file in my "WEB-INF/classes" folder.
By me Service Builder called the .properties "service.properties", but maybe it is by you an other name you can try to set your .properties files to that directory and look if you still have the error.

good luck, vk
Tell me if you where able to fix it or not with this.

G Atar