Return-Path: Delivered-To: apmail-tomcat-users-archive@www.apache.org Received: (qmail 72300 invoked from network); 1 Sep 2008 19:58:38 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 1 Sep 2008 19:58:38 -0000 Received: (qmail 64061 invoked by uid 500); 1 Sep 2008 19:58:24 -0000 Delivered-To: apmail-tomcat-users-archive@tomcat.apache.org Received: (qmail 64041 invoked by uid 500); 1 Sep 2008 19:58:24 -0000 Mailing-List: contact users-help@tomcat.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Tomcat Users List" Delivered-To: mailing list users@tomcat.apache.org Received: (qmail 64030 invoked by uid 99); 1 Sep 2008 19:58:24 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 01 Sep 2008 12:58:24 -0700 X-ASF-Spam-Status: No, hits=2.0 required=10.0 tests=HTML_MESSAGE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of olivier.verges@gmail.com designates 72.14.204.175 as permitted sender) Received: from [72.14.204.175] (HELO qb-out-1314.google.com) (72.14.204.175) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 01 Sep 2008 19:57:26 +0000 Received: by qb-out-1314.google.com with SMTP id p4so2774111qba.40 for ; Mon, 01 Sep 2008 12:57:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:in-reply-to:mime-version:content-type:references; bh=EWXbmHrk+3baBB9DKTA0P4J0TnIQSrVlkDYy0JhDJGo=; b=d5R+XtcYEalLbGxqvx0HVTc3vUDr7Uch/YE4n9ViJAaeIgUP2m7Ixdz9JyzXRYXPQk mWr3JLBhebirInJlflBiSSWro9oDj8PzMoP1tdg3b+oYq6iTXxJx0NtG+YzNpm61KC9h u1bhZwn4CrWJWETbkm4yo9a+YPDkx4N0dfQQM= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:in-reply-to:mime-version :content-type:references; b=MTU2JxkKVXkhnBRiyuukRiUWAb9kx48G1mVPAwUQVxFvJs4nhWHCgDxdDcXEQpWVzD UZeggm0C/+xhH8EnY/FtmIpzGrTIgb+ICAN1EmmGclDsmo6ezI2C2k9G0sgVnvt3/f7K 3VArs/iCkPSBCo6OUpOGDV0hGQ3WNgD/t12Ts= Received: by 10.143.31.4 with SMTP id i4mr2235265wfj.87.1220299075086; Mon, 01 Sep 2008 12:57:55 -0700 (PDT) Received: by 10.142.161.5 with HTTP; Mon, 1 Sep 2008 12:57:55 -0700 (PDT) Message-ID: <575c33250809011257k2343ff8dk4f1956bf2f3f0c05@mail.gmail.com> Date: Mon, 1 Sep 2008 21:57:55 +0200 From: "=?ISO-8859-1?Q?Olivier_Verg=E8s?=" To: "Tomcat Users List" Subject: Re: adding a virtual host with jmx In-Reply-To: MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_22767_29505991.1220299075082" References: <575c33250807300655k26c65bbbx2ce0ec42e8c0839d@mail.gmail.com> X-Virus-Checked: Checked by ClamAV on apache.org ------=_Part_22767_29505991.1220299075082 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline hi, so i'm using tomcat 6.0.15. I'm trying now to add a josso valve: always by jm= x. I don't get your lines, in fact... Could you please help me a little more? O.V 2008/7/31 Bill Barker > It's a lot of lines of code, but not that hard. You haven't mentioned yo= ur > Tomcat version, so I'll give a sort of generic setup. > ObjectName loader =3D getServerLoader(); // depends on the settings an= d > version > ObjectName registry =3D getRegistry(); // depends on the settings and > version > MBeanServer server =3D getTCMBeansServer(); // generally the first one= , > unless you (or your J2EE) are playing games > > String hname =3D "Catalina:type=3DHost,host=3D"+hostName; // Assuming = the > default Engine name of "Catalina" > ObjectName ohost =3D new ObjectName(hname); > Object host =3D server.instantiate(HOST_CLASS, loader); > server.invoke(registry, "registerComponent", > new Object[] {host, hname, null}, > new String[] > {"java.lang.Object","java.lang.String","java.lang.String"}); > server.setAttribute(ohost, new Attribute("appBase", appBase)); > // Set more attributes, and aliases etc here > // Things like Realms and Contexts work much the same way if you follo= w > Tomcat's naming conventions > server.invoke(ohost, "start", null, null); > // Start your contexts here, if you don't have automatic deployment se= t. > > As long as you follow Tomcat's naming conventions for ObjectNames, invoki= ng > "start" will automagically add the new elements to where they should live= . > You can get the values for the "loader" and "registry" by hooking up a JM= X > console to your existing Tomcat. > > "Olivier Verg=E8s" wrote in message > news:575c33250807300655k26c65bbbx2ce0ec42e8c0839d@mail.gmail.com... > > hi all, > > > > I'm creating a web application for auto deploying virtual host through > > apache and tomcat on a production server. > > Everything is ok except for the Tomcat part: > > As tomcat can't be reloaded and as i can't restart anytime I want, I > 've > > heard jmx was great cause it was possible to modify a running tomcat (i= s > > the > > english expression is "on the fly"?). > > > > So, Connection to Mbean server is ok... > > > > My problem is : > > when i invoke the addChild (org.apache.catalina.core.Container) method = of > > Engine I get this error: > > "java.io.NotSerializableException: > > org.apache.catalina.util.LifecycleSupport > > at > > java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1156) > > at > > > java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:150= 9)..." > > > > > > So i try to create my own addChildByString(String;String,String,String) > > which takes the appabase and the name of th virtual host, and path and > > docBase of the first needed context. But i've got a problem with the > > context > > now, > > " GRAVE: Error getConfigured" (and nothing else) > > > > i'm a little lost with all the classes and functions and I haven't foun= d > > any > > docs about adding vh by jmx. > > > > has anyone tried to add and directly make worked a virtual host and a > > context on a running tomcat ? > > > > thx, > > Olivier > > > > > > > --------------------------------------------------------------------- > To start a new topic, e-mail: users@tomcat.apache.org > To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org > For additional commands, e-mail: users-help@tomcat.apache.org > > ------=_Part_22767_29505991.1220299075082--