What is semaphore?

Semaphore is a hardware or software flag. It is facility provided by operating system. In multitasking systems, a semaphore is a variable with a value that indicates the status of a common resource. It’s used to lock the resource that is being used. A process needing the resource checks the semaphore to determine the resource’s status and then decides how to proceed.

org.springframework.web.context.ContextLoader – Context initialization failed

I am getting following exception while starting tomcat. Application context is not loaded after the error. I am using spring framework.

2008-07-02 17:55:19,484 [main] ERROR org.springframework.web.context.ContextLoader - Context initialization failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'testController' defined in ServletContext resource [/WEB-INF/servlet.xml]: Initialization of bean failed; nested exception is org.springframework.beans.factory.BeanCurrentlyInCreationException: Error creating bean with name 'callCenterService': Bean with name 'callCenterService' has been injected into other beans [centerAccessService] in its raw version as part of a circular reference, but has eventually been wrapped (for example as part of auto-proxy creation). This means that said other beans do not use the final version of the bean. This is often the result of over-eager type matching - consider using 'getBeanNamesOfType' with the 'allowEagerInit' flag turned off, for example.
Caused by:
org.springframework.beans.factory.BeanCurrentlyInCreationException: Error creating bean with name 'testService': Bean with name 'testService' has been injected into other beans [testAccessService] in its raw version as part of a circular reference, but has eventually been wrapped (for example as part of auto-proxy creation). This means that said other beans do not use the final version of the bean. This is often the result of over-eager type matching - consider using 'getBeanNamesOfType' with the 'allowEagerInit' flag turned off, for example.
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:431)
	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)

What could be possible reason for this exception?

What is a critical section in embedded software programs?

Critical Section is a set of instructions that must be atomic for system to work properly. Several techniques are used to ensure that a piece of code is atomic, some of which are semaphore, mutex etc.

What is volatile variable?

volatile is a keyword to indicate compiler that the variable it is used with should not be assumed to be unchanged during the course of execution of the code. Most compilers do optimizations which assumes that variable will not be changed until software is changing it. Refer following piece of code to understand it further:

int count = 10;
if(count < 20) {
//do something
}

In this code, compiler can not remove if check for optimization. The value of count can be changed between assignment and if check by some other process.

← Previous Page