selective AOP invocation - spring

I have a class on which there are several methods and the interface for the class looks something like this
Some main program calls the method doSomeOperation which in turn calls the other methods in the class based on business rule. I have a situation where I have to populate some stats after some of the methods in this class is invoked.
For example, after calling doSomeOperation which in turn calls say doOps1, populate some stats table on the database indicating how many records were inserted/updated/deleted etc in specific table and how much time it took etc by doOps1 method. I am trying to use Spring AOP for this purpose. However the issue that I am facing is that the intended code is not getting invoked.
Here is the full code (for sample purpose only)
package spring.aop.exp;
public interface Business {
void doSomeOperation();
void doOps1();
}
package spring.aop.exp;
public class BusinessImpl implements Business {
public void doSomeOperation() {
System.out.println("I am within doSomeOperation");
try {
Thread.sleep(200);
} catch (InterruptedException e) {
System.out.println("Thread interrupted");
}
System.out.println("Done with sleeping.");
doOps1();
}
public void doOps1() {
System.out.println("within Ops1");
}
}
The aspect class
package spring.aop.exp;
import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.annotation.After;
import org.aspectj.lang.annotation.Around;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Pointcut;
#Aspect
public class BusinessProfiler {
#Pointcut("execution(* doOps1*(..))")
public void businessMethods1() { }
#After("businessMethods1()")
public void profile1() throws Throwable {
//this method is supposed to populate the db stats and other statistics
System.out.println("populating stats");
}
}
-- the main class
package spring.aop.exp;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
public class SpringAOPDemo {
/**
* #param args
*/
public static void main(String[] args) {
ApplicationContext context = new ClassPathXmlApplicationContext(
"ExpAOP.xml");
Business bc = (Business) context.getBean("myBusinessClass");
bc.doSomeOperation();
}
}
*and the configuration file***
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:aop="http://www.springframework.org/schema/aop"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.5.xsd">
<!-- Enable the #AspectJ support -->
<aop:aspectj-autoproxy />
<bean id="businessProfiler" class="spring.aop.exp.BusinessProfiler" />
<bean id="myBusinessClass" class="spring.aop.exp.BusinessImpl" />
</beans>
On running the main program, I am getting the output (and it is not calling profile1 rom the Aspect class - BusinessProfiler). however if I directly call the doOps1 from main class then the aspect method gets invoked. I would like to know if aspect is supposed to work if only called from the main method and not otherwise.
Oct 26, 2012 11:56:19 AM
org.springframework.context.support.AbstractApplicationContext
prepareRefresh INFO: Refreshing
org.springframework.context.support.ClassPathXmlApplicationContext#be2358:
display name
[org.springframework.context.support.ClassPathXmlApplicationContext#be2358];
startup date [Fri Oct 26 11:56:19 EDT 2012]; root of context hierarchy
Oct 26, 2012 11:56:19 AM
org.springframework.beans.factory.xml.XmlBeanDefinitionReader
loadBeanDefinitions INFO: Loading XML bean definitions from class path
resource [ExpAOP.xml] Oct 26, 2012 11:56:19 AM
org.springframework.context.support.AbstractApplicationContext
obtainFreshBeanFactory INFO: Bean factory for application context
[org.springframework.context.support.ClassPathXmlApplicationContext#be2358]:
org.springframework.beans.factory.support.DefaultListableBeanFactory#1006d75
Oct 26, 2012 11:56:19 AM
org.springframework.beans.factory.support.DefaultListableBeanFactory
preInstantiateSingletons INFO: Pre-instantiating singletons in
org.springframework.beans.factory.support.DefaultListableBeanFactory#1006d75:
defining beans
[org.springframework.aop.config.internalAutoProxyCreator,businessProfiler,myBusinessClass];
root of factory hierarchy
*I am within doSomeOperation
Done with sleeping.
within Ops1***

Spring AOP is by default proxy-based and when you call a method on the same class from within another method on that calss, your call doesn't go through the aspect proxy, but directly to the method - that's why your aspect code is not invoked. To understand it better read this chapter of Spring documentation on Understanding AOP proxies.

Related

Throw Exception after add aop config

At first, I have a spring application works fine:
but when to add aop config to aop.xml like this, It throws a very lang exception.
this is AOP.java:
import org.springframework.beans.factory.BeanFactory;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import com.animal.Cat;
public class AOP {
public static void main(String args[]){
System.out.println("1");
BeanFactory factory = new ClassPathXmlApplicationContext("aop.xml");
Cat c1 =(Cat)factory.getBean("cat1");
System.out.println("2");
c1.mark();
}
}
this is Cat.java:
package com.animal;
public class Cat {
public void mark(){
System.out.println("cat is mark");
}
}
this is Rat.java:
package com.animal;
public class Rat {
public void sleep(){
System.out.println("rat is sleep");
}
public void run(){
System.out.println("rat running");
}
}
this is xml file:
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:aop="http://www.springframework.org/schema/aop"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/aop
http://www.springframework.org/schema/aop/spring-aop.xsd
">
<bean id="cat1" class="com.animal.Cat">
</bean>
<bean id="rat1" class="com.animal.Rat">
</bean>
<aop:config>
<aop:pointcut id="cat_mark" expression="execution(public void com.animal.Cat.mark())" />
<aop:aspect ref="rat1">
<aop:before method="sleep" pointcut-ref="cat_mark" />
<aop:after method="run" pointcut-ref="cat_mark" />
</aop:aspect>
</aop:config>
As you can see, this is a very simple application, I just want to use spring AOP to make rat do some action before cat going to mark.
I have config XML file which copies from some tutorial, but I can not find what is wrong with it.
yeah, I miss aspectjweaver.jar which org.springframework.context required.
This is the solution:
You have edited your question, so I am editing my answer because now I can reproduce your problem.
Actually your original pointcut was correct. Forget what I said about it being wrong, I parsed it wrong when I first saw it. Just change it back to using only a single *, please:
execution(* com.animal.Cat.mark(..))
Now I think your problem is far simpler, judging from the callstack you posted earlier but cut off in order to replace it by a screenshot of an incomplete callstack. But I found it in your question's history, looking at the old version:
...
Caused by: java.lang.ClassNotFoundException: org.aspectj.weaver.reflect.ReflectionWorld$ReflectionWorldException
I believe you just forgot to put aspectjweaver.jar (or a versioned name like aspectjweaver-1.8.13) on the classpath when running the application. Do that and it should go away. If I do that, your application prints:
1
Apr 20, 2018 6:04:34 PM org.springframework.context.support.ClassPathXmlApplicationContext prepareRefresh
INFORMATION: Refreshing org.springframework.context.support.ClassPathXmlApplicationContext#18769467: startup date [Fri Apr 20 18:04:34 ICT 2018]; root of context hierarchy
Apr 20, 2018 6:04:35 PM org.springframework.beans.factory.xml.XmlBeanDefinitionReader loadBeanDefinitions
INFORMATION: Loading XML bean definitions from class path resource [aop.xml]
2
rat is sleep
cat is mark
rat running

Using #Component for bean throws error. NoSuchBeanDefinitionException

I'm trying to create a simple spring app, but when i use #Component annotation for a bean instead of defining it in spring.xml file, I'm getting this error.
Aug 09, 2017 11:06:03 AM org.springframework.context.support.ClassPathXmlApplicationContext prepareRefresh
INFO: Refreshing org.springframework.context.support.ClassPathXmlApplicationContext#7e32c033: startup date [Wed Aug 09 11:06:03 IST 2017]; root of context hierarchy
Aug 09, 2017 11:06:03 AM org.springframework.beans.factory.xml.XmlBeanDefinitionReader loadBeanDefinitions
INFO: Loading XML bean definitions from class path resource [spring.xml]
Exception in thread "main" org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'oval' available
at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeanDefinition(DefaultListableBeanFactory.java:687)
at org.springframework.beans.factory.support.AbstractBeanFactory.getMergedLocalBeanDefinition(AbstractBeanFactory.java:1207)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:284)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:197)
at org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:1078)
at org.sumit.javabrains.DrawingApp.main(DrawingApp.java:24)
My Classes are al follows:
1. DrawingApp.java (main class)
public package org.sumit.javabrains;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
public class DrawingApp {
public static void main(String[] args) throws InterruptedException {
ApplicationContext context = new ClassPathXmlApplicationContext("spring.xml");
Oval oval = (Oval) context.getBean("oval");
oval.draw();
}
}
2. Spring.xml
<?xml version = "1.0" encoding = "UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:context="http://www.springframework.org/schema/context"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-4.0.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-4.0.xsd">
<context:component-scan base-package="com.sumit.javabrains" />
<context:annotation-config />
<bean id="focus" class="org.sumit.javabrains.Point" scope="singleton">
<property name="x" value="-7" />
<property name="y" value="8" />
</bean>
</beans>
3 Point.java
package org.sumit.javabrains;
public class Point {
private int x;
private int y;
public int getX() {
return x;
}
public void setX(int x) {
this.x = x;
}
public int getY() {
return y;
}
public void setY(int y) {
this.y = y;
}
}
4 Oval.java
package org.sumit.javabrains;
import javax.annotation.Resource;
import org.springframework.stereotype.Component;
#Component
public class Oval {
private Point focus;
public Point getFocus() {
return focus;
}
#Resource
public void setFocus(Point focus) {
this.focus = focus;
}
public void draw() {
System.out.println("Point focus is: ("+focus.getX()+", "+focus.getY()+")");
}
}
could someone be able to help what caused this issue. I'm using spring 4.3.10 RELEASE
That's because your component scan is scanning the wrong packages
<context:component-scan base-package="com.sumit.javabrains" /> - Wrong
It should be scanning as follows:
<context:component-scan base-package="org.sumit.javabrains" /> - Correct
you must define all your bean in spring.xml. in this scenario you missed the Oval class in you spring configuration files. define the Oval class as a bean in your spring.xml file.
or
edit your component-scan tag and put the correct package.
Two thing went wrong here.
1. You've mentioned wrong base package in your xml file
com.sumit.javabrains must be replaced with org.sumit.javabrains
Replace #Resource with #Resource #Qualifier("focus").By default beans marked with ‘#Component’ will have the same name as the class
Try using #ComponentScan instead of #Component on top of the Oval class.
I wasn't using a spring.xml file (just the default spring boot configuration instead), my #SpringBootApplication annotated class was one package level deeper than my #Component class, which made that the #Component class wasn't picked up.
E.g.:
com.company.base/ComponentAnnotatedClass.java
com.company.base.application/MySpringBootApplication.java

