You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@geronimo.apache.org by Stefan Schulze Frielinghaus <st...@sf-net.com> on 2007/08/24 20:13:40 UTC
deploy and undeploy a gbean
Hello,
I'm trying to write a GBean which dynamically deploys and undeploys
other GBeans. My first thought about this task was to get a list of
all running modules from which I could decide which to undeploy.
String uri = "deployer:geronimo:inVM";
String username = "system";
String password = "manager";
dManager = dFactoryMgr.getDeploymentManager(uri, username, password);
System.out.println("Targets:");
Target[] targets = dManager.getTargets();
for(Target t : targets) {
System.out.println(t);
}
System.out.println("Modules:");
TargetModuleID[] moduleIDs = dManager.getRunningModules(null, targets);
for(TargetModuleID m : moduleIDs) {
System.out.println(m);
}
With the code above I tried to accomplish my goal. But if I run this
one I get the following exception:
14:38:55,100 ERROR [BaseDeploymentFactory]
org.apache.geronimo.web.deployment.WARConfigurer
java.lang.ClassCastException:
org.apache.geronimo.web.deployment.WARConfigurer
at
org.apache.geronimo.deployment.plugin.jmx.LocalDeploymentManager.loadMod
uleConfigurers(LocalDeploymentManager.java:51)
at
org.apache.geronimo.deployment.plugin.jmx.LocalDeploymentManager.<init>(
LocalDeploymentManager.java:41)
at
org.apache.geronimo.deployment.plugin.factories.BaseDeploymentFactory.ge
tDeploymentManager(BaseDeploymentFactory.java:133)
at
javax.enterprise.deploy.shared.factories.DeploymentFactoryManager.getDep
loymentManager(DeploymentFactoryManager.java:109)
at
de.furtwangen.hs.informatik.geronimo.ac.MigrationService.test
(MigrationService.java:37)
at
de.furtwangen.hs.informatik.geronimo.ac.AutonomicGeronimoGBean.testMigra
tion(AutonomicGeronimoGBean.java:202)
at
de.furtwangen.hs.informatik.geronimo.ac.AutonomicGeronimoGBean$
$FastClassByCGLIB$$78735f6f.invoke(<generated>)
at net.sf.cglib.reflect.FastMethod.invoke(FastMethod.java:53)
at org.apache.geronimo.gbean.runtime.FastMethodInvoker.invoke
(FastMethodInvoker.java:38)
at org.apache.geronimo.gbean.runtime.GBeanOperation.invoke
(GBeanOperation.java:127)
at org.apache.geronimo.gbean.runtime.GBeanInstance.invoke
(GBeanInstance.java:863)
at org.apache.geronimo.kernel.basic.BasicKernel.invoke
(BasicKernel.java:239)
at org.apache.geronimo.system.jmx.MBeanGBeanBridge.invoke
(MBeanGBeanBridge.java:168)
at com.sun.jmx.mbeanserver.DynamicMetaDataImpl.invoke
(DynamicMetaDataImpl.java:213)
at com.sun.jmx.mbeanserver.MetaDataImpl.invoke
(MetaDataImpl.java:220)
at
com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke
(DefaultMBeanServerInterceptor.java:815)
at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke
(JmxMBeanServer.java:784)
at javax.management.remote.rmi.RMIConnectionImpl.doOperation
(RMIConnectionImpl.java:1408)
at javax.management.remote.rmi.RMIConnectionImpl.access$100
(RMIConnectionImpl.java:81)
at javax.management.remote.rmi.RMIConnectionImpl
$PrivilegedOperation.run(RMIConnectionImpl.java:1245)
at
javax.management.remote.rmi.RMIConnectionImpl.doPrivilegedOperation
(RMIConnectionImpl.java:1341)
at javax.management.remote.rmi.RMIConnectionImpl.invoke
(RMIConnectionImpl.java:782)
at sun.reflect.GeneratedMethodAccessor187.invoke(Unknown
Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke
(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at sun.rmi.server.UnicastServerRef.dispatch
(UnicastServerRef.java:294)
at sun.rmi.transport.Transport$1.run(Transport.java:153)
at java.security.AccessController.doPrivileged(Native Method)
at sun.rmi.transport.Transport.serviceCall(Transport.java:149)
at sun.rmi.transport.tcp.TCPTransport.handleMessages
(TCPTransport.java:466)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run
(TCPTransport.java:707)
at java.lang.Thread.run(Thread.java:613)
Is there another way to deploy/undeploy GBeans via another GBean?
I even tried it with another URI (String uri =
"deployer:geronimo:jmx:rmi://localhost/jndi/rmi:/JMXConnector";) but
with that I still got a worse result.
javax.enterprise.deploy.spi.exceptions.DeploymentManagerCreationExceptio
n: Failed to retrieve RMIServer stub:
javax.naming.NoInitialContextException: Cannot instantiate class:
org.apache.xbean.naming.global.GlobalContextManager [Root exception
is java.lang.ClassNotFoundException:
org.apache.xbean.naming.global.GlobalContextManager]
at
org.apache.geronimo.deployment.plugin.factories.BaseDeploymentFactory.ne
wRemoteDeploymentManager(BaseDeploymentFactory.java:167)
at
org.apache.geronimo.deployment.plugin.factories.BaseDeploymentFactory.ge
tDeploymentManager(BaseDeploymentFactory.java:131)
at
javax.enterprise.deploy.shared.factories.DeploymentFactoryManager.getDep
loymentManager(DeploymentFactoryManager.java:109)
at
de.furtwangen.hs.informatik.geronimo.ac.MigrationService.test
(MigrationService.java:37)
at
de.furtwangen.hs.informatik.geronimo.ac.AutonomicGeronimoGBean.testMigra
tion(AutonomicGeronimoGBean.java:202)
at
de.furtwangen.hs.informatik.geronimo.ac.AutonomicGeronimoGBean$
$FastClassByCGLIB$$78735f6f.invoke(<generated>)
at net.sf.cglib.reflect.FastMethod.invoke(FastMethod.java:53)
at org.apache.geronimo.gbean.runtime.FastMethodInvoker.invoke
(FastMethodInvoker.java:38)
at org.apache.geronimo.gbean.runtime.GBeanOperation.invoke
(GBeanOperation.java:127)
at org.apache.geronimo.gbean.runtime.GBeanInstance.invoke
(GBeanInstance.java:863)
at org.apache.geronimo.kernel.basic.BasicKernel.invoke
(BasicKernel.java:239)
at org.apache.geronimo.system.jmx.MBeanGBeanBridge.invoke
(MBeanGBeanBridge.java:168)
at com.sun.jmx.mbeanserver.DynamicMetaDataImpl.invoke
(DynamicMetaDataImpl.java:213)
at com.sun.jmx.mbeanserver.MetaDataImpl.invoke
(MetaDataImpl.java:220)
at
com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke
(DefaultMBeanServerInterceptor.java:815)
at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke
(JmxMBeanServer.java:784)
at javax.management.remote.rmi.RMIConnectionImpl.doOperation
(RMIConnectionImpl.java:1408)
at javax.management.remote.rmi.RMIConnectionImpl.access$100
(RMIConnectionImpl.java:81)
at javax.management.remote.rmi.RMIConnectionImpl
$PrivilegedOperation.run(RMIConnectionImpl.java:1245)
at
javax.management.remote.rmi.RMIConnectionImpl.doPrivilegedOperation
(RMIConnectionImpl.java:1341)
at javax.management.remote.rmi.RMIConnectionImpl.invoke
(RMIConnectionImpl.java:782)
at sun.reflect.GeneratedMethodAccessor187.invoke(Unknown
Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke
(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at sun.rmi.server.UnicastServerRef.dispatch
(UnicastServerRef.java:294)
at sun.rmi.transport.Transport$1.run(Transport.java:153)
at java.security.AccessController.doPrivileged(Native Method)
at sun.rmi.transport.Transport.serviceCall(Transport.java:149)
at sun.rmi.transport.tcp.TCPTransport.handleMessages
(TCPTransport.java:466)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run
(TCPTransport.java:707)
at java.lang.Thread.run(Thread.java:613)
Caused by: java.io.IOException: Failed to retrieve RMIServer stub:
javax.naming.NoInitialContextException: Cannot instantiate class:
org.apache.xbean.naming.global.GlobalContextManager [Root exception
is java.lang.ClassNotFoundException:
org.apache.xbean.naming.global.GlobalContextManager]
at javax.management.remote.rmi.RMIConnector.connect
(RMIConnector.java:317)
at javax.management.remote.JMXConnectorFactory.connect
(JMXConnectorFactory.java:248)
at
org.apache.geronimo.deployment.plugin.factories.BaseDeploymentFactory.ne
wRemoteDeploymentManager(BaseDeploymentFactory.java:159)
... 30 more
Caused by: javax.naming.NoInitialContextException: Cannot instantiate
class: org.apache.xbean.naming.global.GlobalContextManager [Root
exception is java.lang.ClassNotFoundException:
org.apache.xbean.naming.global.GlobalContextManager]
at javax.naming.spi.NamingManager.getInitialContext
(NamingManager.java:657)
at javax.naming.InitialContext.getDefaultInitCtx
(InitialContext.java:247)
at javax.naming.InitialContext.init(InitialContext.java:223)
at javax.naming.InitialContext.<init>(InitialContext.java:197)
at javax.management.remote.rmi.RMIConnector.findRMIServerJNDI
(RMIConnector.java:1815)
at javax.management.remote.rmi.RMIConnector.findRMIServer
(RMIConnector.java:1787)
at javax.management.remote.rmi.RMIConnector.connect
(RMIConnector.java:259)
... 32 more
Caused by: java.lang.ClassNotFoundException:
org.apache.xbean.naming.global.GlobalContextManager
at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:
268)
at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:
319)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:242)
at com.sun.naming.internal.VersionHelper12.loadClass
(VersionHelper12.java:42)
at javax.naming.spi.NamingManager.getInitialContext
(NamingManager.java:654)
... 38 more
Since I've the package org.apache.xbean.naming in my classpath I
don't no why geronimo can't instantiate a class of them.
So has anyone an idea how to solve a deply/undeploy task?
Best regards,
Stefan
PS: I miss opened this thread at dev@geronimo.apache.org and "closed"
it. Sorry for the inconvenience.
Re: deploy and undeploy a gbean
Posted by Ricky Ignatius <ac...@worker.com>.
I tried to do deploy/undeploy from code also.
Currently I create ant script to run command line to deploy/undeploy/etc.
<target name="deploy">
<echo message="Deploying ${module.name} at instance port ${rmi.port}" />
<java jar="bin/deployer.jar" fork="true">
<arg value="--port"/>
<arg value="${rmi.port}"/>
<arg value="--user"/>
<arg value="${user}"/>
<arg value="--password"/>
<arg value="${password}"/>
<arg value="deploy"/>
<arg value="${module.name}.war"/>
</java>
</target>
Then I trigger that ant task from code.
public void deployModule(String rmiPort, String moduleName, String user,
String password) {
Map<String, String> param = new HashMap<String, String>();
param.put("rmi.port",rmiPort);
param.put("module.name",moduleName);
param.put("user",user);
param.put("password",password);
antWrapper.callAnt("deploy",true,param);
}
AntWrapper.java
public void callAnt(String target, boolean showOutput,Map<String,
String> param){
Project p = new Project();
p.setUserProperty("ant.file", buildFile.getAbsolutePath());
...
p.fireBuildStarted();
p.init();
ProjectHelper helper = ProjectHelper.getProjectHelper();
p.addReference("ant.projectHelper", helper);
helper.parse(p, buildFile);
p.executeTarget(target);
This one call gbean method directly using JMX:
gbeanObjName = new
ObjectName("geronimo:ServiceModule=org.apache.geronimo.framework/plugin/2.1.3/car,J2EEServer=geronimo,name=PluginInstaller,j2eeType=GBean");
Object [] paramsStartInstall = new Object[] {carFile, null, false, null,
null};
String [] signatureStartInstall = new String[] {"java.io.File",
"java.lang.String" , "boolean", "java.lang.String", "java.lang.String"};
returnObj = mbServerConn.invoke(gbeanObjName, "install-plugin", params,
signature);
Thanks,
Ricky
djencks wrote:
>
>
> On Jan 14, 2009, at 3:29 PM, Ricky Ignatius wrote:
>
>>
>> Hi,
>> I try to do same thing.
>> Currently I use ant to run command line, and call those ant task
>> from java.
>> For install-plugin, I unable to do that using ant so I use JMX to call
>> plugin gbean directly.
>>
>> It's work so far, is there any bteer way to do that?
>
> I'm a little bit confused about what you want. The original request
> was for advice on how to call some gbean methods from within the
> geronimo vm. We also have a lot of gshell commands that call these
> gbean methods from another vm running gshell, and of course there are
> lot of maven plugins that let you do this stuff. You mention ant
> repeatedly.... do you want some way to call these methods from ant?
> Or from another vm? JMX should certainly work but you should be able
> to write some simpler client code if you use gbean proxies as the
> gshell code does.
>
> Ant tasks should be pretty easy to write also, I think no one here
> uses ant much so it hasn't been a priority. If you would like to try
> we can give you some advice and if you could contribute them that
> would be great!
>
> thanks
> david jencks
>
>>
>>
>> Thanks,
>>
>> Ricky
>>
>>
>> djencks wrote:
>>>
>>>
>>> On Aug 27, 2007, at 12:56 AM, Stefan Schulze Frielinghaus wrote:
>>>
>>>> I would like to have the functionality of the command line tool
>>>> "java -jar deployer.jar --user system --password manager
>>>> {deploy,undeploy} <tool>.jar" in a GBean. So I could programmatic
>>>> load and unload other GBeans via a GBean.
>
>
--
View this message in context: http://www.nabble.com/deploy-and-undeploy-a-gbean-tp12317449s134p21468560.html
Sent from the Apache Geronimo - Users mailing list archive at Nabble.com.
Re: deploy and undeploy a gbean
Posted by David Jencks <da...@yahoo.com>.
On Jan 14, 2009, at 3:29 PM, Ricky Ignatius wrote:
>
> Hi,
> I try to do same thing.
> Currently I use ant to run command line, and call those ant task
> from java.
> For install-plugin, I unable to do that using ant so I use JMX to call
> plugin gbean directly.
>
> It's work so far, is there any bteer way to do that?
I'm a little bit confused about what you want. The original request
was for advice on how to call some gbean methods from within the
geronimo vm. We also have a lot of gshell commands that call these
gbean methods from another vm running gshell, and of course there are
lot of maven plugins that let you do this stuff. You mention ant
repeatedly.... do you want some way to call these methods from ant?
Or from another vm? JMX should certainly work but you should be able
to write some simpler client code if you use gbean proxies as the
gshell code does.
Ant tasks should be pretty easy to write also, I think no one here
uses ant much so it hasn't been a priority. If you would like to try
we can give you some advice and if you could contribute them that
would be great!
thanks
david jencks
>
>
> Thanks,
>
> Ricky
>
>
> djencks wrote:
>>
>>
>> On Aug 27, 2007, at 12:56 AM, Stefan Schulze Frielinghaus wrote:
>>
>>> I would like to have the functionality of the command line tool
>>> "java -jar deployer.jar --user system --password manager
>>> {deploy,undeploy} <tool>.jar" in a GBean. So I could programmatic
>>> load and unload other GBeans via a GBean.
>>>
>>> Is something like that possible?
>>
>> Definitely. There's a portlet in the admin console that does that.
>> There's also a portlet that lists all the "gbean" (non-javaee)
>> modules that are running.
>>
>> I assume you are aware that the command you mention deploys a module
>> or configuration that contains a plan describing any number of gbeans
>> and creates a classloader also described by the plan. Your
>> description of what you want sounds a little like you want to deploy
>> single gbeans which is not exactly how I would describe a module.
>>
>> thanks
>> david jencks
>>
>>
>>
>
> --
> View this message in context: http://www.nabble.com/deploy-and-undeploy-a-gbean-tp12317449s134p21467768.html
> Sent from the Apache Geronimo - Users mailing list archive at
> Nabble.com.
>
Re: deploy and undeploy a gbean
Posted by Ricky Ignatius <ac...@worker.com>.
Hi,
I try to do same thing.
Currently I use ant to run command line, and call those ant task from java.
For install-plugin, I unable to do that using ant so I use JMX to call
plugin gbean directly.
It's work so far, is there any bteer way to do that?
Thanks,
Ricky
djencks wrote:
>
>
> On Aug 27, 2007, at 12:56 AM, Stefan Schulze Frielinghaus wrote:
>
>> I would like to have the functionality of the command line tool
>> "java -jar deployer.jar --user system --password manager
>> {deploy,undeploy} <tool>.jar" in a GBean. So I could programmatic
>> load and unload other GBeans via a GBean.
>>
>> Is something like that possible?
>
> Definitely. There's a portlet in the admin console that does that.
> There's also a portlet that lists all the "gbean" (non-javaee)
> modules that are running.
>
> I assume you are aware that the command you mention deploys a module
> or configuration that contains a plan describing any number of gbeans
> and creates a classloader also described by the plan. Your
> description of what you want sounds a little like you want to deploy
> single gbeans which is not exactly how I would describe a module.
>
> thanks
> david jencks
>
>
>
--
View this message in context: http://www.nabble.com/deploy-and-undeploy-a-gbean-tp12317449s134p21467768.html
Sent from the Apache Geronimo - Users mailing list archive at Nabble.com.
Re: deploy and undeploy a gbean
Posted by David Jencks <da...@yahoo.com>.
On Aug 27, 2007, at 12:56 AM, Stefan Schulze Frielinghaus wrote:
> I would like to have the functionality of the command line tool
> "java -jar deployer.jar --user system --password manager
> {deploy,undeploy} <tool>.jar" in a GBean. So I could programmatic
> load and unload other GBeans via a GBean.
>
> Is something like that possible?
Definitely. There's a portlet in the admin console that does that.
There's also a portlet that lists all the "gbean" (non-javaee)
modules that are running.
I assume you are aware that the command you mention deploys a module
or configuration that contains a plan describing any number of gbeans
and creates a classloader also described by the plan. Your
description of what you want sounds a little like you want to deploy
single gbeans which is not exactly how I would describe a module.
thanks
david jencks
>
> On 24.08.2007, at 22:38, David Jencks wrote:
>
>> Could you describe how you want to use this a bit? There's
>> already the ServiceConfigBuilder which converts xml gbean plans to
>> Configurations and the whole Configuration framework which do
>> this. Also you can register custom NamespaceDrivenBuilders to
>> process documents in other xml schemas into gbean configurations.
>> So I wonder if what you want to do is already possible...
>>
>> Without knowing what you are aiming for its very hard to give you
>> any advice.
>>
>> thanks
>> david jencks
>> On Aug 24, 2007, at 11:13 AM, Stefan Schulze Frielinghaus wrote:
>>
>>> Hello,
>>>
>>> I'm trying to write a GBean which dynamically deploys and undeploys
>>> other GBeans. My first thought about this task was to get a list of
>>> all running modules from which I could decide which to undeploy.
>>>
>>> String uri = "deployer:geronimo:inVM";
>>> String username = "system";
>>> String password = "manager";
>>>
>>> dManager = dFactoryMgr.getDeploymentManager(uri, username,
>>> password);
>>>
>>> System.out.println("Targets:");
>>> Target[] targets = dManager.getTargets();
>>> for(Target t : targets) {
>>> System.out.println(t);
>>> }
>>>
>>> System.out.println("Modules:");
>>> TargetModuleID[] moduleIDs = dManager.getRunningModules(null,
>>> targets);
>>>
>>> for(TargetModuleID m : moduleIDs) {
>>> System.out.println(m);
>>> }
>>>
>>> With the code above I tried to accomplish my goal. But if I run this
>>> one I get the following exception:
>>>
>>> 14:38:55,100 ERROR [BaseDeploymentFactory]
>>> org.apache.geronimo.web.deployment.WARConfigurer
>>> java.lang.ClassCastException:
>>> org.apache.geronimo.web.deployment.WARConfigurer
>>> at
>>> org.apache.geronimo.deployment.plugin.jmx.LocalDeploymentManager.loa
>>> dMod
>>> uleConfigurers(LocalDeploymentManager.java:51)
>>> at
>>> org.apache.geronimo.deployment.plugin.jmx.LocalDeploymentManager.<in
>>> it>(
>>> LocalDeploymentManager.java:41)
>>> at
>>> org.apache.geronimo.deployment.plugin.factories.BaseDeploymentFactor
>>> y.ge
>>> tDeploymentManager(BaseDeploymentFactory.java:133)
>>> at
>>> javax.enterprise.deploy.shared.factories.DeploymentFactoryManager.ge
>>> tDep
>>> loymentManager(DeploymentFactoryManager.java:109)
>>> at
>>> de.furtwangen.hs.informatik.geronimo.ac.MigrationService.test
>>> (MigrationService.java:37)
>>> at
>>> de.furtwangen.hs.informatik.geronimo.ac.AutonomicGeronimoGBean.testM
>>> igra
>>> tion(AutonomicGeronimoGBean.java:202)
>>> at
>>> de.furtwangen.hs.informatik.geronimo.ac.AutonomicGeronimoGBean$
>>> $FastClassByCGLIB$$78735f6f.invoke(<generated>)
>>> at net.sf.cglib.reflect.FastMethod.invoke
>>> (FastMethod.java:53)
>>> at
>>> org.apache.geronimo.gbean.runtime.FastMethodInvoker.invoke
>>> (FastMethodInvoker.java:38)
>>> at org.apache.geronimo.gbean.runtime.GBeanOperation.invoke
>>> (GBeanOperation.java:127)
>>> at org.apache.geronimo.gbean.runtime.GBeanInstance.invoke
>>> (GBeanInstance.java:863)
>>> at org.apache.geronimo.kernel.basic.BasicKernel.invoke
>>> (BasicKernel.java:239)
>>> at org.apache.geronimo.system.jmx.MBeanGBeanBridge.invoke
>>> (MBeanGBeanBridge.java:168)
>>> at com.sun.jmx.mbeanserver.DynamicMetaDataImpl.invoke
>>> (DynamicMetaDataImpl.java:213)
>>> at com.sun.jmx.mbeanserver.MetaDataImpl.invoke
>>> (MetaDataImpl.java:220)
>>> at
>>> com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke
>>> (DefaultMBeanServerInterceptor.java:815)
>>> at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke
>>> (JmxMBeanServer.java:784)
>>> at
>>> javax.management.remote.rmi.RMIConnectionImpl.doOperation
>>> (RMIConnectionImpl.java:1408)
>>> at javax.management.remote.rmi.RMIConnectionImpl.access$100
>>> (RMIConnectionImpl.java:81)
>>> at javax.management.remote.rmi.RMIConnectionImpl
>>> $PrivilegedOperation.run(RMIConnectionImpl.java:1245)
>>> at
>>> javax.management.remote.rmi.RMIConnectionImpl.doPrivilegedOperation
>>> (RMIConnectionImpl.java:1341)
>>> at javax.management.remote.rmi.RMIConnectionImpl.invoke
>>> (RMIConnectionImpl.java:782)
>>> at sun.reflect.GeneratedMethodAccessor187.invoke(Unknown
>>> Source)
>>> at sun.reflect.DelegatingMethodAccessorImpl.invoke
>>> (DelegatingMethodAccessorImpl.java:25)
>>> at java.lang.reflect.Method.invoke(Method.java:585)
>>> at sun.rmi.server.UnicastServerRef.dispatch
>>> (UnicastServerRef.java:294)
>>> at sun.rmi.transport.Transport$1.run(Transport.java:153)
>>> at java.security.AccessController.doPrivileged(Native
>>> Method)
>>> at sun.rmi.transport.Transport.serviceCall
>>> (Transport.java:149)
>>> at sun.rmi.transport.tcp.TCPTransport.handleMessages
>>> (TCPTransport.java:466)
>>> at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run
>>> (TCPTransport.java:707)
>>> at java.lang.Thread.run(Thread.java:613)
>>>
>>> Is there another way to deploy/undeploy GBeans via another GBean?
>>>
>>> I even tried it with another URI (String uri =
>>> "deployer:geronimo:jmx:rmi://localhost/jndi/rmi:/JMXConnector";) but
>>> with that I still got a worse result.
>>>
>>> javax.enterprise.deploy.spi.exceptions.DeploymentManagerCreationExce
>>> ptio
>>> n: Failed to retrieve RMIServer stub:
>>> javax.naming.NoInitialContextException: Cannot instantiate class:
>>> org.apache.xbean.naming.global.GlobalContextManager [Root exception
>>> is java.lang.ClassNotFoundException:
>>> org.apache.xbean.naming.global.GlobalContextManager]
>>> at
>>> org.apache.geronimo.deployment.plugin.factories.BaseDeploymentFactor
>>> y.ne
>>> wRemoteDeploymentManager(BaseDeploymentFactory.java:167)
>>> at
>>> org.apache.geronimo.deployment.plugin.factories.BaseDeploymentFactor
>>> y.ge
>>> tDeploymentManager(BaseDeploymentFactory.java:131)
>>> at
>>> javax.enterprise.deploy.shared.factories.DeploymentFactoryManager.ge
>>> tDep
>>> loymentManager(DeploymentFactoryManager.java:109)
>>> at
>>> de.furtwangen.hs.informatik.geronimo.ac.MigrationService.test
>>> (MigrationService.java:37)
>>> at
>>> de.furtwangen.hs.informatik.geronimo.ac.AutonomicGeronimoGBean.testM
>>> igra
>>> tion(AutonomicGeronimoGBean.java:202)
>>> at
>>> de.furtwangen.hs.informatik.geronimo.ac.AutonomicGeronimoGBean$
>>> $FastClassByCGLIB$$78735f6f.invoke(<generated>)
>>> at net.sf.cglib.reflect.FastMethod.invoke
>>> (FastMethod.java:53)
>>> at
>>> org.apache.geronimo.gbean.runtime.FastMethodInvoker.invoke
>>> (FastMethodInvoker.java:38)
>>> at org.apache.geronimo.gbean.runtime.GBeanOperation.invoke
>>> (GBeanOperation.java:127)
>>> at org.apache.geronimo.gbean.runtime.GBeanInstance.invoke
>>> (GBeanInstance.java:863)
>>> at org.apache.geronimo.kernel.basic.BasicKernel.invoke
>>> (BasicKernel.java:239)
>>> at org.apache.geronimo.system.jmx.MBeanGBeanBridge.invoke
>>> (MBeanGBeanBridge.java:168)
>>> at com.sun.jmx.mbeanserver.DynamicMetaDataImpl.invoke
>>> (DynamicMetaDataImpl.java:213)
>>> at com.sun.jmx.mbeanserver.MetaDataImpl.invoke
>>> (MetaDataImpl.java:220)
>>> at
>>> com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke
>>> (DefaultMBeanServerInterceptor.java:815)
>>> at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke
>>> (JmxMBeanServer.java:784)
>>> at
>>> javax.management.remote.rmi.RMIConnectionImpl.doOperation
>>> (RMIConnectionImpl.java:1408)
>>> at javax.management.remote.rmi.RMIConnectionImpl.access$100
>>> (RMIConnectionImpl.java:81)
>>> at javax.management.remote.rmi.RMIConnectionImpl
>>> $PrivilegedOperation.run(RMIConnectionImpl.java:1245)
>>> at
>>> javax.management.remote.rmi.RMIConnectionImpl.doPrivilegedOperation
>>> (RMIConnectionImpl.java:1341)
>>> at javax.management.remote.rmi.RMIConnectionImpl.invoke
>>> (RMIConnectionImpl.java:782)
>>> at sun.reflect.GeneratedMethodAccessor187.invoke(Unknown
>>> Source)
>>> at sun.reflect.DelegatingMethodAccessorImpl.invoke
>>> (DelegatingMethodAccessorImpl.java:25)
>>> at java.lang.reflect.Method.invoke(Method.java:585)
>>> at sun.rmi.server.UnicastServerRef.dispatch
>>> (UnicastServerRef.java:294)
>>> at sun.rmi.transport.Transport$1.run(Transport.java:153)
>>> at java.security.AccessController.doPrivileged(Native
>>> Method)
>>> at sun.rmi.transport.Transport.serviceCall
>>> (Transport.java:149)
>>> at sun.rmi.transport.tcp.TCPTransport.handleMessages
>>> (TCPTransport.java:466)
>>> at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run
>>> (TCPTransport.java:707)
>>> at java.lang.Thread.run(Thread.java:613)
>>> Caused by: java.io.IOException: Failed to retrieve RMIServer stub:
>>> javax.naming.NoInitialContextException: Cannot instantiate class:
>>> org.apache.xbean.naming.global.GlobalContextManager [Root exception
>>> is java.lang.ClassNotFoundException:
>>> org.apache.xbean.naming.global.GlobalContextManager]
>>> at javax.management.remote.rmi.RMIConnector.connect
>>> (RMIConnector.java:317)
>>> at javax.management.remote.JMXConnectorFactory.connect
>>> (JMXConnectorFactory.java:248)
>>> at
>>> org.apache.geronimo.deployment.plugin.factories.BaseDeploymentFactor
>>> y.ne
>>> wRemoteDeploymentManager(BaseDeploymentFactory.java:159)
>>> ... 30 more
>>> Caused by: javax.naming.NoInitialContextException: Cannot
>>> instantiate
>>> class: org.apache.xbean.naming.global.GlobalContextManager [Root
>>> exception is java.lang.ClassNotFoundException:
>>> org.apache.xbean.naming.global.GlobalContextManager]
>>> at javax.naming.spi.NamingManager.getInitialContext
>>> (NamingManager.java:657)
>>> at javax.naming.InitialContext.getDefaultInitCtx
>>> (InitialContext.java:247)
>>> at javax.naming.InitialContext.init(InitialContext.java:
>>> 223)
>>> at javax.naming.InitialContext.<init>
>>> (InitialContext.java:197)
>>> at
>>> javax.management.remote.rmi.RMIConnector.findRMIServerJNDI
>>> (RMIConnector.java:1815)
>>> at javax.management.remote.rmi.RMIConnector.findRMIServer
>>> (RMIConnector.java:1787)
>>> at javax.management.remote.rmi.RMIConnector.connect
>>> (RMIConnector.java:259)
>>> ... 32 more
>>> Caused by: java.lang.ClassNotFoundException:
>>> org.apache.xbean.naming.global.GlobalContextManager
>>> at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
>>> at java.security.AccessController.doPrivileged(Native
>>> Method)
>>> at java.net.URLClassLoader.findClass(URLClassLoader.java:
>>> 188)
>>> at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
>>> at sun.misc.Launcher$AppClassLoader.loadClass
>>> (Launcher.java:
>>> 268)
>>> at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
>>> at java.lang.ClassLoader.loadClassInternal
>>> (ClassLoader.java:
>>> 319)
>>> at java.lang.Class.forName0(Native Method)
>>> at java.lang.Class.forName(Class.java:242)
>>> at com.sun.naming.internal.VersionHelper12.loadClass
>>> (VersionHelper12.java:42)
>>> at javax.naming.spi.NamingManager.getInitialContext
>>> (NamingManager.java:654)
>>> ... 38 more
>>>
>>> Since I've the package org.apache.xbean.naming in my classpath I
>>> don't no why geronimo can't instantiate a class of them.
>>>
>>> So has anyone an idea how to solve a deply/undeploy task?
>>>
>>> Best regards,
>>> Stefan
>>>
>>> PS: I miss opened this thread at dev@geronimo.apache.org and
>>> "closed" it. Sorry for the inconvenience.
>>
>
Re: deploy and undeploy a gbean
Posted by Stefan Schulze Frielinghaus <st...@sf-net.com>.
I would like to have the functionality of the command line tool "java
-jar deployer.jar --user system --password manager {deploy,undeploy}
<tool>.jar" in a GBean. So I could programmatic load and unload other
GBeans via a GBean.
Is something like that possible?
On 24.08.2007, at 22:38, David Jencks wrote:
> Could you describe how you want to use this a bit? There's already
> the ServiceConfigBuilder which converts xml gbean plans to
> Configurations and the whole Configuration framework which do
> this. Also you can register custom NamespaceDrivenBuilders to
> process documents in other xml schemas into gbean configurations.
> So I wonder if what you want to do is already possible...
>
> Without knowing what you are aiming for its very hard to give you
> any advice.
>
> thanks
> david jencks
> On Aug 24, 2007, at 11:13 AM, Stefan Schulze Frielinghaus wrote:
>
>> Hello,
>>
>> I'm trying to write a GBean which dynamically deploys and undeploys
>> other GBeans. My first thought about this task was to get a list of
>> all running modules from which I could decide which to undeploy.
>>
>> String uri = "deployer:geronimo:inVM";
>> String username = "system";
>> String password = "manager";
>>
>> dManager = dFactoryMgr.getDeploymentManager(uri, username, password);
>>
>> System.out.println("Targets:");
>> Target[] targets = dManager.getTargets();
>> for(Target t : targets) {
>> System.out.println(t);
>> }
>>
>> System.out.println("Modules:");
>> TargetModuleID[] moduleIDs = dManager.getRunningModules(null,
>> targets);
>>
>> for(TargetModuleID m : moduleIDs) {
>> System.out.println(m);
>> }
>>
>> With the code above I tried to accomplish my goal. But if I run this
>> one I get the following exception:
>>
>> 14:38:55,100 ERROR [BaseDeploymentFactory]
>> org.apache.geronimo.web.deployment.WARConfigurer
>> java.lang.ClassCastException:
>> org.apache.geronimo.web.deployment.WARConfigurer
>> at
>> org.apache.geronimo.deployment.plugin.jmx.LocalDeploymentManager.load
>> Mod
>> uleConfigurers(LocalDeploymentManager.java:51)
>> at
>> org.apache.geronimo.deployment.plugin.jmx.LocalDeploymentManager.<ini
>> t>(
>> LocalDeploymentManager.java:41)
>> at
>> org.apache.geronimo.deployment.plugin.factories.BaseDeploymentFactory
>> .ge
>> tDeploymentManager(BaseDeploymentFactory.java:133)
>> at
>> javax.enterprise.deploy.shared.factories.DeploymentFactoryManager.get
>> Dep
>> loymentManager(DeploymentFactoryManager.java:109)
>> at
>> de.furtwangen.hs.informatik.geronimo.ac.MigrationService.test
>> (MigrationService.java:37)
>> at
>> de.furtwangen.hs.informatik.geronimo.ac.AutonomicGeronimoGBean.testMi
>> gra
>> tion(AutonomicGeronimoGBean.java:202)
>> at
>> de.furtwangen.hs.informatik.geronimo.ac.AutonomicGeronimoGBean$
>> $FastClassByCGLIB$$78735f6f.invoke(<generated>)
>> at net.sf.cglib.reflect.FastMethod.invoke(FastMethod.java:
>> 53)
>> at
>> org.apache.geronimo.gbean.runtime.FastMethodInvoker.invoke
>> (FastMethodInvoker.java:38)
>> at org.apache.geronimo.gbean.runtime.GBeanOperation.invoke
>> (GBeanOperation.java:127)
>> at org.apache.geronimo.gbean.runtime.GBeanInstance.invoke
>> (GBeanInstance.java:863)
>> at org.apache.geronimo.kernel.basic.BasicKernel.invoke
>> (BasicKernel.java:239)
>> at org.apache.geronimo.system.jmx.MBeanGBeanBridge.invoke
>> (MBeanGBeanBridge.java:168)
>> at com.sun.jmx.mbeanserver.DynamicMetaDataImpl.invoke
>> (DynamicMetaDataImpl.java:213)
>> at com.sun.jmx.mbeanserver.MetaDataImpl.invoke
>> (MetaDataImpl.java:220)
>> at
>> com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke
>> (DefaultMBeanServerInterceptor.java:815)
>> at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke
>> (JmxMBeanServer.java:784)
>> at javax.management.remote.rmi.RMIConnectionImpl.doOperation
>> (RMIConnectionImpl.java:1408)
>> at javax.management.remote.rmi.RMIConnectionImpl.access$100
>> (RMIConnectionImpl.java:81)
>> at javax.management.remote.rmi.RMIConnectionImpl
>> $PrivilegedOperation.run(RMIConnectionImpl.java:1245)
>> at
>> javax.management.remote.rmi.RMIConnectionImpl.doPrivilegedOperation
>> (RMIConnectionImpl.java:1341)
>> at javax.management.remote.rmi.RMIConnectionImpl.invoke
>> (RMIConnectionImpl.java:782)
>> at sun.reflect.GeneratedMethodAccessor187.invoke(Unknown
>> Source)
>> at sun.reflect.DelegatingMethodAccessorImpl.invoke
>> (DelegatingMethodAccessorImpl.java:25)
>> at java.lang.reflect.Method.invoke(Method.java:585)
>> at sun.rmi.server.UnicastServerRef.dispatch
>> (UnicastServerRef.java:294)
>> at sun.rmi.transport.Transport$1.run(Transport.java:153)
>> at java.security.AccessController.doPrivileged(Native
>> Method)
>> at sun.rmi.transport.Transport.serviceCall(Transport.java:
>> 149)
>> at sun.rmi.transport.tcp.TCPTransport.handleMessages
>> (TCPTransport.java:466)
>> at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run
>> (TCPTransport.java:707)
>> at java.lang.Thread.run(Thread.java:613)
>>
>> Is there another way to deploy/undeploy GBeans via another GBean?
>>
>> I even tried it with another URI (String uri =
>> "deployer:geronimo:jmx:rmi://localhost/jndi/rmi:/JMXConnector";) but
>> with that I still got a worse result.
>>
>> javax.enterprise.deploy.spi.exceptions.DeploymentManagerCreationExcep
>> tio
>> n: Failed to retrieve RMIServer stub:
>> javax.naming.NoInitialContextException: Cannot instantiate class:
>> org.apache.xbean.naming.global.GlobalContextManager [Root exception
>> is java.lang.ClassNotFoundException:
>> org.apache.xbean.naming.global.GlobalContextManager]
>> at
>> org.apache.geronimo.deployment.plugin.factories.BaseDeploymentFactory
>> .ne
>> wRemoteDeploymentManager(BaseDeploymentFactory.java:167)
>> at
>> org.apache.geronimo.deployment.plugin.factories.BaseDeploymentFactory
>> .ge
>> tDeploymentManager(BaseDeploymentFactory.java:131)
>> at
>> javax.enterprise.deploy.shared.factories.DeploymentFactoryManager.get
>> Dep
>> loymentManager(DeploymentFactoryManager.java:109)
>> at
>> de.furtwangen.hs.informatik.geronimo.ac.MigrationService.test
>> (MigrationService.java:37)
>> at
>> de.furtwangen.hs.informatik.geronimo.ac.AutonomicGeronimoGBean.testMi
>> gra
>> tion(AutonomicGeronimoGBean.java:202)
>> at
>> de.furtwangen.hs.informatik.geronimo.ac.AutonomicGeronimoGBean$
>> $FastClassByCGLIB$$78735f6f.invoke(<generated>)
>> at net.sf.cglib.reflect.FastMethod.invoke(FastMethod.java:
>> 53)
>> at
>> org.apache.geronimo.gbean.runtime.FastMethodInvoker.invoke
>> (FastMethodInvoker.java:38)
>> at org.apache.geronimo.gbean.runtime.GBeanOperation.invoke
>> (GBeanOperation.java:127)
>> at org.apache.geronimo.gbean.runtime.GBeanInstance.invoke
>> (GBeanInstance.java:863)
>> at org.apache.geronimo.kernel.basic.BasicKernel.invoke
>> (BasicKernel.java:239)
>> at org.apache.geronimo.system.jmx.MBeanGBeanBridge.invoke
>> (MBeanGBeanBridge.java:168)
>> at com.sun.jmx.mbeanserver.DynamicMetaDataImpl.invoke
>> (DynamicMetaDataImpl.java:213)
>> at com.sun.jmx.mbeanserver.MetaDataImpl.invoke
>> (MetaDataImpl.java:220)
>> at
>> com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke
>> (DefaultMBeanServerInterceptor.java:815)
>> at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke
>> (JmxMBeanServer.java:784)
>> at javax.management.remote.rmi.RMIConnectionImpl.doOperation
>> (RMIConnectionImpl.java:1408)
>> at javax.management.remote.rmi.RMIConnectionImpl.access$100
>> (RMIConnectionImpl.java:81)
>> at javax.management.remote.rmi.RMIConnectionImpl
>> $PrivilegedOperation.run(RMIConnectionImpl.java:1245)
>> at
>> javax.management.remote.rmi.RMIConnectionImpl.doPrivilegedOperation
>> (RMIConnectionImpl.java:1341)
>> at javax.management.remote.rmi.RMIConnectionImpl.invoke
>> (RMIConnectionImpl.java:782)
>> at sun.reflect.GeneratedMethodAccessor187.invoke(Unknown
>> Source)
>> at sun.reflect.DelegatingMethodAccessorImpl.invoke
>> (DelegatingMethodAccessorImpl.java:25)
>> at java.lang.reflect.Method.invoke(Method.java:585)
>> at sun.rmi.server.UnicastServerRef.dispatch
>> (UnicastServerRef.java:294)
>> at sun.rmi.transport.Transport$1.run(Transport.java:153)
>> at java.security.AccessController.doPrivileged(Native
>> Method)
>> at sun.rmi.transport.Transport.serviceCall(Transport.java:
>> 149)
>> at sun.rmi.transport.tcp.TCPTransport.handleMessages
>> (TCPTransport.java:466)
>> at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run
>> (TCPTransport.java:707)
>> at java.lang.Thread.run(Thread.java:613)
>> Caused by: java.io.IOException: Failed to retrieve RMIServer stub:
>> javax.naming.NoInitialContextException: Cannot instantiate class:
>> org.apache.xbean.naming.global.GlobalContextManager [Root exception
>> is java.lang.ClassNotFoundException:
>> org.apache.xbean.naming.global.GlobalContextManager]
>> at javax.management.remote.rmi.RMIConnector.connect
>> (RMIConnector.java:317)
>> at javax.management.remote.JMXConnectorFactory.connect
>> (JMXConnectorFactory.java:248)
>> at
>> org.apache.geronimo.deployment.plugin.factories.BaseDeploymentFactory
>> .ne
>> wRemoteDeploymentManager(BaseDeploymentFactory.java:159)
>> ... 30 more
>> Caused by: javax.naming.NoInitialContextException: Cannot instantiate
>> class: org.apache.xbean.naming.global.GlobalContextManager [Root
>> exception is java.lang.ClassNotFoundException:
>> org.apache.xbean.naming.global.GlobalContextManager]
>> at javax.naming.spi.NamingManager.getInitialContext
>> (NamingManager.java:657)
>> at javax.naming.InitialContext.getDefaultInitCtx
>> (InitialContext.java:247)
>> at javax.naming.InitialContext.init(InitialContext.java:223)
>> at javax.naming.InitialContext.<init>(InitialContext.java:
>> 197)
>> at
>> javax.management.remote.rmi.RMIConnector.findRMIServerJNDI
>> (RMIConnector.java:1815)
>> at javax.management.remote.rmi.RMIConnector.findRMIServer
>> (RMIConnector.java:1787)
>> at javax.management.remote.rmi.RMIConnector.connect
>> (RMIConnector.java:259)
>> ... 32 more
>> Caused by: java.lang.ClassNotFoundException:
>> org.apache.xbean.naming.global.GlobalContextManager
>> at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
>> at java.security.AccessController.doPrivileged(Native
>> Method)
>> at java.net.URLClassLoader.findClass(URLClassLoader.java:
>> 188)
>> at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
>> at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:
>> 268)
>> at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
>> at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:
>> 319)
>> at java.lang.Class.forName0(Native Method)
>> at java.lang.Class.forName(Class.java:242)
>> at com.sun.naming.internal.VersionHelper12.loadClass
>> (VersionHelper12.java:42)
>> at javax.naming.spi.NamingManager.getInitialContext
>> (NamingManager.java:654)
>> ... 38 more
>>
>> Since I've the package org.apache.xbean.naming in my classpath I
>> don't no why geronimo can't instantiate a class of them.
>>
>> So has anyone an idea how to solve a deply/undeploy task?
>>
>> Best regards,
>> Stefan
>>
>> PS: I miss opened this thread at dev@geronimo.apache.org and
>> "closed" it. Sorry for the inconvenience.
>
Re: deploy and undeploy a gbean
Posted by David Jencks <da...@yahoo.com>.
Could you describe how you want to use this a bit? There's already
the ServiceConfigBuilder which converts xml gbean plans to
Configurations and the whole Configuration framework which do this.
Also you can register custom NamespaceDrivenBuilders to process
documents in other xml schemas into gbean configurations. So I
wonder if what you want to do is already possible...
Without knowing what you are aiming for its very hard to give you any
advice.
thanks
david jencks
On Aug 24, 2007, at 11:13 AM, Stefan Schulze Frielinghaus wrote:
> Hello,
>
> I'm trying to write a GBean which dynamically deploys and undeploys
> other GBeans. My first thought about this task was to get a list of
> all running modules from which I could decide which to undeploy.
>
> String uri = "deployer:geronimo:inVM";
> String username = "system";
> String password = "manager";
>
> dManager = dFactoryMgr.getDeploymentManager(uri, username, password);
>
> System.out.println("Targets:");
> Target[] targets = dManager.getTargets();
> for(Target t : targets) {
> System.out.println(t);
> }
>
> System.out.println("Modules:");
> TargetModuleID[] moduleIDs = dManager.getRunningModules(null,
> targets);
>
> for(TargetModuleID m : moduleIDs) {
> System.out.println(m);
> }
>
> With the code above I tried to accomplish my goal. But if I run this
> one I get the following exception:
>
> 14:38:55,100 ERROR [BaseDeploymentFactory]
> org.apache.geronimo.web.deployment.WARConfigurer
> java.lang.ClassCastException:
> org.apache.geronimo.web.deployment.WARConfigurer
> at
> org.apache.geronimo.deployment.plugin.jmx.LocalDeploymentManager.loadM
> od
> uleConfigurers(LocalDeploymentManager.java:51)
> at
> org.apache.geronimo.deployment.plugin.jmx.LocalDeploymentManager.<init
> >(
> LocalDeploymentManager.java:41)
> at
> org.apache.geronimo.deployment.plugin.factories.BaseDeploymentFactory.
> ge
> tDeploymentManager(BaseDeploymentFactory.java:133)
> at
> javax.enterprise.deploy.shared.factories.DeploymentFactoryManager.getD
> ep
> loymentManager(DeploymentFactoryManager.java:109)
> at
> de.furtwangen.hs.informatik.geronimo.ac.MigrationService.test
> (MigrationService.java:37)
> at
> de.furtwangen.hs.informatik.geronimo.ac.AutonomicGeronimoGBean.testMig
> ra
> tion(AutonomicGeronimoGBean.java:202)
> at
> de.furtwangen.hs.informatik.geronimo.ac.AutonomicGeronimoGBean$
> $FastClassByCGLIB$$78735f6f.invoke(<generated>)
> at net.sf.cglib.reflect.FastMethod.invoke(FastMethod.java:53)
> at org.apache.geronimo.gbean.runtime.FastMethodInvoker.invoke
> (FastMethodInvoker.java:38)
> at org.apache.geronimo.gbean.runtime.GBeanOperation.invoke
> (GBeanOperation.java:127)
> at org.apache.geronimo.gbean.runtime.GBeanInstance.invoke
> (GBeanInstance.java:863)
> at org.apache.geronimo.kernel.basic.BasicKernel.invoke
> (BasicKernel.java:239)
> at org.apache.geronimo.system.jmx.MBeanGBeanBridge.invoke
> (MBeanGBeanBridge.java:168)
> at com.sun.jmx.mbeanserver.DynamicMetaDataImpl.invoke
> (DynamicMetaDataImpl.java:213)
> at com.sun.jmx.mbeanserver.MetaDataImpl.invoke
> (MetaDataImpl.java:220)
> at
> com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke
> (DefaultMBeanServerInterceptor.java:815)
> at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke
> (JmxMBeanServer.java:784)
> at javax.management.remote.rmi.RMIConnectionImpl.doOperation
> (RMIConnectionImpl.java:1408)
> at javax.management.remote.rmi.RMIConnectionImpl.access$100
> (RMIConnectionImpl.java:81)
> at javax.management.remote.rmi.RMIConnectionImpl
> $PrivilegedOperation.run(RMIConnectionImpl.java:1245)
> at
> javax.management.remote.rmi.RMIConnectionImpl.doPrivilegedOperation
> (RMIConnectionImpl.java:1341)
> at javax.management.remote.rmi.RMIConnectionImpl.invoke
> (RMIConnectionImpl.java:782)
> at sun.reflect.GeneratedMethodAccessor187.invoke(Unknown
> Source)
> at sun.reflect.DelegatingMethodAccessorImpl.invoke
> (DelegatingMethodAccessorImpl.java:25)
> at java.lang.reflect.Method.invoke(Method.java:585)
> at sun.rmi.server.UnicastServerRef.dispatch
> (UnicastServerRef.java:294)
> at sun.rmi.transport.Transport$1.run(Transport.java:153)
> at java.security.AccessController.doPrivileged(Native Method)
> at sun.rmi.transport.Transport.serviceCall(Transport.java:
> 149)
> at sun.rmi.transport.tcp.TCPTransport.handleMessages
> (TCPTransport.java:466)
> at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run
> (TCPTransport.java:707)
> at java.lang.Thread.run(Thread.java:613)
>
> Is there another way to deploy/undeploy GBeans via another GBean?
>
> I even tried it with another URI (String uri =
> "deployer:geronimo:jmx:rmi://localhost/jndi/rmi:/JMXConnector";) but
> with that I still got a worse result.
>
> javax.enterprise.deploy.spi.exceptions.DeploymentManagerCreationExcept
> io
> n: Failed to retrieve RMIServer stub:
> javax.naming.NoInitialContextException: Cannot instantiate class:
> org.apache.xbean.naming.global.GlobalContextManager [Root exception
> is java.lang.ClassNotFoundException:
> org.apache.xbean.naming.global.GlobalContextManager]
> at
> org.apache.geronimo.deployment.plugin.factories.BaseDeploymentFactory.
> ne
> wRemoteDeploymentManager(BaseDeploymentFactory.java:167)
> at
> org.apache.geronimo.deployment.plugin.factories.BaseDeploymentFactory.
> ge
> tDeploymentManager(BaseDeploymentFactory.java:131)
> at
> javax.enterprise.deploy.shared.factories.DeploymentFactoryManager.getD
> ep
> loymentManager(DeploymentFactoryManager.java:109)
> at
> de.furtwangen.hs.informatik.geronimo.ac.MigrationService.test
> (MigrationService.java:37)
> at
> de.furtwangen.hs.informatik.geronimo.ac.AutonomicGeronimoGBean.testMig
> ra
> tion(AutonomicGeronimoGBean.java:202)
> at
> de.furtwangen.hs.informatik.geronimo.ac.AutonomicGeronimoGBean$
> $FastClassByCGLIB$$78735f6f.invoke(<generated>)
> at net.sf.cglib.reflect.FastMethod.invoke(FastMethod.java:53)
> at org.apache.geronimo.gbean.runtime.FastMethodInvoker.invoke
> (FastMethodInvoker.java:38)
> at org.apache.geronimo.gbean.runtime.GBeanOperation.invoke
> (GBeanOperation.java:127)
> at org.apache.geronimo.gbean.runtime.GBeanInstance.invoke
> (GBeanInstance.java:863)
> at org.apache.geronimo.kernel.basic.BasicKernel.invoke
> (BasicKernel.java:239)
> at org.apache.geronimo.system.jmx.MBeanGBeanBridge.invoke
> (MBeanGBeanBridge.java:168)
> at com.sun.jmx.mbeanserver.DynamicMetaDataImpl.invoke
> (DynamicMetaDataImpl.java:213)
> at com.sun.jmx.mbeanserver.MetaDataImpl.invoke
> (MetaDataImpl.java:220)
> at
> com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke
> (DefaultMBeanServerInterceptor.java:815)
> at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke
> (JmxMBeanServer.java:784)
> at javax.management.remote.rmi.RMIConnectionImpl.doOperation
> (RMIConnectionImpl.java:1408)
> at javax.management.remote.rmi.RMIConnectionImpl.access$100
> (RMIConnectionImpl.java:81)
> at javax.management.remote.rmi.RMIConnectionImpl
> $PrivilegedOperation.run(RMIConnectionImpl.java:1245)
> at
> javax.management.remote.rmi.RMIConnectionImpl.doPrivilegedOperation
> (RMIConnectionImpl.java:1341)
> at javax.management.remote.rmi.RMIConnectionImpl.invoke
> (RMIConnectionImpl.java:782)
> at sun.reflect.GeneratedMethodAccessor187.invoke(Unknown
> Source)
> at sun.reflect.DelegatingMethodAccessorImpl.invoke
> (DelegatingMethodAccessorImpl.java:25)
> at java.lang.reflect.Method.invoke(Method.java:585)
> at sun.rmi.server.UnicastServerRef.dispatch
> (UnicastServerRef.java:294)
> at sun.rmi.transport.Transport$1.run(Transport.java:153)
> at java.security.AccessController.doPrivileged(Native Method)
> at sun.rmi.transport.Transport.serviceCall(Transport.java:
> 149)
> at sun.rmi.transport.tcp.TCPTransport.handleMessages
> (TCPTransport.java:466)
> at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run
> (TCPTransport.java:707)
> at java.lang.Thread.run(Thread.java:613)
> Caused by: java.io.IOException: Failed to retrieve RMIServer stub:
> javax.naming.NoInitialContextException: Cannot instantiate class:
> org.apache.xbean.naming.global.GlobalContextManager [Root exception
> is java.lang.ClassNotFoundException:
> org.apache.xbean.naming.global.GlobalContextManager]
> at javax.management.remote.rmi.RMIConnector.connect
> (RMIConnector.java:317)
> at javax.management.remote.JMXConnectorFactory.connect
> (JMXConnectorFactory.java:248)
> at
> org.apache.geronimo.deployment.plugin.factories.BaseDeploymentFactory.
> ne
> wRemoteDeploymentManager(BaseDeploymentFactory.java:159)
> ... 30 more
> Caused by: javax.naming.NoInitialContextException: Cannot instantiate
> class: org.apache.xbean.naming.global.GlobalContextManager [Root
> exception is java.lang.ClassNotFoundException:
> org.apache.xbean.naming.global.GlobalContextManager]
> at javax.naming.spi.NamingManager.getInitialContext
> (NamingManager.java:657)
> at javax.naming.InitialContext.getDefaultInitCtx
> (InitialContext.java:247)
> at javax.naming.InitialContext.init(InitialContext.java:223)
> at javax.naming.InitialContext.<init>(InitialContext.java:
> 197)
> at javax.management.remote.rmi.RMIConnector.findRMIServerJNDI
> (RMIConnector.java:1815)
> at javax.management.remote.rmi.RMIConnector.findRMIServer
> (RMIConnector.java:1787)
> at javax.management.remote.rmi.RMIConnector.connect
> (RMIConnector.java:259)
> ... 32 more
> Caused by: java.lang.ClassNotFoundException:
> org.apache.xbean.naming.global.GlobalContextManager
> at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
> at java.security.AccessController.doPrivileged(Native Method)
> at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
> at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
> at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:
> 268)
> at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
> at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:
> 319)
> at java.lang.Class.forName0(Native Method)
> at java.lang.Class.forName(Class.java:242)
> at com.sun.naming.internal.VersionHelper12.loadClass
> (VersionHelper12.java:42)
> at javax.naming.spi.NamingManager.getInitialContext
> (NamingManager.java:654)
> ... 38 more
>
> Since I've the package org.apache.xbean.naming in my classpath I
> don't no why geronimo can't instantiate a class of them.
>
> So has anyone an idea how to solve a deply/undeploy task?
>
> Best regards,
> Stefan
>
> PS: I miss opened this thread at dev@geronimo.apache.org and
> "closed" it. Sorry for the inconvenience.