Search code examples
hibernatespringstrutsmyeclipse

What's the problem with myeclipse?


I imported a project include spring + hibernate + struts2, and I got the following problems:

Description Resource Path Location Type Class 'org.apache.commons.dbcp.BasicDataSource' not found
applicationContext.xml /Struts2Example/src/main/java line 10
Spring Beans Problem Class 'org.springframework.orm.hibernate3.LocalSessionFactoryBean' not found applicationContext.xml /Struts2Example/src/main/java line 21 Spring Beans Problem

I have tried to include Spring 3.0 Persistence Core library into build path, and when I type "org.springframework.orm.hibernate3.LocalSessionFactoryBean" in java editor, this class can be found, so what's the problem here ? Why the xml file can not find the class ?

Thanks in advance !


Solution

  • Add the Spring 3.0 Persistence JDBC Libraries (right click on the project, go to Build Path->Add Libraries..., then select MyEclipse Libraries type, finally select the Spring libraries mentioned above). That should get you the BasicDataSource class. The LocalSessionFactoryBean class should be in a library already on the build path, the Spring 3.0 Persistence Core Libraries. Could you expand the container and confirm that the org.springframework.orm JAR is part of the container?

    If you still have problems, it is best to raise them on the MyEclipse forums (www.myeclipseide.com then click on the Support Forums link at the bottom) If you don't have a login, it's easy to set one up - click the Register link - ... it's free.