|
From: Jim R. <jr...@er...> - 2003-10-02 01:07:49
|
Sal, My apologies, my initial google search for JMX and DCOM shows up a number of references. I should have read them more closely. The DCOM reference, although in the same paragraph refered to other Sun extension. Back to the drawing board on why the wrapper generates COM requests. Jim On 2003.10.01 18:05, Sal Ingrilli wrote: > no. > > 1. download the jmx libraries from here > http://java.sun.com/products/JavaManagement/download.html > > 2. put these 2 files from the above download in your classpath > jmxri.jar > jmxtools.jar > > 3. convert the attached sample code to fit somewhere in your system. > > 4. point a browser to the jmx-console: > http://localhost:8082 > > 5. Click on > Adaptor | protocol=Wrapper > > 6. Click restart > > 7. learn jmx from the best book: JMX Managing J2EE with Java > Management > Extensions by Lindfors and Fleury > > 8. Next time, before you post, go to www.google.com, enter type "jmx", > press > "Google Search", click on the first link that comes up & you'll find > out > what jmx is (or at least that it's not COM) > > sal. > > -----Original Message----- > From: wra...@li... > [mailto:wra...@li...]On Behalf Of Jim > Redman > Sent: Wednesday, October 01, 2003 4:14 PM > To: wra...@li... > Subject: Re: [Wrapper-user] How Does One... Remotely Restart a JVM > > > Is JMX based on Windows COM? > > Jim > > On 2003.10.01 17:05, Sal Ingrilli wrote: > > we embedded the sun jmx server into our app & restart the service > > through > > the wrapper jmx interface. > > that's also how we issue thread dumps when running as a service. > > > > -----Original Message----- > > From: wra...@li... > > [mailto:wra...@li...]On Behalf Of Daniel > > Lemus > > Sent: Wednesday, October 01, 2003 3:44 PM > > To: wra...@li... > > Subject: [Wrapper-user] How Does One... Remotely Restart a JVM > > > > > > Here's the situation: > > I have a process that the wrapper runs as a service, but the service > > is on > > another box. I also do not have permission to restart the service. > > In > > cases where I have a patch to push out on the server, I have to wait > > for the > > admin on the box to restart my service (as to reload the JVM and to > > load my > > changes). > > > > This might be correct in a production environment, but our > development > > environment is the same (I have to wait for someone else to restart > > the > > service). This gets a bit annoying (on the admin's side to), so > here > > is my > > question: > > -Is there a way to remotely call "something" to restart the JVM on > > demand? > > > > I have read that there is a WrapperManager that has a restart() > > method, but > > how can that be called? Would I have to have another service > running > > that > > has the sole purpose of restarting JVMs? > > > > (This is on an NT 2000 box, and there is no chance to give me > > permission to > > start/stop services on their boxes). > > > > Thanks for any assistance. > > > > -Dan > > > > _________________________________________________________________ > > Frustrated with dial-up? Get high-speed for as low as $29.95/month > > (depending on the local service providers in your area). > > https://broadband.msn.com > > > > > > > > ------------------------------------------------------- > > This sf.net email is sponsored by:ThinkGeek > > Welcome to geek heaven. > > http://thinkgeek.com/sf > > _______________________________________________ > > Wrapper-user mailing list > > Wra...@li... > > https://lists.sourceforge.net/lists/listinfo/wrapper-user > > > > > > > > ------------------------------------------------------- > > This sf.net email is sponsored by:ThinkGeek > > Welcome to geek heaven. > > http://thinkgeek.com/sf > > _______________________________________________ > > Wrapper-user mailing list > > Wra...@li... > > https://lists.sourceforge.net/lists/listinfo/wrapper-user > > > > -- > > Jim Redman > (505) 662 5156 x85 > http://www.ergotech.com > > > ------------------------------------------------------- > This sf.net email is sponsored by:ThinkGeek > Welcome to geek heaven. > http://thinkgeek.com/sf > _______________________________________________ > Wrapper-user mailing list > Wra...@li... > https://lists.sourceforge.net/lists/listinfo/wrapper-user > > package com.syncvoice.commons.jmx.impl; > > import javax.management.MBeanServer; > import javax.management.MBeanServerFactory; > import javax.management.ObjectName; > > import com.sun.jdmk.comm.HtmlAdaptorServer; > > /** > * <p>Title: </p> > * <p>Description: </p> > * <p>Copyright: Copyright (c) 2003</p> > * <p>Company: </p> > * @author not attributable > * @version 1.0 > */ > > public class Demo { > // java -cp c:\proj\vxtracker\commons\classes;C:\temp\wrapper > \jmxri.jar;C:\temp\wrapper\jmxtools.jar;C:\temp\wrapper\wrapper.jar > com.syncvoice.commons.jmx.impl.Demo > public static void main (final String[] args) { > try { > // create jmx mbean server > final MBeanServer server = MBeanServerFactory.createMBeanServer > (); > > // start jmx-console mbean > { > log ("starting jmx-console"); > final HtmlAdaptorServer mbean = new HtmlAdaptorServer (); > mbean.setPort (8082); > mbean.start (); > final ObjectName mbeanObjectName = new ObjectName > ("Adaptor:protocol=HTTP,port=8082"); > server.registerMBean (mbean, mbeanObjectName); > } > > // start wrapper mbean (wrapper 3.0.5) > { > log ("starting wrapper console"); > final Class mbeanClass = forName > ("org.tanukisoftware.wrapper.jmx.WrapperManager"); > final Object mbean = mbeanClass.newInstance (); > final ObjectName mBeanObjectName = new ObjectName > ("Adaptor:protocol=Wrapper"); > server.registerMBean (mbean, mBeanObjectName); > } > > // wait > log ("entering modal loop"); > while (!Thread.currentThread ().isInterrupted ()) { > Thread.sleep (500); > } > } > catch (final Throwable t) { > t.printStackTrace (); > } > } > > /** > * JVM-version independent one-stop-location to create a class > object > * from a fully qualified class name > * @param className > * @return > * @throws ClassNotFoundException > */ > private static Class forName (final String className) > throws ClassNotFoundException { > > final Thread currentThread = Thread.currentThread (); > final ClassLoader classLoader = > currentThread.getContextClassLoader (); > final Class newClass = classLoader.loadClass (className); > return newClass; > } > > /** > * Helper to log > * @param string > */ > private static void log (final String string) { > System.out.println (string); > } > } -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com |