-3

How can I run Java application on Apache tomcat?Is there an option to do it?

For example, running application that scan web services and upload the data to the database every 5 min.

If it possible, how it works? is there on process for running web apps (servlets) and another process that runs the Java application?

syb0rg
  • 8,057
  • 9
  • 41
  • 81
15412s
  • 3,298
  • 5
  • 28
  • 38
  • 1
    Yes, you can deploy a WAR file with a Thread that runs every 5 minutes (use of `java.util.TimerTask` is the best method probably). – Philip Whitehouse Apr 28 '13 at 18:23
  • 1
    The question isn't about Java applications in general (which would include web apps, which of course you can do!), but about a specific kind of Java application; the question should make this clear right up front. Can we say this is a daemon? If so, see http://stackoverflow.com/questions/3062596/how-can-i-make-a-java-daemon and http://stackoverflow.com/questions/6838426/how-to-set-a-class-as-daemon-with-tomcat . – Owen S. Apr 28 '13 at 23:12
  • Thanks Owen, thats what I lokked for. – 15412s Apr 29 '13 at 07:09

1 Answers1

2

On tomcat you can run a web application. For this you need to create a dynamic web project in tomcat and create deployed .war file. Once this is generated deploy it on tomcat by putting it inside webapps directory.

Will suggest better read some tutorial on this in detail.

rai.skumar
  • 10,309
  • 6
  • 39
  • 55
  • Thanks for the answer, I know how to build dynamic web project, JSP & Servlets. I wanted to know if I'm able to create java application that will repeat itself (like in my example) – 15412s Apr 28 '13 at 18:06