• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

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

 
Ranch Hand
Posts: 64
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
ranger
Posts: 17347
11
Mac IntelliJ IDE Spring
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic