facebook

I can not create sessionfactory

  1. MyEclipse Archived
  2.  > 
  3. Database Tools (DB Explorer, Hibernate, etc.)
Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #258926 Reply

    longxm
    Member

    Hi, everybody

    I use myeclipse 5.0.1. I has a java project. But I can not create sessionfactory.

    my .classpath:
    <classpathentry kind=”src” path=”src/app”/>

    In define sessionfactory properties dialog box:
    Java source folder: display “app”( but “src/app”)

    I can not choice Java Package. So, finish button is diasble.

    If I modify .classpath:
    <classpathentry kind=”src” path=”src”/>
    It is OK.

    Is it bug? Who can help me? Thanks.
    [/img]

    #258948 Reply

    Brian Fernandes
    Moderator

    Hi,

    How are you trying to creat a session factory? Do you use the Session factory wizard and are you trying to create it into an existing Hibernate Project?

    Because of the nature of the session factory, you cannot create a session factory in the default package, you must create or choose an existing package within your project.
    Are you unable to choose an existing package? Is the browse button disabled or it does not show you any packages?

    Could you please answer the additional questions asked here? Posting Guidelines
    Please include your Error log.

    Best,
    Brian.

    #258997 Reply

    longxm
    Member

    Thank Brian.

    I has a existed java project. It has not hibernate. I want to add Hibernate Capabilities.

    my .classpath:
    <classpathentry kind=”src” path=”src/app”/>

    In Define SessionFactory properties dialog box, first, I choose Java source folder, screen display “app“(I think it should be “src/app“). Then, I press Browse button, it is not show my any package. So, I press New button to add Java package. But Finish button is disable at all times.

    I check hibernate-tools.log, there is not error log.

    If I modify .classpath:
    <classpathentry kind=”src” path=”src”/>
    It is Ok.

    Thanks again.

    #259004 Reply

    Brian Fernandes
    Moderator

    Hi,

    Thank you for re-explaining the problem. I’m afraid it is a bug in MyEclipse and has been filed internally. It will be fixed in the upcoming 5.0.3 maintanence release.

    As a workaround:
    1) Disable the SessionFactory generation when adding Hibernate capabilities so that the capabilities can be added without issue.
    2) Create a dummy hibernate project with a single level source folder and create the session factory in that project, with the same package name you intend to use.
    3) Copy the created file into your project and make the following modifications.
    a) Within the session factory class, you should correct the location of the hibernate configuration file (CONFIG_FILE_LOCATION).
    b) Edit the .myhibernatedata file in your main project and modify or add a sessionFactoryName property to point to your SessionFactory class –
    for example sessionFactoryName=com.foo.MySessionFactory

    I apologize for the inconvenience caused, thanks again for your report. Do let us know if you require further assistance.

    Best,
    Brian.

    #259008 Reply

    longxm
    Member

    Thank Brian.

Viewing 5 posts - 1 through 5 (of 5 total)
Reply To: I can not create sessionfactory

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