RE: VAJ and Tomcat 3.2

2000-12-06 Thread Ensing, Marco
Title: RE: VAJ and Tomcat 3.2





Here are my settings. Maybe this helps.


Run properties \ Program :: set tomcat home variable
 tomcat.home=d:\Tomcat


Run properties \ classpath
 d:\Tomcat\_classes\jasper.jar;
 d:\Tomcat\_classes\servlet.jar;
 d:\Tomcat\_classes\webserver.jar;
 d:\Tomcat\_classes\ant.jar;
 d:\Tomcat\_classes\xml.jar;
 d:\Tomcat\;
 d:\Tomcat\conf\;
 d:\Tomcat\webapps\;
 d:\Tomcat\webapps\examples\jsp\;



public class StartMyTomcat {
   public static void main(java.lang.String[] args) {
      try {
     Class aClass = Class.forName("org.apache.tomcat.startup.Tomcat");
     java.lang.reflect.Method method = null;
     Class[] argsClass = new Class[] {String[].class};
     // get the main method for the org.apache.tomcat.shell.Startup class
     method = aClass.getMethod("main", argsClass);
     Object object = null;
     Object[] arguments = new Object[] {new String[] {}};
     // now invoke the main method for the org.apache.tomcat.shell.Startup class
     method.invoke(object, arguments);
      }
      catch (Exception e) {
     System.out.println("Exception occurred: " + e.getMessage());
     e.printStackTrace();
      }
   }    
}


public class StopMyTomcat {
   public static void main(java.lang.String[] args) {
      try {
     Class aClass = Class.forName("org.apache.tomcat.startup.Tomcat");
     java.lang.reflect.Method method = null;
     Class[] argsClass = new Class[] {String[].class};
     // get the main method for the org.apache.tomcat.shell.Shutdown class
     method = aClass.getMethod("stopTomcat", argsClass);
     Object object = null;
     Object[] arguments = new Object[] {new String[] {}};
     // now invoke the main method for the org.apache.tomcat.shell.Shutdown class
     method.invoke(object, arguments);
      }
      catch (Exception e) {
     System.out.println("Exception occurred: " + e.getMessage());
     e.printStackTrace();
      }
   }   
}


