Replies: 1 comment 1 reply
|
This is because of incorrect package naming. You have kept your The following bean definitions are the rectified ones: <bean id="SalaryAccount" class="com.spring.driver.bean.SalaryAccount" scope="prototype">
<constructor-arg index="0" value="201"></constructor-arg>
<constructor-arg index="1" value="rohit"></constructor-arg>
<constructor-arg index="2" value="20000"></constructor-arg>
</bean>
<bean id="SavingsAccount" class="com.spring.driver.bean.SavingsAccount" scope="prototype">
<constructor-arg index="0" value="101"></constructor-arg>
<constructor-arg index="1" value="sankalp"></constructor-arg>
<constructor-arg index="2" value="500000"></constructor-arg>
</bean> |
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
sir I`m facing a
Exception in thread "main" org.springframework.beans.factory.CannotLoadBeanClassException: Cannot find class [com.spring.Driver.beans.SalaryAccount] for bean with name 'SalaryAccount' defined in class path resource [applicationContext.xml]; nested exception is java.lang.ClassNotFoundException: com.spring.Driver.beans.SalaryAccount
I checked all things in Xml file including package all and all class name but why still its showing me a this Exception
Driver Class
Beans Class
BankAccount
SavingsAccount
SalaryAccount
ALL EVENT CLASS
EventHandler
WithdrawalEvent
WithDrawalEventPublisher
src/main/Resource
applicationContext.xml
POM.xml
All reactions