From issues-return-32680-archive-asf-public=cust-asf.ponee.io@struts.apache.org Wed Nov 21 07:34:05 2018 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx-eu-01.ponee.io (Postfix) with SMTP id C65A6180668 for ; Wed, 21 Nov 2018 07:34:04 +0100 (CET) Received: (qmail 7068 invoked by uid 500); 21 Nov 2018 06:34:03 -0000 Mailing-List: contact issues-help@struts.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@struts.apache.org Delivered-To: mailing list issues@struts.apache.org Received: (qmail 7058 invoked by uid 99); 21 Nov 2018 06:34:03 -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; Wed, 21 Nov 2018 06:34:03 +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 515C1C21B3 for ; Wed, 21 Nov 2018 06:34:03 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd4-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -109.501 X-Spam-Level: X-Spam-Status: No, score=-109.501 tagged_above=-999 required=6.31 tests=[ENV_AND_HDR_SPF_MATCH=-0.5, KAM_ASCII_DIVIDERS=0.8, RCVD_IN_DNSWL_MED=-2.3, SPF_PASS=-0.001, USER_IN_DEF_SPF_WL=-7.5, USER_IN_WHITELIST=-100] autolearn=disabled Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd4-us-west.apache.org [10.40.0.11]) (amavisd-new, port 10024) with ESMTP id oGYZ7-FJC6nb for ; Wed, 21 Nov 2018 06:34:02 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTP id 2640E60E68 for ; Wed, 21 Nov 2018 06:34:01 +0000 (UTC) Received: from jira-lw-us.apache.org (unknown [207.244.88.139]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id 5D540E0110 for ; Wed, 21 Nov 2018 06:34:00 +0000 (UTC) Received: from jira-lw-us.apache.org (localhost [127.0.0.1]) by jira-lw-us.apache.org (ASF Mail Server at jira-lw-us.apache.org) with ESMTP id 1D40621363 for ; Wed, 21 Nov 2018 06:34:00 +0000 (UTC) Date: Wed, 21 Nov 2018 06:34:00 +0000 (UTC) From: "Yasser Zamani (JIRA)" To: issues@struts.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Resolved] (WW-4984) Static files like css and js files in struts-core not properly served MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/WW-4984?page=3Dcom.atlassian.j= ira.plugin.system.issuetabpanels:all-tabpanel ] Yasser Zamani resolved WW-4984. ------------------------------- Resolution: Fixed > Static files like css and js files in struts-core not properly served > --------------------------------------------------------------------- > > Key: WW-4984 > URL: https://issues.apache.org/jira/browse/WW-4984 > Project: Struts 2 > Issue Type: Bug > Components: Core > Affects Versions: 2.5.18 > Reporter: Daniel Le Berre > Assignee: Yasser Zamani > Priority: Major > Fix For: 2.5.19 > > > While preparing a=C2=A0small demo of struts2 for my students I was annoye= d that error messages were not shown in red. > While investigating why, I noticed a lot of errors like this in the conso= le: > {code:java} > GRAVE: "Servlet.service()" pour la servlet [default] a g=C3=A9n=C3=A9r=C3= =A9 une exception > java.lang.NullPointerException > at org.apache.struts2.dispatcher.DefaultStaticContentLoader.findStaticRes= ource(DefaultStaticContentLoader.java:199) > at org.apache.struts2.dispatcher.ExecuteOperations.executeStaticResourceR= equest(ExecuteOperations.java:59) > at org.apache.struts2.dispatcher.filter.StrutsPrepareAndExecuteFilter.doF= ilter(StrutsPrepareAndExecuteFilter.java:128) > at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appli= cationFilterChain.java:193) > at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFi= lterChain.java:166) > at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperVa= lve.java:199) > at org.apache.catalina.core.StandardContextValve.invoke(StandardContextVa= lve.java:96) > at org.apache.catalina.authenticator.AuthenticatorBase.invoke(Authenticat= orBase.java:490) > at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.ja= va:139) > at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.ja= va:92) > at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAcces= sLogValve.java:668) > at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValv= e.java:74) > at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java= :343) > at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:= 408) > at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLigh= t.java:66) > at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractP= rotocol.java:770) > at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoi= nt.java:1415) > at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase= .java:49) > at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPool= Executor.java:1167) > at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoo= lExecutor.java:641) > at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThr= ead.java:61) > at java.base/java.lang.Thread.run(Thread.java:844) > {code} > =C2=A0 > While looking at the HTML source of the page and web inspector of my brow= ser, I also noted that three ressources were not found in that page: > =C2=A0 > {code:java} > /struts/utils.js =C2=A0 > /struts/css_xhtml/styles.css > /struts/css_xhtml/validation.js > {code} > =C2=A0 > =C2=A0 > AFAIK, those resources should be served by default from struts-core jar f= ile because=C2=A0 > {code:java} > {code} > by default. > I could check that setting that constant to false prevents the NPE to occ= ur. > I was able to find the three=C2=A0files in struts-core jar file. > I could check that copying those files in my webapp with the constant to = false fixed my=C2=A0css issue regarding error messages. > So the NPE is related IMHO to=C2=A0 DefaultStaticContentLoader not being = able to locate correctly the resources in the jar. I do not know why. -- This message was sent by Atlassian JIRA (v7.6.3#76005)