History | Log In     View a printable version of the current page.  
Issue Details (XML | Word | Printable)

Key: RHQ-297
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Jay Shaughnessy
Reporter: Heiko W. Rupp
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
RHQ Project

Active alert template prevents adding of a new platform

Created: 15/Apr/08 07:50 AM   Updated: 12/Jun/08 04:44 PM
Component/s: FX - Alerts
Affects Version/s: 0.1, 1.0
Fix Version/s: 1.0.1

Time Tracking:
Not Specified

Issue Links:
Dependency
 
Relation
 

Resolution Date: 12/Jun/08 03:08 PM
Date of First Response: 16/Apr/08 06:48 AM
Tester: Jeff Weiss


 Description  « Hide
I added a template to alert "Platform Mac OS X, idle < 30%". This got nicely applied to the existing resource.
Then I added a 2nd agent to my mac mini/ppc. As soon as the agent shows the sending> prompt, I get the below error.
When I shut the agent down and restart it, I get the error again. Same when I run discovery --full

This prevents adding the whole platform + resources on it, as it never shows up in the AD portlet.

When I delete the alert template, I am able to import that plaform as usual.

14:41:18,587 INFO [CoreServerServiceImpl] Got agent registration request for new agent: lilly[172.31.7.3:8080]
14:41:56,064 INFO [DiscoveryBossBean] Received inventory report from RHQ Agent [Agent[id=500051,name=lilly,address=172.31.7.3,port=8080,remote-endpoint=socket://172.31.7.3:8080/?rhq.communications.connector.rhqtype=agent&numAcceptThreads=1&maxPoolSize=303&clientMaxPoolSize=304&socketTimeout=60000&enableTcpNoDelay=true&backlog=200,last-availability-report=null]]. Number of added roots: 1
14:41:56,238 ERROR [AlertConditionCache] Error inserting alert condition 'org.rhq.core.domain.alert.AlertCondition[ id=500057, category=Measurement Threshold, measurementDefinition=[MeasurementDefinition,id=500098,name=CpuPerc.idle], name=Idle, comparator='<', threshold=0.3, option=null, org.rhq.core.domain.alert.AlertDefinition[ id=100016, name=High load on mac, conditionExpression=ALL, priority=!! - Medium, resourceId=500625 ] ]': javax.persistence.NoResultException: No entity found for query
14:41:56,274 WARN [JDBCExceptionReporter] SQL Error: 0, SQLState: null
14:41:56,274 ERROR [JDBCExceptionReporter] Transaction is not active: tx=TransactionImple < ac, BasicAction: -53e0f8f9:c40d:480477f5:b258 status: ActionStatus.ABORT_ONLY >; - nested throwable: (javax.resource.ResourceException: Transaction is not active: tx=TransactionImple < ac, BasicAction: -53e0f8f9:c40d:480477f5:b258 status: ActionStatus.ABORT_ONLY >)
14:41:56,288 ERROR [DiscoveryServerServiceImpl] Fatal error occurred during merging of inventory report from agent [Agent[id=0,name=lilly,address=null,port=0,remote-endpoint=null,last-availability-report=null]].
javax.ejb.EJBTransactionRolledbackException: org.hibernate.exception.GenericJDBCException: Cannot open connection
        at org.jboss.ejb3.tx.Ejb3TxPolicy.handleInCallerTx(Ejb3TxPolicy.java:87)
        at org.jboss.aspects.tx.TxPolicy.invokeInCallerTx(TxPolicy.java:130)
        at org.jboss.aspects.tx.TxInterceptor$Required.invoke(TxInterceptor.java:195)
        at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
        at org.jboss.aspects.tx.TxPropagationInterceptor.invoke(TxPropagationInterceptor.java:76)
        at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
        at org.jboss.ejb3.stateless.StatelessInstanceInterceptor.invoke(StatelessInstanceInterceptor.java:62)
        at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
        at org.jboss.aspects.security.AuthenticationInterceptor.invoke(AuthenticationInterceptor.java:77)
        at org.jboss.ejb3.security.Ejb3AuthenticationInterceptor.invoke(Ejb3AuthenticationInterceptor.java:106)
        at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
        at org.jboss.ejb3.ENCPropagationInterceptor.invoke(ENCPropagationInterceptor.java:46)
        at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
        at org.jboss.ejb3.asynchronous.AsynchronousInterceptor.invoke(AsynchronousInterceptor.java:106)
        at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
        at org.jboss.ejb3.stateless.StatelessContainer.localInvoke(StatelessContainer.java:214)
        at org.jboss.ejb3.stateless.StatelessContainer.localInvoke(StatelessContainer.java:184)
        at org.jboss.ejb3.stateless.StatelessLocalProxy.invoke(StatelessLocalProxy.java:81)
        at $Proxy212.addProductVersion(Unknown Source)
        at org.rhq.enterprise.server.discovery.DiscoveryBossBean.addProductVersionsRecursively(DiscoveryBossBean.java:619)
        at org.rhq.enterprise.server.discovery.DiscoveryBossBean.addResourceToInventory(DiscoveryBossBean.java:596)
        at org.rhq.enterprise.server.discovery.DiscoveryBossBean.mergeResource(DiscoveryBossBean.java:431)
        at org.rhq.enterprise.server.discovery.DiscoveryBossBean.mergeInventoryReport(DiscoveryBossBean.java:145)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:585)
        at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:112)
        at org.jboss.ejb3.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:166)
        at org.rhq.enterprise.server.authz.RequiredPermissionsInterceptor.checkRequiredPermissions(RequiredPermissionsInterceptor.java:153)
        at sun.reflect.GeneratedMethodAccessor192.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:585)
        at org.jboss.ejb3.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:118)
        at org.jboss.ejb3.interceptor.EJB3InterceptorsInterceptor.invoke(EJB3InterceptorsInterceptor.java:63)
        at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
        at org.jboss.ejb3.entity.TransactionScopedEntityManagerInterceptor.invoke(TransactionScopedEntityManagerInterceptor.java:54)
        at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
        at org.jboss.ejb3.AllowedOperationsInterceptor.invoke(AllowedOperationsInterceptor.java:47)
        at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
        at org.jboss.aspects.tx.TxPolicy.invokeInOurTx(TxPolicy.java:79)
        at org.jboss.aspects.tx.TxInterceptor$Required.invoke(TxInterceptor.java:191)
        at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
        at org.jboss.aspects.tx.TxPropagationInterceptor.invoke(TxPropagationInterceptor.java:76)
        at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
        at org.jboss.ejb3.stateless.StatelessInstanceInterceptor.invoke(StatelessInstanceInterceptor.java:62)
        at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
        at org.jboss.aspects.security.AuthenticationInterceptor.invoke(AuthenticationInterceptor.java:77)
        at org.jboss.ejb3.security.Ejb3AuthenticationInterceptor.invoke(Ejb3AuthenticationInterceptor.java:106)
        at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
        at org.jboss.ejb3.ENCPropagationInterceptor.invoke(ENCPropagationInterceptor.java:46)
        at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
        at org.jboss.ejb3.asynchronous.AsynchronousInterceptor.invoke(AsynchronousInterceptor.java:106)
        at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
        at org.jboss.ejb3.stateless.StatelessContainer.localInvoke(StatelessContainer.java:214)
        at org.jboss.ejb3.stateless.StatelessContainer.localInvoke(StatelessContainer.java:184)
        at org.jboss.ejb3.stateless.StatelessLocalProxy.invoke(StatelessLocalProxy.java:81)
        at $Proxy257.mergeInventoryReport(Unknown Source)
        at org.rhq.enterprise.server.discovery.DiscoveryServerServiceImpl.mergeInventoryReport(DiscoveryServerServiceImpl.java:58)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:585)
        at org.rhq.enterprise.communications.command.impl.remotepojo.server.RemotePojoInvocationCommandService.execute(RemotePojoInvocationCommandService.java:184)
        at sun.reflect.GeneratedMethodAccessor298.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:585)
        at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
        at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
        at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
        at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
        at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
        at javax.management.MBeanServerInvocationHandler.invoke(MBeanServerInvocationHandler.java:201)
        at $Proxy370.execute(Unknown Source)
        at org.rhq.enterprise.communications.command.server.CommandProcessor.handleIncomingInvocationRequest(CommandProcessor.java:335)
        at org.rhq.enterprise.communications.command.server.CommandProcessor.invoke(CommandProcessor.java:230)
        at org.jboss.remoting.ServerInvoker.invoke(ServerInvoker.java:734)
        at org.jboss.remoting.transport.servlet.ServletServerInvoker.processRequest(ServletServerInvoker.java:231)
        at sun.reflect.GeneratedMethodAccessor286.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:585)
        at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
        at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
        at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
        at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
        at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
        at javax.management.MBeanServerInvocationHandler.invoke(MBeanServerInvocationHandler.java:201)
        at $Proxy346.processRequest(Unknown Source)
        at org.jboss.remoting.transport.servlet.web.ServerInvokerServlet.processRequest(ServerInvokerServlet.java:128)
        at org.jboss.remoting.transport.servlet.web.ServerInvokerServlet.doPost(ServerInvokerServlet.java:157)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:710)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
        at org.rhq.helpers.rtfilter.filter.RtFilter.doFilter(RtFilter.java:112)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
        at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
        at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
        at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
        at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:179)
        at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
        at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:104)
        at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:157)
        at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
        at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:241)
        at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
        at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:580)
        at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
        at java.lang.Thread.run(Thread.java:613)