#Autowired annotation in spring-Getting BeanCreationException and java.lang.NoSuchMethodError

I have written a small code to check #Autowired annotation in Spring, here is my piece of code.
package beans;
//import org.springframework.beans.factory.annotation.AutoWired;
import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor;
import org.springframework.beans.factory.annotation.Qualifier;
//import org.springframework.beans.factory.annotation.*;
public class Car {
#Autowired
#Qualifier(value="e1")
private Engine engine;
//no need to have setters or constructors here
public void printData()
{
System.out.println("Engine model year: " +engine.getModelyear());
}
}
package beans;
public class Engine {
private String modelyear;
//generate setter and getter
public void setModelyear(String modelyear) {
this.modelyear = modelyear;
}
public String getModelyear() {
return modelyear;
}
}
package test;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import beans.Car;
//import beans.Test;
public class Client {
/**
* #param args
*/
public static void main(String[] args) {
ApplicationContext ap = new ClassPathXmlApplicationContext("resource/spring.xml");
Car c=(Car)ap.getBean("c");
c.printData();
}
}
<!--spring.xml-->
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN 2.0//EN"
"http://www.springframework.org/dtd/spring-beans-2.0.dtd">
<beans>
<!-- activate autowire annotation -->
<bean class="org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor"/>
<bean id="engine" class="beans.Engine">
<property name="modelyear" value="2015"/>
</bean>
<bean id="e1" class="beans.Engine">
<property name="modelyear" value="2016"/>
</bean>
<bean id="c" class="beans.Car">
</bean>
</beans>
When I am trying to run Client.java class ,I am getting following error:
Can someone suggest why I am facing this issue?
Mar 11, 2017 10:19:24 AM org.springframework.context.support.AbstractApplicationContext prepareRefresh
INFO: Refreshing org.springframework.context.support.ClassPathXmlApplicationContext#70d18a80: display name [org.springframework.context.support.ClassPathXmlApplicationContext#70d18a80]; startup date [Sat Mar 11 10:19:24 IST 2017]; root of context hierarchy
Mar 11, 2017 10:19:24 AM org.springframework.beans.factory.xml.XmlBeanDefinitionReader loadBeanDefinitions
INFO: Loading XML bean definitions from class path resource [resource/spring.xml]
Mar 11, 2017 10:19:25 AM org.springframework.context.support.AbstractApplicationContext obtainFreshBeanFactory
INFO: Bean factory for application context [org.springframework.context.support.ClassPathXmlApplicationContext#70d18a80]: org.springframework.beans.factory.support.DefaultListableBeanFactory#18d1cf9e
Mar 11, 2017 10:19:25 AM org.springframework.context.support.AbstractApplicationContext$BeanPostProcessorChecker postProcessAfterInitialization
INFO: Bean 'org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor' is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
Mar 11, 2017 10:19:25 AM org.springframework.beans.factory.support.DefaultListableBeanFactory preInstantiateSingletons
INFO: Pre-instantiating singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory#18d1cf9e: defining beans [org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor,engine,e1,c]; root of factory hierarchy
Mar 11, 2017 10:19:25 AM org.springframework.beans.factory.support.DefaultSingletonBeanRegistry destroySingletons
INFO: Destroying singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory#18d1cf9e: defining beans [org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor,engine,e1,c]; root of factory hierarchy
Exception in thread "main" org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'c': Autowiring of fields failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private beans.Engine beans.Car.engine; nested exception is java.lang.NoSuchMethodError: org.springframework.beans.factory.config.ConfigurableListableBeanFactory.resolveDependency(Lorg/springframework/beans/factory/config/DependencyDescriptor;Ljava/lang/String;Ljava/util/Set;Lorg/springframework/beans/TypeConverter;)Ljava/lang/Object;
Caused by: org.springframework.beans.factory.BeanCreationException: Could not autowire field: private beans.Engine beans.Car.engine; nested exception is java.lang.NoSuchMethodError: org.springframework.beans.factory.config.ConfigurableListableBeanFactory.resolveDependency(Lorg/springframework/beans/factory/config/DependencyDescriptor;Ljava/lang/String;Ljava/util/Set;Lorg/springframework/beans/TypeConverter;)Ljava/lang/Object;
Caused by: java.lang.NoSuchMethodError: org.springframework.beans.factory.config.ConfigurableListableBeanFactory.resolveDependency(Lorg/springframework/beans/factory/config/DependencyDescriptor;Ljava/lang/String;Ljava/util/Set;Lorg/springframework/beans/TypeConverter;)Ljava/lang/Object;
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredElement.inject(AutowiredAnnotationBeanPostProcessor.java:361)
at org.springframework.beans.factory.annotation.InjectionMetadata.injectFields(InjectionMetadata.java:61)
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessAfterInstantiation(AutowiredAnnotationBeanPostProcessor.java:228)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:414)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:249)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:155)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:246)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:160)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:291)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:352)
at org.springframework.context.support.ClassPathXmlApplicationContext.(ClassPathXmlApplicationContext.java:122)
at org.springframework.context.support.ClassPathXmlApplicationContext.(ClassPathXmlApplicationContext.java:66)
at test.Client.main(Client.java:13)
Set of jars which I am using are:
List of jars used and reference libraries while creating the project

