Announcement Announcement Module
No announcement yet.
Loading hibernate mappings in Axis Archives (AAR) Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • Loading hibernate mappings in Axis Archives (AAR)

    Has anyone been able to use Spring to load hibernate mapping files inside of an AAR? I followed the documentation on the Axis 2 website to initialize Spring, but I have not had any luck loading mapping files.

    The file structure of the AAR is the following:

    (prefixed with tomcat\webapps\axis2\WEB-INF\services\<myservice>)


    In applicationContext, I defined the following:

    <property name="mappingResources">

    I am getting a FileNotFoundException when I fire up my service:

    Error: org.apache.axis2.deployment.DeploymentException: Processing Operations Modules with an error of Error creating bean with name 'sessionFactory' defined in class path resource [applicationContext.xml]: Initialization of bean failed; nested exception is class path resource [domain/TransferScenario.hbm.xml] cannot be opened because it does not exist at

  • #2
    So the problem is that the AAR (Axis archive) is not on the classpath and thus Spring classloader can't find the mapping files. What is the best way to get the files somewhere on the classpath so the Spring classloader can find them? One suggestion was to user real paths (i.e. c:/path/to/file/myfile.hbm.xml) and other solution was to put the mapping files in Tomcat/webapps/axis2/WEB-INF/classes/. The first solution is a non-starter and I'm not too keen on the second one either. Is there a better way to get these files on the classpath (perhaps as part of the deployment) so Spring can load them?



    • #3
      Packaging mapping files inside an AAR is a must in your project ?


      • #4
        There are some guidelines about Hibernate files and running Spring inside AAR on Axis 2 site:


        • #5
          I don't know if packaging hibernate files in the AAR is a must, but it's certainly a "nice to have". I got a simple example working by putting my Hibernate mapping files in a location outside of the AAR (in a place where Spring can find them), but it's gross... I was just wondering if anyone had any better ideas...


          • #6
            Same issue, hibernate is not aware of the AAR classes and JARs

            I have exactly the same issue, I have been trial and error for some time now. Basically I have to put my Entity classes and mappings in Axis2/WEB-INF/lib . I also had to put all spring-hibernate3/spring-* jars in Axis2/WEB-INF/lib contrary to what they say on .

            Its ugly, I hope a fix comes for this real soon. The good news is, atleast my Axis2 Spring service is now wired with Hibernate.