This week's book giveaway is in the Mac OS forum.
We're giving away four copies of a choice of "Take Control of Upgrading to Yosemite" or "Take Control of Automating Your Mac" and have Joe Kissell on-line!
See this thread for details.
The moose likes Other Application Frameworks and the fly likes Error creating bean 'beanId' with name defined in class path Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Frameworks » Other Application Frameworks
Bookmark "Error creating bean Watch "Error creating bean New topic
Author

Error creating bean 'beanId' with name defined in class path

vinitha simon
Ranch Hand

Joined: Dec 13, 2007
Posts: 64
Hi,
I have a JUnit test, in which I'm trying to load the applicationContext. But it gives me the following exception :
org.springframework.beans.factory.BeanCreationException: Error creating bean with name defined in class path resource'com.nationwide.corporate.common.util.ContextualPropertyConfigurer' defined in class path resource [configuration/integrationApplicationContext.xml]: Can't resolve reference to bean 'environment' while setting property 'environment'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'environment': FactoryBean threw exception on object creation; nested exception is java.lang.IllegalArgumentException: System property 'environment' not set and default not specified.
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'environment': FactoryBean threw exception on object creation; nested exception is java.lang.IllegalArgumentException: System property 'environment' not set and default not specified.

I'm not sure how to proceed...Any help is appreciated !!
Thanks,
vinitha simon
Mark Spritzler
ranger
Sheriff

Joined: Feb 05, 2001
Posts: 17250
    
    6

It seems in your ContextualPropertyConfigurer you want to inject a value for "environment" But whatever class it needs to create, it can't because it isn't declared in the configuration? or maybe it is of the wrong type. But the first place I would look is at the property environment, what is your "ref" and is that bean declared correctly in your xml.

Mark


Perfect World Programming, LLC - Two Laptop Bag - Tube Organizer
How to Ask Questions the Smart Way FAQ
 
GeeCON Prague 2014
 
subject: Error creating bean 'beanId' with name defined in class path