Well, if i want to invoke the deployment localy, what should i do in order to get the Spring context of this bean & invoke it?
Is it a good approach? Thanks. On Thu, Mar 5, 2009 at 5:47 PM, Guillaume Nodet <[email protected]> wrote: > The DeployServiceAssembly is supposed to be initialized via a spring config > from inside servicemix (it's really only used when using a static > configuration file for servicemix to be able to deploy jbi artifacts from > the configuration itself). > I thought you were looking for a remote way to deploy your SA. > > On Thu, Mar 5, 2009 at 16:41, liav ezer <[email protected]> wrote: > > > Hi, > > > > After a bit research i got my hands on the class which implement the > deploy > > process itself & wrote the following: > > > > DeployServiceAssembly deploySA = *new* DeployServiceAssembly(); > > > > deploySA.setServiceAssemblyName( > > "c:\liav\forecast-weather-consumer-sa-1.1.jar"); > > > > deploySA.doDeploy(); // <- compilation error here > > But, I have the following compilation error indicating a build bath error > > on > > Spring. > > > > The type org.springframework.beans.factory.InitializingBean cannot be > > resolved. It is indirectly referenced from required .class files > > > > My build path points to the .m2 repository - why is it refering to Spring > > class? > > > > Thanks. > > > > > > On Thu, Mar 5, 2009 at 9:28 AM, Guillaume Nodet <[email protected]> > wrote: > > > > > See http://java.sun.com/docs/books/tutorial/jmx/remote/custom.html and > > > > > > > > > https://svn.apache.org/repos/asf/servicemix/smx4/nmr/trunk/jbi/deployer/src/main/java/org/apache/servicemix/jbi/deployer/task/JbiTask.java > > > > > > On Thu, Mar 5, 2009 at 06:54, liav ezer <[email protected]> wrote: > > > > > > > Hi Guillaume, > > > > > > > > I do follow your code but i get an exception: > > > > > > > > Exception in thread "main" *java.lang.IllegalArgumentException*: > > > > org.apache.servicemix.jbi.framework.AdminCommandsService is not n > > > > interface > > > > at java.lang.reflect.Proxy.getProxyClass(*Proxy.java:362*) at > > > > java.lang.reflect.Proxy.newProxyInstance(*Proxy.java:581*) at > > > > javax.management.MBeanServerInvocationHandler.newProxyInstance(* > > > > MBeanServerInvocationHandler.java:149*)at > > > > > com.amdocs.oxp.sdp.ManageSMXMbean.getSmxMBean(*ManageSMXMbean.java:48*) > > > at > > > > com.amdocs.oxp.sdp.ManageSMXMbean.main(*ManageSMXMbean.java:60*) > > > > > > > > It's because i didn't implemented the > > > > JmxConnector::getMBeanServerConnection() - it's currently returning > > null. > > > > > > > > Can you advise on its implementation? > > > > > > > > Thanks. > > > > > > > > > > > > On Wed, Mar 4, 2009 at 5:37 PM, Guillaume Nodet <[email protected]> > > > wrote: > > > > > > > > > You should really look at the code of the ant tasks i mentionned > > above. > > > > > You'll see how to create everything, create a proxy to the > > > > > AdminCommandsService and perform operations using it. > > > > > > > > > > On Wed, Mar 4, 2009 at 16:10, liav ezer <[email protected]> > wrote: > > > > > > > > > > > Can you advise on the implementation of > > > > > > JmxConnector::getMBeanServerConnection() > > > > > > method? > > > > > > > > > > > > Do i need to downloaad any jars to work with the JMS api? > > > > > > > > > > > > Thanks. > > > > > > > > > > > > On Mon, Mar 2, 2009 at 6:33 PM, Guillaume Nodet < > [email protected]> > > > > > wrote: > > > > > > > > > > > > > Well, if you want to *deploy* a SA, you will not have anything > > > > related > > > > > > > to that in JMX before deploying it. > > > > > > > The objectName is the one I pasted earlier, which is the JMX > name > > > > > > > under which the AdminCommandsService object is registered. > > > > > > > > > > > > > > On Mon, Mar 2, 2009 at 17:30, liav ezer <[email protected]> > > > wrote: > > > > > > > > a bit confused about the second parameter. > > > > > > > > > > > > > > > > objectName is the name of the MBean i want to manipulate? > > Meaning > > > > is > > > > > it > > > > > > > the > > > > > > > > name of the SA? > > > > > > > > > > > > > > > > Thanks. > > > > > > > > > > > > > > > > > > > > > > > > On Mon, Mar 2, 2009 at 5:53 PM, Guillaume Nodet < > > > [email protected]> > > > > > > > wrote: > > > > > > > > > > > > > > > >> I would advise using something similar to what the ant tasks > > do: > > > > > > > >> > > > > > > > >> return (AdminCommandsService) > > > > > > > >> MBeanServerInvocationHandler.newProxyInstance( > > > > > > > >> jmxConnector.getMBeanServerConnection(), > > > > objectName, > > > > > > > >> AdminCommandsService.class, true); > > > > > > > >> > > > > > > > >> This should work with Java >= 1.4 > > > > > > > >> > > > > > > > >> On Mon, Mar 2, 2009 at 16:50, liav ezer < > [email protected]> > > > > > wrote: > > > > > > > >> > Can i use JMX api in java 1.5? > > > > > > > >> > > > > > > > > >> > According to this sun document the api is available for > 1.6, > > > > > > correct? > > > > > > > >> > > > > > > > > >> > > > > > > > > > > > > > > > > > http://java.sun.com/javase/6/docs/technotes/guides/management/index.html > > > > > > > >> > > > > > > > > >> > > > > > > > > >> > > > > > > > > >> > On Mon, Mar 2, 2009 at 5:08 PM, Guillaume Nodet < > > > > [email protected] > > > > > > > > > > > > > >> wrote: > > > > > > > >> > > > > > > > > >> >> Yes, ant tasks use the JMX api and the jbi maven plugin > > uses > > > > ant > > > > > > > >> >> tasks, so if you want to manage jbi artifacts > > > programmatically, > > > > > > using > > > > > > > >> >> JMX is the way to go. > > > > > > > >> >> > > > > > > > >> >> On Mon, Mar 2, 2009 at 15:57, liav ezer < > > [email protected] > > > > > > > > > > wrote: > > > > > > > >> >> > Please correct me if i'm wrong but the second option > (JMX > > > > api) > > > > > > > seems > > > > > > > >> like > > > > > > > >> >> a > > > > > > > >> >> > more supported API then start running ant commands. > > > > > > > >> >> > > > > > > > > >> >> > Let me explain: > > > > > > > >> >> > > > > > > > > >> >> > If i only wish to deploy the SA then running JBI:Deploy > > > will > > > > > > simply > > > > > > > >> >> > accomplish it. But, if i also want to retrieve the > > returned > > > > > > status > > > > > > > >> from > > > > > > > >> >> the > > > > > > > >> >> > deploy action then i'll have a tough time using ant > > command > > > > > while > > > > > > > the > > > > > > > >> JMX > > > > > > > >> >> > api will probably support it. > > > > > > > >> >> > > > > > > > > >> >> > Am i shooting to the right direction here? > > > > > > > >> >> > > > > > > > > >> >> > Thanks. > > > > > > > >> >> > > > > > > > > >> >> > > > > > > > > >> >> > > > > > > > > >> >> > On Mon, Mar 2, 2009 at 4:50 PM, Guillaume Nodet < > > > > > > [email protected]> > > > > > > > >> >> wrote: > > > > > > > >> >> > > > > > > > > >> >> >> No, you can either use ant tasks, or use plain JMX api > > to > > > > > access > > > > > > > the > > > > > > > >> >> >> AdminCommandsService object which is already available > > in > > > > JMX. > > > > > > > >> >> >> > > > > > > > >> >> >> On Mon, Mar 2, 2009 at 15:19, liav ezer < > > > > [email protected]> > > > > > > > wrote: > > > > > > > >> >> >> > So, i should implement this interface & in > > > > > > deployServiceAssembly > > > > > > > >> >> method i > > > > > > > >> >> >> > use ant tasks? > > > > > > > >> >> >> > > > > > > > > >> >> >> > On Mon, Mar 2, 2009 at 4:08 PM, Guillaume Nodet < > > > > > > > [email protected]> > > > > > > > >> >> >> wrote: > > > > > > > >> >> >> > > > > > > > > >> >> >> >> You can use ant tasks or JMX (ant tasks use JMX > > > > > underneath). > > > > > > > >> >> >> >> At the end, everything is delegated to > > > > > > > >> >> >> >> > > > > > > org.apache.servicemix.jbi.framework.AdminCommandsServiceMBean > > > > > > > >> >> >> >> object registered in JMX. > > > > > > > >> >> >> >> See > > > > > > > >> >> >> >> > > > > > > > >> >> >> > > > > > > > >> >> > > > > > > > >> > > > > > > > > > > > > > > > > > > > > > > > > > > > > https://svn.apache.org/repos/asf/servicemix/smx3/trunk/core/servicemix-core/src/main/java/org/apache/servicemix/jbi/framework/AdminCommandsServiceMBean.java > > > > > > > >> >> >> >> > > > > > > > >> >> >> >> It's jmx name is by default: > > > > > > > >> >> >> >> > > > > > > > >> >> >> >> > > > > > > > >> >> >> > > > > > > > >> >> > > > > > > > >> > > > > > > > > > > > > > > > > > > > > > > > > > > > > org.apache.servicemix:ContainerName=ServiceMix,Type=SystemService,Name=AdminCommandsService > > > > > > > >> >> >> >> You should find it easily in JConsole or any other > > JMX > > > > > > console. > > > > > > > >> >> >> >> > > > > > > > >> >> >> >> On Mon, Mar 2, 2009 at 14:59, Liav Ezer < > > > > > [email protected] > > > > > > > > > > > > > > >> wrote: > > > > > > > >> >> >> >> > > > > > > > > >> >> >> >> > Hi, > > > > > > > >> >> >> >> > > > > > > > > >> >> >> >> > I'm intrested in automating the deploy phase of > my > > > SA. > > > > > > > >> >> >> >> > > > > > > > > >> >> >> >> > Assuming that i have built a SA & it's ready to > be > > > > > deployed > > > > > > > to > > > > > > > >> >> >> >> servicemix, > > > > > > > >> >> >> >> > which Java API do i use in order to deploy it & > get > > > the > > > > > > deply > > > > > > > >> >> process > > > > > > > >> >> >> >> status > > > > > > > >> >> >> >> > from the container? > > > > > > > >> >> >> >> > > > > > > > > >> >> >> >> > > > > > > > > >> >> >> >> > Thanks. > > > > > > > >> >> >> >> > -- > > > > > > > >> >> >> >> > View this message in context: > > > > > > > >> >> >> >> > > > > > > > >> >> >> > > > > > > > >> >> > > > > > > > >> > > > > > > > > > > > > > > > > > > > > > > > > > > > > http://www.nabble.com/Is-there-a-Java-API-to-deploy-SA--tp22288609p22288609.html > > > > > > > >> >> >> >> > Sent from the ServiceMix - User mailing list > > archive > > > at > > > > > > > >> Nabble.com. > > > > > > > >> >> >> >> > > > > > > > > >> >> >> >> > > > > > > > > >> >> >> >> > > > > > > > >> >> >> >> > > > > > > > >> >> >> >> > > > > > > > >> >> >> >> -- > > > > > > > >> >> >> >> Cheers, > > > > > > > >> >> >> >> Guillaume Nodet > > > > > > > >> >> >> >> ------------------------ > > > > > > > >> >> >> >> Blog: http://gnodet.blogspot.com/ > > > > > > > >> >> >> >> ------------------------ > > > > > > > >> >> >> >> Open Source SOA > > > > > > > >> >> >> >> http://fusesource.com > > > > > > > >> >> >> >> > > > > > > > >> >> >> > > > > > > > > >> >> >> > > > > > > > >> >> >> > > > > > > > >> >> >> > > > > > > > >> >> >> -- > > > > > > > >> >> >> Cheers, > > > > > > > >> >> >> Guillaume Nodet > > > > > > > >> >> >> ------------------------ > > > > > > > >> >> >> Blog: http://gnodet.blogspot.com/ > > > > > > > >> >> >> ------------------------ > > > > > > > >> >> >> Open Source SOA > > > > > > > >> >> >> http://fusesource.com > > > > > > > >> >> >> > > > > > > > >> >> > > > > > > > > >> >> > > > > > > > >> >> > > > > > > > >> >> > > > > > > > >> >> -- > > > > > > > >> >> Cheers, > > > > > > > >> >> Guillaume Nodet > > > > > > > >> >> ------------------------ > > > > > > > >> >> Blog: http://gnodet.blogspot.com/ > > > > > > > >> >> ------------------------ > > > > > > > >> >> Open Source SOA > > > > > > > >> >> http://fusesource.com > > > > > > > >> >> > > > > > > > >> > > > > > > > > >> > > > > > > > >> > > > > > > > >> > > > > > > > >> -- > > > > > > > >> Cheers, > > > > > > > >> Guillaume Nodet > > > > > > > >> ------------------------ > > > > > > > >> Blog: http://gnodet.blogspot.com/ > > > > > > > >> ------------------------ > > > > > > > >> Open Source SOA > > > > > > > >> http://fusesource.com > > > > > > > >> > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > -- > > > > > > > Cheers, > > > > > > > Guillaume Nodet > > > > > > > ------------------------ > > > > > > > Blog: http://gnodet.blogspot.com/ > > > > > > > ------------------------ > > > > > > > Open Source SOA > > > > > > > http://fusesource.com > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > -- > > > > > Cheers, > > > > > Guillaume Nodet > > > > > ------------------------ > > > > > Blog: http://gnodet.blogspot.com/ > > > > > ------------------------ > > > > > Open Source SOA > > > > > http://fusesource.com > > > > > > > > > > > > > > > > > > > > > -- > > > Cheers, > > > Guillaume Nodet > > > ------------------------ > > > Blog: http://gnodet.blogspot.com/ > > > ------------------------ > > > Open Source SOA > > > http://fusesource.com > > > > > > > > > -- > Cheers, > Guillaume Nodet > ------------------------ > Blog: http://gnodet.blogspot.com/ > ------------------------ > Open Source SOA > http://fusesource.com >
