Unable to create a user defined label on nodes after upgrade to 16.0.0
Description
Acceptance / Success Criteria
Attachments
Lucidchart Diagrams
Activity

Jesse White June 9, 2015 at 12:34 PM
Fixed in release-16.0.1 and develop with 1d521b89dbdc602050d443f951373de0932ed854.

Jesse White June 9, 2015 at 9:59 AM
I'm still unable to reproduce this on my test system, the label gets updated successfully. However, the stack trace does identify the cause. We need to wrap the call in a transaction context.
I've made this change here: https://github.com/OpenNMS/opennms/commit/1d521b89dbdc602050d443f951373de0932ed854

Alejandro Galue June 8, 2015 at 4:43 PM
Here is the code for NodeLabelDaoImpl:
The method assignLabel has some debug lines, so I've enabled DEBUG for web on log4j2.xml, and here is what I got:
So, looking carefully at the exception I found that the controller is manually instantiating a NodeLabelDaoImpl which in my personal opinion is not correct, considering that this class is supposed to be managed through Spring (because it has autowired dependencies against NodeDao). I think that could be the reason. Probably the best solution is to migrate that servlet to be Spring MVC to properly inject NodeLabelDao and use it.

Alejandro Galue June 8, 2015 at 4:30 PM
I'm attaching web.log with the full stack trace for both options, but here is the relevant content:
web.log

Alejandro Galue June 8, 2015 at 4:29 PMEdited
I think I have an idea about what could be happening but I would like some input from Scott.
Change the node's label for a node only makes sense for discovered nodes. Actually in OpenNMS 16, the link to change the node's label doesn't appear on requisitioned nodes, so that should not be a confusion anymore in 16.
Now, if I go to the node's label change page from the node's page (after clicking on Admin on the node's page toolbar and then "Change Node Label"), choose a name for "User Defined" and click "Change Label", I get a org.springframework.dao.InvalidDataAccessApiUsageException exception. Of course, the label is not changed.
So, still DNS label, repeat the process again and just click "Change Label" (without changing anything else), I got the exception again. I think this is the problem reported by Scott.
I think this is obvious, but you should add a node through "Add Interface" (i.e. a discovered).
Following a successful upgrade to Horizon 16.0.0. from 15.0.2 I am no longer able to create user defined labels for nodes (it doesn't matter what label/size of label I try and allocate. I receive the error message: The OpenNMS web UI has encountered an error that it does not know how to handle. I have attached screen shots and the relevant exception trace.