This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
I tried to add an external Tomcat installation to the IDE together with a colleague who initially reported the problem. The version in question is the one that's shipped with Solaris 9 (it's 4.0.X, probably not an official release). However, the problem derives from properties of CATALINA_BASE, not CATALINA_HOME so it's not the server libraries themselves that are the problem. We can reproduce the exact same behaviour when setting CATALINA_HOME to the directory that is bundled with the IDE. The server is set up with separate BASE and HOME and works correctly when managed outside of the IDE. We tried to do all this with MINIMUM installation. To reproduce: 1) Add the Tomcat home directory (on Solaris 9, or use tomcat404 under IDE root). 2) We get a dialog saying that there is no server.xml in the directory, please set the base directory if appropriate. 3) We then set the BASE directory, which looks as follows ../conf/server.xml ../conf/web.xml ../conf/sth else... Note there is no webapps directory, which is not required for a Tomcat installation to run. 4) We see the same dialog as in (2). This should be a different message - it was appropriate when there was a BASE to be set, but in this case there isn't. Also, the message is clearly wrong because there is a server.xml file. 5) The directory was set up with softlinks. To determine that the problem didn't derive from the links, we created a new directory under /tmp/tomcat with the same files. It doesn't work either. 6) We then deleted /tmp/tomcat and copied tomcat_404base to /tmp/tomcat, after which we copied the conf files from the original directory to overwrite the ones from tomcat404base. This works. Clearly the installation process expects something other than server.xml and reports the problem incorrectly. Perhaps it expects the manager application to be installed or something. Whatever the actual problem is, the dependency should be removed. The IDE should not fail to add an external installation that is a valid working installation of Tomcat.
Created attachment 7556 [details] Tar archive of the directory that the IDE does not accept as CATALINA_BASE
Created attachment 7557 [details] Tar archive of the directory that the IDE does not accept as CATALINA_BASE
message will be more detailed > Note there is no webapps directory, which is not required > for a Tomcat installation to run. webapps" directory is part of standard tomcat 4.0.? and 4.1.? installations. Is there some official notice in the tomcat doc that this directory is not necessary?
Current rule to identify proper setting of CATALINA_HOME or CATALINA_BASE is: One of CATALINA_HOME and CATALINA_BASE have to contain both: 1. "conf", "webapps", "work" and "log" subdirs and 2. conf/server.xml file If one of these conditions isn't satisfied, the message (you mentioned) will display. So, proper fix of this issue is to display message with these details, isn't it?
Fixed in trunk. Diff: http://www.netbeans.org/source/browse/tomcatint/tomcat40/src/org/netbeans/modules/tomcat/tomcat40/Bundle.properties.diff?r1=1.30&r2=1.31
I just tried to add a Tomcat 4.0.6 installation to the build from 02/03. I get the dialog stating that the directories need to be there as you describe above. I downloaded the tar.gz file and used winzip on Win2k to unzip so the log and work directories were not created as part of the installation. I manually added the log and work directories, and confirmed that everything was as requested in the dialog, but the installation still does not work. Steps to reproduce: 0. windows 2000 1. jakarta.apache.org -> download -> tar.gz file 2. use winzip to extract 3. use browse to select the directory, you see the dialog about required directories. 4. manually create the log and work directories under the server root. 5. the dialog still pops up. I believe that the reason for this is that the directory we require is actually called "logs". But, I would argue that these are not real requirements - they are things that Netbeans wants, but not things that Tomcat actually requires. Firstly, contrary to what Damian says, the webapps directory is not required for Tomcat to run. Tomcat provides two ways of adding web apps to the server: one is by declaring them in the server.xml file, and one of them is to throw them into web apps. The former is actually the mechanism which we support through the IDE (I think it's the recommended mechanism also, since it gives less information of how the file system is structured to potential hackers). The tomcatint module has introduced a dependency on the manager application which is inside the web apps directory. But that's not a dependency on the web apps directory, as can easily be verified by renaming the webapps directory and changing the manager context declaration to point to the new path. So strictly our requirement here is that server.xml declares a context called manager and this happens to coincide with the tomcat app.... As an aside, users may not want to run the manager app on a production server since that's a potential security hole. I think our deployment features should work even if the manager is not installed, because developers might want to make exact copies of their production environment. I don't know if this works right now. Secondly, Tomcat does not require the work and logs directories to start. This can be verified by downloading Tomcat as I described above and then starting it using the startup.xxx script. Tomcat creates these directories on its own. I think it would be preferrable for the tomcatint module to do the same if possible - if they aren't there, then we create them or wait for the server to create them. So to better reflect the Tomcat structures, our requirements should be for conf/server.xml (which is truly requried, web.xml isn't, it's just a set of defaults) and I guess the jar files that make up the runtime.... Sorry to be such a pain!
It is true that the work and logs directories will be created by the server when needed. However, the temp directory is important, and Tomcat does not work well without it. Tomcat 4.1.x even contains a useful README file in this directory, which explains why it is important: "This temp directory is used by the JVM for temporary file storage. The JVM is configured to use this as its java.io.tmpdir in the catalina.sh and catalina.bat scripts. Tomcat is configured to use this temporary directory rather than its default for security reasons. The temp directory must exist for Tomcat to work correctly." So I believe we should mainly check that the temp directory exists. As for the requirement to have the manager application, this depends on whether we want to allow deployment to production environment from the IDE. I don't think that is a priority, so I don't mind much that we require the manager.
Fixed in trunk. Relative to all your comments, we will check, whether the selected dir contains both conf and temp subdirs and conf/server.xml file. Tomcat40Installation.java, rev. 1.52 Bundle.properties, rev. 1.33
Correction: Only catalina_home must contain temp subdir.
VERIFIED