For help with installation, bugs reports or feature requests, please head over to our new forums.
Genuitec Community on GitHub
- This topic has 6 replies, 2 voices, and was last updated 18 years, 8 months ago by
Mork.
-
AuthorPosts
-
Hello,
I’m trying to get MyEclipse to work in a project that wasn’t started with MyEclipse in mind (unfortunately, most of them).
I added Hibernate capabilities initially but chose the Hibernate configuration file instead the Spring one that the project actually uses.
Then, going back into MyEclipse’s project properties and trying to “browse” to the applicationContext.xml file gives me a strange error… “No Local SessionFactory Beans found” (in red when I try to update the mapping file).
As you can see below by the portion of the applicationContext.xml file, there is a LocalSessionFactoryBean defined.
What do I need to do? Should the bean ID below be renamed?
Why is MyEclipse complaining?
All suggestions would be welcome.
Thanks.
— M
———————————————-
(relevant portion of applicationContext.xml)<bean id=”sessionFactory”
class=”org.springframework.orm.hibernate3.LocalSessionFactoryBean”>
<property name=”dataSource” ref=”explicitUserDataSource” />
<property name=”mappingDirectoryLocations”>
<list>
<value>classpath:(portion omitted here)/class1</value>
<value>classpath:(portion omitted here)/class2</value>
</list>
</property>
….December 18, 2007 at 3:14 pm #279790
Riyad KallaMemberMork,
Did you add both Hibernate and Spring capabilities to the project so ME knows it has to consider both files?December 18, 2007 at 4:58 pm #279805Yes, as I said in my original posting, I picked the wrong option given (by ME) initially. ME gave me both the hibernate xml and the Spring context files as options to pick from.
Any ideas what could be wrong?
Thanks.
— M
December 20, 2007 at 11:18 am #279880
Riyad KallaMemberMork,
If you open the project properties, and go to MyEclipse > Hibernate, you can change the “Active configuration file” to the applicationContext file. Then the dropdown that pops up, be sure to select the session factory and hit OK.December 20, 2007 at 4:44 pm #279901Hi R,
I guess my original posting wasn’t clear.
What you just described is the exact method I used but got the error I posted in my first thread above. I also posted that part of the applicationcontext.xml file so you could see if you noticed anything.
Thanks again in advance.
— M
December 20, 2007 at 5:00 pm #279903
Riyad KallaMemberMork,
Sorry about that… I guess I’m running slow today. Unfortunately no, I don’t have any idea why you are getting that validation error to popup.What you you *could* try is to remove the capabilities manually, then go through the process of re-adding them.
NOTE: Please backup your project
Then you can:
1. Switch to the Navigator view
2. Open the .project file
3. Remove the hibernate and spring natures (down near the bottom)
4. Save the file, then close-reopen the project.
5. Re-add the Spring Capabilities
6. Re-add the Hibernate CapabilitiesDecember 21, 2007 at 5:48 am #279911OK, thanks.
These kind of problems always seem to occur when I start a project that’s “in process” and didn’t have MYE to start with.
Hopefully, MyE will become smarter over time about how to configure itself in an existing non-MyE project….though in this case, I’m not sure how it could.
Thanks again.
— M
-
AuthorPosts

