From dev-return-2232-apmail-juneau-dev-archive=juneau.apache.org@juneau.apache.org Thu Dec 13 00:59:47 2018 Return-Path: X-Original-To: apmail-juneau-dev-archive@minotaur.apache.org Delivered-To: apmail-juneau-dev-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 6C384187C7 for ; Thu, 13 Dec 2018 00:59:47 +0000 (UTC) Received: (qmail 3264 invoked by uid 500); 13 Dec 2018 00:59:47 -0000 Delivered-To: apmail-juneau-dev-archive@juneau.apache.org Received: (qmail 3225 invoked by uid 500); 13 Dec 2018 00:59:47 -0000 Mailing-List: contact dev-help@juneau.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@juneau.apache.org Delivered-To: mailing list dev@juneau.apache.org Received: (qmail 3196 invoked by uid 99); 13 Dec 2018 00:59:46 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd4-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 13 Dec 2018 00:59:46 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd4-us-west.apache.org (ASF Mail Server at spamd4-us-west.apache.org) with ESMTP id 2C36DC01C1 for ; Thu, 13 Dec 2018 00:59:46 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd4-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 1.809 X-Spam-Level: * X-Spam-Status: No, score=1.809 tagged_above=-999 required=6.31 tests=[DKIMWL_WL_MED=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, HTML_MESSAGE=2, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_PASS=-0.001, T_MIXED_ES=0.01, URIBL_BLOCKED=0.001, WEIRD_PORT=0.001] autolearn=disabled Authentication-Results: spamd4-us-west.apache.org (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd4-us-west.apache.org [10.40.0.11]) (amavisd-new, port 10024) with ESMTP id g4bSQnS_JEEf for ; Thu, 13 Dec 2018 00:59:43 +0000 (UTC) Received: from mail-wr1-f43.google.com (mail-wr1-f43.google.com [209.85.221.43]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTPS id 5A9EC5F359 for ; Thu, 13 Dec 2018 00:59:43 +0000 (UTC) Received: by mail-wr1-f43.google.com with SMTP id c14so292478wrr.0 for ; Wed, 12 Dec 2018 16:59:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to; bh=+3Ca45088e7YMv8zZWyAt1ZugbNI794nes5BVhwGWG8=; b=gTRvpjnXFiuRKowf96OQ1132a93U0fY28FS1iRmdoZFgHmtnkWylN193eO/L3H/PNP COqHJ5Qy4BhOWJSf/Pt2WMGWQgwa8jSvPaJhURqauHyXItu9SLLZmpU5a0PMN4mGjTKU u9D0NmiacleoURiD1bCIuhcg2l8DewAdYRofLCoj1zG7dbe8IUTTLYITa4kKQH0OngGU DeITYT9nn1qlbro+NrorEMirK/IrThj7zTDyv8LVQbkSoQft81yymPYASpII5sokxIvx znjeZkjEDA8rEr+pD6/g3dSxFXID+nHl6CW+5sr9NK8Ulxxa/UVu/d4yM5lZ2MXA5fBE jJOA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to; bh=+3Ca45088e7YMv8zZWyAt1ZugbNI794nes5BVhwGWG8=; b=a8FaEiMDDHBcEqTcnEp3tNd4RCXBGSy2zxDRc0FziUsKOuYURZiB0xqDzdlH9CO2RG kfVO+WcPiIBmnMLWrkuslVrSw0ItHL9ESzDEsGAUnua6Lmbwn7BmGXcBs/S9qKiDYlsr fnS8536L9TNagy7yRGLc3kTo8VfUN0zsJrcTKHOMBEnmVbYqhhpKpvp60O+9k4WW4O4o RuHQ+I0hdia1nl5Yef3WTKbIZtu+p1UWaIBtnCD3jdA1pFxGxScgZ2z/dlm5PCJmnGNV 36lLq7HQoD3/yT61zyrG2xVfeJVXl9aPOxgVFW1mYFnkSxOBUxUIyRBaEegibwo/xwvD VAeg== X-Gm-Message-State: AA+aEWZE5VRn6FSq1oHIwRqhH3kJ3KaFChPhnt0Z2+Dk2+QKfFWal4C5 KZKvRVtAsYYuIFuFII0gAICyMkQYkSk4TAS5Df35ygg= X-Google-Smtp-Source: AFSGD/Up5Kv9Bn3hWQhM3c484pfkDezy1n+9FKBlRbznODA1ID0kiYz6NcE0JN5GT3cArZYDghIfZl8Tx1+NI2DJN8Q= X-Received: by 2002:adf:9542:: with SMTP id 60mr18489173wrs.60.1544662781809; Wed, 12 Dec 2018 16:59:41 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: Gary Gregory Date: Wed, 12 Dec 2018 17:59:29 -0700 Message-ID: Subject: Re: Method 'GET' not found on resource with matching pattern on path '/htdocs/themes/devops.css'. To: dev@juneau.apache.org Content-Type: multipart/alternative; boundary="0000000000006859f7057cdcd4c2" --0000000000006859f7057cdcd4c2 Content-Type: text/plain; charset="UTF-8" On Wed, Dec 12, 2018 at 3:59 PM James Bognar wrote: > It was fixed in 8.0.0-SNAPSHOT 4 days ago, so if your snapshot is 10 > days old you're not going to have the fix. > > I just uploaded a 7.2.3-SNAPSHOT with the fix. Can you try it again? > > The files should be located in the following folder: > src/main/resources/files/htdocs > > Also, you shouldn't need staticFiles={"htdocs:htdocs"} on your > resource anymore. The staticFiles value is being defined by the > BasicRestConfig interface that your class is likely extending from. > James, I was able to depend and build with 7.2.3-SNAPSHOT but it still does not work. My class extends BasicRestServletJenaGroup like this: @RestResource( // @formatter:off path="/*", title="Access & Connectivity Agent Administration Microservice", description="Access & Connectivity Agent Administration Microservice", defaultRequestHeaders= { "Accept: application/json" }, serializers={ JsonSerializer.class, HtmlDocSerializer.class, HtmlStrippedDocSerializer.class, HtmlSchemaDocSerializer.class, SimpleJsonSerializer.class, JsonSchemaSerializer.class, XmlDocSerializer.class, XmlSchemaDocSerializer.class, UonSerializer.class, UrlEncodingSerializer.class, MsgPackSerializer.class, SoapXmlSerializer.class, PlainTextSerializer.class }, htmldoc=@HtmlDoc( head={ "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "" }, header={ "

$R{resourceTitle}

", "

$R{methodSummary,$R{servletDescription}}

", "" }, widgets={ ContentTypeMenuItem.class, ThemeMenuItem.class, PoweredByRocketSoftware.class }, navlinks={ "options: servlet:/?method=OPTIONS", "$W{ContentTypeMenuItem}" }, footer="$W{PoweredByRocketSoftware}" ), staticFiles={"htdocs:htdocs"}, children={ ConfigResource.class, LogsResource.class } // @formatter:on ) public class AdminRootResources extends BasicRestServletJenaGroup { Right now, I see my /admin page styled. If I remove staticFiles={"htdocs:htdocs"}, then /admin is not styled. On /admin clicking on "logs" displays an unstyled page. I have: src/main/resources/com/rs/seagull/httpmonitor/admin/htdocs/themes/devops.css and I "turned off" the other one like this: src/main/resources/org/apache/juneau/microservice2 (notice the "2") What else should I try? Gary On Wed, Dec 12, 2018 at 4:35 PM Gary Gregory wrote: > > > > On Wed, Dec 12, 2018 at 2:21 PM James Bognar > wrote: > >> > >> Yea, it should be at the following location to be picked up: > >> > >> > /src/main/resources/org/apache/juneau/microservice/resources/files/htdocs/themes/devops.css > >> > >> However, since you're getting a 500 error, it sounds like something > >> else is going on. > >> > >> The fix was made in 8.0. I'll have to create a branch off of 7.2.2 to > >> backport it. > > > > > > Right now, I am seeing the same behavior in 8.0.0-SNAPSHOT. I can test > 7.2.3-SNAPSHOT or 8.0.0-SNAPSHOT (which looks 10 days old), you tell me. > > > > With the following on my classpath: > > > > - > src/main/resources/com/rs/seagull/httpmonitor/admin/htdocs/themes/devops.css, > > - > src/main/resources/org/apache/juneau/microservice/resource/files/htdocs/themes/devops.css > > - > src/main/resources/org/apache/juneau/microservice/resource/files/htdocs/devops.css > > > > my /admin page is styled but admin/logs is not. > > > > Without the files, nothing is styled. > > > > Gary > > > > > >> > >> On Wed, Dec 12, 2018 at 4:19 PM Gary Gregory > wrote: > >> > > >> > > >> > > >> > On Wed, Dec 12, 2018 at 2:01 PM James Bognar > wrote: > >> >> > >> >> I think you may be hitting a bug I recently found and fixed in > >> >> ClasspathResourceFinderSimple. For the LogsResource class, it's only > >> >> going to look on the classpath at the location > >> >> "org/apache.juneau/microservice/resource/files/htdocs". > >> >> > >> > > >> > Is there really a dot in the folder name in > "org/apache.juneau/microservice/resource/files/htdocs"? As opposed to > "org/apache/juneau/microservice/resource/files/htdocs". > >> > > >> > But... if I add the files to my project where /src/main/resources/ is > on the classpath in Eclipse: > >> > > >> > > /src/main/resources/org/apache/juneau/microservice/resource/files/htdocs/themes/devops.css > >> > > /src/main/resources/org/apache/juneau/microservice/resource/files/htdocs/devops.css > >> > > >> > The file is still not served. > >> > > >> > You are saying that this should work without your fix? > >> > > >> > Should I try 7.2.3-SNAPSHOT? > >> > > >> > Gary > >> > > >> > > >> >> > >> >> If you need the files folder to be in the jar, I can fix it in the > 7.2 > >> >> branch and cut a 7.2.3 release. I'll also see if I can reproduce > that > >> >> 500 error. > >> >> > >> >> On Wed, Dec 12, 2018 at 3:49 PM James Bognar > wrote: > >> >> > > >> >> > Is that the org.apache.juneau.microservice.resources.LogsResource > class? > >> >> > > >> >> > A 500 error definitely sounds like something is wrong. If it can't > >> >> > find the file, it should be a 404. > >> >> > > >> >> > How this works is that the BasicRestConfig interface defines the > >> >> > following annotation: > >> >> > @RestResource( > >> >> > staticFiles="$C{REST/staticFiles}" > >> >> > ) > >> >> > > >> >> > Then the config file defines the following: > >> >> > [REST] > >> >> > # URL mappings to static files in the working directory or > classpath. > >> >> > staticFiles = htdocs:files/htdocs > >> >> > > >> >> > So when a request is sent to /admin/logs/htdocs/..., it gets > >> >> > intercepted by our resource at /admin/logs which checks to see if > the > >> >> > remainder /htdocs/... matches one of our static file mappings. If > it > >> >> > does, it tries to find that file in the working directory > >> >> > "files/htdocs", or in the classpath "files/htdocs". If it can't > find > >> >> > the file then it should return a 404. > >> >> > > >> >> > Out of curiosity, what happens if you place it in the following > >> >> > location in your classpath? > >> >> > "org/apache.juneau/microservice/resource/files/htdocs/devops.css" > >> >> > On Wed, Dec 12, 2018 at 3:36 PM Gary Gregory < > garydgregory@gmail.com> wrote: > >> >> > > > >> >> > > On Wed, Dec 12, 2018 at 1:35 PM Gary Gregory < > garydgregory@gmail.com> wrote: > >> >> > >> > >> >> > >> On Wed, Dec 12, 2018 at 1:26 PM Gary Gregory < > garydgregory@gmail.com> wrote: > >> >> > >>> > >> >> > >>> On Wed, Dec 12, 2018 at 1:08 PM James Bognar < > jamesbognar@apache.org> wrote: > >> >> > >>>> > >> >> > >>>> Hi Gary, > >> >> > >>>> > >> >> > >>>> Two things to check: > >> >> > >>>> 1) What's the path on the root resource? Is it "/*"? If > it's "/", > >> >> > >>>> then subpaths are not going to be picked up. > >> >> > >>> > >> >> > >>> > >> >> > >>> I have: > >> >> > >>> > >> >> > >>> @RestResource( > >> >> > >>> path="/", > >> >> > >>> ... > >> >> > >>> > >> >> > >>> changing that to "/*" does not help :-( but... > >> >> > >>> > >> >> > >>> 2) Make sure you have this /files directory in your working > directory: > >> >> > >>>> > >> >> > >>>> > https://github.com/apache/juneau/tree/juneau-7.2.2/juneau-microservice/juneau-microservice-template/files > >> >> > >>>> The files were moved outside the classpath to make it easier > to make > >> >> > >>>> modifications. They can also be placed in the root of the > jar, but by > >> >> > >>>> default are being kept outside the jar. > >> >> > >>> > >> >> > >>> > >> >> > >>> If I copy the folders and files from > >> >> > >>> > >> >> > >>> > https://github.com/apache/juneau/tree/juneau-7.2.2/juneau-microservice/juneau-microservice-template/files > >> >> > >>> > >> >> > >>> into my Eclipse/Maven project at > >> >> > >>> > >> >> > >>> src/main/resources/com/rs/seagull/httpmonitor/admin/htdocs > >> >> > >>> > >> >> > >>> for my @RestResource class > com.rs.seagull.httpmonitor.admin.AdminRootResources, then my main page at > /admin is now styled (good) but when I click on the built-in "logs" link, > then _that_ page is not styled. > >> >> > >>> > >> >> > >>> So I copied devops.css to src/main/resources but that does not > help. > >> >> > >>> > >> >> > >>> What am I missing? > >> >> > >> > >> >> > >> > >> >> > >> A few more details. I embed Jetty and use a jetty.xml to map > /admin to com.rs.seagull.httpmonitor.admin.AdminRootResources > >> >> > >> > >> >> > >> For the logs page, the browser requests > http://localhost:9193/admin/logs/htdocs/themes/devops.css and does not > find it. > >> >> > > > >> >> > > > >> >> > > The server returns a 500 which is odd, as opposed to a 404. > >> >> > > > >> >> > > Gary > >> >> > > > >> >> > >> > >> >> > >> > >> >> > >> Where is logs/htdocs/themes/devops.css supposed to be mapped? > >> >> > >> > >> >> > >> Gary > >> >> > >> > >> >> > >>> > >> >> > >>> Thank you, > >> >> > >>> Gary > >> >> > >>> > >> >> > >>> > >> >> > >>>> On Wed, Dec 12, 2018 at 2:52 PM Gary Gregory < > garydgregory@gmail.com> wrote: > >> >> > >>>> > > >> >> > >>>> > Hi James and all: > >> >> > >>>> > > >> >> > >>>> > We embed juneau-microservice-server 7.2.2 programatically > and when a browser displays a page, it has NO styling and the server > console shows: > >> >> > >>>> > > >> >> > >>>> > [2018.12.12 12:41:37 WARNING] [4579979f.404.1] HTTP GET 404 > /admin/htdocs/themes/devops.css, Method 'GET' not found on resource with > matching pattern on path '/htdocs/themes/devops.css'. > >> >> > >>>> > > >> >> > >>>> > We have a demo upcoming and the lack of styling looks > _really_ bad :-( > >> >> > >>>> > > >> >> > >>>> > Has something changed since 7.1.0 to cause this? Can I > change _something_ in our server to pickup the stylesheet? > >> >> > >>>> > > >> >> > >>>> > For us to revert to 7.1.0 would mean some code changes :-( > >> >> > >>>> > > >> >> > >>>> > Thank you, > >> >> > >>>> > Gary > --0000000000006859f7057cdcd4c2 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
On Wed, Dec 12, 2018 = at 3:59 PM James Bognar <james= bognar@apache.org> wrote:
It was fixed in 8.0.0-SNAPSHOT 4 days ago, so if your snap= shot is 10
days old you're not going to have the fix.

I just uploaded a 7.2.3-SNAPSHOT with the fix.=C2=A0 Can you try it again?<= br>
The files should be located in the following folder:
src/main/resources/files/htdocs

Also, you shouldn't need staticFiles=3D{"htdocs:htdocs"} on y= our
resource anymore.=C2=A0 The staticFiles value is being defined by the
BasicRestConfig interface that your class is likely extending from.

James,

I was able to = depend and build with 7.2.3-SNAPSHOT but it still does not work.
= My class extends=C2=A0BasicRestServletJenaGroup like this:

@RestResource(
// @formatter:off
path=3D"/*",
title=3D"Access & Connectivity Agent= Administration Microservice",
description=3D"Access & Connectivity Agent Administrati= on Microservice",
=C2=A0 =C2=A0 =C2=A0 =C2=A0 defaultRequest= Headers=3D {
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 "Accept: application/json"
},
=C2=A0 =C2=A0 =C2=A0 =C2=A0 serializers=3D{
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 JsonSeriali= zer.class,
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 HtmlDocSerializer.class,
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 HtmlStrippedDocSerializer.class,
=C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 HtmlSchemaDocSerializer.class= ,
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 SimpleJ= sonSerializer.class,
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 JsonSchemaSerializer.class,
=C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 XmlDocSerializer.class,
=C2=A0= =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 XmlSchemaDocSerializer.cl= ass,
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 UonS= erializer.class,
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A0 UrlEncodingSerializer.class,
=C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 MsgPackSerializer.class,
=C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 SoapXmlSerializer.class,
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 PlainTextSeri= alizer.class
=C2=A0 =C2=A0 =C2=A0 =C2=A0 },
htmldoc=3D@HtmlDoc(
=C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 head=3D{
=C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 "= ;<link rel=3D'apple-touch-icon' sizes=3D'57x57' href=3D&= #39;$U{servlet:/htdocs/images/apple-icon-57x57.png}'/>",
<= div>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 "<link rel=3D'apple-touch-icon' sizes=3D'= 60x60' href=3D'$U{servlet:/htdocs/images/apple-icon-60x60.png}'= />",
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 "<link rel=3D'apple-touch-icon&= #39; sizes=3D'72x72' href=3D'$U{servlet:/htdocs/images/apple-ic= on-72x72.png}'/>",
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 "<link rel=3D'= ;apple-touch-icon' sizes=3D'76x76' href=3D'$U{servlet:/htdo= cs/images/apple-icon-76x76.png}'/>",
=C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 "= ;<link rel=3D'apple-touch-icon' sizes=3D'114x114' href= =3D'$U{servlet:/htdocs/images/apple-icon-114x114.png}'/>",<= /div>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 "<link rel=3D'apple-touch-icon' sizes= =3D'120x120' href=3D'$U{servlet:/htdocs/images/apple-icon-120x1= 20.png}'/>",
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 "<link rel=3D'app= le-touch-icon' sizes=3D'144x144' href=3D'$U{servlet:/htdocs= /images/apple-icon-144x144.png}'/>",
=C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 "= ;<link rel=3D'apple-touch-icon' sizes=3D'152x152' href= =3D'$U{servlet:/htdocs/images/apple-icon-152x152.png}'/>",<= /div>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 "<link rel=3D'apple-touch-icon' sizes= =3D'180x180' href=3D'$U{servlet:/htdocs/images/apple-icon-180x1= 80.png}'/>",
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 "<link rel=3D'ico= n' type=3D'image/png' sizes=3D'192x192'=C2=A0 href=3D&#= 39;$U{servlet:/htdocs/images/android-icon-192x192.png}'/>",
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 "<link rel=3D'icon' type=3D'image/png= ' sizes=3D'32x32' href=3D'$U{servlet:/htdocs/images/favicon= -32x32.png}'/>",
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 "<link rel=3D'= icon' type=3D'image/png' sizes=3D'96x96' href=3D'$U= {servlet:/htdocs/images/favicon-96x96.png}'/>",
=C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 "<link rel=3D'icon' type=3D'image/png' sizes= =3D'16x16' href=3D'$U{servlet:/htdocs/images/favicon-16x16.png}= '/>",
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 "<link rel=3D'icon' = type=3D'image/png' href=3D'$U{servlet:/htdocs/images/favicon.pn= g}' />",
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 "<link rel=3D'shortcu= t icon' href=3D'$U{servlet:/htdocs/favicon.ico}' />",
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 "<link rel=3D'manifest' href=3D'$U{se= rvlet:/htdocs/manifest.json}'/>",
=C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 "&l= t;meta name=3D'msapplication-TileColor' content=3D'#ffffff'= />",
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 "<meta name=3D'msapplication-Ti= leImage' content=3D'$U{servlet:/htdocs/images/ms-icon-144x144.png}&= #39;/>",
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 "<meta name=3D'theme-color&= #39; content=3D'#ffffff'/>"
=C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 },
=C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A0 =C2=A0 =C2=A0 =C2=A0 header=3D{
=C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 "<h1>= ;$R{resourceTitle}</h1>",
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 "&= lt;h2>$R{methodSummary,$R{servletDescription}}</h2>",
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 "<a href=3D'https://www.rocketsoftware.com'><img src=3D&= #39;$U{servlet:/htdocs/images/ram.png}' style=3D'position:absolute;= top:5;right:5;background-color:transparent;height:30px'/></a>&= quot;
=C2=A0 =C2=A0 =C2= =A0 =C2=A0 },
widgets=3D= {
ContentTypeMenuItem.c= lass,
ThemeMenuItem.cla= ss,
PoweredByRocketSoft= ware.class
},
= navlinks=3D{
"options: servlet:/?method=3DOPTIONS&qu= ot;,
=C2=A0 =C2=A0 =C2= =A0 =C2=A0 "$W{ContentTypeMenuItem}"
},
footer=3D"$W{PoweredByRocketSoftware}"
),
staticFiles=3D{"htdocs:htdocs"},
children=3D{
ConfigResource.class,
= LogsResource.class
}
// @formatter:on
)
public class AdminRoo= tResources extends BasicRestServletJenaGroup {

Right now, I see my /admin page styled.
If I remove staticFile= s=3D{"htdocs:htdocs"}, then /admin is not styled.
On /a= dmin clicking on "logs" displays an unstyled page.
I ha= ve:
src/main/resources/com/rs/seagull/httpmonitor/admin/htdocs/th= emes/devops.css
and I "turned off" the other one li= ke this:=C2=A0src/main/resources/org/apache/juneau/microservice2 (notice th= e "2")

What else should I try?

Gary


On Wed, Dec 12, 2018 at 4:35 PM Gary Gregory <garydgregory@gmail.com> wrote:
>
> On Wed, Dec 12, 2018 at 2:21 PM James Bognar <jamesbognar@apache.org> wrote= :
>>
>> Yea, it should be at the following location to be picked up:
>>
>> /src/main/resources/org/apache/juneau/microservice/resources/files= /htdocs/themes/devops.css
>>
>> However, since you're getting a 500 error, it sounds like some= thing
>> else is going on.
>>
>> The fix was made in 8.0.=C2=A0 I'll have to create a branch of= f of 7.2.2 to
>> backport it.
>
>
> Right now, I am seeing the same behavior in 8.0.0-SNAPSHOT. I can test= 7.2.3-SNAPSHOT or 8.0.0-SNAPSHOT (which looks 10 days old), you tell me. >
> With the following on my classpath:
>
> - src/main/resources/com/rs/seagull/httpmonitor/admin/htdocs/themes/de= vops.css,
> - src/main/resources/org/apache/juneau/microservice/resource/files/htd= ocs/themes/devops.css
> - src/main/resources/org/apache/juneau/microservice/resource/files/htd= ocs/devops.css
>
> my /admin page is styled but admin/logs is not.
>
> Without the files, nothing is styled.
>
> Gary
>
>
>>
>> On Wed, Dec 12, 2018 at 4:19 PM Gary Gregory <garydgregory@gmail.com> w= rote:
>> >
>> >
>> >
>> > On Wed, Dec 12, 2018 at 2:01 PM James Bognar <jamesbognar@apache.org&= gt; wrote:
>> >>
>> >> I think you may be hitting a bug I recently found and fix= ed in
>> >> ClasspathResourceFinderSimple.=C2=A0 For the LogsResource= class, it's only
>> >> going to look on the classpath at the location
>> >> "org/apache.juneau/microservice/resource/files/htdoc= s".
>> >>
>> >
>> > Is there really a dot in the folder name in "org/apache.= juneau/microservice/resource/files/htdocs"? As opposed to "org/ap= ache/juneau/microservice/resource/files/htdocs".
>> >
>> > But... if I add the files to my project where /src/main/resou= rces/ is on the classpath in Eclipse:
>> >
>> > /src/main/resources/org/apache/juneau/microservice/resource/f= iles/htdocs/themes/devops.css
>> > /src/main/resources/org/apache/juneau/microservice/resource/f= iles/htdocs/devops.css
>> >
>> > The file is still not served.
>> >
>> > You are saying that this should work without your fix?
>> >
>> > Should I try 7.2.3-SNAPSHOT?
>> >
>> > Gary
>> >
>> >
>> >>
>> >> If you need the files folder to be in the jar, I can fix = it in the 7.2
>> >> branch and cut a 7.2.3 release.=C2=A0 I'll also see i= f I can reproduce that
>> >> 500 error.
>> >>
>> >> On Wed, Dec 12, 2018 at 3:49 PM James Bognar <jamesbognar@gmail.com> wrote:
>> >> >
>> >> > Is that the org.apache.juneau.microservice.resources= .LogsResource class?
>> >> >
>> >> > A 500 error definitely sounds like something is wron= g.=C2=A0 If it can't
>> >> > find the file, it should be a 404.
>> >> >
>> >> > How this works is that the BasicRestConfig interface= defines the
>> >> > following annotation:
>> >> >=C2=A0 =C2=A0 @RestResource(
>> >> >=C2=A0 =C2=A0 =C2=A0 =C2=A0staticFiles=3D"$C{RES= T/staticFiles}"
>> >> >=C2=A0 =C2=A0 )
>> >> >
>> >> > Then the config file defines the following:
>> >> >=C2=A0 =C2=A0 [REST]
>> >> >=C2=A0 =C2=A0 # URL mappings to static files in the w= orking directory or classpath.
>> >> >=C2=A0 =C2=A0 staticFiles =3D htdocs:files/htdocs
>> >> >
>> >> > So when a request is sent to /admin/logs/htdocs/...,= it gets
>> >> > intercepted by our resource at /admin/logs which che= cks to see if the
>> >> > remainder /htdocs/... matches one of our static file= mappings.=C2=A0 If it
>> >> > does, it tries to find that file in the working dire= ctory
>> >> > "files/htdocs", or in the classpath "= files/htdocs".=C2=A0 If it can't find
>> >> > the file then it should return a 404.
>> >> >
>> >> > Out of curiosity, what happens if you place it in th= e following
>> >> > location in your classpath?
>> >> > "org/apache.juneau/microservice/resource/files/= htdocs/devops.css"
>> >> > On Wed, Dec 12, 2018 at 3:36 PM Gary Gregory <
garydgregory@gmail= .com> wrote:
>> >> > >
>> >> > > On Wed, Dec 12, 2018 at 1:35 PM Gary Gregory &l= t;garydgregory@= gmail.com> wrote:
>> >> > >>
>> >> > >> On Wed, Dec 12, 2018 at 1:26 PM Gary Gregor= y <garydgreg= ory@gmail.com> wrote:
>> >> > >>>
>> >> > >>> On Wed, Dec 12, 2018 at 1:08 PM James B= ognar <james= bognar@apache.org> wrote:
>> >> > >>>>
>> >> > >>>> Hi Gary,
>> >> > >>>>
>> >> > >>>> Two things to check:
>> >> > >>>> 1) What's the path on the root = resource?=C2=A0 Is it "/*"?=C2=A0 If it's "/",
>> >> > >>>> then subpaths are not going to be p= icked up.
>> >> > >>>
>> >> > >>>
>> >> > >>> I have:
>> >> > >>>
>> >> > >>> @RestResource(
>> >> > >>> path=3D"/",
>> >> > >>> ...
>> >> > >>>
>> >> > >>> changing that to "/*" does no= t help :-( but...
>> >> > >>>
>> >> > >>>=C2=A0 2) Make sure you have this /files= directory in your working directory:
>> >> > >>>>
>> >> > >>>> https://github.com/apache/june= au/tree/juneau-7.2.2/juneau-microservice/juneau-microservice-template/files=
>> >> > >>>> The files were moved outside the cl= asspath to make it easier to make
>> >> > >>>> modifications.=C2=A0 They can also = be placed in the root of the jar, but by
>> >> > >>>> default are being kept outside the = jar.
>> >> > >>>
>> >> > >>>
>> >> > >>> If I copy the folders and files from >> >> > >>>
>> >> > >>> https://github.com/apache/juneau/t= ree/juneau-7.2.2/juneau-microservice/juneau-microservice-template/files=
>> >> > >>>
>> >> > >>> into my Eclipse/Maven project at
>> >> > >>>
>> >> > >>> src/main/resources/com/rs/seagull/httpm= onitor/admin/htdocs
>> >> > >>>
>> >> > >>> for my @RestResource class com.rs.seagu= ll.httpmonitor.admin.AdminRootResources, then my main page at /admin is now= styled (good) but when I click on the built-in "logs" link, then= _that_ page is not styled.
>> >> > >>>
>> >> > >>> So I copied devops.css to src/main/reso= urces but that does not help.
>> >> > >>>
>> >> > >>> What am I missing?
>> >> > >>
>> >> > >>
>> >> > >> A few more details. I embed Jetty and use a= jetty.xml to map /admin to com.rs.seagull.httpmonitor.admin.AdminRootResou= rces
>> >> > >>
>> >> > >> For the logs page, the browser requests http://localhost:9193/admin/logs/htdocs/themes= /devops.css and does not find it.
>> >> > >
>> >> > >
>> >> > > The server returns a 500 which is odd, as oppos= ed to a 404.
>> >> > >
>> >> > > Gary
>> >> > >
>> >> > >>
>> >> > >>
>> >> > >> Where is logs/htdocs/themes/devops.css supp= osed to be mapped?
>> >> > >>
>> >> > >> Gary
>> >> > >>
>> >> > >>>
>> >> > >>> Thank you,
>> >> > >>> Gary
>> >> > >>>
>> >> > >>>
>> >> > >>>> On Wed, Dec 12, 2018 at 2:52 PM Gar= y Gregory <g= arydgregory@gmail.com> wrote:
>> >> > >>>> >
>> >> > >>>> > Hi James and all:
>> >> > >>>> >
>> >> > >>>> > We embed juneau-microservice-s= erver 7.2.2 programatically and when a browser displays a page, it has NO s= tyling and the server console shows:
>> >> > >>>> >
>> >> > >>>> > [2018.12.12 12:41:37 WARNING] = [4579979f.404.1] HTTP GET 404 /admin/htdocs/themes/devops.css, Method '= GET' not found on resource with matching pattern on path '/htdocs/t= hemes/devops.css'.
>> >> > >>>> >
>> >> > >>>> > We have a demo upcoming and th= e lack of styling looks _really_ bad :-(
>> >> > >>>> >
>> >> > >>>> > Has something changed since 7.= 1.0 to cause this? Can I change _something_ in our server to pickup the sty= lesheet?
>> >> > >>>> >
>> >> > >>>> > For us to revert to 7.1.0 woul= d mean some code changes :-(
>> >> > >>>> >
>> >> > >>>> > Thank you,
>> >> > >>>> > Gary
--0000000000006859f7057cdcd4c2--