Caused by: javax.persistence.PersistenceException: org.hibernate.exception.GenericJDBCException: Cannot open connection
        at org.hibernate.ejb.AbstractEntityManagerImpl.throwPersistenceException(AbstractEntityManagerImpl.java:629)
        at org.hibernate.ejb.QueryImpl.getResultList(QueryImpl.java:73)
        at org.rhq.enterprise.server.resource.ProductVersionManagerBean.addProductVersion(ProductVersionManagerBean.java:54)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:585)
        at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:112)
        at org.jboss.ejb3.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:166)
        at org.rhq.enterprise.server.authz.RequiredPermissionsInterceptor.checkRequiredPermissions(RequiredPermissionsInterceptor.java:153)
        at sun.reflect.GeneratedMethodAccessor192.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:585)
        at org.jboss.ejb3.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:118)
        at org.jboss.ejb3.interceptor.EJB3InterceptorsInterceptor.invoke(EJB3InterceptorsInterceptor.java:63)
        at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
        at org.jboss.ejb3.entity.TransactionScopedEntityManagerInterceptor.invoke(TransactionScopedEntityManagerInterceptor.java:54)
        at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
        at org.jboss.ejb3.AllowedOperationsInterceptor.invoke(AllowedOperationsInterceptor.java:47)
        at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
        at org.jboss.aspects.tx.TxPolicy.invokeInCallerTx(TxPolicy.java:126)
        ... 111 more
