You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@karaf.apache.org by Erwin Hogeweg <er...@me.com> on 2020/01/28 00:52:21 UTC

JAX-RS Whiteboard is eclipsing war app. (Was: Angular Test app gives HTTP ERROR 403)

Hi -

The angular demo app is working fine after removing the app name from the Web-ContextPath in the pom.xml and from the outputPath in the angular.json file. But now of course the war application clashes with the default Aries JAX-RS Whiteboard application so index.html needs to be explicitly specified in the site URL.

karaf@root()> web:list
ID  │ State       │ Web-State   │ Level │ Web-ContextPath │ Name
────┼─────────────┼─────────────┼───────┼─────────────────┼─────────────────────────────────────────────
242 │ Active      │ Deployed    │ 80    │ /               │ test-frontend (1.0.0.SNAPSHOT)

Although a bit clumsy that is no biggie when the entire thing runs behind an Apache2 server. I am still wondering though if there is a better (cleaner) way to resolve this.


Cheers,

Erwin


> On Jan 26, 2020, at 17:20, Erwin Hogeweg <er...@me.com> wrote:
> 
> I am making progress on this one but I am not out of the woods yet. It appears that there are at least (…) two issues to resolve.
> 
> 1. The newer versions of ng (I have 8.1.3) create a subdirectory under the dist folder (dist/test-frontend) when a new project is created with 'ng new test-frontend'.
> 2. CORS prevents the scripts from being loaded. Adding "crossOrigin": "anonymous”, to the architect build options in angular.json files solve this (kinda), but now...
> 3. … Current browser versions (Safari, Chrome) loose the context path on the URL for the resources. The browser tries to load http://localhost:8181/polyfills-es2015.js <http://localhost:8181/polyfills-es2015.js> instead of http://localhost:8181/angular-test/polyfills-es2015.js <http://localhost:8181/angular-test/polyfills-es2015.js>.
> 
> I feel I am running around in circles at the moment so I am going to let this ferment for a few days… If anyone has some suggestions in the mean time I would be delighted to hear.
> 
> 
> Cheers,
> 
> Erwin
> 
> 
>> On Jan 26, 2020, at 12:27, Erwin Hogeweg <erwin.hogeweg@me.com <ma...@me.com>> wrote:
>> 
>> Never mind… something is not right with the content of that jar file. I’ll dig a bit deeper.
>> 
>> Sorry for the noise.
>> 
>> Erwin
>> 
>> 
>>> On Jan 26, 2020, at 12:11, Erwin Hogeweg <erwin.hogeweg@me.com <ma...@me.com>> wrote:
>>> 
>>> Hi -
>>> 
>>> I am trying to get JB's angular-test from here <http://blog.nanthrax.net/?p=827> running in 4.2.8 but I get a 403 (Forbidden) error. I tried with 4.2.6 as well and get the same result.
>>> 
>>> The app seems to be deployed properly and all the file system permissions appear to be correct as well.
>>> 
>>> 	11:56:48.697 INFO [paxweb-extender-4-thread-1] Started HttpServiceContext{httpContext=WebAppHttpContext{net.nanthrax.test-frontend - 118}}
>>> 
>>> 	karaf@root()> web:list
>>> 	ID  │ State       │ Web-State   │ Level │ Web-ContextPath │ Name
>>> 	────┼─────────────┼─────────────┼───────┼─────────────────┼───────────────────────────────
>>> 	118 │ Active      │ Deployed    │ 80    │ /angular-test   │ test-frontend (1.0.0.SNAPSHOT)
>>> 
>>> 
>>> Does anyone have a suggestion what I might be missing?
>>> 
>>> 
>>> Cheers,
>>> 
>>> Erwin
>> 
> 


Re: JAX-RS Whiteboard is eclipsing war app. (Was: Angular Test app gives HTTP ERROR 403)

Posted by Erwin Hogeweg <er...@me.com>.
Hi Tim,

Thanks for the response. I have not tried that because I couldn’t find any setting for that. I will look again now that I know that it must exist ;-)


Regards,

Erwin


