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

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

 
vinitha simon
Ranch Hand
Posts: 64
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 17276
6
IntelliJ IDE Mac Spring
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Consider Paul's rocket mass heater.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic