This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 196030

Summary: project copy to new project name does not change context root in copied project
Product: serverplugins Reporter: emiddio <emiddio>
Component: GlassFishAssignee: Vince Kraemer <vkraemer>
Status: NEW ---    
Severity: normal CC: dkonecny, phejl, vkraemer
Priority: P4    
Version: 7.0   
Hardware: PC   
OS: Windows 7 x64   
Issue Type: DEFECT Exception Reporter:
Attachments: project before copy
project after copy

Description emiddio 2011-02-26 00:48:22 UTC
it does in nb691 and is a convenience - new context root matches project name.

it does not in nb70b2 -- keeps old context root value.

see this with JSF2 web projects



just a FYI -- i dont know what it really should do
Comment 1 Vince Kraemer 2011-02-26 23:06:51 UTC
what do we need to do to reproduce what you are seeing?

here is what I did...

started a recently built pull from web-main with a fresh userdir
i did not import settings
i registered a 3.1 build
i create a java ee 6 web app that targets server... with project name WebApplication193
i run the project
   the server starts. the browser starts. the index.xhtml page displays as expected
  the url was http://localhost:8080/WebApplication193
I used the Copy action on WebApplication193's right-click menu.
A dialog appeared to let me select the name and directory for the new project
  I kept the default values (webApplication193_1, ~/NetBeansProjects).
  The new project appeared.
I used the Run item from WebApplication193_1's right click menu.
  the project deployed. the index.xhtml page appeared.
  http://localhost:8080/WebApplication193_1...

What steps did you follow that were different from the one I described above?
Comment 2 emiddio 2011-02-27 01:00:40 UTC
things work as you describe in nb691

the nb7.0beta2 works differently

use that build if you want to reproduce

i am not currently running dev builds -- i could if you are not seeing
it in the cureent dev builds -- to confirm issue is gone away
Comment 3 Vince Kraemer 2011-02-27 01:26:19 UTC
Please provide more details about "the nb7.0beta2 works differently"...

Maybe you would be willing to attach the 'src' project also.
Comment 4 emiddio 2011-02-27 21:38:58 UTC
Created attachment 106507 [details]
project before copy
Comment 5 emiddio 2011-02-27 21:39:28 UTC
Created attachment 106508 [details]
project after copy
Comment 6 emiddio 2011-02-27 21:41:22 UTC
copied jpa to jpa_4; context root remains /jpa in both with nb70beta2

Product Version: NetBeans IDE 7.0 Beta 2 (Build 201102140001)
Java: 1.6.0_23; Java HotSpot(TM) 64-Bit Server VM 19.0-b09
System: Windows 7 version 6.1 running on amd64; Cp1252; en_US (nb)
Userdir: C:\Users\emiddio\.netbeans\7.0beta2

with nb691 jpa_4 would have context root /jpa_4

thanks
Comment 7 David Konecny 2011-02-28 02:14:31 UTC
I can see that JPA_4 you attached has "<context-root>/jpa</context-root>" in sun-web.xml. If I perform copy myself on

Product Version: NetBeans IDE Dev (Build 110223-f768bf0f0b79)
Java: 1.6.0_24; Java HotSpot(TM) 64-Bit Server VM 19.1-b02
System: Linux version 2.6.35-25-generic running on amd64; UTF-8; en_NZ (nb)
Userdir: /home/david/.netbeans/_UD4

then no context-root is set in my copy of JPA project and therefore it is deployed correctly. I'm not aware of any changes in this area since Beta2 so I wonder if it is reproducible only under certain other conditions.
Comment 8 Vince Kraemer 2011-02-28 14:45:13 UTC
Hmm.  I will take a look at it some more.

One thing that I would note.... this is one of those things that can never be 'right' to all users.

I would bet that there are some users that would say the way 6.9.1 worked was incorrect and the 'new' way is correct, too.

Maybe we need to add a check-mark on the Copy dialog that allows a user to state their preference about how to handle the content of 'location dependent data' like the context root?
Comment 9 emiddio 2011-02-28 20:19:29 UTC
as i noted in initial post -- it just works differently than nb691 -- but i cannot say which way is "better" ?
Comment 10 David Konecny 2011-02-28 23:48:21 UTC
(In reply to comment #8)
> Maybe we need to add a check-mark on the Copy dialog that allows a user to
> state their preference about how to handle the content of 'location dependent
> data' like the context root?

That's true.

I intentionally turned this into P4 as I do not think copying projects is part of developers daily(not even weekly) workflow.
Comment 11 TomasKraus 2012-11-27 15:05:25 UTC
This is more about decision how it should work instead of fixing it.
Targeting for next release. Adding Petr Hejl to cc list to know his opinion.