Caused by: org.hibernate.exception.GenericJDBCException: Cannot open connection
        at org.hibernate.exception.SQLStateConverter.handledNonSpecificException(SQLStateConverter.java:103)
        at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:91)
        at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43)
        at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:29)
        at org.hibernate.jdbc.ConnectionManager.openConnection(ConnectionManager.java:426)
        at org.hibernate.jdbc.ConnectionManager.getConnection(ConnectionManager.java:144)
        at org.hibernate.jdbc.AbstractBatcher.prepareQueryStatement(AbstractBatcher.java:139)
        at org.hibernate.loader.Loader.prepareQueryStatement(Loader.java:1547)
        at org.hibernate.loader.Loader.doQuery(Loader.java:673)
        at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:236)
        at org.hibernate.loader.Loader.doList(Loader.java:2213)
        at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2104)
        at org.hibernate.loader.Loader.list(Loader.java:2099)
        at org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:378)
        at org.hibernate.hql.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:338)
        at org.hibernate.engine.query.HQLQueryPlan.performList(HQLQueryPlan.java:172)
        at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1121)
        at org.hibernate.impl.QueryImpl.list(QueryImpl.java:79)
        at org.hibernate.ejb.QueryImpl.getResultList(QueryImpl.java:64)
        ... 130 more
