Skip to content
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

[PAYARA-3662] fixing glassfish-web.xml contextroot overwrite #3831

Merged
merged 5 commits into from
Mar 19, 2019

Conversation

cubastanley
Copy link
Contributor

Unfortunately git has tracked the changes in formatting that ended up coming into existence, the only physical changes I've made to the code are I the deployAll() method from line 1530 onwards

@@ -14,7 +14,6 @@
* limitations under the License.
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes to this file can be ignored

Copy link

@rdebusscher rdebusscher left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@cubastanley With reproducer, context root from glassfish-web.xml is still ignored.

if (war.getName().startsWith("ROOT.")) {
deployer.deploy(war, "--availabilityenabled=true", "--force=true", "--contextroot=/", "--loadOnly", "true");
} else {
deployer.deploy(war, "--availabilityenabled=true", "--force=true", "--loadOnly", "true", "--contextroot", deployContext);
if(deployContext == null) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

deployContext is never null since it is set earlier from the war name.

Copy link
Contributor Author

@cubastanley cubastanley Mar 13, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@smillidge regarding this, what's the purpose of the deployContext variable? It seems in these cases it would be more beneficial to just use contextRoot directly?

@rdebusscher
Copy link

Difficult to find out what exactly changed due to the many code reformats

Copy link
Member

@Pandrex247 Pandrex247 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Formatting quibbles

@@ -1587,7 +1595,11 @@ private void deployAll() throws GlassFishException {
if (entry.getName().startsWith("ROOT.")) {
deployer.deploy(entry, "--availabilityenabled=true", "--force=true", "--contextroot=/", "--loadOnly", "true");
} else {
deployer.deploy(entry, "--availabilityenabled=true", "--force=true", "--loadOnly", "true", "--contextroot",deployContext);
if(deployContext == null) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be a space between if and (

if (war.getName().startsWith("ROOT.")) {
deployer.deploy(war, "--availabilityenabled=true", "--force=true", "--contextroot=/", "--loadOnly", "true");
} else {
deployer.deploy(war, "--availabilityenabled=true", "--force=true", "--loadOnly", "true", "--contextroot", deployContext);
if(deployContext == null) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be a space between if and (

@mulderbaba mulderbaba added this to the 5.192 milestone Mar 13, 2019
@cubastanley cubastanley requested a review from Pandrex247 March 14, 2019 09:11
Copy link

@rdebusscher rdebusscher left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Only a small improvement for me required.

for (File entry : deploymentDirEntries) {

boolean hasDefinedContextRoot = (contextRoot != null && contextRoot.isEmpty() == false);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

contextRoot.isEmpty() == false -> !contextRoot.isEmpty()

if (war.exists() && war.canRead()) {
for (File war : deployments) {

boolean hasDefinedContextRoot = (contextRoot != null && contextRoot.isEmpty() == false);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

contextRoot.isEmpty() == false -> !contextRoot.isEmpty()

@cubastanley cubastanley requested a review from rdebusscher March 14, 2019 14:41
@Pandrex247 Pandrex247 changed the title Payara-3662 fixing glassfish-web.xml contextroot overwrite [PAYARA-3662] fixing glassfish-web.xml contextroot overwrite Mar 14, 2019
@cubastanley
Copy link
Contributor Author

Jenkins test please

@Pandrex247 Pandrex247 merged commit 6c638c6 into payara:master Mar 19, 2019
AlanRoth pushed a commit to AlanRoth/Payara that referenced this pull request Aug 13, 2019
Signed-off-by: Maxim Nesen <[email protected]>
Cousjava pushed a commit to Cousjava/Payara that referenced this pull request Aug 21, 2019
[PAYARA-3662] fixing glassfish-web.xml contextroot overwrite
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants