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 200772 - "Ignore, I don't want IDE managed deployment" resets active config to default
Summary: "Ignore, I don't want IDE managed deployment" resets active config to default
Status: VERIFIED FIXED
Alias: None
Product: javaee
Classification: Unclassified
Component: Maven (show other bugs)
Version: 7.0.1
Hardware: PC Windows 7
: P2 normal (vote)
Assignee: Jesse Glick
URL:
Keywords:
Depends on: 200982
Blocks:
  Show dependency tree
 
Reported: 2011-08-08 22:01 UTC by _ gtzabari
Modified: 2011-08-19 20:06 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Testcase (3.54 KB, application/x-zip-compressed)
2011-08-09 14:58 UTC, _ gtzabari
Details

Note You need to log in before you can comment on or make changes to this bug.
Description _ gtzabari 2011-08-08 22:01:53 UTC
This is an extremely annoying bug. I also suspect it's a regression because it used to work in (recent) dev builds.

Repro steps:

1. Create a Maven web project
2. Create multiple projects in the POM file
3. Set the current profile to FOO (where FOO is anything other than <default>)
4. Project -> Properties -> Run -> Server -> No server selected
5. Project -> Properties -> Actions -> Configuration = FOO -> Execute Goals: "jetty:run", Set Properties: "netbeans.deploy=true"
6. Run the main project
7. Netbeans will prompt "Select deployment server".
8. Select "Ignore, I don't want IDE managed deployment" and click OK
9. The project runs.
10. Bug #1: Notice how the active configuration changed from FOO to <default>.
11. Stop execution and go to step 6.
12. Bug #2: Notice how the dialog from #7 pops up again (Netbeans forgets your settings).
Comment 1 _ gtzabari 2011-08-09 14:58:49 UTC
Created attachment 109890 [details]
Testcase
Comment 2 _ gtzabari 2011-08-09 15:00:39 UTC
Here are simpler repro steps:

1. Open the attached testcase project
2. Set Configuration to windows-i386-vs10-debug
3. Run the project
4. Select "Ignore, I don't want IDE managed deployment" and click OK
5. Notice how "configuration" jumps back to "<default>"
6. Notice how you have to select "Ignore, I don't want IDE managed deployment" if you run again.
Comment 3 _ gtzabari 2011-08-09 15:04:18 UTC
I've reproduced this issue in Netbeans 7.0.1 final and 7.1 dev build 201108080600.

Also, it's worth noting that the Maven project doesn't need to actually list the Jetty artifact as a dependency. It's sufficient to refer to the "jetty:run" goal.
Comment 4 Jesse Glick 2011-08-10 21:00:45 UTC
Please try to give a more specific summary for new bugs.
Comment 5 _ gtzabari 2011-08-10 23:38:37 UTC
You're right... I'll try to do a better job next time.
Comment 6 _ gtzabari 2011-08-16 12:35:30 UTC
David,

Any chance we can make this feature more consistent? Perhaps add a full-fledged "server" that users can select off "Project Properties -> Run -> Server" whose name is "Maven Server"?
Comment 7 David Konecny 2011-08-16 23:49:28 UTC
Jesse, I think the problem here is in the maven module itself. o.n.m.maven.j2ee.ExecutionChecker.removeNetbeansDeployFromActionMappings() tries to remove a property in currently selected configuration but it cannot because there is no API for that. I started fixing this by adding

    public static NetbeansActionMapping getActiveMapping(String action, Project project, AbstractMavenActionsProvider config) {
        return ActionToGoalUtils.getActiveMapping(action, project, config);
    }

to o.n.m.maven.api.customizer.ModelHandle and using it but that is still not enough. o.n.m.maven.spi.customizer.ModelHandleUtils.createModelHandle(Project) seems to ignore configurations as well.

