File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Other Application Frameworks and the fly likes problem in my Spring Application program Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Other Application Frameworks
Bookmark "problem in my Spring Application program" Watch "problem in my Spring Application program" New topic
Author

problem in my Spring Application program

ganesh pol
Ranch Hand

Joined: Apr 29, 2005
Posts: 151
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

Joined: Jul 08, 2003
Posts: 24187
    
  34

Spring questions go in our application frameworks forum. I will move this there for you.


[Jess in Action][AskingGoodQuestions]
Karthik Guru
Ranch Hand

Joined: Mar 06, 2001
Posts: 1209


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
 
subject: problem in my Spring Application program