- This topic has 4 replies, 2 voices, and was last updated 18 years, 1 month ago by longxm.
-
AuthorPosts
-
longxmMemberHi, 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]
Brian FernandesModeratorHi,
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.
longxmMemberThank 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.
Brian FernandesModeratorHi,
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.MySessionFactoryI apologize for the inconvenience caused, thanks again for your report. Do let us know if you require further assistance.
Best,
Brian.
longxmMemberThank Brian.
-
AuthorPosts