Tomcat 5.5 Integration

I'm having a problem trying to set up my first web app with Tomcat 5.5 and IntelliJ. The web app compiles fine in IntelliJ, and I can copy it over to the server and it works fine (it's just a simply hello world servlet).

The problem is that I can't get IntelliJ to deploy the app to the server. The installer didn't come with the catalina.bat file but that was easily resolved by my own batch file, so IntelliJ can now start and stop Tomcat just fine. The problem is that deploying the project does ABSOLUTELY nothing at all. It doesn't deploy or undeploy anything when I click the buttons -- no files are changed, added, or modified in the Tomcat installation or webapp root. But IntelliJ gives an "OK" icon.

I can't figure how how to get IntelliJ to do anything for the deployment. As I said, the exploded directory that is created is correct -- if I copy it to Tomcat it works. If I have IntelliJ generate a WAR file the WAR file can be deployed by hand without a problem.

So what am I missing? How can I get IntelliJ to integrate with Tomcat?

6 comments
Comment actions Permalink

Hello Jason,

I'm having a problem trying to set up my first web app with Tomcat 5.5
and IntelliJ. The web app compiles fine in IntelliJ, and I can copy
it over to the server and it works fine (it's just a simply hello
world servlet).

The problem is that I can't get IntelliJ to deploy the app to the
server. The installer didn't come with the catalina.bat file but that
was easily resolved by my own batch file, so IntelliJ can now start
and stop Tomcat just fine. The problem is that deploying the project
does ABSOLUTELY nothing at all. It doesn't deploy or undeploy
anything when I click the buttons -- no files are changed, added, or
modified in the Tomcat installation or webapp root. But IntelliJ
gives an "OK" icon.

I can't figure how how to get IntelliJ to do anything for the
deployment. As I said, the exploded directory that is created is
correct -- if I copy it to Tomcat it works. If I have IntelliJ
generate a WAR file the WAR file can be deployed by hand without a
problem.

So what am I missing? How can I get IntelliJ to integrate with
Tomcat?


Please use zipped Tomcat distribution, it comes with the .bat files necessary
for IDEA integration. Follow this tutorial if you have problems: ftp://intellij.net/pub/.idea/TomcatTutorial/TomcatJspDebug.zip
.

--
Serge Baranov
JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"




0
Comment actions Permalink

Thank you for your quick reply. That tutorial is much better than the help inside of IDEA.

I already knew about the batch file thing, which is why I created my own. But I decided to try Tomcat 5.0 (because I didn't know for sure until now that IDEA supported 5.5), and I still had the same problem somehow. But following your tutorial directly and everything worked -- I don't know what the problem was because after I did that my original project (I did Hello World servlet instead of index.jsp) started to work even though I've been working with it for 6 hours :\. So now I will use the zip for Tomcat 5.5 to get IDEA to work with that.

It seems that IDEA makes a temp directory for the configuration in IDEA's cache -- this is extremely good because I want to develop as limited user and not admin, who will not have write access to the Tomcat directory.

I am very grateful for your help so far, and I would be glad if you could answer two further questions:

  • IDEA puts server.xml and config files in the temp directory -- are they copied from Tomcat so that they are generated from any Tomcat settings I use (if I change server.xml or server's default web.xml)

  • Despite my best attempts, I can't get Javadoc to work with the servlet API. Quick is not possible without source, but shouldn't I get the HTML external Javadoc to work?

0
Comment actions Permalink

Hello Jason,

  • IDEA puts server.xml and config files in the temp directory -- are

they copied from Tomcat so that they are generated from any Tomcat
settings I use (if I change server.xml or server's default web.xml)


Yes, these files are taken from Tomcat, also if you need to define some additional
options, such as datasources, you can make a custom .xml file for your context
and place it into ]]>/conf/Catalina/localhost directory, in deployment
settings choose the same context name as defined in this .xml file, IDEA
will modify documents root in it and place it into the temp dir.

  • Despite my best attempts, I can't get Javadoc to work with the

servlet API. Quick is not possible without source, but shouldn't I
get the HTML external Javadoc to work?


It's a known limitation of IDEA 4.5, Tomcat libraries are configured in Settings
| Application Servers and there is no way to attach JavaDocs and sources
to them. This problem is fixed in IDEA 5.0 which should be released next
week: http://www.jetbrains.net/confluence/display/IDEADEV/Home .

--
Serge Baranov
JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"


0
Comment actions Permalink

It's unfortuante that it cannot be done. But since Irdia is so close to launch, maybe it is time for me to check it out. Since I'm responsible for license upgrade and purchase, I need to do this. We just started using J2EE (previously only Java apps), and it seems Irdia will help us with that.

The deployment tab confused me some -- I think maybe that is what happened. I thought that box was setting the root, but then also there is a path where the resources go (default is /). I think maybe I messed up the URL settings in my project and I was trying to go to the wrong URL with the browser, but everything is working now with Tomcat 5.5, so thanks for your help.

Right now I'm just trying to see if I can create a servlet in IDEA without touching the web.xml, but I'm having problems getting it to create a <servlet-mapping> tag to actually place my servlet in the web application.

0
Comment actions Permalink

Hello Jason,

Right now I'm just trying to see if I can create a servlet in IDEA
without touching the web.xml, but I'm having problems getting it to
create a <servlet-mapping> tag to actually place my servlet in the web
application.


It's easy, switch to J2EE view in the Project panel and double click on the
module with globus icon, you'll see tabs for
General and Assembly Descriptor settings.

You can also hit Alt+Insert while standing on the web module in the J2EE
view and choose Servlet from the drop-down list.

When servlet is added you can configure mappings visually in the Web Module
Properties dialog, you don't have to edit web.xml manually.

P.S. If you have additional questions, could you please write to support@jetbrains.com?
It's easier for me to answer there.

--
Serge Baranov
JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"


0
Comment actions Permalink

Thank you for your reply. After getting your mail I was still confused, because I did do the "add Servlet" action. But then I finally found there is a properties page one level higher than the servlet that does the mappings and filters. So now all of my questions are answered. If I do have further questions I will use the address you gave, although I hope that I am through with that ;).

IDEA is an amazing tool. I was using it only for J2ME and J2SE development but now I see it is equally as amazing for J2EE. I have installed the new Irdia and it works great for me and Javadoc works perfectly, so now I can learn the servlet API very easily now. There is no question we will be upgrading our whole team to 5.0!

0

Please sign in to leave a comment.