struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Yasser Zamani <yasserzam...@apache.org>
Subject Re: BUG in struts-2.5.15
Date Thu, 15 Feb 2018 15:12:39 GMT


On 2/14/2018 7:13 PM, liemnguyen@ups.com.INVALID wrote:
> Hi all,
> 
> Testing your upcoming struts-2.5.15, when starting Weblogic server (Weblogic server version
12.2.1.2.0, JDK v 1.8.0_101), we see exception below.
> 
> Thanks,
> Liem.
> --------------------------------------------
> 
> 2018-02-14 10:28:37.194 WARN  - Could not create JarEntryRevision for [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]!
> java.net.MalformedURLException: unknown protocol: c
>                 at java.net.URL.<init>(URL.java:600) ~[?:1.8.0_101]
>                 at java.net.URL.<init>(URL.java:490) ~[?:1.8.0_101]
>                 at java.net.URL.<init>(URL.java:439) ~[?:1.8.0_101]
>                 at java.net.JarURLConnection.parseSpecs(JarURLConnection.java:175) ~[?:1.8.0_101]
>                 at java.net.JarURLConnection.<init>(JarURLConnection.java:158)
~[?:1.8.0_101]
>                 at com.opensymphony.xwork2.util.fs.StrutsJarURLConnection.<init>(StrutsJarURLConnection.java:44)
~[struts2-core.jar:2.5.15]
>                 at com.opensymphony.xwork2.util.fs.StrutsJarURLConnection.openConnection(StrutsJarURLConnection.java:99)
~[struts2-core.jar:2.5.15]
>                 at com.opensymphony.xwork2.util.fs.JarEntryRevision.build(JarEntryRevision.java:42)
[struts2-core.jar:2.5.15]
>                 at com.opensymphony.xwork2.util.fs.DefaultFileManager.monitorFile(DefaultFileManager.java:94)
[struts2-core.jar:2.5.15]


Hi Liem,

Thank you so much for your report and nice catch!

It seems weblogic is commerical and so I cannot try this myself then may
I ask you to run following code in your action then examine output and
reply me every line starting with "COPY ME:"?

import com.opensymphony.xwork2.util.ClassLoaderUtil;

    public String execute() throws Exception {
        Iterator<URL> strutsDefaultXmls =
ClassLoaderUtil.getResources("struts-default.xml", this.getClass(), true);
        while (strutsDefaultXmls.hasNext()) {
            URLConnection conn = strutsDefaultXmls.next().openConnection();
            System.out.println("COPY ME: " + conn.toString());
            conn.getInputStream().close();
        }

These two days I tried to make StrutsJarURLConnection even more
decoupled from container (e.g. weblogic) but could not pass tests so far :(

The issue is, JDK's JarURLConnection expects url of jars in
jar:<url>!/{entry} format but weblogic reports them as zip:C:/... then
JDK is going to convert C:/... to url then sees it does not know any
protocol named c.

So I'm interested to know if "conn.toString" above contains "jar" or not
i.e. does weblogic report them as jars or not.

I also would like to say it seems it's just a warning and does not block
your app functionality; Only "reloading configs runtime when jar
changes" won't work as expected.

Thanks in advance!


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Mime
View raw message