-
Notifications
You must be signed in to change notification settings - Fork 810
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
WW-4920 fix java.net.JarURLConnection#parseSpecs #209
Conversation
See also WW-4920
See also WW-4920
@@ -18,6 +18,8 @@ | |||
*/ | |||
package com.opensymphony.xwork2.util.fs; | |||
|
|||
import sun.net.www.ParseUtil; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sun.net.www.ParseUtil
Sure?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was what my Oracle JDK 7 also imports in it's java.net.JarURLConnection class! I now researched and saw OpenJDK, Oracle JDK 8 and 9 also is same. I see sun.net.www.ParseUtil is inside rt.jar of these JDKs. It looks like opensymphony package name in Struts.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Doesn't mean you should use it. ;) See Replace sun.net.www.ParseUtil#decode with public API and sun.net.www.ParseUtil.decode() vs java.net.URLDecoder.decode()
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice catch 👍 thanks! fixed.
@yasserzamani Is it still the same issue as in WW-4869? Maybe we just need to drop this fs stuff? We can refactor it later into its own plugin. |
@aleksandr-m , thank you for your comments and review. As Struts 2.5.15 is in I think WW-4869 isn't same. That was Struts itself issue but this one is either JDK issue or WebLogic issue. WebLogic reports jar as "zip:C:/..." but JDK's JarUrlConnection expects "zip:file:/C:/...". During my research I saw frameworks (e.g. Spring) also have such issue with WebLogic<->JDK. They adapted themselves with both by their own implementation as JDK and WebLogic are bully 😉 |
See also WW-4920
This is a bit over-engineered solution - basically the idea behind this solution (FileManager and so on) is to allow reload classes placed in a JAR (or ZIP in case of Weblogic) when working in Also, I was planning to drop this whole layer as it in mose case is useless. |
👍 So I think I can close this, right? because it seems Struts already warns a message and ignores when cannot handle. |
... and then closing WW-4920 as not a problem and continuing the release of 2.5.15. |
Nah... we can merge it as is, maybe someone is using it. I would double check if this happens only in |
👍 you're right. here is a good time to fix that also. In previous user reports, I remember this happens also in |
4b89034 has deleted /**
* Adds file to list of monitored files if {@link #setReloadingConfigs(boolean)} is true
*
* @param fileUrl {@link URL} to file to be monitored
*/
void monitorFile(URL fileUrl); I think we must revert this change (other changes of this commit looks good). I'm just worry about: //watch class file
if (isReloadEnabled()) {
URL classFile = actionClass.getResource(actionClass.getSimpleName() + ".class");
fileManager.monitorFile(classFile);
loadedFileUrls.add(classFile.toString());
} in Any way I feel OK to revert back that if statement and adding more heavy test covering all possible situations i.e. when that constant is set to true or false (two states) and when file is modified or not (two states) so total four states. @lukaszlenart , @apache/struts-committers ❓ |
Please do not mention |
I wonder ehy I am CC on this mail, I have no connection to struts.
rgds
jan i
On Mon, 19 Feb 2018 at 21:59, Yasser Zamani ***@***.***> wrote:
4b89034
<4b89034>
has deleted if (isReloadingConfigs()) { from all implemented
FileManager#monitorFile methods. This causes Struts to monitor all loaded
files always, regardless of if the value of STRUTS_CONFIGURATION_XML_RELOAD
= "struts.configuration.xml.reload" is true or false. i.e. Struts may
reload a file even when that constant is set to false because if
(revision == null) { is false and Struts will use monitored revision in
FileManager#fileNeedsReloading. As FileManager interface documents:
/** * Adds file to list of monitored files if ***@***.*** #setReloadingConfigs(boolean)} is true * * @param fileUrl ***@***.*** URL} to file to be monitored */
void monitorFile(URL fileUrl);
I think we must revert this change (other changes of this commit looks
good). I'm just worry about:
//watch class file
if (isReloadEnabled()) {
URL classFile = actionClass.getResource(actionClass.getSimpleName() + ".class");
fileManager.monitorFile(classFile);
loadedFileUrls.add(classFile.toString());
}
in \convention\PackageBasedActionConfigBuilder.java. This piece of code
seems expects monitorFile method always monitor but I think if it wants to
monitor .class files, then it must use it's own internal mechanism
because as documents say, the monitorFile method will monitor if STRUTS_CONFIGURATION_XML_RELOAD
= "struts.configuration.xml.reload" is set to true by user.
Any way I feel OK to revert back that if statement and adding more heavy
test covering all possible situations i.e. when that constant is set to
true or false (two states) and when file is modified or not (two states) so
total four states. @lukaszlenart <https://github.com/lukaszlenart> ,
@apache/apache-committers
<https://github.com/orgs/apache/teams/apache-committers> ❓
—
You are receiving this because you are on a team that was mentioned.
Reply to this email directly, view it on GitHub
<#209 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AF5hr14rsAvjLxg5VtoRTKIdDsvpGaPpks5tWeDGgaJpZM4SIJ5U>
.
--
Sent from My iPad, sorry for any misspellings.
|
unsubscribe |
Same here.
On Mon, Feb 19, 2018 at 4:02 PM, jan iversen <notifications@github.com>
wrote:
… I wonder ehy I am CC on this mail, I have no connection to struts.
rgds
jan i
On Mon, 19 Feb 2018 at 21:59, Yasser Zamani ***@***.***>
wrote:
> 4b89034
> <4b89034
6e9113d445>
> has deleted if (isReloadingConfigs()) { from all implemented
> FileManager#monitorFile methods. This causes Struts to monitor all loaded
> files always, regardless of if the value of STRUTS_CONFIGURATION_XML_
RELOAD
> = "struts.configuration.xml.reload" is true or false. i.e. Struts may
> reload a file even when that constant is set to false because if
> (revision == null) { is false and Struts will use monitored revision in
> FileManager#fileNeedsReloading. As FileManager interface documents:
>
> /** * Adds file to list of monitored files if ***@***.***
#setReloadingConfigs(boolean)} is true * * @param fileUrl ***@***.*** URL} to
file to be monitored */
> void monitorFile(URL fileUrl);
>
> I think we must revert this change (other changes of this commit looks
> good). I'm just worry about:
>
> //watch class file
> if (isReloadEnabled()) {
> URL classFile = actionClass.getResource(actionClass.getSimpleName() +
".class");
> fileManager.monitorFile(classFile);
> loadedFileUrls.add(classFile.toString());
> }
>
> in \convention\PackageBasedActionConfigBuilder.java. This piece of code
> seems expects monitorFile method always monitor but I think if it wants
to
> monitor .class files, then it must use it's own internal mechanism
> because as documents say, the monitorFile method will monitor if
STRUTS_CONFIGURATION_XML_RELOAD
> = "struts.configuration.xml.reload" is set to true by user.
>
> Any way I feel OK to revert back that if statement and adding more heavy
> test covering all possible situations i.e. when that constant is set to
> true or false (two states) and when file is modified or not (two states)
so
> total four states. @lukaszlenart <https://github.com/lukaszlenart> ,
> @apache/apache-committers
> <https://github.com/orgs/apache/teams/apache-committers> ❓
>
> —
> You are receiving this because you are on a team that was mentioned.
> Reply to this email directly, view it on GitHub
> <#209 (comment)>, or
mute
> the thread
> <https://github.com/notifications/unsubscribe-auth/
AF5hr14rsAvjLxg5VtoRTKIdDsvpGaPpks5tWeDGgaJpZM4SIJ5U>
> .
>
--
Sent from My iPad, sorry for any misspellings.
—
You are receiving this because you are on a team that was mentioned.
Reply to this email directly, view it on GitHub
<#209 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AADwoQGxqRPPA7RTACERGku5BPCG1dNGks5tWeGAgaJpZM4SIJ5U>
.
--
Darryl L. Pierce <mcpierce@gmail.com>
"Le centre du monde est partout." - Blaise Pascal
"Let's try and find some point of transcendence and leap together." - Gord
Downie
|
@apache/apache-committers , Ach! I'm really sorry 😭 github auto completed my at-sign 😢 please excuse me, sorry for inconvenience :( |
@yasserzamani Why have you done it again? Even if it is for saying sorry this is not appropriate for a group containing 2000 people! Please stop this! |
+1
To Yasser: Don't be so sloppy in future. Pay attention to what you're doing
and spare us all the annoyance.
…On Mon, Feb 19, 2018 at 4:11 PM, Konrad Windszus ***@***.***> wrote:
@yasserzamani <https://github.com/yasserzamani> Why have you done it
again? Even if it is for saying sorry this is not appropriate for a group
containing 2000 people! Please stop this!
—
You are receiving this because you are on a team that was mentioned.
Reply to this email directly, view it on GitHub
<#209 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AADwoWVjndt2Drv33pQKbQGmNh84E0CZks5tWeN_gaJpZM4SIJ5U>
.
--
Darryl L. Pierce <mcpierce@gmail.com>
"Le centre du monde est partout." - Blaise Pascal
"Let's try and find some point of transcendence and leap together." - Gord
Downie
|
I have created https://issues.apache.org/jira/browse/INFRA-16062 to have e-mails to team-apache turned off.
S.
… On Feb 19, 2018, at 1:13 PM, Darryl L. Pierce ***@***.***> wrote:
+1
To Yasser: Don't be so sloppy in future. Pay attention to what you're doing
and spare us all the annoyance.
On Mon, Feb 19, 2018 at 4:11 PM, Konrad Windszus ***@***.***>
wrote:
> @yasserzamani <https://github.com/yasserzamani> Why have you done it
> again? Even if it is for saying sorry this is not appropriate for a group
> containing 2000 people! Please stop this!
>
> —
> You are receiving this because you are on a team that was mentioned.
> Reply to this email directly, view it on GitHub
> <#209 (comment)>, or mute
> the thread
> <https://github.com/notifications/unsubscribe-auth/AADwoWVjndt2Drv33pQKbQGmNh84E0CZks5tWeN_gaJpZM4SIJ5U>
> .
>
--
Darryl L. Pierce ***@***.***>
"Le centre du monde est partout." - Blaise Pascal
"Let's try and find some point of transcendence and leap together." - Gord
Downie
—
You are receiving this because you are on a team that was mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.
{"api_version":"1.0","publisher":{"api_key":"05dde50f1d1a384dd78767c55493e4bb","name":"GitHub"},"entity":{"external_key":"github/apache/struts","title":"apache/struts","subtitle":"GitHub repository","main_image_url":"https://cloud.githubusercontent.com/assets/143418/17495839/a5054eac-5d88-11e6-95fc-7290892c7bb5.png","avatar_image_url":"https://cloud.githubusercontent.com/assets/143418/15842166/7c72db34-2c0b-11e6-9aed-b52498112777.png","action":{"name":"Open in ***@***.*** in #209: +1\n\nTo Yasser: Don't be so sloppy in future. Pay attention to what you're doing\nand spare us all the annoyance.\n\nOn Mon, Feb 19, 2018 at 4:11 PM, Konrad Windszus ***@***.***\u003e\nwrote:\n\n\u003e @yasserzamani \u003chttps://github.com/yasserzamani\u003e Why have you done it\n\u003e again? Even if it is for saying sorry this is not appropriate for a group\n\u003e containing 2000 people! Please stop this!\n\u003e\n\u003e —\n\u003e You are receiving this because you are on a team that was mentioned.\n\u003e Reply to this email directly, view it on GitHub\n\u003e \u003chttps://github.com/apache/struts/pull/209#issuecomment-366803587\u003e, or mute\n\u003e the thread\n\u003e \u003chttps://github.com/notifications/unsubscribe-auth/AADwoWVjndt2Drv33pQKbQGmNh84E0CZks5tWeN_gaJpZM4SIJ5U\u003e\n\u003e .\n\u003e\n\n\n\n-- \nDarryl L. Pierce ***@***.***\u003e\n\"Le centre du monde est partout.\" - Blaise Pascal\n\"Let's try and find some point of transcendence and leap together.\" - Gord\nDownie\n"}],"action":{"name":"View Pull Request","url":"#209 (comment)"}}}
--
sander@temme.net http://www.temme.net/sander/
PGP FP: BCD1 6D2C 8906 C48A 540E 253E 94D3 36A3 6D15 930A
|
@kwin Last time I checked apologizing for a fault and giving context to those wondering why they received unrelated mail could rightfully be considered polite and friendly. And yes, even for 2000 recipients. |
@rgielen, in defense for @kwin: he was pointing out that in @yasserzamani's apology he actually did re-mention the entire group again, causing the already unsubscribed people to be resubscribed yet again, if I get his point right. But anyway, these mistakes happen and if infra can do something about it from their side, it should be resolved for good in the future anyway. So no big deal IMO. |
Please stop perpetuating this conversation.
…On Mon, Feb 19, 2018 at 5:22 PM, René Gielen ***@***.***> wrote:
@kwin <https://github.com/kwin> Last time I checked apologizing for a
fault and giving context to those wondering why they received unrelated
mail could rightfully be considered polite and friendly. And yes, even for
2000 recipients.
@mcpierce <https://github.com/mcpierce> your harsh order to stop being
sloppy might feel suitable in some corporate environments. As an Apache
community and foundation member I would ask you to reconsider this
attitude. Raising awareness and being supportive to help avoiding future
mistakes is great. Finger pointing, blaming and patronizing is as much an
annoyance as mistakenly posting to 2000 users.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#209 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AADwoTQfhFJmnLMCxH9BPHbOcWMJ592rks5tWfQxgaJpZM4SIJ5U>
.
--
Darryl L. Pierce <mcpierce@gmail.com>
"Le centre du monde est partout." - Blaise Pascal
"Let's try and find some point of transcendence and leap together." - Gord
Downie
|
@Luke1410 point taken. But we should rather blame the tool and maybe our setup here instead of a person acting in good faith. |
unsubscribe
…Sent from my iPhone
On Feb 19, 2018, at 2:49 PM, René Gielen ***@***.***> wrote:
@Luke1410 point taken. But we should rather blame the tool and maybe our setup here instead of a person acting in good faith.
—
You are receiving this because you are on a team that was mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.
|
Please merge and/or delete this PR so 2,000 people don't have to manually mute the thread. |
I inspired such fix from Spring Framework when I found it during my research at here.
Oracle WebLogic may report jar urls like "zip:C:/web-app-lib-path/some-jar.jar" but JDK's JarURLConnection#parseSpecs breaks on such urls.
While JDK's JarURLConnection#parseSpecs is private then I had to extend URLConnection instead.
@apache/struts-committers , I hope we can deliver this fix in Struts 2.5.15 instead of 2.6, please (?)