Issue while running spring ; No error logs

I am a new bee to spring and am writing my first spring program.I have the following files.
package com.springstarter;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
public class SpringUser
{
public static void main( String[] args )
{
ApplicationContext context = new ClassPathXmlApplicationContext("Beans.xml");
SpringStarter starter = ( SpringStarter ) context.getBean( "springstarter" );
starter.getMessage();
}
}
I have a bean called SpringStarter
package com.springstarter;
public class SpringStarter
{
private String message;
public String getMessage()
{
return message;
}
public void setMessage( String message )
{
this.message = message;
}
}
Beans.xml
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-3.0.xsd">
<bean id="springstarter" class="com.springstarter.SpringStarter">
<property name="message" value="Hello World!"/>
</bean>
</beans>
The following is the package structure:
I have run the program in eclipse Mars, using Spring 4.2.4.
I didn't find any compilation issues, but the program is just showing the following logs.
Jan 14, 2016 10:36:08 AM org.springframework.context.support.ClassPathXmlApplicationContext prepareRefresh
INFO: Refreshing org.springframework.context.support.ClassPathXmlApplicationContext#73a83205: startup date [Thu Jan 14 10:36:08 IST 2016]; root of context hierarchy
Jan 14, 2016 10:36:08 AM org.springframework.beans.factory.xml.XmlBeanDefinitionReader loadBeanDefinitions
INFO: Loading XML bean definitions from class path resource [Beans.xml]
The expected output though, is Hello World!
Kindly let me know if i'm making any obvious mistakes.
Nothing wrong, but to print the output on console, so you should use it like:
System.out.println(starter.getMessage());