> On Jan 28, 2020, at 10:09, Tim Ward <ti...@paremus.com> wrote:
> 
> Hi Erwin,
> 
> Did you try configuring the Aries JAX-RS whiteboard to use a non-root context path? That would allow you to separate the JAX-RS whiteboard from other uses of the HTTP whiteboard, helping to avoid path conflicts. Note that this will also set up an isolated servlet context for your JAX-RS whiteboard (i.e. it will be separate from any other servlets using the HTTP whiteboard). This may or may not be helpful to you.
> 
> Best Regards,
> 
> Tim
> 
>> On 28 Jan 2020, at 00:52, Erwin Hogeweg <erwin.hogeweg@me.com <ma...@me.com>> wrote:
>> 
>> Hi -
>> 
>> The angular demo app is working fine after removing the app name from the Web-ContextPath in the pom.xml and from the outputPath in the angular.json file. But now of course the war application clashes with the default Aries JAX-RS Whiteboard application so index.html needs to be explicitly specified in the site URL.
>> 
>> karaf@root()> web:list
>> ID  │ State       │ Web-State   │ Level │ Web-ContextPath │ Name
>> ────┼─────────────┼─────────────┼───────┼─────────────────┼─────────────────────────────────────────────
>> 242 │ Active      │ Deployed    │ 80    │ /               │ test-frontend (1.0.0.SNAPSHOT)
>> 
>> Although a bit clumsy that is no biggie when the entire thing runs behind an Apache2 server. I am still wondering though if there is a better (cleaner) way to resolve this.
>> 
>> 
>> Cheers,
>> 
>> Erwin
>> 
>> 
>>> On Jan 26, 2020, at 17:20, Erwin Hogeweg <erwin.hogeweg@me.com <ma...@me.com>> wrote:
>>> 
>>> I am making progress on this one but I am not out of the woods yet. It appears that there are at least (…) two issues to resolve.
>>> 
>>> 1. The newer versions of ng (I have 8.1.3) create a subdirectory under the dist folder (dist/test-frontend) when a new project is created with 'ng new test-frontend'.
>>> 2. CORS prevents the scripts from being loaded. Adding "crossOrigin": "anonymous”, to the architect build options in angular.json files solve this (kinda), but now...
>>> 3. … Current browser versions (Safari, Chrome) loose the context path on the URL for the resources. The browser tries to load http://localhost:8181/polyfills-es2015.js <http://localhost:8181/polyfills-es2015.js> instead of http://localhost:8181/angular-test/polyfills-es2015.js <http://localhost:8181/angular-test/polyfills-es2015.js>.
>>> 
>>> I feel I am running around in circles at the moment so I am going to let this ferment for a few days… If anyone has some suggestions in the mean time I would be delighted to hear.
>>> 
>>> 
>>> Cheers,
>>> 
>>> Erwin
>>> 
>>> 
>>>> On Jan 26, 2020, at 12:27, Erwin Hogeweg <erwin.hogeweg@me.com <ma...@me.com>> wrote:
>>>> 
>>>> Never mind… something is not right with the content of that jar file. I’ll dig a bit deeper.
>>>> 
>>>> Sorry for the noise.
>>>> 
>>>> Erwin
>>>> 
>>>> 
>>>>> On Jan 26, 2020, at 12:11, Erwin Hogeweg <erwin.hogeweg@me.com <ma...@me.com>> wrote:
>>>>> 
>>>>> Hi -
>>>>> 
>>>>> I am trying to get JB's angular-test from here <http://blog.nanthrax.net/?p=827> running in 4.2.8 but I get a 403 (Forbidden) error. I tried with 4.2.6 as well and get the same result.
>>>>> 
>>>>> The app seems to be deployed properly and all the file system permissions appear to be correct as well.
>>>>> 
>>>>> 	11:56:48.697 INFO [paxweb-extender-4-thread-1] Started HttpServiceContext{httpContext=WebAppHttpContext{net.nanthrax.test-frontend - 118}}
>>>>> 
>>>>> 	karaf@root()> web:list
>>>>> 	ID  │ State       │ Web-State   │ Level │ Web-ContextPath │ Name
>>>>> 	────┼─────────────┼─────────────┼───────┼─────────────────┼───────────────────────────────
>>>>> 	118 │ Active      │ Deployed    │ 80    │ /angular-test   │ test-frontend (1.0.0.SNAPSHOT)
>>>>> 
>>>>> 
>>>>> Does anyone have a suggestion what I might be missing?
>>>>> 
>>>>> 
>>>>> Cheers,
>>>>> 
>>>>> Erwin
>>>> 
>>> 
>> 
> 


Re: JAX-RS Whiteboard is eclipsing war app. (Was: Angular Test app gives HTTP ERROR 403)

