Saturday, 7 September 2013

org.springframework.beans.factory.NoSuchBeanDefinitionException exception in UNIX

org.springframework.beans.factory.NoSuchBeanDefinitionException exception
in UNIX

I have my java spring standalone project which works fine in windows but
when I create jar file and executes that jar file by using shell script,
it gives me
org.springframework.beans.factory.NoSuchBeanDefinitionException. It seems
that in unix it is unable to load the beans and unable to do component
scan.
I have application contex file as below:
<context:annotation-config />
<context:component-scan base-package="com.ubs.lazar" />
<context:property-placeholder location="oracle.properties" />
<bean id="dataSource"
class="org.springframework.jdbc.datasource.DriverManagerDataSource">
<property name="driverClassName" value="${batch.jdbc.driver}" />
<property name="url" value="${batch.jdbc.url}" />
<property name="username" value="${batch.jdbc.user}" />
<property name="password" value="${batch.jdbc.password}" />
</bean>
<bean id="daoFactory" class="com.ubs.mzq.xen.db.XenDaoFactory">
<property name="databaseName" value="oracle" />
<property name="dataSource" ref="dataSource" />
</bean>
<tx:annotation-driven/>
And I am invoking and load the configuration from java as below:
ApplicationContext context = new
ClassPathXmlApplicationContext("classpath*:META-INF/application-context.xml");
AwardEventService awardEventService = (AwardEventService)
context.getBean("awardEventServiceImpl");
Can you please somebody helps to how to overcome this issue in UNIX.
Thanks

No comments:

Post a Comment