Caused by: org.jboss.util.NestedSQLException: Transaction is not active: tx=TransactionImple < ac, BasicAction: -53e0f8f9:c40d:480477f5:b258 status: ActionStatus.ABORT_ONLY >; - nested throwable: (javax.resource.ResourceException: Transaction is not active: tx=TransactionImple < ac, BasicAction: -53e0f8f9:c40d:480477f5:b258 status: ActionStatus.ABORT_ONLY >)
        at org.jboss.resource.adapter.jdbc.WrapperDataSource.getConnection(WrapperDataSource.java:94)
        at org.hibernate.ejb.connection.InjectedDataSourceConnectionProvider.getConnection(InjectedDataSourceConnectionProvider.java:47)
        at org.hibernate.jdbc.ConnectionManager.openConnection(ConnectionManager.java:423)
        ... 144 more
Caused by: javax.resource.ResourceException: Transaction is not active: tx=TransactionImple < ac, BasicAction: -53e0f8f9:c40d:480477f5:b258 status: ActionStatus.ABORT_ONLY >
        at org.jboss.resource.connectionmanager.TxConnectionManager.getManagedConnection(TxConnectionManager.java:304)
        at org.jboss.resource.connectionmanager.BaseConnectionManager2.allocateConnection(BaseConnectionManager2.java:396)
        at org.jboss.resource.connectionmanager.BaseConnectionManager2$ConnectionManagerProxy.allocateConnection(BaseConnectionManager2.java:842)
        at org.jboss.resource.adapter.jdbc.WrapperDataSource.getConnection(WrapperDataSource.java:88)
        ... 146 more



 All   Comments   Work Log   Change History      Sort Order: Ascending order - Click to sort in descending order
Joseph Marques - 16/Apr/08 06:48 AM
i think what's happening is that the alert template tries to create an alert definition for the resource in question, but the resource has not yet had it's measurement schedules created (from the measurement definitions for the given resource type), so the alert condition cache tries to look up the schedule to insert it's id as the key for one of the internal measurement-based maps -- boom -- javax.persistence.NoResultException: No entity found for query

Joseph Marques - 16/Apr/08 06:01 PM
svn650 - alert template creation as a result of newly imported resources MUST occur after measurement schedules are created, otherwise things go boom;
soo...move the creation code to the MeasurementServerServiceImpl which is called from the agent after a tree of resources is committed to persist the new schedules;
pay extra attention to ONLY create alert defintiions for resources that are new...
in other words, if resources already have schedules they must have been committed earlier, and thus would already have gotten the definition from the template applied to them;

Charles Crouch - 16/Apr/08 06:06 PM
Re-opening, just to making this issue stand-out for tracking purposes.

Heiko, please retest

Heiko W. Rupp - 17/Apr/08 04:25 AM
This works now as expected.

Joseph Marques - 17/Apr/08 12:09 PM
the fix only applied templates to platforms and servers (and maybe platforms services?) it needs to be applied to all resource types.

