You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by Brian Kates <be...@shaw.ca> on 2007/07/12 04:13:37 UTC

Locating Hibernate resources in AAR

I see that this is a common problem and I too am struggling with it.  I'm trying to locate Hibernate mapping files as defined in my applicationContext.  I have one mapping file, called TransferScenario.  It is located at /domain/TransferScenario inside the AAR.  In my applicationContext, I am looking for it at the following location:

<property name="mappingResources">
    <list>
        <value>classpath*:**/domain/TransferScenario.hbm.xml</value>
    </list>
</property>

I have tried various permutations of the above with no luck.  I still get the FileNotFoundException.  Any ideas?  In the documentation it suggests turning the logging to DEBUG.  How do I do that?  Where is the logger?  

I'm curious, which jars have to be inside of the AAR?  I only have my project jars (i.e. Spring, Hibernate, Oracle, etc) inside of the AAR.  Do I need any of the AXIS2 jars?  

If I decide to deploy my service as a WAR, what is the structure of the WAR file?  I assume it's:

/WEB-INF/classes/...
/WEB-INF/lib/...
/WEB-INF/web.xml
/WEB-INF/applicationContext
/WEB-INF/services.xml

Thanks.

-Brian


Re: Locating Hibernate resources in AAR

Posted by robert lazarski <ro...@gmail.com>.
The whole AAR concept has the purpose - as I understand it - of
allowing a completely seperate classloader for each one of them. Two
advantages immediately come to mind with AAR's.

One advantage is that two classes of the same name and package can be
deployed in one instance of axis2. A single classloader doesn't permit
two classes of the same name and package in it. So in respect to
spring, you can have two or more completely different instances of
spring - even with the same beans - running independently.

The other immediate advantage is the hot deploy of aar's is a big
improvement over what axis1 has, IMHO.

With respect to the first point - the relevant point here - is its a
feature that allows a lot of flexibility. On the other hand, that
flexibility is often not required. What I do most often with spring
and axis2 is simply have the AAR contain just the services.xml and the
wsdl file if there is one in the META-INF dir - and that's it. No
classes, no spring nor hibernate in the aar - nothing. Then I just put
the spring config files in WEB-INF, the spring jars in WEB-INF/lib,
the hibernate files in WEB-INF/classes, and all the Service classes
and its business classes under WEB-INF/classes. And that's all there
is to it - works great if you just have one app running in tomcat.

In other words, the Einstein approach: as simple as possible, but no
simpler. If you really need two or more aar's - you ended up in about
the right place.

HTH,
Robert


