-
1. Re: Creating resources using the new JAVA API
p_zz Sep 21, 2010 9:27 AM (in response to kirkm)I have a similar issue using JON 2.4.
Following the script from this POC http://community.jboss.org/wiki/JON23ScriptedGroupDeploymentsUsingTheCLIAPI
i tried to deploy a war file to JBoss AS server
var deployConfig = new Configuration();
deployConfig.put( new PropertySimple("deployDirectory", "deploy"));
deployConfig.put( new PropertySimple("deployZipped", "true"));
deployConfig.put( new PropertySimple("createBackup", "false"));and the script ran successfully but from the "History of create child resource requests" section of the JON console it has:
org.rhq.core.util.exception.WrappedRemotingException:javax.persistence.NoResultException: No entity found for query -> org.rhq.core.util.exception.WrappedRemotingException:No entity found for query
Web Application (WAR) No resource key specified for failed request Failure -
2. Re: Creating resources using the new JAVA API
pilhuhn Sep 23, 2010 4:43 AM (in response to p_zz)The source snippet you posted is not enough to judge what may be going wrong. Can you please post the full source?
-
3. Re: Creating resources using the new JAVA API
john.sanda Sep 24, 2010 10:26 AM (in response to kirkm)The create/delete methods in ResourceFactoryManagerRemote are asynchronous in that they use a fire and forget model. They send the request down to the agent and immediately return. As part of those operations though, they log an entry onto their respective audit trails. In the case of creating a resource, this comes in the form of a CreateResourceHistory object. In the case of deleting a resource, this comes in the form of a DeleteResourceHistoryObject. When the operation completes on the agent machine, the agent calls back to the server updating the history object with the status of the operation. This is a common work flow pattern throughout RHQ.
I actually brought up this very issue on the rhq-devel mailing list. Earlier this morning I committed changes (not yet pushed to the remote repo though) so that the create/delete operations in ResourceFactoryManagerRemote return the history objects. With a reference to the history, it will be possible to poll the server for the status of the operation. The history objects also include an error message field that should get populated with a stacktrace or other error message should the operation fail.
- John
-
4. Re: Creating resources using the new JAVA API
john.sanda Sep 24, 2010 10:43 AM (in response to p_zz)Hi Pete,
Make sure that you specify the correct resource type id. I have seen this error in scripts when the resource type id for the new resource being deployed is not specified correctly. So if you are deploying a war file to a JBoss AS instance you need to specify the resource type id of the "Web Application (WAR)" resource type and not the "JBossAS" type.
If this is in fact the problem you encountered like I think it is, then the exception is coming out of ContentManagerBean where it trying to determine the underling ResourceType of the package being deployed. Maybe I can look at providing some better error messages in this code.
- John