Hi!!!! Please Help!!!

Hello everybody, i'm new into de J2EE world, i would need some help for setting up my Intellij Idea 4.5.3 with tomcat.
i set it up under the preferences but when i try to start a new project it does not seem to appear as a valid application server. i tried both tomcat 4.1 and 5.5. is there anything i am doing wrong? when i add through the preferences i specify the path where i installed tomcat and it automatically shows me all the packages.

by the way, is there any tutorial that shows how to start a mini EJB project from the start to the end, something very simple... for example a project that manages users from a DB.

1 comment
Comment actions Permalink


Setting up the application server really depends on how you plan to debug your application. For the most part, I recommend remotely connecting to a separate instance of the application server. To do this, you need to make a change to your Tomcat start-up, adding some options to the java command. You can set the env var CATALINA_OPTS in whatever shell you use to start catalina.bat or catalina.sh or do it in the script explicitly. Just add:

If you go to the Run->Debug dialog and select Remote, it'll have this in there also.

Then you can start up Tomcat. Once the start-up process is completed, start up the Run->Debug dialog again, select Remote, create a Remote configuration for your app (Transport: Socket, Debugger mode: Attach, Host: whatever , Port: 5005 ) and click Debug.

Boom, you're debugging your web app. You can set break points in your code and, whenever that stuff gets called it'll break there.

The main drawback to this approach is that you can't debug code contained in JSP files. Then again, that could be seen as an advantage, since, as we know, the model-view separation requires NO CODE IN YOUR JSP (as we know, right? :^). The performance in this mode is much better than in the embedded server mode also.

If you're bound and determined to use the embedded server, first, it looks like that functionality has changed quite a bit from when I last really used it. That said, there are a few steps to getting this up properly:

1) Go to File->Settings and open the settings dialog. Click on the IDE tab, then select Application Servers.

2) Click Add and add your server. That basically sets the Tomcat home, base directory, and libraries for that server (I have three set up this way, Tomcat 4.0, Tomcat 4.0 Test, and Tomcat 4.1).

3) To use this in your project, open the Project Settings and go to the Project tab. Click on Paths then Web Module Settings. Note that, if you don't have a Web module in your project, or if you don't have a Web module selected in the Modules list, you won't see the Web Module tab. Either create a new Web module or select an existing Web module to see this tab. You can then select the application server for that Web module at the top of that tab. As you'd expect, the selected app server affects the libraries available to your application. You can also select the app server for a module during module creation.

So basically you have to configure one or more app servers prior to creating your Web module. You can then select one of those app servers for your Web modules during creation. You can also change the app server for a module after creation through the module settings.

Does that answer your question?

As far as the EJB mini-app, I haven't seen one, but I would love to find one! I think a sample code and project configuration repository for various types of IntelliJ projects would be a really great thing!


Please sign in to leave a comment.