File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

problem in my Spring Application program

 
ganesh pol
Ranch Hand
Posts: 151
  • 0
  • 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>
 
Ernest Friedman-Hill
author and iconoclast
Marshal
Pie
Posts: 24204
34
Chrome Eclipse IDE Mac OS X
  • 0
  • 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.
 
Karthik Guru
Ranch Hand
Posts: 1209
  • 0
  • 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.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic