geronimo-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From David Jencks <david_jen...@yahoo.com>
Subject Re: Access resources in rar embedded inside an ear
Date Fri, 13 Mar 2009 16:54:42 GMT

On Mar 13, 2009, at 6:55 AM, Olaf Bergner wrote:

>
> I have an application packaged as an ear containing wars, rars and  
> ejb-jars.
> Employing what little I have in the way of graphical talent I would
> visualize the overall structure as
>
> app-ear - META-INF/application.xml
>    |
>    ------- ra.rar - META-INF/ra.xml
>    |                  - META-INF/resource.xml
>    |
>    (further JEE modules)
>
> From inside code deployed in ra.rar I'm trying to access the classpath
> resource
>
> ra.rar/META-INF/resource.xml
>
> using the usual getResourceAsStream(...) mechanism.
>
> This however fails, i.e. returns null. Only if I put resource.xml  
> inside the
> ear's META-INF directory am I able to access it.

Stuff in the rar such as your ra.rar/META-INF/resource.xml would be  
accessible at META-INF/resource.xml, not ra.rar/META-INF/resource.xml   
(you might need /META-INF/resource.xml)  If this doesn't work we have  
a problem (I think :-)

thanks
david jencks

>
>
> My expectation is that this is such a common requirement and that when
> accessing resources from inside a JEE module you naturally expect  
> those
> resources to be resolved relative to the current module and not  
> relative to
> the enclosing ear so that there has to be some standard solution. Am I
> wrong?
>
> Thx,
> Olaf
>
> -- 
> View this message in context: http://www.nabble.com/Access-resources-in-rar-embedded-inside-an-ear-tp22496887s134p22496887.html
> Sent from the Apache Geronimo - Users mailing list archive at  
> Nabble.com.
>


Mime
View raw message