Question about Hibernate facet

Hi all,

I have a small project with some Hibernate and Spring dependencies. Therefore, I also added the Hibernate and Spring facet. They seem to be working okay, but when I go the J2EE perspective, and select my sessionFactory, there are no Hibernate mappings, even though they are configured (they are configured in the applicationContext.xml). Also, when I open the ER model, I see no entities, nor does adding them do any good (nothing happens).

What could I have missed, or how can I fix this? Any help greatly appreciated!

Erik

6 comments
Comment actions Permalink

ps: these are my Spring configurations (and web.xml)



Attachment(s):
applicationContext.xml
cookbook-servlet.xml
web.xml
0
Comment actions Permalink

Hello Erik,

Can it be this one: http://www.jetbrains.net/jira/browse/IDEADEV-17217 ?

ps: these are my Spring configurations (and web.xml)

Alexander.


0
Comment actions Permalink

Actually, I just created an issue for it myself:

http://www.jetbrains.net/jira/secure/ManageAttachments!default.jspa?id=150713

I'll check if the classpath prefix works.

0
Comment actions Permalink

You're right, it's exactly the same behaviour. I've added the classpath prefix, and now IntelliJ does find them. However, the poster of the comment in issue IDEADEV-17217 is also right: now, the application doesn't work anymore, failing with a FileNotFoundException:

SEVERE: Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListener
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'transactionManager' defined in ServletContext resource : Cannot resolve reference to bean 'sessionFactory' while setting bean property 'sessionFactory'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in ServletContext resource : Invocation of init method failed; nested exception is java.io.FileNotFoundException: class path resource cannot be opened because it does not exist
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in ServletContext resource : Invocation of init method failed; nested exception is java.io.FileNotFoundException: class path resource cannot be opened because it does not exist
Caused by: java.io.FileNotFoundException: class path resource cannot be opened because it does not exist
at org.springframework.core.io.ClassPathResource.getInputStream(ClassPathResource.java:135)
at org.springframework.orm.hibernate3.LocalSessionFactoryBean.buildSessionFactory(LocalSessionFactoryBean.java:656)

0
Comment actions Permalink

Try using the "mappingLocations" property of LocalSessionFactoryBean. IDEA
does not fully support "mappingResources" yet.
In addition, when your SessionFactory is configured using spring you won't
need a hibernate.cfg.xml.

Taras


0
Comment actions Permalink

Hi Taras,

Thanks for the answer. I tried your approach, and it seems to be working. I'd still like this bug/feature to be implented though, but this is also workable!

Thanks!

0

Please sign in to leave a comment.