Posted by Tim Ward <ti...@paremus.com>.
Hi Erwin,

Did you try configuring the Aries JAX-RS whiteboard to use a non-root context path? That would allow you to separate the JAX-RS whiteboard from other uses of the HTTP whiteboard, helping to avoid path conflicts. Note that this will also set up an isolated servlet context for your JAX-RS whiteboard (i.e. it will be separate from any other servlets using the HTTP whiteboard). This may or may not be helpful to you.

Best Regards,

Tim

> On 28 Jan 2020, at 00:52, Erwin Hogeweg <er...@me.com> wrote:
> 
> Hi -
> 
> The angular demo app is working fine after removing the app name from the Web-ContextPath in the pom.xml and from the outputPath in the angular.json file. But now of course the war application clashes with the default Aries JAX-RS Whiteboard application so index.html needs to be explicitly specified in the site URL.
> 
> karaf@root()> web:list
> ID  │ State       │ Web-State   │ Level │ Web-ContextPath │ Name
> ────┼─────────────┼─────────────┼───────┼─────────────────┼─────────────────────────────────────────────
> 242 │ Active      │ Deployed    │ 80    │ /               │ test-frontend (1.0.0.SNAPSHOT)
> 
> Although a bit clumsy that is no biggie when the entire thing runs behind an Apache2 server. I am still wondering though if there is a better (cleaner) way to resolve this.
> 
> 
> Cheers,
> 
> Erwin
> 
> 
>> On Jan 26, 2020, at 17:20, Erwin Hogeweg <erwin.hogeweg@me.com <ma...@me.com>> wrote:
>> 
>> I am making progress on this one but I am not out of the woods yet. It appears that there are at least (…) two issues to resolve.
>> 
>> 1. The newer versions of ng (I have 8.1.3) create a subdirectory under the dist folder (dist/test-frontend) when a new project is created with 'ng new test-frontend'.
>> 2. CORS prevents the scripts from being loaded. Adding "crossOrigin": "anonymous”, to the architect build options in angular.json files solve this (kinda), but now...
>> 3. … Current browser versions (Safari, Chrome) loose the context path on the URL for the resources. The browser tries to load http://localhost:8181/polyfills-es2015.js <http://localhost:8181/polyfills-es2015.js> instead of http://localhost:8181/angular-test/polyfills-es2015.js <http://localhost:8181/angular-test/polyfills-es2015.js>.
>> 
>> I feel I am running around in circles at the moment so I am going to let this ferment for a few days… If anyone has some suggestions in the mean time I would be delighted to hear.
>> 
>> 
>> Cheers,
>> 
>> Erwin
>> 
>> 
>>> On Jan 26, 2020, at 12:27, Erwin Hogeweg <erwin.hogeweg@me.com <ma...@me.com>> wrote:
>>> 
>>> Never mind… something is not right with the content of that jar file. I’ll dig a bit deeper.
>>> 
>>> Sorry for the noise.
>>> 
>>> Erwin
>>> 
>>> 
>>>> On Jan 26, 2020, at 12:11, Erwin Hogeweg <erwin.hogeweg@me.com <ma...@me.com>> wrote:
>>>> 
>>>> Hi -
>>>> 
>>>> I am trying to get JB's angular-test from here <http://blog.nanthrax.net/?p=827> running in 4.2.8 but I get a 403 (Forbidden) error. I tried with 4.2.6 as well and get the same result.
>>>> 
>>>> The app seems to be deployed properly and all the file system permissions appear to be correct as well.
>>>> 
>>>> 	11:56:48.697 INFO [paxweb-extender-4-thread-1] Started HttpServiceContext{httpContext=WebAppHttpContext{net.nanthrax.test-frontend - 118}}
>>>> 
>>>> 	karaf@root()> web:list
>>>> 	ID  │ State       │ Web-State   │ Level │ Web-ContextPath │ Name
>>>> 	────┼─────────────┼─────────────┼───────┼─────────────────┼───────────────────────────────
>>>> 	118 │ Active      │ Deployed    │ 80    │ /angular-test   │ test-frontend (1.0.0.SNAPSHOT)
>>>> 
>>>> 
>>>> Does anyone have a suggestion what I might be missing?
>>>> 
>>>> 
>>>> Cheers,
>>>> 
>>>> Erwin
>>> 
>> 
>