Announcement Announcement Module
Collapse
No announcement yet.
Problem with oc4j and hibernate mapping Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Problem with oc4j and hibernate mapping

    Hi,
    I've been having some issues depoying in oracle oc4j. I am using maven, and I have seperated my project into project-core and project-web modules. The core module has the hibernate mapping files under src/main/resources/hibernate/hbm folder. The web module depends on the core module and includes the core's jar file. It works fine under jetty and tomcat, but under oc4j, it doesn't see the hibernate mapping files within the jar file and it throws and exception. I physically copied the hibernate/hbm folder under classes and it works. My session factory bean looks like this.

    <bean id="sessionFactory"
    class="org.springframework.orm.hibernate3.LocalSes sionFactoryBean">
    <property name="mappingLocations">
    <value>classpath*:/hibernate/hbm/*.hbm.xml</value>
    </property>
    <property name="dataSource" ref="dataSource" />
    <property name="hibernateProperties">
    <props>
    <prop key="hibernate.dialect">
    ${hibernate.dialect}
    </prop>
    </props>
    </property>
    </bean>

    I am getting a hibernate mapping exception
    org.springframework.orm.hibernate3.HibernateSystem Exception: Unknown entity: com.project.Dummy; nested exception is org.hibernate.MappingException: Unknown entity: com.project.Dummy
    Caused by: org.hibernate.MappingException: Unknown entity:

    Does anyone have any idea why?

    Thanks.
    -John

  • #2
    I would presume this is related to the classpath*: prefix, there is a note about this in the reference manual that might be relevent.
    http://www.springframework.org/docs/...path-wildcards
    Last edited by karldmoore; Aug 29th, 2007, 01:25 PM.

    Comment


    • #3
      solution

      I was already using classpath*: previously

      I ended up finding a solution. It might not be the best way to do it and I dont know why it works, but it does. I used mappingJarLocations and mapping Locations at the same time.

      <property name="mappingJarLocations">
      <list>
      <value>classpath*:**/xxx-core-*.jar</value>
      </list>
      </property>
      <property name="mappingLocations">
      <value>classpath*:/hibernate/hbm/*.hbm.xml</value>
      </property>

      Comment

      Working...
      X