Return-Path: Delivered-To: apmail-jakarta-tomcat-user-archive@jakarta.apache.org Received: (qmail 73810 invoked by uid 500); 19 May 2001 20:11:38 -0000 Mailing-List: contact tomcat-user-help@jakarta.apache.org; run by ezmlm Precedence: bulk Reply-To: tomcat-user@jakarta.apache.org list-help: list-unsubscribe: list-post: Delivered-To: mailing list tomcat-user@jakarta.apache.org Received: (qmail 73803 invoked from network); 19 May 2001 20:11:38 -0000 Received: from mailgate3.cinetic.de (212.227.116.80) by h31.sny.collab.net with SMTP; 19 May 2001 20:11:38 -0000 Received: from smtp.web.de (smtp01.web.de [194.45.170.210]) by mailgate3.cinetic.de (8.11.2/8.11.2/SuSE Linux 8.11.0-0.4) with SMTP id f4JKBeu05012 for ; Sat, 19 May 2001 22:11:40 +0200 Received: from 0007872983005200602306540001 by smtp.web.de with smtp (freemail 4.2.1.8 #22) id m151D4d-007WwNC; Sat, 19 May 2001 22:11 +0200 Message-ID: <001601c0b0b9$3da2ed60$016fa8c0@0007872983005200602306540001> From: "Matthias Schiffer" To: Subject: How to embed Tomcat into an existing application OR how to use EmbededTomcat - Class Date: Mon, 19 Mar 2001 22:12:01 +0100 MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_0013_01C0B0C1.9F2431E0" X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 5.00.2615.200 X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2615.200 X-Spam-Rating: h31.sny.collab.net 1.6.2 0/1000/N This is a multi-part message in MIME format. ------=_NextPart_000_0013_01C0B0C1.9F2431E0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Hi! I have developed an application which runs with the jo!-server at the = moment, now I want to replace it with the embeded Tomcat, but i don't = really know how!!! Can someone write me a short explanation how to embed = Tomcat into my application? Below you can see what i have tried to = embed, but this does not work and additional: i know that the src is not = complete but some additional things are missing, please write which ones = that are. Thank you very much! Source code: public static void main( String[] args) throws ServerException { ContextManager cm =3D new ContextManager(); WebXmlReader xml =3D new WebXmlReader(); EmbededTomcat et =3D new EmbededTomcat(); try { xml.engineInit(cm); }catch(TomcatException te) { System.out.println("Exception: " + te); } Context ctx =3D new Context(); ctx.setContextManager(cm); cm.setTomcatHome("/home/matsch/synet/tomcat"); xml.setContextManager(cm) ; try { xml.contextInit(ctx); }catch(TomcatException te) { System.out.println("Exception: " +te); } AdminService admin =3D new AdminService(); admin.setName( "AdminService"); admin.start(); } ------=_NextPart_000_0013_01C0B0C1.9F2431E0 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable
Hi!
 
I have developed an application which = runs with the=20 jo!-server at the moment, now I want to replace it with the embeded = Tomcat, but=20 i don't really know how!!! Can someone write me a short explanation how = to embed=20 Tomcat into my application? Below you can see what i have tried to = embed, but=20 this does not work and additional: i know that the src is not complete = but some=20 additional things are missing, please write which ones that are. Thank = you very=20 much!
 
Source code:
 
public static void main( String[] args) = throws=20 ServerException {
  ContextManager cm =3D new=20 ContextManager();
WebXmlReader xml =3D new = WebXmlReader();
EmbededTomcat et=20 =3D new EmbededTomcat();
try=20 {
 xml.engineInit(cm);
}catch(TomcatException te)=20 {
 System.out.println("Exception: " + te);
}
Context ctx = =3D new=20 Context();
ctx.setContextManager(cm);
cm.setTomcatHome("/home/matsc= h/synet/tomcat");
xml.setContextManager(cm)=20 ;
try {
 xml.contextInit(ctx);
}catch(TomcatException te)=20 {
 System.out.println("Exception: " +te);
}
AdminService = admin =3D=20 new AdminService();
admin.setName(=20 "AdminService");
admin.start();
}
------=_NextPart_000_0013_01C0B0C1.9F2431E0--