[undertow-dev] Does ClassPathResourceManager work to serve a html file which is inside a packaged jar

Tomaž Cerar tomaz.cerar at gmail.com
Fri Sep 5 06:24:04 EDT 2014


So show as the code that you use to setup ClassPAthResourceManager
also some locations of classes / resources would be welcome.


On Fri, Sep 5, 2014 at 11:52 AM, Venkatesha T R <vworld4u at gmail.com> wrote:

> Hi Tomaz,
>
> I have seen and confirmed that resources are present in right packages
> inside the packaged jar. But I am not able to get the resource served! :(
>
> Thanks,
> Venkatesha T R
>
>
> On Fri, Sep 5, 2014 at 3:20 PM, Tomaž Cerar <tomaz.cerar at gmail.com> wrote:
>
>> Maybe problem is that you are not properly packaging resources in your
>> jar.
>> For maven project that should be in main/java/resources (standard jar
>> module type)
>> otherwise you can easily add any custom path as resource that will be
>> packed into your war.
>>
>> In short, open the resulting jar and see if resources are there.
>>
>>
>> On Fri, Sep 5, 2014 at 6:56 AM, Bill O'Neil <bill at dartalley.com> wrote:
>>
>>> Could you provide a little more info.
>>>
>>> 1. Are the html pages in a non standard location that may not be added
>>> to the class path in the jar?
>>> 2. Are you setting a resource base path?
>>>
>>> I just tested serving files from an executable jar and it works as
>>> expected for me.
>>>
>>>
>>> On Fri, Sep 5, 2014 at 12:30 AM, Venkatesha T R <vworld4u at gmail.com>
>>> wrote:
>>>
>>>> Hi,
>>>>
>>>> I am seeing this behavior in undertow - I have written a simple web
>>>> application using undertow which processes 3 requests and provides a single
>>>> (may be two in future) page (s) to see. These pages are just html pages and
>>>> 3 requests are GET/POST requests. I am using ClassPathResourceManager class
>>>> to serve the index.html file which is present inside classpath in one of my
>>>> package (I am using a maven project). It works fine when I run this
>>>> application in the Eclipse environment (where there is no jar used for
>>>> running). But when I package this application as a jar file and run it in
>>>> standalone mode, ClassPathResourceManager fails to pick the resource and
>>>> serve it.
>>>>
>>>> ClassPathResourceManager reports Resource instance, but I see a blank
>>>> page (404) error when I see it in browser. If somebody has any clue about
>>>> what is going on, or knows about this possible bug, please let me know. It
>>>> will help me a lot.
>>>>
>>>> Thanks in advance..
>>>>
>>>> --
>>>>
>>>> *Thanks and Regards*
>>>>
>>>> *--------------------------------------------------------------------------------------------------------------------*
>>>> *Venkatesh T R*
>>>> *9945040858*
>>>> A Man with Many Dimensions...
>>>>
>>>>
>>>> _______________________________________________
>>>> undertow-dev mailing list
>>>> undertow-dev at lists.jboss.org
>>>> https://lists.jboss.org/mailman/listinfo/undertow-dev
>>>>
>>>
>>>
>>> _______________________________________________
>>> undertow-dev mailing list
>>> undertow-dev at lists.jboss.org
>>> https://lists.jboss.org/mailman/listinfo/undertow-dev
>>>
>>
>>
>
>
> --
>
> *Thanks and Regards*
>
> *--------------------------------------------------------------------------------------------------------------------*
> *Venkatesh T R*
> *9945040858*
> A Man with Many Dimensions...
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/undertow-dev/attachments/20140905/a4e444c5/attachment-0001.html 


More information about the undertow-dev mailing list