You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Jaime Almeida <22...@alunos.isel.ipl.pt> on 2007/10/09 14:57:03 UTC

Where can I find the thread main?

Hello.
Yesterday you've told me that all java applications need one thread main.
I have one main class - BD.java, where I define all the functions needed by 
the web application to work.
So, I probabily have some problem with the link of my project to that main 
class, isn't it?
How can I define it?
Best regards,
Jaime Almeida.
 --------------------------------------------
IPLNet WebMail http://www.net.ipl.pt/mail
 --------------------------------------------

---------------------------------------------------------------------
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


RE: Where can I find the thread main?

Posted by "Caldarale, Charles R" <Ch...@unisys.com>.
> From: Jaime Almeida [mailto:22348@alunos.isel.ipl.pt] 
> Subject: Where can I find the thread main?
> 
> Yesterday you've told me that all java applications need one 
> thread main.

Not need - have.

> I have one main class - BD.java, where I define all the 
> functions needed by the web application to work.

Don't confuse main thread with a main() method, nor the fact that your
BD.java happens to be important to your application.

Again, you need to get some basic understanding of Java in general
before you plunge into servlets and app servers.  There are numerous
free tutorials available for both Java and servlets - Google is your
friend.

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY
MATERIAL and is thus for use only by the intended recipient. If you
received this in error, please contact the sender and delete the e-mail
and its attachments from all computers.

---------------------------------------------------------------------
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


Re: Where can I find the thread main?

Posted by Christopher Schultz <ch...@christopherschultz.net>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Jaime,

Jaime Almeida wrote:
> Yesterday you've told me that all java applications need one thread main.
> I have one main class - BD.java, where I define all the functions needed
> by the web application to work.

Er, is this a helper class or something? It is a servlet? What do you
mean by "main class"?

> So, I probably have some problem with the link of my project to that
> main class, isn't it?

Maybe. Are you experiencing some kind of problem? If so, what is it?

> How can I define it?

Define a main thread? You don't "define" threads. You create and launch
them. The main thread is special because it is created by the JVM and
used to begin execution of the program being run (Tomcat in this case,
though I'm not entirely convinced at this point).

You should not have to worry about defining threads or anything like that.

- -chris

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFHC4o59CaO5/Lv0PARAhQqAJ4jyEB/pwL6DQY3izE+bO59qEE6OgCfTim3
5u018cQvFVIH3X/7SdBniIM=
=weCH
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
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


Re: Where can I find the thread main?

Posted by Pierre Goupil <go...@gmail.com>.
Hello,

If I understand you well, you are looking for a way of telling Tomcat where
your main() METHOD is, right? But you don't need it :

http://www.stardeveloper.com/articles/display.html?article=2001061901&page=1

HTH,

Pierre


-- 
"Deux choses ne se peuvent cacher : l'ivresse et l'amour."
(Antiphane)

Re: Where can I find the thread main?

Posted by Joshua Fielek <jf...@centriccrm.com>.
Very briefly, the Java Main thread for Tomcat is created when Tomcat is 
launched. Tomcat creates threads that then execute your servlets and 
associated code.

I'm certain that other folks will point you at more complete 
documentation on the way Tomcat works within the JVM.

Thanks,
J

Jaime Almeida wrote:
> Hello.
> Yesterday you've told me that all java applications need one thread main.
> I have one main class - BD.java, where I define all the functions needed 
> by the web application to work.
> So, I probabily have some problem with the link of my project to that 
> main class, isn't it?
> How can I define it?
> Best regards,
> Jaime Almeida.
> --------------------------------------------
> IPLNet WebMail http://www.net.ipl.pt/mail
> --------------------------------------------
> 
> ---------------------------------------------------------------------
> 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
> 

-- 
Joshua J. Fielek
Sr. Software Engineer
Centric CRM
223 East City Hall Ave., Suite 212
Norfolk, VA 23510
Phone  : (757) 627-3002x6656
Mobile : (757) 754-4462
Fax    : (757) 627-8773
Email  : jfielek@centriccrm.com
http://www.centriccrm.com


---------------------------------------------------------------------
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