Win a copy of Svelte and Sapper in Action this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

problem in my Spring Application program

 
Ranch Hand
Posts: 151
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
request to all the people who contol this forum please start the section for Spring also

now my problem

i have created 2 java classes


my xml file is as follows

<beans>

<beanid="hello"
class="HelloImpl">

<property name="greeting">
<value>
shubh prabhat!...
</value>
</property>

<property name="obj">
<ref bean="java.lang.Object"/>
</property>

</bean>

</beans>


and when i suppose to run HelloClient.java
it gives me erroe like this

INFO: Unable to locate ApplicationEventMulticaster with name 'applicationEventMulticaster': using default [org.spri
ngframework.context.event.SimpleApplicationEventMulticaster@1ad086a]
16-Nov-2005 19:11:33 org.springframework.beans.factory.support.DefaultListableBeanFactory preInstantiateSingletons
INFO: Pre-instantiating singletons in factory [org.springframework.beans.factory.support.DefaultListableBeanFactory
defining beans [hello]; root of BeanFactory hierarchy]
16-Nov-2005 19:11:33 org.springframework.beans.factory.support.AbstractBeanFactory destroySingletons
INFO: Destroying singletons in factory {org.springframework.beans.factory.support.DefaultListableBeanFactory defini
ng beans [hello]; root of BeanFactory hierarchy}
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'hello' defined in file [C:\
spring_examples\hello.xml]: Can't resolve reference to bean 'java.lang.Object' while setting property 'obj';
nested
exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'java.lang.Object' is
defined: org.springframework.beans.factory.support.DefaultListableBeanFactory defining beans [hello]; root of BeanF
actory hierarchy
org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'java.lang.Object' is defined: org.s
pringframework.beans.factory.support.DefaultListableBeanFactory defining beans [hello]; root of BeanFactory hierarc
hy
at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeanDefinition(DefaultListableBe
anFactory.java:349)
at org.springframework.beans.factory.support.AbstractBeanFactory.getMergedBeanDefinition(AbstractBeanFactor
y.java:671)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:198)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:147)
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionVal
ueResolver.java:176)
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefini
tionValueResolver.java:105)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(Abstrac
tAutowireCapableBeanFactory.java:1012)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowi
reCapableBeanFactory.java:823)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowire
CapableBeanFactory.java:345)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:226)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:147)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultLis
tableBeanFactory.java:275)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:3
18)
at org.springframework.context.support.FileSystemXmlApplicationContext.<init>(FileSystemXmlApplicationConte
xt.java:83)
at org.springframework.context.support.FileSystemXmlApplicationContext.<init>(FileSystemXmlApplicationConte
xt.java:68)
at org.springframework.context.support.FileSystemXmlApplicationContext.<init>(FileSystemXmlApplicationConte
xt.java:59)
at HelloClient.main(HelloClient.java:17)
Exception in thread "main" java.lang.NullPointerException
at HelloClient.main(HelloClient.java:29)

C:\spring_examples>
 
author and iconoclast
Posts: 24203
43
Mac OS X Eclipse IDE Chrome
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Spring questions go in our application frameworks forum. I will move this there for you.
 
Ranch Hand
Posts: 1209
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


I guess you are getting started with Spring. Search for some better Spring tutorials and interesting examples that explains the concept well.
 
    Bookmark Topic Watch Topic
  • New Topic