Removing an AlertNotification from a Definition?
by Heiko W.Rupp
Hi,
I have this code
public Response deleteNotification(@PathParam("nid") int notificationId) {
AlertNotification notification = notificationMgr.getAlertNotification(caller,notificationId);
AlertDefinition definition = alertDefinitionManager.getAlertDefinition(caller,notification.getAlertDefinition().getId());
definition.getAlertNotifications().remove(notification);
alertDefinitionManager.updateAlertDefinition(caller,definition.getId(),definition,true);
entityManager.flush();
Which always bails out with javax.persistence.OptimisticLockException: org.hibernate.StaleStateException: Batch update returned unexpected row count from update [0]; actual row count: 0; expected: 1
I have tried dozens of ways, but always end up with an error.
When removing a notification in the UI, the AlertDefinition that is passed into updateAlertDefinition() also just does not
have the notification set anymore.
Any ideas?
Heiko
--
Reg. Adresse: Red Hat GmbH, Technopark II, Haus C,
Werner-von-Siemens-Ring 14, D-85630 Grasbrunn
Handelsregister: Amtsgericht München HRB 153243
Geschaeftsführer: Mark Hegarty, Charlie Peters, Michael Cunningham, Charles Cachera
11 years, 3 months
new automatic startup reconfig
by John Mazzitelli
In the old RHQ Server impl that ran inside JBossAS 4, whenever you changed rhq-server.properties, all you needed to do was restart the server and the new configuration values were automatically picked up (because we passed to JBoss the option -Prhq-server.properties and all services had configuration values like ${rhq.server.http.port}). Very handy - a one-stop-shop for all RHQ configuration in a single .properties file.
AS7.1.1.Final has a few problems with not supporting expressions (e.g. ${prop}) in some subsystem configurations (as they did in the older JBossAS 4). See https://issues.jboss.org/browse/AS7-6120 - so what this means is, changing rhq-server.properties after the initial installation was done does nothing - new values have no effect (this only effects some config properties but not all).
To work around this, the installer now supports the command line option "--reconfig" - if you ever change rhq-server.properties, after you restart the server, you must run "rhq-installer.sh --reconfig" to have the new values take effect. This, in turn, causes the AS7 to restart itself (because some of these change in values require the AS7 to reload its services).
Of course, this means users have to remember to do this (assuming they even know they have to do this in the first place!). Obviously, not ideal.
So, until these AS7 problems are fixed (and I think some already are in some newer AS7 builds), our production builds will ship rhq-server.sh (and .bat) with an extra call to "rhq-installer.sh --reconfig" in it. So, when you start the server, you will always be spawning a second Java process - the installer in reconfig mode - and it will look to see if your server needs to be reconfigured and if it does will reconfigure AND RESTART the server.
What does this mean? When you restart the server, you will see some messages come out on the console saying something like "reconfiguring server" or "everything is OK, nothing needs to be reconfigured". If you did change values in the .properties file that requires a restart, you'll notice the server immediately shutdown and restart. So the server will look like it went into fits :)
The hope is that we can eventually get rid of the entire "reconfig" stuff once that AS7 JIRA is resolved. Once AS7 supports expressions where we need them, we can remove the --reconfig code from the installer and we can remove this extra JVM we spawn from rhq-server script. But until then, we'll have to deal with this.
11 years, 3 months
Purging the agent's security token
by Jiri Kremser
Hi,
I would like to implement this feature Jay originally proposed. The idea is that it should be possible, for the authorized user (MANAGE_SECURITY), to invalidate an existing security token for any reason (mostly agent/db upgrade). Invalidating the token means setting its value to something like @#$reset$#@, and storing it to the DB for an agent with name "A". Next time the agent "A" tries to register, server finds out the token in the DB is willing to be updated with the agent's actual token. And stores it into DB instead of temporary marker "@#$reset$#@".
There are still some questions to discuss:
1) When clicking on the button for purging the existing token, should be the agent disconnected/reconnected or is it ok to continue in this quite undef state?
2) Are there any edge cases in this approach? For instance if attacker provides -Drhq.agent.security-token=@#$reset$#@ on purpose (this can be easily handled).
3) Possible race condition when registering the different 2 agents with the same name when the token is invalidated for this name.
..
Here is the BZ for it https://bugzilla.redhat.com/show_bug.cgi?id=888016
JK
11 years, 3 months
Fwd: AS7Plugin: upload connection with httpclient
by Thomas Segismont
Hi,
I'm forwarding this to the list in case anybody has any comment.
Cheers
Thomas Segismont
-------- Message original --------
Sujet: AS7Plugin: upload connection with httpclient
Date : Thu, 03 Jan 2013 12:30:27 +0100
De : Thomas Segismont <tsegismo(a)redhat.com>
Pour : ON Team <jboss-on-team(a)redhat.com>
Hi all,
As a fix for BZ 887320, I have refactored ASUploadConnection so that it
now uses httpclient as communication layer with AS7 http management
interface.
The change is in branch tsegismont/as7plugin-httpclient and here are the
contents:
* Added a commons-httpclient.version property to the root POM
The same httpclient version was hard-coded in various sub projects
* Added commons-httpclient and commons-codec (needed by httpclient) as
dependencies of AS7 plugin
* Change ASUploadConnection implementation
The new implementation has minor API modifications. I changed the code
accordingly in our source tree but it could be a problem if a plugin
developer uses this class (simple call or class extension).
I had trouble to run integration tests on my machine so I made some
extra modifications:
* Changed ANT script for AS7 download and install
This script, embedded in the plugin POM, was not working for all
versions of AS7 (community/eap, release/snapshot). I made it generic
(needed to upgrade ANT version to latest).
Additionally, I found that in Arquillian integration project we had a
class (SigarInstaller) relying on an hard-coded version of the Sigar
dist artifact so I also fixed that.
Eventually, I was not able to run the integration tests locally (it
seems related to the way Arquillian resolve Maven artifacts, it doesn't
use my local repo).
Still, all integration tests passed when I used the rhq-probe job on
Jenkins (I added as7.itest as an active profile).
Can someone please review the code in this branch before I put it into
master?
Thanks and regards
Thomas
11 years, 3 months