Spring context:component-scan not working with annotated beans

I'm trying to run a simple Spring + Hibernate tutorial => Maven Spring Hibernate annotation example
My beans definition file BeanLocations.xml is like this :
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:context="http://www.springframework.org/schema/context"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-2.5.xsd">
<!-- Database Configuration -->
<import resource="../database/Datasource.xml"/>
<import resource="../database/Hibernate.xml" />
<context:component-scan base-package="com.sample.springhibernate"/>
</beans>
My main method:
public static void main( String[] args )
{
ApplicationContext appContext = new ClassPathXmlApplicationContext("classpath*:BeanLocations.xml");
StockBo stockBo = (StockBo)appContext.getBean("stockBo");
}
I have a defined service with an interface:
public interface StockBo {
public void save(Stock stock);
public void update(Stock stock);
public void delete(Stock stock);
public Stock findByStockCode(String stockCode);
}
And his implementation:
#Service("stockBo")
public class StockBoImpl implements StockBo {
#Autowired
StockDao stockDao;
public void setStockDao(StockDao stockDao){
this.stockDao = stockDao;
}
#Override
public void save(Stock stock) {
stockDao.save(stock);
}
........
There is any problem with this because spring throws a Exception when StockBo)appContext.getBean("stockBo") :
30-oct-2014 15:31:49 org.springframework.context.support.AbstractApplicationContext prepareRefresh
INFO: Refreshing org.springframework.context.support.ClassPathXmlApplicationContext#64dc11: display name [org.springframework.context.support.ClassPathXmlApplicationContext#64dc11]; startup date [Thu Oct 30 15:31:49 CET 2014]; root of context hierarchy
30-oct-2014 15:31:49 org.springframework.context.support.AbstractApplicationContext obtainFreshBeanFactory
INFO: Bean factory for application context [org.springframework.context.support.ClassPathXmlApplicationContext#64dc11]: org.springframework.beans.factory.support.DefaultListableBeanFactory#a3d4cf
30-oct-2014 15:31:49 org.springframework.beans.factory.support.DefaultListableBeanFactory preInstantiateSingletons
INFO: Pre-instantiating singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory#a3d4cf: defining beans []; root of factory hierarchy
Exception in thread "main" org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'stockBo' is defined
at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeanDefinition(DefaultListableBeanFactory.java:387)
Spring not foud my annotated service StockBoo (with #Service("stockBo") )....
What is the problem? How can I ensure that Spring recognize my service with component scan?
FYI: StockBo is in com.sample.springhibernate.bo and StockBoImpl in com.sample.springhibernate.bo.impl
If you turn your log level to DEBUG, you'll more than likely find a line like
DEBUG o.s.b.f.xml.XmlBeanDefinitionReader - Loaded 0 bean definitions from location pattern [classpath*:BeanLocations.xml]
That is, your ClassPathXmlApplicationContext did not find any resources that match classpath*:BeanLocations.xml and therefore didn't load any context.
You'll need to provide a resource location String value that properly identifies and locates the context configuration file.

Resources