Joseph Marques - 17/Apr/08 06:57 PM
rev662 - move alert template creation into recursive call so that ALL new resources get definitions created on them (according to their type's templates) during commit-time;
remove unused query from domain and service layer, which was replaced by using the updateCount available in the recursive call;

Jay Shaughnessy - 05/May/08 03:44 PM
RC11 (JON RC7) This seems to work.
Created templates three deep Platform(Windows), JBAS Server, Datasource w/o applying to existing resources
- worked
Updated to apply then to existing resources
- worked
Uninventoried platform
Agent shutdown, start, discovery -f
Re-imported platform from a-d portlet
- worked, templates applied at all three levels

Ian Springer - 22/May/08 11:58 AM
Looks like this is still an issue for Resources that are added manually, whose Resource types have one or more alert templates defined. When I attempt to manually add a JBossAS Resource after creating a JBossAS alert template, I get the error "Failed to add resource with type [JBossAS Server] and parent resource id [500050]. -> org.rhq.core.util.exception.WrappedRemotingException:java.lang.NullPointerException -> org.rhq.core.util.exception.WrappedRemotingException:null". However, when I go to the Dashboard, I can see the JBossAS Resource was indeed added to inventory, but with status NEW, rather than COMMITTED. When I import the Resource, the alert template does get applied to it (i.e. it has a corresponding alert defined).

Here's the lines from the log from when I did the manual add:

2008-05-22 12:24:23,788 DEBUG [org.rhq.enterprise.communications.command.server.CommandProcessor] {CommandProcessor.executing}Executing command [Command: type=[remotepojo]; cmd-in-response=[false]; config=[{rhq.security-token=1211411328407-1752998092-8502584036593054604, rhq.send-throttle=true}]; params=[{targetInterfaceName=org.rhq.core.clientapi.server.discovery.DiscoveryServerService, invocation=NameBasedInvocation[addResource]}]]
2008-05-22 12:24:23,804 DEBUG [org.rhq.enterprise.server.discovery.DiscoveryBossBean]
2008-05-22 12:24:23,804 DEBUG [org.rhq.enterprise.server.discovery.DiscoveryBossBean] getExistingResource processing for [Resource[id=0, type=JBossAS Server, key=C:\opt\jboss-4.2.2.GA\server\default, name=MAINFRAME JBossAS 4.2.2.GA default (1099), version=4.2.2.GA]]
2008-05-22 12:24:23,804 DEBUG [org.rhq.enterprise.server.discovery.DiscoveryBossBean] id=0: Agent reported resource with id of 0.
2008-05-22 12:24:23,804 DEBUG [org.rhq.enterprise.server.discovery.DiscoveryBossBean] id=0: Checking if a resource exists with the specified business key.
2008-05-22 12:24:23,804 DEBUG [org.rhq.enterprise.server.discovery.DiscoveryBossBean] id=0: Unable to find the agent-reported resource by id and business key.
2008-05-22 12:24:23,804 DEBUG [org.rhq.enterprise.server.discovery.DiscoveryBossBean] id=0: Resource's id was already zero, nothing to do for the merge.
2008-05-22 12:24:24,069 ERROR [org.rhq.enterprise.server.alert.engine.AlertConditionCache] Error inserting alert condition 'org.rhq.core.domain.alert.AlertCondition[ id=500053, category=Measurement Threshold, measurementDefinition=[MeasurementDefinition,id=500456,name=jboss.system:type=ServerInfo:ActiveThreadCount], name=Active Thread Count, comparator='>', threshold=5.0, option=null, org.rhq.core.domain.alert.AlertDefinition[ id=100012, name=foobar, conditionExpression=ALL, priority=!!! - High, resourceId=500396 ] ]': javax.persistence.NoResultException: No entity found for query
2008-05-22 12:24:24,069 DEBUG [org.rhq.enterprise.server.alert.AlertDefinitionManagerBean] createAlertDefinition: AlertConditionCacheStats[ created=0, updated=0, deleted=0, matched=0, age=15ms ]
2008-05-22 12:24:24,147 DEBUG [org.rhq.enterprise.communications.command.server.CommandProcessor] {CommandProcessor.executed}Executed command - response is [Command Response: isSuccessful=[true]; command=[null]; results=[org.rhq.core.domain.discovery.MergeResourceResponse@139a3b6]; exception=[>> exception was null <<]]
2008-05-22 12:24:24,147 DEBUG [org.rhq.helpers.rtfilter.filter.RtFilter] Request to [/jboss-remoting-servlet-invoker/ServerInvokerServlet] took 390 ms
2008-05-22 12:24:24,163 DEBUG [org.rhq.enterprise.communications.command.server.CommandProcessor] {CommandProcessor.executing}Executing command [Command: type=[remotepojo]; cmd-in-response=[false]; config=[{rhq.security-token=1211411328407-1752998092-8502584036593054604, rhq.send-throttle=true}]; params=[{targetInterfaceName=org.rhq.core.clientapi.server.discovery.DiscoveryServerService, invocation=NameBasedInvocation[getInventoryStatus]}]]
2008-05-22 12:24:24,179 DEBUG [org.rhq.enterprise.communications.command.server.CommandProcessor] {CommandProcessor.executed}Executed command - response is [Command Response: isSuccessful=[false]; command=[null]; results=[null]; exception=[java.lang.reflect.InvocationTargetException:null -> org.rhq.core.util.exception.WrappedRemotingException:java.lang.NullPointerException -> org.rhq.core.util.exception.WrappedRemotingException:null]]
2008-05-22 12:24:24,194 DEBUG [org.rhq.helpers.rtfilter.filter.RtFilter] Request to [/jboss-remoting-servlet-invoker/ServerInvokerServlet] took 31 ms
2008-05-22 12:24:24,288 DEBUG [org.rhq.enterprise.communications.command.client.ClientRemotePojoFactory] {ClientRemotePojoFactory.execution-failure}Failed to execute remote POJO method [manuallyAddResource]. Cause: org.rhq.core.clientapi.agent.PluginContainerException:Failed to add resource with type [JBossAS Server] and parent resource id [500050]. -> org.rhq.core.util.exception.WrappedRemotingException:java.lang.NullPointerException -> org.rhq.core.util.exception.WrappedRemotingException:null

Jay Shaughnessy - 11/Jun/08 04:48 PM
r970

Fixed manual add at least to the level of AD import. There is an outstanding issue in that neither AD import or manual add will apply alert templates if the resource type has no metrics defined.
This is due to the fact that alert template application is tied to measurement schedule creation. This is a bit odd and we should probably break this up. There is an inherent lack of ability to
distinguish a New vs Committed resource, the logic today relies on whether measurement schedules exist for the resource in question.

Either we clean this up or we protect against multiply applying the same alert template to a resource.

Joseph Marques - 12/Jun/08 03:08 PM
this is ready for testing, as of the last commit made by Jay S.

Jay Shaughnessy - 12/Jun/08 03:27 PM
OK, suggested test that covers the myriad of stuff above:

1) Install, if necessary some JON supported version of JBoss