-Original Message-
From: AC [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, December 06, 2000 1:47 AM
To: [EMAIL PROTECTED]
Subject: RE: VAJ and Tomcat 3.2



At the IBM site you can find 2 classes to start and stop tomcat inside VAJ. 
If you can't find it I can send it to you directly


andrea



At 09.42 06/12/2000 +0100, you wrote:



>-Message d'origine-
>De : Rick Goeltz [mailto:[EMAIL PROTECTED]]
>Envoyé : mardi 5 décembre 2000 19:07
>À : [EMAIL PROTECTED]
>Objet : Re: VAJ and Tomcat 3.2
>
>Dear Rick,
>
>I thank you for your great help, but I have some comment :
>
> > > You're correct : IVJ doesn't close sockets even if the program performed
>an
> > > an exit().
>
> >I have not seen this (Win98/NT, VAJ 3.0.2 EA, Tomcat 3.1/3.2).
>
>As I already say, IVJ doesn't close sockets which wasn't closed by the
>program.
>Try to open a socket and next kill the thread who does the job.
>If you restart this thread, you'll get an error.
>I'm waiting for your explaination.
>
> >To run Tomcat within VAJ, the first thing I do is get Tomcat running
> >standalone.  Then, install Tomcat in VAJ.  I mention this because I have
> >Tomcat log to stdout/stderr, not a file.  Therefore, Tomcat/VAJ will log to
>
> >the VAJ console (a good thing).  When you want to stop Tomcat, use the
> >Console's top window, select the thread, and stop/remove it.
>
>It's dirty and will this work with AJP12/13 ?
>
> >To start Tomcat/VAJ, I go to the Tomcat class in the startup package and
> >modify it's Run properties; classpath stuff, plus the -D parameter to point
>
> >the standalone installation.
>
>OK, I see that you know how to setup VisualAge, but me and some others
>think it's more practical to have a start and a stop program
>to manage Tomcat, aspecialy to have a clean stop.
>
>
>Regards,
>
>Thibault FREY.





RE: VAJ and Tomcat 3.2

2000-12-06 Thread AC

At the IBM site you can find 2 classes to start and stop tomcat inside VAJ. 
If you can't find it I can send it to you directly

andrea


At 09.42 06/12/2000 +0100, you wrote:


>-Message d'origine-
>De : Rick Goeltz [mailto:[EMAIL PROTECTED]]
>Envoyé : mardi 5 décembre 2000 19:07
>À : [EMAIL PROTECTED]
>Objet : Re: VAJ and Tomcat 3.2
>
>Dear Rick,
>
>I thank you for your great help, but I have some comment :
>
> > > You're correct : IVJ doesn't close sockets even if the program performed
>an
> > > an exit().
>
> >I have not seen this (Win98/NT, VAJ 3.0.2 EA, Tomcat 3.1/3.2).
>
>As I already say, IVJ doesn't close sockets which wasn't closed by the
>program.
>Try to open a socket and next kill the thread who does the job.
>If you restart this thread, you'll get an error.
>I'm waiting for your explaination.
>
> >To run Tomcat within VAJ, the first thing I do is get Tomcat running
> >standalone.  Then, install Tomcat in VAJ.  I mention this because I have
> >Tomcat log to stdout/stderr, not a file.  Therefore, Tomcat/VAJ will log to
>
> >the VAJ console (a good thing).  When you want to stop Tomcat, use the
> >Console's top window, select the thread, and stop/remove it.
>
>It's dirty and will this work with AJP12/13 ?
>
> >To start Tomcat/VAJ, I go to the Tomcat class in the startup package and
> >modify it's Run properties; classpath stuff, plus the -D parameter to point
>
> >the standalone installation.
>
>OK, I see that you know how to setup VisualAge, but me and some others
>think it's more practical to have a start and a stop program
>to manage Tomcat, aspecialy to have a clean stop.
>
>
>Regards,
>
>Thibault FREY.




RE: VAJ and Tomcat 3.2

2000-12-06 Thread FREY Thibault



-Message d'origine-
De : Rick Goeltz [mailto:[EMAIL PROTECTED]]
Envoyé : mardi 5 décembre 2000 19:07
À : [EMAIL PROTECTED]
Objet : Re: VAJ and Tomcat 3.2

Dear Rick,

I thank you for your great help, but I have some comment :

> > You're correct : IVJ doesn't close sockets even if the program performed
an
> > an exit().

>I have not seen this (Win98/NT, VAJ 3.0.2 EA, Tomcat 3.1/3.2).

As I already say, IVJ doesn't close sockets which wasn't closed by the
program.
Try to open a socket and next kill the thread who does the job.
If you restart this thread, you'll get an error. 
I'm waiting for your explaination.

>To run Tomcat within VAJ, the first thing I do is get Tomcat running 
>standalone.  Then, install Tomcat in VAJ.  I mention this because I have 
>Tomcat log to stdout/stderr, not a file.  Therefore, Tomcat/VAJ will log to

>the VAJ console (a good thing).  When you want to stop Tomcat, use the 
>Console's top window, select the thread, and stop/remove it.

It's dirty and will this work with AJP12/13 ?

>To start Tomcat/VAJ, I go to the Tomcat class in the startup package and 
>modify it's Run properties; classpath stuff, plus the -D parameter to point

>the standalone installation.

OK, I see that you know how to setup VisualAge, but me and some others
think it's more practical to have a start and a stop program
to manage Tomcat, aspecialy to have a clean stop.


Regards,

Thibault FREY.




Re: VAJ and Tomcat 3.2

2000-12-05 Thread Stein M. Eliassen

Rick Goeltz wrote:
> 
> When you want to stop Tomcat, use the
> Console's top window, select the thread, and stop/remove it.
> 
> To start Tomcat/VAJ, I go to the Tomcat class in the startup package and
> modify it's Run properties; classpath stuff, plus the -D parameter to point
> the standalone installation.
> 

Rick,

Have you seen this?
http://muffin.kpnqwest.no/~steinme/vajtools/

Regards
Stein



Re: VAJ and Tomcat 3.2

2000-12-05 Thread Stein M. Eliassen

Hi,

I have now tested Tomcat 3.2 on VAJ 3.5 on W2K and it works as it should, it's
possible to re-start tomcat.

Since Tomcat 3.1 worked okey in VAJ 3.02 for Linux, I assume there is something
changed with the code that shuts down Tomcat 3.2.

Maybe some tomcat-developer could share some thoughts on this?

Regards
Stein



Re: VAJ and Tomcat 3.2

2000-12-05 Thread Rick Goeltz

 > You're correct : IVJ doesn't close sockets even if the program performed an
 > an exit().

I have not seen this (Win98/NT, VAJ 3.0.2 EA, Tomcat 3.1/3.2).

To run Tomcat within VAJ, the first thing I do is get Tomcat running 
standalone.  Then, install Tomcat in VAJ.  I mention this because I have 
Tomcat log to stdout/stderr, not a file.  Therefore, Tomcat/VAJ will log to 
the VAJ console (a good thing).  When you want to stop Tomcat, use the 
Console's top window, select the thread, and stop/remove it.

To start Tomcat/VAJ, I go to the Tomcat class in the startup package and 
modify it's Run properties; classpath stuff, plus the -D parameter to point 
the standalone installation.


Rick



RE: VAJ and Tomcat 3.2

2000-12-05 Thread FREY Thibault



> >Seems that the 8080 port never get's released...

>But I'm running a normal Tomcat -stop type shutdown.

>And why do Tomcat 3.1 work properly, but not 3.2?

Because 3.2 crashes with your config. Here is my congig :

* to start :

public class StartTomcat {
public static void main(java.lang.String[] args) {
try {
Class aClass =
Class.forName("org.apache.tomcat.startup.Tomcat");
java.lang.reflect.Method method = null;
Class[] argsClass = new Class[] {String[].class};
method = aClass.getMethod("main", argsClass);
Object object = null;
Object[] arguments = new Object[] {new String[] {}};
method.invoke(object, arguments);
}
catch (Exception e) {
System.out.println("Exception occurred: " +
e.getMessage());
e.printStackTrace();
}
}
}

Properties for TomcatStart :

- in Program / Properties : tomcat.home=d:\tomcat3.2\
- in Class Path :
- Project path : Tomcat, Servlet API, Xerces and all my stuff
- Extra directories path :
d:\tomcat3.2\classes\;d:\tomcat3.2\webapps\examples\WEB-INF\classes\;

where tomcat dir is d:\tomcat3.2\ and d:\tomcat3.2\classes\ are deflated
classes of d:\tomcat3.2\lib\

* to stop :

public class StopTomcat {
public static void main(java.lang.String[] args) {
try {
Class aClass =
Class.forName("org.apache.tomcat.startup.Tomcat");
java.lang.reflect.Method method = null;
Class[] argsClass = new Class[] {String[].class};
method = aClass.getMethod("main", argsClass);
Object object = null;
Object[] arguments = new Object[] {new String[]
{"-stop"}};
method.invoke(object, arguments);
}
catch (Exception e) {
System.out.println("Exception occurred: " +
e.getMessage());
e.printStackTrace();
}
}
}

with the same properties than StartTomcat.

* Be sure that HttpConnectionHandler for port 8080 is set (that's default)

* If you use mod_jk, let ajp13 far away, because it is not as robust as
ajp12, even if faster


>> The only solution I found is to restart IVJ (and therefore the JVM).

>You mean restarting Visual Age, or?

Yes restarting IBM VisualAge for Java (IVJ).

When I said that IVJ doesn't close socket, 

I would say that IVJ doesn't close sockets which were not closed by program.

For example, it's the case if your modify an instance variable while
debugging,

because program craches.


Regards
Thibault FREY.



Re: VAJ and Tomcat 3.2

2000-12-04 Thread Stein M. Eliassen

FREY Thibault wrote:
> 
> >Tomcat 3.2 runs inside Visual Age for Java, but after (trying) a re-start I
> get
> >this message:
> 
> >FATAL:java.net.SocketException: Address already in use
> >java.net.SocketException: Address already in use
> 
> >Seems that the 8080 port never get's released...
> 
> You're correct : IVJ doesn't close sockets even if the program performed an
> an exit().
> 

But I'm running a normal Tomcat -stop type shutdown.

And why do Tomcat 3.1 work properly, but not 3.2?

> The only solution I found is to restart IVJ (and therefore the JVM).

You mean restarting Visual Age, or?

Regards
Stein



RE: VAJ and Tomcat 3.2

2000-12-04 Thread Gomez Henri

Bien vu ;-)





Re: VAJ and Tomcat 3.2

2000-12-04 Thread Dominique BATARD

I'm running Tomcat 3.2 without any problem in VAJAVA 3.0 and VAJAVA 3.5

I can start it and stop it any number of time without restarting vajava.

I installed tomcat in by hand. You must verify your start and stop
properties.

Dom

- Original Message -
From: "Stein M. Eliassen" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, December 04, 2000 6:11 PM
Subject: VAJ and Tomcat 3.2


> Hi,
>
> Tomcat 3.2 runs inside Visual Age for Java, but after (trying) a re-start
I get
> this message:
>
> FATAL:java.net.SocketException: Address already in use
> java.net.SocketException: Address already in use
>
> Seems that the 8080 port never get's released...
>
> Has anyone succesfully gotten 3.2 to work inside vaj?
>
> Haven't tested for VAJ 3.5 yet, only 3.02 for linux.
>
> Regards
> Stein
>




RE: VAJ and Tomcat 3.2

2000-12-04 Thread FREY Thibault

>Tomcat 3.2 runs inside Visual Age for Java, but after (trying) a re-start I
get
>this message:

>FATAL:java.net.SocketException: Address already in use
>java.net.SocketException: Address already in use

>Seems that the 8080 port never get's released...

You're correct : IVJ doesn't close sockets even if the program performed an
an exit().

I think the cause is that IVJ runs all programs in only one JVM, 
and uses a custom classloader to simulate several JVM's.
In this way, when a program exits, the JVM doesn't fall down
and sockets stay open.

The only solution I found is to restart IVJ (and therefore the JVM).

>Has anyone succesfully gotten 3.2 to work inside vaj?

Yes, OK with IVJ3.02 (JDK1.1.8 and JDK1.2.0) and with IVJ3.5 (JDK1.2.2) for
Windows (sorry).

Regards,

Thibault FREY.