Yasser Zamani,

Run your test codes below:
import com.opensymphony.xwork2.util.ClassLoaderUtil;
import com.opensymphony.xwork2.util.fs.JarEntryRevision;
import com.opensymphony.xwork2.util.fs.Revision;

private void testStruts2_2()
{
  try {
    Iterator<URL> strutsDefaultXmls = 
ClassLoaderUtil.getResources("struts-default.xml", this.getClass(), true);
    while (strutsDefaultXmls.hasNext())
    {

      URL url = strutsDefaultXmls.next();
      URL url2 = new URL(url.getProtocol(), url.getHost(), url.getPort(), 
"file:/" + url.getFile());
      System.out.println("COPY ME, url2.toString=" + url2.toString());
      Revision r = JarEntryRevision.build(url2);
      System.out.println("COPY ME: " + r.needsReloading());

    }

  } catch (Exception e) {
    e.printStackTrace();
  }

}

Here is the output:
COPY ME, 
url2.toString=zip:file:/C:/Oracle/Middleware/Oracle_Home12.2.1.0.0/user_projects/domains/iwa_local_domain/servers/AdminServer/tmp/_WL_user/IWA/zfd81u/war/WEB-INF/lib/struts2-core.jar!/struts-default.xml
COPY ME: false




  *   From: Yasser Zamani <y...@apache.org>
Subject: Re: BUG in struts-2.5.15
Date: 2018/02/16 06:44:07
List: 
user@struts.apache.org<https://lists.apache.org/list.html?user@struts.apache.org>


*





On 2/15/2018 7:32 PM, liemngu...@ups.com.INVALID wrote:

> Here is the output:

>

> COPY ME:

> weblogic.utils.zip.ZipURLConnection:zip:C:/Oracle/Middleware/Oracle_Home12.2.1.0.0/user_projects/domains/iwa_local_domain/servers/AdminServer/tmp/_WL_user/IWA/zfd81u/war/WEB-INF/lib/struts2-core.jar!/struts-default.xml

>



Thanks! I have a candidate solution (correcting url to "file:/" when

protocol is empty; like Spring Framework [1]) but my JDK here then says

"Unknown protocol: zip". Could you please also run following block to

see if your context there already knows zip protocol?



import com.opensymphony.xwork2.util.ClassLoaderUtil;

import com.opensymphony.xwork2.util.fs.JarEntryRevision;

import com.opensymphony.xwork2.util.fs.Revision;

        Iterator<URL> strutsDefaultXmls =



    public String execute() throws Exception {

ClassLoaderUtil.getResources("struts-default.xml", this.getClass(), true);

        while (strutsDefaultXmls.hasNext()) {

            URL url = strutsDefaultXmls.next();

            URL url2 = new URL(url.getProtocol(), url.getHost(),

url.getPort(), "file:/" + url.getFile());

            Revision r = JarEntryRevision.build(url2);

            System.out.println("COPY ME: " + r.needsReloading());

        }

Reply via email to