2) Start JON server

3) Start JON agent

4) If necessary import your platform

5) Create one or more alert templates for both JBAS Server and JBAS-Server->Datasource

- This gives you two levels in the hierarchy as the JBAS server parent will have a Datasource child.
- If you check the option to apply to current resources you can see these applied to your JON JBAS server and the RHQ Datasource child

Test auto-discovery:

6) Start up your JBoss server (I used 4.0.4)

7) Discovery - f on the JON agent to detect the new server

8) Import it from the AD portlet (in the GUI Dashboard)

9) Check to see if the Alert Templates generated Alert Definitions for your new JBAS Server and its Datasource.

Test manual add:

10) Shut down the JBoss server

11) Uninventory the JBOss server from the GUI (browse resources)

12) Verify its gone from the agent inventory (the Inventory command)

13) exit the agent

14) start the agent again

- 13,14 just force a discovery . In this case we're trying to *avoid* auto-discovering the JBoss server

15) wait a minute after startup to let discovery complete

16) start the JBOss server

17) Manually add the JBoss server to inventory

17 a) Go to Platform->Inventory

17 b) select manual add JBAS server

17 c) set the required path, deploy path, and *expand* advanced properties and set ProductType to AS.

17 d) click OK

18) Assuming the manual add worked, check to ensure the alert definitions were generated.



Jeff Weiss - 12/Jun/08 04:44 PM
Followed Jay's procedures, everything worked against qa-6020 build.