facebook

Trying to confiugre Hibernate capabilities

💡
Our Forums Have Moved

For help with installation, bugs reports or feature requests, please head over to our new forums.
Genuitec Community on GitHub

  1. MyEclipse IDE
  2.  > 
  3. Installation, Configuration & Updates
Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #279764 Reply

    Mork
    Participant

    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>
    ….

    #279790

    Riyad Kalla
    Member

    Mork,
    Did you add both Hibernate and Spring capabilities to the project so ME knows it has to consider both files?

    #279805

    Mork
    Participant

    Yes, 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

    #279880

    Riyad Kalla
    Member

    Mork,
    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.

    #279901

    Mork
    Participant

    Hi 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

    #279903

    Riyad Kalla
    Member

    Mork,
    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 Capabilities

    #279911

    Mork
    Participant

    OK, 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

Viewing 7 posts - 1 through 7 (of 7 total)
Reply To: Trying to confiugre Hibernate capabilities

You must be logged in to post in the forum log in