Bug 151222 - starting a downloaded 6.0.18 is not easy
starting a downloaded 6.0.18 is not easy
Product: serverplugins
Classification: Unclassified
Component: Tomcat
All All
: P2 (vote)
: 6.x
Assigned To: Petr Hejl
Depends on:
  Show dependency treegraph
Reported: 2008-10-23 21:43 UTC by Vince Kraemer
Modified: 2009-02-19 23:12 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT


Note You need to log in before you can comment on or make changes to this bug.
Description Vince Kraemer 2008-10-23 21:43:25 UTC
I built NB from a recent pull.

I downloaded TC 6.0.18 and unzipped it.

I registered the freshly unzipped TC in my NB build

I tried to start TC, using the Start item from the server instances right-click menu.  the start failed... because the
catalina.sh was not executable.  

    *** The ide should try to resolve that automatically under the covers. enhancement...

I did the chmod on catalina.sh and attempted to start again.  the server did not start again!  This time the IDE says
the start failed.  the 'Tomcat 6.0' window in the Output area says: 
"The BASEDIR environment variable is not defined correctly
This environment variable is needed to run this program"

   *** the IDE should feed that variable into the environment as it does the exec. BUG
Comment 1 Petr Jiricka 2009-02-12 15:28:45 UTC
Actually, the same problem happens when using Tomcat from the command line:

dhcp-eprg06-123:~/tomcat/bin petrjiricka$ ./startup.sh
-bash: ./startup.sh: Permission denied
dhcp-eprg06-123:~/tomcat/bin petrjiricka$ chmod +x startup.sh 
dhcp-eprg06-123:~/tomcat/bin petrjiricka$ ./startup.sh
Cannot find ./catalina.sh
This file is needed to run this program
dhcp-eprg06-123:~/tomcat/bin petrjiricka$ chmod +x catalina.sh 
dhcp-eprg06-123:~/tomcat/bin petrjiricka$ ./startup.sh
The BASEDIR environment variable is not defined correctly
This environment variable is needed to run this program
dhcp-eprg06-123:~/tomcat/bin petrjiricka$ chmod +x *.sh
dhcp-eprg06-123:~/tomcat/bin petrjiricka$ ./startup.sh
Using CATALINA_BASE:   /Users/petrjiricka/tomcat
Using CATALINA_HOME:   /Users/petrjiricka/tomcat
Using CATALINA_TMPDIR: /Users/petrjiricka/tomcat/temp
Using JRE_HOME:       /System/Library/Frameworks/JavaVM.framework/Versions/CurrentJDK/Home
dhcp-eprg06-123:~/tomcat/bin petrjiricka$

What you see is:
1. After unzipping Tomcat, just running startup.sh does not work - you need to change the permissions
2. That's not enough, also catalina.sh permissions need to be changed
3. Still not enough, and you get the cryptic message about BASEDIR env.variable
4. You need to change all the .sh file permissions, which finally helps

So the BASEDIR message is issued *not* because of the missing environment variable, but because of the permissions issue
that, and it's the same message from the IDE and the command line. I believe I even filed an issue against Tomcat to
make the message less cryptic, but the Tomcat maintainers are not receptive at all to bug reports (GlassFish is much
better in this respect).

I found some more info also here: http://linux-sxs.org/internet_serving/c140.html
The general recommendation is to use the tar.gz archive on *nix platforms, rather than the zip file.

So, since this is a general Tomcat problem and the IDE does not do anything special, I think we should not try to
recover from this on the IDE side, just leave the behavior as it is and close this report as WONTFIX, what do you think?
Comment 2 Vince Kraemer 2009-02-12 15:42:45 UTC
If the user is allowed to register the instance... it should work. Period.

If the instance is not going to work... say because of permission problems, we could:
1. fix the permission problems during registration OR
2. not allow the user to complete registration... with a message that indicates why registration was not able to complete.

I don't think leaving a user hanging with a registered instance which is broken is acceptable.

This is especially true now that you have done the analysis of the problem.

An IDE SHOULD do 'something special' to help prevent users running into dead-ends like this one.
Comment 3 Petr Hejl 2009-02-16 12:42:59 UTC
Improved message - main 8edea273692a.

There is nothing special NetBeans can do on JDK5.
Comment 4 Quality Engineering 2009-02-18 10:50:13 UTC
Integrated into 'main-golden', will be available in build *200902180201* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main/rev/8edea273692a
User: phejl@netbeans.org
Log: #151222 starting a downloaded 6.0.18 is not easy

By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2014, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo