Cannot instantiate bean class?

Questions about developing the edge server core as well as applications

Moderators: Matt, kyle

Post Reply
saqibd
Posts: 2
Joined: Thu Dec 17, 2009 12:00 pm
Organization: S5 Systems

Cannot instantiate bean class?

Post by saqibd » Thu Dec 17, 2009 12:13 pm

Hello,

I am trying out the source code for dbapp but I am running into this error. Note when I ran the dbapp binary earlier (via edge server binary + loadApp dbapp + dbstart) the dbstart command was not recognized either.

Any ideas what may be wrong? I was able to sucessfully run the Northwind example BTW.

*ShippingApp Constructor Invoked*
10:53:59,683 WARN org.rifidi.edge.app.db.DBApp:54 - Cannot start DBApp. Either DAO or EsperService is null
10:53:59,685 WARN org.springframework.beans.factory.support.DisposableBeanAdapter:181 - Couldn't find a destroy method named 'close' on bean with name 'datasource'
10:53:59,686 ERROR org.springframework.osgi.context.support.OsgiBundleXmlApplicationContext:307 - Post refresh error
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'app' defined in URL [bundleentry://56.fwk25610032/META-INF/spring/spring.xml]: Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [org.rifidi.edge.app.db.DBApp]: Constructor threw exception; nested exception is java.lang.NullPointerException
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateBean(AbstractAutowireCapableBeanFactory.java:883)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:839)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:440)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:409)
at java.security.AccessController.doPrivileged(Native Method)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:380)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:264)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:261)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:185)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:164)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:429)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:728)
at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext.completeRefresh(AbstractDelegatedExecutionApplicationContext.java:288)
at org.springframework.osgi.extender.internal.dependencies.startup.DependencyWaiterApplicationContextExecutor$CompleteRefreshTask.run(DependencyWaiterApplicationContextExecutor.java:145)
at java.lang.Thread.run(Thread.java:619)
Caused by: org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [org.rifidi.edge.app.db.DBApp]: Constructor threw exception; nested exception is java.lang.NullPointerException
at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:115)
at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:61)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateBean(AbstractAutowireCapableBeanFactory.java:877)
... 15 more
Caused by: java.lang.NullPointerException
at org.rifidi.edge.app.db.DBApp.start(DBApp.java:59)
at org.rifidi.edge.app.db.DBApp.<init>(DBApp.java:45)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:100)
... 17 more
Exception in thread "SpringOsgiExtenderThread-35" org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'app' defined in URL [bundleentry://56.fwk25610032/META-INF/spring/spring.xml]: Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [org.rifidi.edge.app.db.DBApp]: Constructor threw exception; nested exception is java.lang.NullPointerException
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateBean(AbstractAutowireCapableBeanFactory.java:883)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:839)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:440)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:409)
at java.security.AccessController.doPrivileged(Native Method)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:380)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:264)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:261)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:185)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:164)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:429)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:728)
at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext.completeRefresh(AbstractDelegatedExecutionApplicationContext.java:288)
at org.springframework.osgi.extender.internal.dependencies.startup.DependencyWaiterApplicationContextExecutor$CompleteRefreshTask.run(DependencyWaiterApplicationContextExecutor.java:145)
at java.lang.Thread.run(Thread.java:619)
Caused by: org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [org.rifidi.edge.app.db.DBApp]: Constructor threw exception; nested exception is java.lang.NullPointerException
at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:115)
at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:61)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateBean(AbstractAutowireCapableBeanFactory.java:877)
... 15 more
Caused by: java.lang.NullPointerException
at org.rifidi.edge.app.db.DBApp.start(DBApp.java:59)
at org.rifidi.edge.app.db.DBApp.<init>(DBApp.java:45)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:100)
... 17 more
10:53:59,818 INFO org.springframework.remoting.rmi.RmiServiceExporter:386 - Looking for RMI registry at port '1101'
10:54:01,192 INFO org.springframework.remoting.rmi.RmiServiceExporter:396 - Could not detect RMI registry - creating new one
10:54:01,203 INFO org.springframework.remoting.rmi.RmiServiceExporter:271 - Binding service 'SensorManagerService' to RMI registry: RegistryImpl[UnicastServerRef [liveRef: [endpoint:[127.0.0.1:1101](local),objID:[0:0:0, 0]]]]
10:54:01,243 INFO org.springframework.remoting.rmi.RmiServiceExporter:386 - Looking for RMI registry at port '1101'
10:54:01,273 INFO org.springframework.remoting.rmi.RmiServiceExporter:271 - Binding service 'CommandManagerService' to RMI registry: RegistryImpl_Stub[UnicastRef [liveRef: [endpoint:[192.168.0.103:1101](remote),objID:[0:0:0, 0]]]]
10:54:01,329 INFO org.springframework.remoting.rmi.RmiServiceExporter:386 - Looking for RMI registry at port '1101'
10:54:01,331 INFO org.springframework.remoting.rmi.RmiServiceExporter:271 - Binding service 'EdgeServerManagerService' to RMI registry: RegistryImpl_Stub[UnicastRef [liveRef: [endpoint:[192.168.0.103:1101](remote),objID:[0:0:0, 0]]]]

The problem is being detected here:

public void start() {
if (rfidDAO == null || esperService == null) {
logger.warn("Cannot start DBApp. "
+ "Either DAO or EsperService is null");
}

Post Reply

Who is online

Users browsing this forum: No registered users and 6 guests