geronimo-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Steve Higham <st...@sjlt.co.uk>
Subject Re: Geronimo:wait-for-server is not waiting
Date Fri, 03 Jan 2014 14:01:44 GMT
Hi David,

I've got the code running for a LocalDeploymentManager and I'm querying for GBeans using kernel.listGBeans
(CONFIGURER_QUERY). However only 2 beans are being returned. One has the attribute kernelFullyStarted.
The other doesn't have this attribute. I was expecting more GBeans. Any idea what I'm doing
wrong?

Cheers,

Steve

Steve Higham <steve@sjlt.co.uk> wrote:

>Hi David,
>
>Thanks for responding - really appreciated :-) 
>
>I've downloaded the 3.0.1 source code. I'm building it with "mvn clean install". I'm running
with the following commands
>
>cd assemblies/geronimo-tomcat7-javaee6-web/target/assembly/bin
>chmod a+x Geronimo
>./Geronimo run
>
>Once started I'm running Geronimo:wait-for-server. When this completes I shut down the
server and look at the log file. I'm adding additional logging and fixing issues in the code
as follows:
>
>file framework/modules/geronimo-shell-base/.../WaitForServerCommand.Java
>
>The method of interest is protected Object do execute ()
>
>This starts with
>
>if (is embedded ()) { return null; }
>
>The isEmbedded () call is returning true so the method consistently returns immediately.
I think this code needs deleting. I appreciate that the embedded case needs thought but an
immediate return is inappropriate. 
>
>Further down we see the code
>
>if (server != null) { started = ... }
>
>if (!started) { Throwable error = server.getLastError (); ... }
>
>This clearly fails when server == null. The fix is trivial.
>
>Within the try section (in the !started loop) the problems get more interesting. connection.getDeploymentManager
() is downcast to RemoteDeploymentManager. Unfortunately in my scenario the object returned
is of type LocalDeploymentManager so this fails. I'm working to fix this with minimal code
changes. I can clean up later. Therefore  I've started with the following: 
>
>DeploymentManager deploymentMgr = null;
>try {
>  connection = connect ();
>  deploymentMgr = connection.getDeploymentManager ();
>  if (deploymentMgr instanceof RemoteDeploymentManager) {
>    ... existing solution ...
>  } else if (deploymentMgr instanceof LocalDeploymentManager) {
>    started = ((LocalDeploymentManager)deploymentMgr).isFullyStarted ();
>  }
>
>This looks OK, but to compile I need to add isFullyStarted () to the class LocalDeploymentManager.
I've done this based on the same function in the ServerProxy class. The private utility methods
have been cut and pasted over (can refactor later).
>
>File framework/modules/geronimo-deploy-jsr88/.../LocalDeploymentManager.Java
>
>public boolean isFullyStarted () {
>  boolean fully started = true;
>  // Do I need to mess about with class loaders in the Local case?
>  Set<AbstractName> result = kernel.listGBeans (CONFIGURER_QUERY);
>  try {
>    for (AbstractName name : result) {
>      boolean started = getBooleanAttribute (name, "kernelFullyStarted");
>      if (!started) {
>        fully started = false; break;
>      }
>    }
>  }
>  catch (IOException e) { ... }
>  catch (Exception e) { ... }
>  ...
>}
>
>This compiles but when I run it I'm getting a NoSuchAttributeException for attribute "kernelFullyStarted".
I've traced this to a GBeanInstance:invoke call but that's as far as I've got.
>
>Any insights very welcome as this is my first forray into the Geronimo code base.
>
>Cheers,
>
>Steve
>
>
Mime
View raw message