On 7/12/07, Brian Kates <be...@shaw.ca> wrote:
> I got the file to map by putting them in
> WEB-INF/classes/domain/transferScenario.hbm.xml.  In my
> applicationContext, the mapping file value is
> <value>domain/TransferScenario.hbm.xml</value>.  Thanks a
> lot of your help and patience!
>
> Just to wrap up this conversation, (now that we're both on the same page),
> what are the alternatives?  How can I get the AAR on the classpath (expanded
> or not)?  Are there any best practices?
>
> Thanks.
>
> -Brian
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org


Re: Locating Hibernate resources in AAR

Posted by Brian Kates <be...@shaw.ca>.
I got the file to map by putting them in WEB-INF/classes/domain/transferScenario.hbm.xml.  In my applicationContext, the mapping file value is <value>domain/TransferScenario.hbm.xml</value>.  Thanks a lot of your help and patience!  

Just to wrap up this conversation, (now that we're both on the same page), what are the alternatives?  How can I get the AAR on the classpath (expanded or not)?  Are there any best practices?  

Thanks.

-Brian

 

Re: Locating Hibernate resources in AAR

Posted by robert lazarski <ro...@gmail.com>.
WEB-INF/classes is fine - that's where spring would look for the
hibernate files without axis2. I believe the mapping location could be
a relative path from WEB-INF , but if you're ok with using a classpath
location outside the AAR then you can't do any better than
WEB-INF/classes .

Glad it worked out ;-) .
Robert

On 7/12/07, Brian Kates <be...@shaw.ca> wrote:
> Ok, I think I get it.  Thanks for spelling it out.  So according to the
> logs, my compilation classpath is the following (removed a whole bunch of
> Jars).  Correct me if I'm wrong, but you were suggesting I put the mapping
> files in axis2/WEB-INF/classes (which is the first entry below).  In that
> case I would have to prefix the mapping files in the application context
> with "classpath" (as per the documentation).  I would rather avoid using a
> real path (i.e. c:/path/to/location/myfile.hbm.xml), so I'm
> wondering if there are any best practices / alternatives to WEB-INF classes?
>
>
> Compilation classpath initialized:
> /C:/Program%20Files/Apache%20Software%20Foundation/Tomcat%205.5/webapps/axis2/WEB-INF/classes/;
> /C:/Program Files\Apache Software Foundation\Tomcat
> 5.5\work\Catalina\localhost\axis2;
> /C:/Program%20Files/Apache%20Software%20Foundation/Tomcat%205.5/webapps/axis2/WEB-INF/classes/;/C:/Program%20Files/Apache%20Software%20Foundation/Tomcat%205.5/webapps/axis2/WEB-INF/lib/XmlSchema-1.3.1.jar;/C:/Program%20Files/Apache%20Software%20Foundation/Tomcat%205.5/webapps/axis2/WEB-INF/lib/activation-1.1.jar;/C:/Program%20Files/Apache%20Software%20Foundation/Tomcat%205.5/webapps/axis2/WEB-INF/lib/annogen-0.1.0.jar;/C:/Program%20Files/Apache%20Software%20Foundation/Tomcat%205.5/webapps/axis2/WEB-INF/lib/axiom-api-1.2.4.jar;/C:/Program%20Files/Apache%20Software%20Foundation/Tomcat%205.5/webapps/axis2/WEB-INF/lib/axiom-dom-1.2.4.jar;/C:/Program%20Files/Apache%20Software%20Foundation/Tomcat%205.5/webapps/axis2/WEB-INF/lib/axiom-impl-1.2.4.jar;/C:/Program%20Files/Apache%20Software%20Foundation/Tomcat%205.5/webapps/axis2/WEB-INF/lib/axis2-adb-1.2.jar;/C:/Program%20Files/Apache%20Software%20Foundation/Tomcat%205.5/webapps/axis2/WEB-INF/lib/axis2-adb-codegen-1.2.jar;/C:/Program%20Files/Apache%20Software%20Foundation/Tomcat%205.5/webapps/axis2/WEB-INF/lib/axis2-codegen-1.2.jar;/C:/Program%20Files/Apache%20Software%20Foundation/Tomcat%205.5/webapps/axis2/WEB-INF/lib/axis2-fastinfoset-1.2.jar;/C:/Program%20Files/Apache%20Software%20Foundation/Tomcat%205.5/webapps/axis2/WEB-INF/lib/axis2-java2wsdl-1.2.jar;/C:/Program%20Files/Apache%20Software%20Foundation/Tomcat%205.5/webapps/axis2/WEB-INF/lib/axis2-jaxbri-1.2.jar;/C:/Program%20Files/Apache%20Software%20Foundation/Tomcat%205.5/webapps/axis2/WEB-INF/lib/axis2-jaxws-1.2.jar;/C:/Program%20Files/Apache%20Software%20Foundation/Tomcat%205.5/webapps/axis2/WEB-INF/lib/axis2-jaxws-api-1.2.jar;/C:/Program%20Files/Apache%20Software%20Foundation/Tomcat%205.5/webapps/axis2/WEB-INF/lib/axis2-jibx-1.2.jar;/C:/Program%20Files/Apache%20Software%20Foundation/Tomcat%205.5/webapps/axis2/WEB-INF/lib/axis2-json-1.2.jar;/C:/Program%20Files/Apache%20Software%20Foundation/Tomcat%205.5/webapps/axis2/WEB-INF/lib/axis2-kernel-1.2.jar;/C:/Program%20Files/Apache%20Software%20Foundation/Tomcat%205.5/webapps/axis2/WEB-INF/lib/axis2-metadata-1.2.jar;/C:/Program%20Files/Apache%20Software%20Foundation/Tomcat%205.5/webapps/axis2/WEB-INF/lib/axis2-saaj-1.2.jar;/C:/Program%20Files/Apache%20Software%20Foundation/Tomcat%205.5/webapps/axis2/WEB-INF/lib/axis2-saaj-api-1.2.jar;/C:/Program%20Files/Apache%20Software%20Foundation/Tomcat%205.5/webapps/axis2/WEB-INF/lib/axis2-soapmonitor-1.2.jar;/C:/Program%20Files/Apache%20Software%20Foundation/Tomcat%205.5/webapps/axis2/WEB-INF/lib/axis2-spring-1.2.jar;/C:/Program%20Files/Apache%20Software%20Foundation/Tomcat%205.5/webapps/axis2/WEB-INF/lib/axis2-xmlbeans-1.2.jar;/C:/Program%20Files/Apache%20Software%20Foundation/Tomcat%205.5/webapps/axis2/WEB-INF/lib/backport-util-concurrent-2.2.jar;/C:/Program%20Files/Apache%20Software%20Foundation/Tomcat%205.5/webapps/axis2/WEB-INF/lib/commons-codec-1.3.jar;/C:/Program%20Files/Apache%20Software%20Foundation/Tomcat%205.5/webapps/axis2/WEB-INF/lib/commons-fileupload-1.1.1.jar;/C:/Program%20Files/Apache%20Software%20Foundation/Tomcat%205.5/webapps/axis2/WEB-INF/lib/commons-httpclient-3.0.1.jar;/C:/Program%20Files/Apache%20Software%20Foundation/Tomcat%205.5/webapps/axis2/WEB-INF/lib/commons-io-1.2.jar;/C:/Program%20Files/Apache%20Software%20Foundation/Tomcat%205.5/webapps/axis2/WEB-INF/lib/commons-logging-1.1.jar;/C:/Program%20Files/Apache%20Software%20Foundation/Tomcat%205.5/webapps/axis2/WEB-INF/lib/jakarta-httpcore-4.0-alpha4.jar;/C:/Program%20Files/Apache%20Software%20Foundation/Tomcat%205.5/webapps/axis2/WEB-INF/lib/jaxen-1.1-beta-10.jar;/C:/Program%20Files/Apache%20Software%20Foundation/Tomcat%205.5/webapps/axis2/WEB-INF/lib/jibx-run-1.1.4.jar;/C:/Program%20Files/Apache%20Software%20Foundation/Tomcat%205.5/webapps/axis2/WEB-INF/lib/log4j-1.2.14.jar;/C:/Program%20Files/Apache%20Software%20Foundation/Tomcat%205.5/webapps/axis2/WEB-INF/lib/mail-1.4.jar;/C:/Program%20Files/Apache%20Software%20Foundation/Tomcat%205.5/webapps/axis2/WEB-INF/lib/neethi-2.0.1.jar;/C:/Program%20Files/Apache%20Software%20Foundation/Tomcat%205.5/webapps/axis2/WEB-INF/lib/spring-beans-1.2.8.jar;/C:/Program%20Files/Apache%20Software%20Foundation/Tomcat%205.5/webapps/axis2/WEB-INF/lib/spring-context-1.2.8.jar;/C:/Program%20Files/Apache%20Software%20Foundation/Tomcat%205.5/webapps/axis2/WEB-INF/lib/spring-core-1.2.8.jar;/C:/Program%20Files/Apache%20Software%20Foundation/Tomcat%205.5/webapps/axis2/WEB-INF/lib/spring-web-1.2.8.jar;/C:/Program%20Files/Apache%20Software%20Foundation/Tomcat%205.5/webapps/axis2/WEB-INF/lib/stax-api-1.0.1.jar;/C:/Program%20Files/Apache%20Software%20Foundation/Tomcat%205.5/webapps/axis2/WEB-INF/lib/woden-1.0-incubating-M7a.jar;/C:/Program%20Files/Apache%20Software%20Foundation/Tomcat%205.5/webapps/axis2/WEB-INF/lib/wsdl4j-1.6.2.jar;/C:/Program%20Files/Apache%20Software%20Foundation/Tomcat%205.5/webapps/axis2/WEB-INF/lib/wstx-asl-3.2.1.jar;/C:/Program%20Files/Apache%20Software%20Foundation/Tomcat%205.5/webapps/axis2/WEB-INF/lib/xalan-2.7.0.jar;/C:/Program%20Files/Apache%20Software%20Foundation/Tomcat%205.5/webapps/axis2/WEB-INF/lib/xbean-2.2.0.jar;/C:/Program%20Files/Apache%20Software%20Foundation/Tomcat%205.5/webapps/axis2/WEB-INF/lib/xercesImpl-2.8.1.jar;/C:/Program%20Files/Apache%20Software%20Foundation/Tomcat%205.5/webapps/axis2/WEB-INF/lib/xml-apis-1.3.03.jar;
> /C:/Program Files/Apache Software Foundation/Tomcat 5.5/shared/classes/;
> /C:/Program Files/Apache Software Foundation/Tomcat 5.5/common/classes/;
> ...etc
>
> Thanks.
>
> -Brian

---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org


Re: Locating Hibernate resources in AAR

Posted by Brian Kates <be...@shaw.ca>.
Ok, I think I get it.  Thanks for spelling it out.  So according to the logs, my compilation classpath is the following (removed a whole bunch of Jars).  Correct me if I'm wrong, but you were suggesting I put the mapping files in axis2/WEB-INF/classes (which is the first entry below).  In that case I would have to prefix the mapping files in the application context with "classpath" (as per the documentation).  I would rather avoid using a real path (i.e. c:/path/to/location/myfile.hbm.xml), so I'm wondering if there are any best practices / alternatives to WEB-INF classes?  

Compilation classpath initialized: /C:/Program%20Files/Apache%20Software%20Foundation/Tomcat%205.5/webapps/axis2/WEB-INF/classes/;
/C:/Program Files\Apache Software Foundation\Tomcat 5.5\work\Catalina\localhost\axis2;
/C:/Program%20Files/Apache%20Software%20Foundation/Tomcat%205.5/webapps/axis2/WEB-INF/classes/;/C:/Program%20Files/Apache%20Software%20Foundation/Tomcat%205.5/webapps/axis2/WEB-INF/lib/XmlSchema-1.3.1.jar;/C:/Program%20Files/Apache%20Software%20Foundation/Tomcat%205.5/webapps/axis2/WEB-INF/lib/activation-1.1.jar;/C:/Program%20Files/Apache%20Software%20Foundation/Tomcat%205.5/webapps/axis2/WEB-INF/lib/annogen-0.1.0.jar;/C:/Program%20Files/Apache%20Software%20Foundation/Tomcat%205.5/webapps/axis2/WEB-INF/lib/axiom-api-1.2.4.jar;/C:/Program%20Files/Apache%20Software%20Foundation/Tomcat%205.5/webapps/axis2/WEB-INF/lib/axiom-dom-1.2.4.jar;/C:/Program%20Files/Apache%20Software%20Foundation/Tomcat%205.5/webapps/axis2/WEB-INF/lib/axiom-impl-1.2.4.jar;/C:/Program%20Files/Apache%20Software%20Foundation/Tomcat%205.5/webapps/axis2/WEB-INF/lib/axis2-adb-1.2.jar;/C:/Program%20Files/Apache%20Software%20Foundation/Tomcat%205.5/webapps/axis2/WEB-INF/lib/axis2-adb-codegen-1.2.jar;/C:/Program%20Files/Apache%20Software%20Foundation/Tomcat%205.5/webapps/axis2/WEB-INF/lib/axis2-codegen-1.2.jar;/C:/Program%20Files/Apache%20Software%20Foundation/Tomcat%205.5/webapps/axis2/WEB-INF/lib/axis2-fastinfoset-1.2.jar;/C:/Program%20Files/Apache%20Software%20Foundation/Tomcat%205.5/webapps/axis2/WEB-INF/lib/axis2-java2wsdl-1.2.jar;/C:/Program%20Files/Apache%20Software%20Foundation/Tomcat%205.5/webapps/axis2/WEB-INF/lib/axis2-jaxbri-1.2.jar;/C:/Program%20Files/Apache%20Software%20Foundation/Tomcat%205.5/webapps/axis2/WEB-INF/lib/axis2-jaxws-1.2.jar;/C:/Program%20Files/Apache%20Software%20Foundation/Tomcat%205.5/webapps/axis2/WEB-INF/lib/axis2-jaxws-api-1.2.jar;/C:/Program%20Files/Apache%20Software%20Foundation/Tomcat%205.5/webapps/axis2/WEB-INF/lib/axis2-jibx-1.2.jar;/C:/Program%20Files/Apache%20Software%20Foundation/Tomcat%205.5/webapps/axis2/WEB-INF/lib/axis2-json-1.2.jar;/C:/Program%20Files/Apache%20Software%20Foundation/Tomcat%205.5/webapps/axis2/WEB-INF/lib/axis2-kernel-1.2.jar;/C:/Program%20Files/Apache%20Software%20Foundation/Tomcat%205.5/webapps/axis2/WEB-INF/lib/axis2-metadata-1.2.jar;/C:/Program%20Files/Apache%20Software%20Foundation/Tomcat%205.5/webapps/axis2/WEB-INF/lib/axis2-saaj-1.2.jar;/C:/Program%20Files/Apache%20Software%20Foundation/Tomcat%205.5/webapps/axis2/WEB-INF/lib/axis2-saaj-api-1.2.jar;/C:/Program%20Files/Apache%20Software%20Foundation/Tomcat%205.5/webapps/axis2/WEB-INF/lib/axis2-soapmonitor-1.2.jar;/C:/Program%20Files/Apache%20Software%20Foundation/Tomcat%205.5/webapps/axis2/WEB-INF/lib/axis2-spring-1.2.jar;/C:/Program%20Files/Apache%20Software%20Foundation/Tomcat%205.5/webapps/axis2/WEB-INF/lib/axis2-xmlbeans-1.2.jar;/C:/Program%20Files/Apache%20Software%20Foundation/Tomcat%205.5/webapps/axis2/WEB-INF/lib/backport-util-concurrent-2.2.jar;/C:/Program%20Files/Apache%20Software%20Foundation/Tomcat%205.5/webapps/axis2/WEB-INF/lib/commons-codec-1.3.jar;/C:/Program%20Files/Apache%20Software%20Foundation/Tomcat%205.5/webapps/axis2/WEB-INF/lib/commons-fileupload-1.1.1.jar;/C:/Program%20Files/Apache%20Software%20Foundation/Tomcat%205.5/webapps/axis2/WEB-INF/lib/commons-httpclient-3.0.1.jar;/C:/Program%20Files/Apache%20Software%20Foundation/Tomcat%205.5/webapps/axis2/WEB-INF/lib/commons-io-1.2.jar;/C:/Program%20Files/Apache%20Software%20Foundation/Tomcat%205.5/webapps/axis2/WEB-INF/lib/commons-logging-1.1.jar;/C:/Program%20Files/Apache%20Software%20Foundation/Tomcat%205.5/webapps/axis2/WEB-INF/lib/jakarta-httpcore-4.0-alpha4.jar;/C:/Program%20Files/Apache%20Software%20Foundation/Tomcat%205.5/webapps/axis2/WEB-INF/lib/jaxen-1.1-beta-10.jar;/C:/Program%20Files/Apache%20Software%20Foundation/Tomcat%205.5/webapps/axis2/WEB-INF/lib/jibx-run-1.1.4.jar;/C:/Program%20Files/Apache%20Software%20Foundation/Tomcat%205.5/webapps/axis2/WEB-INF/lib/log4j-1.2.14.jar;/C:/Program%20Files/Apache%20Software%20Foundation/Tomcat%205.5/webapps/axis2/WEB-INF/lib/mail-1.4.jar;/C:/Program%20Files/Apache%20Software%20Foundation/Tomcat%205.5/webapps/axis2/WEB-INF/lib/neethi-2.0.1.jar;/C:/Program%20Files/Apache%20Software%20Foundation/Tomcat%205.5/webapps/axis2/WEB-INF/lib/spring-beans-1.2.8.jar;/C:/Program%20Files/Apache%20Software%20Foundation/Tomcat%205.5/webapps/axis2/WEB-INF/lib/spring-context-1.2.8.jar;/C:/Program%20Files/Apache%20Software%20Foundation/Tomcat%205.5/webapps/axis2/WEB-INF/lib/spring-core-1.2.8.jar;/C:/Program%20Files/Apache%20Software%20Foundation/Tomcat%205.5/webapps/axis2/WEB-INF/lib/spring-web-1.2.8.jar;/C:/Program%20Files/Apache%20Software%20Foundation/Tomcat%205.5/webapps/axis2/WEB-INF/lib/stax-api-1.0.1.jar;/C:/Program%20Files/Apache%20Software%20Foundation/Tomcat%205.5/webapps/axis2/WEB-INF/lib/woden-1.0-incubating-M7a.jar;/C:/Program%20Files/Apache%20Software%20Foundation/Tomcat%205.5/webapps/axis2/WEB-INF/lib/wsdl4j-1.6.2.jar;/C:/Program%20Files/Apache%20Software%20Foundation/Tomcat%205.5/webapps/axis2/WEB-INF/lib/wstx-asl-3.2.1.jar;/C:/Program%20Files/Apache%20Software%20Foundation/Tomcat%205.5/webapps/axis2/WEB-INF/lib/xalan-2.7.0.jar;/C:/Program%20Files/Apache%20Software%20Foundation/Tomcat%205.5/webapps/axis2/WEB-INF/lib/xbean-2.2.0.jar;/C:/Program%20Files/Apache%20Software%20Foundation/Tomcat%205.5/webapps/axis2/WEB-INF/lib/xercesImpl-2.8.1.jar;/C:/Program%20Files/Apache%20Software%20Foundation/Tomcat%205.5/webapps/axis2/WEB-INF/lib/xml-apis-1.3.03.jar;
/C:/Program Files/Apache Software Foundation/Tomcat 5.5/shared/classes/;
/C:/Program Files/Apache Software Foundation/Tomcat 5.5/common/classes/;
...etc

Thanks.

-Brian 

Re: Locating Hibernate resources in AAR

Posted by robert lazarski <ro...@gmail.com>.
The simple answer is that spring mapping locations accepts a real
path, ie, c:\yourlocation . Don't use a classloader location for
inside the aar nor an expanded aar. Spring in debug shows you where
the classloader locations are, and the path you have for the aar won't
be one of them. WEB-INF/classes would be a classloader location, but
that kind of defeats the purpose of spring in the aar. So use a real
path, don't use a classloader path! The link I gave you shows you how.
Or google on using mapping locations with a real path for an example.

Spring inside the aar is an advanced option, sure you're not better
off just putting the spring jars in WEB-INF/lib and your mapping files
in WEB-INF/classes ? Sorry its not working for you, but it would work
if you are reading what I'm saying carefully.

HTH,
Robert

On 7/12/07, Brian Kates <be...@shaw.ca> wrote:
> This is proving to be quite the challenge. At first I put the Hibernate
> mapping files in domain/mappingfile.hbm.xml.  Then I moved it into
> WEB-INF/classes/domain/mappingfile.hbm.xml.  I've tried all
> kinds of different ways to reference the files in the applicationContext but
> no such luck.  I'm curious if there is a working example of Spring/Hibernate
> AAR out there somewhere?  I'm running out of options!  :(
>
> As for the link you sent, if I'm prefixing the hibernate mapping with
> "classpath", do I have to do anything special to include those mappings in
> the classpath?
>
> -Brian
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org


Re: Locating Hibernate resources in AAR

Posted by Brian Kates <be...@shaw.ca>.
This is proving to be quite the challenge. At first I put the Hibernate mapping files in domain/mappingfile.hbm.xml.  Then I moved it into WEB-INF/classes/domain/mappingfile.hbm.xml.  I've tried all kinds of different ways to reference the files in the applicationContext but no such luck.  I'm curious if there is a working example of Spring/Hibernate AAR out there somewhere?  I'm running out of options!  :(

As for the link you sent, if I'm prefixing the hibernate mapping with "classpath", do I have to do anything special to include those mappings in the classpath?

-Brian

 

Re: Locating Hibernate resources in AAR

Posted by robert lazarski <ro...@gmail.com>.
Try this as it should work:

http://www.springframework.org/docs/api/org/springframework/orm/hibernate/LocalSessionFactoryBean.html#setMappingDirectoryLocations(org.springframework.core.io.Resource[])

HTH,
Robert

On 7/12/07, Brian Kates <be...@shaw.ca> wrote:
> Hmm, still can't find any useful logging.
>
> The exception I'm seeing in the logs is:
>
> 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
> java.io.FileNotFoundException: class path resource
> [classpath*:**/TransferScenario.hbm.xml] cannot be opened
> because it does not exist
>
> Just to review, I have one mapping file located in
> services\WeatherSpringService\WEB-INF\classes\TransferScenario.hbm.xml
>
> I had the mapping file some place else, so after expanding the AAR I created
> a WEB-INF/classes directory and dropped the file in there.
>
> Any ideas?
>
> Thanks.
>
> -Brian
>

---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org


Re: Locating Hibernate resources in AAR

Posted by Brian Kates <be...@shaw.ca>.
Hmm, still can't find any useful logging.  

The exception I'm seeing in the logs is:

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 java.io.FileNotFoundException: class path resource [classpath*:**/TransferScenario.hbm.xml] cannot be opened because it does not exist

Just to review, I have one mapping file located in services\WeatherSpringService\WEB-INF\classes\TransferScenario.hbm.xml

I had the mapping file some place else, so after expanding the AAR I created a WEB-INF/classes directory and dropped the file in there.

Any ideas?

Thanks.

-Brian
 

Re: Locating Hibernate resources in AAR

Posted by robert lazarski <ro...@gmail.com>.
Try removing the axis2 line to minimize logging. Or simply search for
your mapping file in the logs - spring debug will show all the
locations its looking at.

Your mapping files - as normally done with hibernate - should be in
WEB-INF/classes . Then use spring's MappingLocations directive to map
that to the location of the expanded AAR.

I'll try to make this clearer in time for the 1.3 release.

HTH,
Robert

On 7/12/07, Brian Kates <be...@shaw.ca> wrote:
> I'm still having troubles here.  So I added the logging like you suggest and
> now I see over a meg of log statements.  Nothing in there seemed relevant.
> Should I be looking for any specific keywords?  Maybe to back up a second
> here, but where inside my AAR should I put my mapping files?
>
> Right now it looks like this:
>
> .../services/<my service>/applicationContext.xml
>
> Where should the mapping files go relative to the <my service> root?  I've
> tried just about everywhere.
>
> Thanks.
>
> -Brian
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org


Re: Locating Hibernate resources in AAR

Posted by Brian Kates <be...@shaw.ca>.
I'm still having troubles here.  So I added the logging like you suggest and now I see over a meg of log statements.  Nothing in there seemed relevant.  Should I be looking for any specific keywords?  Maybe to back up a second here, but where inside my AAR should I put my mapping files?  

Right now it looks like this:

.../services/<my service>/applicationContext.xml

Where should the mapping files go relative to the <my service> root?  I've tried just about everywhere. 

Thanks.

-Brian

 

Re: Locating Hibernate resources in AAR

Posted by robert lazarski <ro...@gmail.com>.
You need to deploy the aar expanded. Just do a jar xf myaar.aar in the
services dir , then remove the aar. From there you'll get a rela path
you can access.

You don't need any axis2 jars in the aar. Just follow the tutorial as is.

To put spring in debug mode, the way I do it is to put any recent
log4j jar in the WEB-INF/lib dir, then copy and paste the following in
the default WEB-INF/classes/log4j.properties:

##################INICIO DOS APPENDERs################################

#-------------------------------------------------------------------#
#-------------------------------------------------------------------#

# console2 será um appender de console que exibirá todas as propriedades
log4j.appender.console2=org.apache.log4j.ConsoleAppender

log4j.appender.console2.layout=org.apache.log4j.PatternLayout
log4j.appender.console2.layout.ConversionPattern=%d [%c] - %m%n

#-------------------------------------------------------------------#
#################INICIO DO ROOTlOGGER################################

log4j.rootLogger=DEBUG, console2

###################FIM DO ROOTlOGGER################################


#############INICIO DAS DECLARAÇÕES DE CATEGORIAS####################

log4j.category.org.apache.axis2=DEBUG, console2
log4j.category.org.springframework=DEBUG, console2

That'll put both spring and axis2 in DEBUG, puttting the logs in
catalina.out in the tomcat case.

HTH,
Robert

On 7/11/07, Brian Kates <be...@shaw.ca> wrote:
> I see that this is a common problem and I too am struggling with it.  I'm
> trying to locate Hibernate mapping files as defined in my
> applicationContext.  I have one mapping file, called TransferScenario.  It
> is located at /domain/TransferScenario inside the AAR.  In my
> applicationContext, I am looking for it at the following location:
>
> <property name="mappingResources">
>     <list>
>
> <value>classpath*:**/domain/TransferScenario.hbm.xml</value>
>     </list>
> </property>
>
> I have tried various permutations of the above with no luck.  I still get
> the FileNotFoundException.  Any ideas?  In the documentation it suggests
> turning the logging to DEBUG.  How do I do that?  Where is the logger?
>
> I'm curious, which jars have to be inside of the AAR?  I only have my
> project jars (i.e. Spring, Hibernate, Oracle, etc) inside of the AAR.  Do I
> need any of the AXIS2 jars?
>
> If I decide to deploy my service as a WAR, what is the structure of the WAR
> file?  I assume it's:
>
> /WEB-INF/classes/...
> /WEB-INF/lib/...
> /WEB-INF/web.xml
> /WEB-INF/applicationContext
> /WEB-INF/services.xml
>
> Thanks.
>
> -Brian
>

---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org