No bean named 'userDao' is defined within applicationContext.xml

Within the file "../WEB-INF/applicationContext.xml", I have the 'userDao' bean defined as such:

<bean id="userDao" class="dao.hibernate.UserDaoHibernate">
    <property name="sessionFactory" ref="sessionFactory"/>
</bean>

Within the file "..UserDaoTest.java", I have the following declared:
public class UserDaoTest extends TestCase{

    private User user = null;
    private UserDao dao = null;

    protected ApplicationContext appCtx = null;

   protected void setUp() throws Exception {
        super.setUp();
        appCtx = new ClassPathXmlApplicationContext("/WEB-INF/applicationContext*.xml");
        dao = (UserDao) appCtx.getBean("userDao");
    }

    public void testSaveUser() thorws Exception {
        user = new User();
        user.setUsername("Jane");
        user.setPassword("123");
        ...

When I run the test file, I get the following errors:
dao.UserDaoTest  FAILED
testSaveUser  caused an ERROR (0.015s)
No bean neamed 'userDao' is defined
org.springframework.beans.factory.NoSuchBeanDefinition
at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeanDefinition( DefaultListableBeanFactory.java.387)

Is there something that I'm defining incorrectly or missing that's causing this to fail?  Thanks ahead of time for any input and effort.
fesitAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

dnunes_brCommented:
I think the problem is that * (asterisk) on the file name on this line:
appCtx = new ClassPathXmlApplicationContext("/WEB-INF/applicationContext*.xml");
0
fesitAuthor Commented:
I've tried with and without the * (asterisk) within the file name.  Without the asterisk, the file can not be found.  With the asterisk, file is found but bean is not found within the file.
0
fesitAuthor Commented:
Backed up the project under a different name and built new project with old name.  Rewrote all of the source code and for some reason, it compiled without a problem.  When both of the project folders were compared(utilizing beyondcompaire) the files were the same except for time stamps.  Since this process was done, I have not re-encounter this problem again.  Will keep you all updated if I find out more info regarding this.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
bentleyforbesCommented:
for those of you who may have found this via a search - this may occur if your classpath contains an older version of the applicationContext.xml file (either resident on the server or in some other location on your classpath) which may not be updated when you update the application during the edit and deploy process. Perform a search on your system, locate any applicationContext.xml file - open it, if the file is associated with your application, verify that it references beans which you've added in your most recent iteration of development. If not, and you prefer not to delete these files, update their contents by copying and pasting the most updated applicationContext file into the ones which are found. I hope this makes sense.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Java

From novice to tech pro — start learning today.