tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stefán Freyr Stefánsson <ste...@decode.is>
Subject RE: Can I somehow run a java process (application) within the Tomcat java process
Date Mon, 01 May 2000 13:22:20 GMT
Thanks... However that wasn't exactly what I meant...  I was talking about
the servlet itself... I've been doing a little reading and found out that
the init() method is run in a servlet when it is first loaded.  However...
what I'm not clear on is if it's ok to start a CORBA server in that method?
I've been doing a little testing and I found out that it seems to work to
put this code in the init() method of the servlet:

        super.init(config);

        try
        {
            String name;

            org.omg.CORBA.ORB orb = org.omg.CORBA.ORB.init();
            org.omg.CORBA.BOA boa =
((com.visigenic.vbroker.orb.ORB)orb).BOA_init();

            name = "KomodoServiceIDL";

            KomodoService komodoServiceIDL = new KomodoService(name);
            boa.obj_is_ready(komodoServiceIDL);
        }
        catch(Exception ex)
        {
            System.err.println(ex);
        }

Then I run "osfind.exe" which is a tool that comes with JBuilder3 and lists
all the CORBA services found I get my service on the list... so this seems
to be working.  However I do get an exception when I try to start my testing
client (which tries to use the CORBA services) but that might have some
other explanation... I have to do some research to find that one out
(waiting for my partner... he's doing all the CORBA stuff).

Just out of curiosity... what does the following tag do?  I'm guessing that
it tells the web server to load the servlet up on startup but what does the
10 mean???
<load-on-startup>10</load-on-startup>

Thanks alot everybody for your comments and ideas.. I think the problem is
gonna solve beautifully ;o)

Kind regards,
Stefan

-----Original Message-----
From: Kevin McBrearty [mailto:kevin@atg.ca]
Sent: 1. maí 2000 12:31
To: tomcat-user@jakarta.apache.org
Subject: RE: Can I somehow run a java process (application) within the
Tomcat java process


Use the LoadOnStrartup when you define your servlet in WEB.XML, something
like this:

    <servlet>
      <servlet-name>Startup</servlet-name>
      <servlet-class>StartupServlet</servlet-class>
      <load-on-startup>10</load-on-startup>
    </servlet>

Kevin McBrearty
ATG Automation Technologies Group Ltd.

> -----Original Message-----
> From: Stefan Freyr Stefansson [mailto:stebbi@decode.is]
> Sent: Monday, May 01, 2000 7:55 AM
> To: tomcat-user@jakarta.apache.org; steve@bonampak.net
> Subject: RE: Can I somehow run a java process (application) within the
> Tomcat java process
>
>
> Thanks... Obvious or not, the first choice sounds exactly what I want.  We
> had considered the other choice and were going to go that way unless
> something better came along.  We didn't think of the first choice however!
> One question though.  If I convert the app to a servlet... how can I make
> sure it starts up when tomcat does?  I mean doesn't somebody have
> to invoke
> the servlet to start it up?  or is there a method (constructor or
> initializer) which is run as soon as tomcat starts?
>
> Thanks a whole bunch for your help!
> Stefan.
>
>
> -----Original Message-----
> From: steve@bonampak.net [mailto:steve@bonampak.net]On Behalf Of Steve
> Weiss
> Sent: 1. mai 2000 02:09
> To: tomcat-user@jakarta.apache.org
> Subject: Re: Can I somehow run a java process (application) within the
> Tomcat java process
>
>
> I could think of two fairly obvious possibilities:
>
> 1) Convert your CORBA application to a servlet (you'd probably want it
> to start up when Tomcat starts). This shouldn't be too difficult and
> you'd have them both running in the same JVM.
>
> 2) Use CORBA to communicate between your JSPs/servlets and the CORBA
> app. You could also use RMI for this, but since your application is
> already CORBA it might be easier to go that way.
>
> -Steve
>
> Stefan Freyr Stefansson wrote:
> >
> > Hi!  Man do I need a quick and positive answer to this one!!! :o/
> >
> > The thing is I'm doing this surveillance system for servers (as in
> > client/server).  It uses CORBA to communicate with the server it's
> > monitoring and receives method invocations from it (things like
> > clientConnected(info), dataPackageSent(info) and so on).
> > We're trying to provide remote administration to it through JSP
> and we've
> > been developing the thing in each corner of the room (we're two who are
> > working on it).  I've been doing the JSP stuff and had pretty
> good success
> > with it and my partner has been doing the CORBA stuff and likewise been
> > pretty successful.
> > Tonight we tried to combine the two and wanted to see if we
> could remotely
> > stop our system from logging information down to the
> database... well.. it
> > didn't work.  It didn't take a long time for us figuring out that the
> reason
> > for this was that Tomcat was running on one java.exe process
> and the CORBA
> > service application (which is just a java app... a class with a main
> > function) was running on another.  This probably means (and I'm guessing
> > here) that they are being run on seperate virtual machines!?!??
> Anyways...
> > that's no good for us since now, the UI part (my JSP) is using a whole
> > different set of class instances than his CORBA things.  Which,
> in return,
> > means that when I shut off "my" database connection... his is still fine
> and
> > dandy!!!  So we see one solution to the problem... have the same process
> > create two threads... one running tomcat and the other running the corba
> > server app.
> > Does anybody know if this is possible???
> >
> > Please help, we're running out of time (this is a school project) and we
> > really need a solution to this problem...  And of course if
> anybody knows
> a
> > better way to solve this... hey I'm all ears!!!
> >
> > Kind regards,
> > Stefan
> >
> >
> --------------------------------------------------------------------------
> > To unsubscribe, email: tomcat-user-unsubscribe@jakarta.apache.org
> > For additional commmands, email: tomcat-user-help@jakarta.apache.org
>
> --
> "If you watch TV news, you know less about the world than if you just
> drank
> gin straight from the bottle."  - Garrison Keillor
>
> --------------------------------------------------------------------------
> To unsubscribe, email: tomcat-user-unsubscribe@jakarta.apache.org
> For additional commmands, email: tomcat-user-help@jakarta.apache.org
>
>
> --------------------------------------------------------------------------
> To unsubscribe, email: tomcat-user-unsubscribe@jakarta.apache.org
> For additional commmands, email: tomcat-user-help@jakarta.apache.org
>


--------------------------------------------------------------------------
To unsubscribe, email: tomcat-user-unsubscribe@jakarta.apache.org
For additional commmands, email: tomcat-user-help@jakarta.apache.org


Mime
View raw message