If my assessment is wrong pass it back please but it looks to me like maven.ee should just call something to persist server selection in active configuration.
Comment 8 David Konecny 2011-08-16 23:51:35 UTC
(In reply to comment #6)
> Any chance we can make this feature more consistent? Perhaps add a full-fledged
> "server" that users can select off "Project Properties -> Run -> Server" whose
> name is "Maven Server"?

Sorry, I have absolutely no resources for that. But please file an issue requesting that and provide as much background and motivation for such feature as you can. I hope we soon get somebody to help with Maven.
Comment 9 Jesse Glick 2011-08-17 15:38:38 UTC
Workaround for this bug is to just remove <netbeans.deploy>true</netbeans.deploy> from the nbactions-*.xml. (Works to do this from the Actions panel.)

A possibly related problem is that selecting a configuration from the Actions panel has no effect. Who knows how long that has been broken. The action mapping / configuration code is rather complicated and did not originally come with any tests whatsoever.
Comment 10 Jesse Glick 2011-08-17 18:18:41 UTC
Seems that ModelHandleUtils was unofficially deprecated but not actually replaced. I will kill it off.

(In reply to comment #9)
> A possibly related problem

bug #201052
Comment 11 Jesse Glick 2011-08-17 18:26:51 UTC
core-main #fcb2965c9226
Comment 12 _ gtzabari 2011-08-17 19:15:37 UTC
> Sorry, I have absolutely no resources for that. But please file an issue
requesting that and provide as much background and motivation for such feature
as you can. I hope we soon get somebody to help with Maven.

Done: bug #201054
Comment 13 Quality Engineering 2011-08-18 13:51:30 UTC
Integrated into 'main-golden'
Changeset: http://hg.netbeans.org/main-golden/rev/fcb2965c9226
User: Jesse Glick <jglick@netbeans.org>
Log: #200772: "Ignore, I don't want IDE managed deployment" resets active config to default
Comment 14 David Konecny 2011-08-18 21:33:49 UTC
Possible candidate (and issue 200982) for 7.0.1 patch 1?
Comment 15 Jesse Glick 2011-08-18 21:57:28 UTC
I do not think this is a great candidate for a patch update; it was a significant refactoring, including some incompatible changes to friend APIs. Rewriting it to use only compatible changes would require some extra work. Anyway the workaround is trivial.

As far as bug #200982, I am nervous about putting such a complicated change of synchronization into a patch update since it is very hard to be sure it is right and does not introduce race conditions. Do you think the deadlock occurs commonly?
Comment 16 David Konecny 2011-08-18 22:37:51 UTC
Make sense what you say Jesse. The deadlock happened to me always when I tried to reproduce the test case. But obviously it never happened to other people otherwise it would be filed and fixed already.
Comment 17 Jesse Glick 2011-08-18 22:40:29 UTC
(In reply to comment #16)
> obviously it never happened to other people
> otherwise it would be filed and fixed already.

Not sure. The deadlock I got had no visible UI manifestation, since the EDT was not involved. Even if the EDT does freeze, we have no reliable reporting infrastructure for that (see TimableEventQueue for the current modest attempt at recovering when a CLI command is invoked on a hung IDE), so a lot of such freezes may go unreported.
Comment 18 David Konecny 2011-08-18 22:44:46 UTC
In my case UI froze. Always.
Comment 19 Jesse Glick 2011-08-18 22:52:49 UTC
Mark it as a patch candidate if you think it is needed; a code review would be appreciated. Comments to go into that issue.
Comment 20 _ gtzabari 2011-08-19 02:57:35 UTC
Jesse,

What is the impact of removing <netbeans.deploy>true</netbeans.deploy>? What does this property do?
Comment 21 _ gtzabari 2011-08-19 14:54:53 UTC
PS: I keep on running into UI deadlocks following the steps in comment #2 (about 20% of the time). I'm not sure if it's related to bug #200982 but if it is then +1 for adding it into patch 1.
Comment 22 Jesse Glick 2011-08-19 15:26:37 UTC
(In reply to comment #20)
> What is the impact of removing <netbeans.deploy>true</netbeans.deploy>? What
> does this property do?

Deploys to an IDE-configured server. When you click "Ignore..." you are asking the IDE to remove this property.

(In reply to comment #21)
> I keep on running into UI deadlocks following the steps in comment #2
> (about 20% of the time). I'm not sure if it's related to bug #200982

Check thread dumps and check in a dev build with the purported fix. Put comments on this topic in bug #200982, not here.
Comment 23 _ gtzabari 2011-08-19 20:06:34 UTC
Verified fix in NetBeans IDE Dev (Build 201108190601).