Results 1 to 3 of 3

Thread: Problem with oc4j and hibernate mapping

Hybrid View

  1. #1
    Join Date
    Feb 2006
    Posts
    2

    Default 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. #2
    Join Date
    Sep 2006
    Location
    UK
    Posts
    8,424

    Default

    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 at 12:25 PM.
    Barracuda Networks SSL VPN Lead Developer
    http://pramatr.wordpress.com
    http://twitter.com/karldmoore
    http://www.linkedin.com/in/karldmoore
    Any postings are my own opinion, and should not be attributed to my employer or clients.

  3. #3
    Join Date
    Feb 2006
    Posts
    2

    Default 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>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •