You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by "Preston L. Bannister" <pr...@home.com> on 1999/11/09 18:18:59 UTC

Tomcat build failing?

I updated the jakarta- tomcat/tools/watchdog directories from CVS this
morning, ran the build, and got the following error:
----
Buildfile: build.xml
Detected Java Version: 1.1
Project base dir set to: D:\Jakarta\jakarta-tomcat
Executing Target: prepare
Executing Target: main
Compiling 1 source files to D:\Jakarta\build\tomcat\classes
D:\Jakarta\jakarta-tomcat\src\share\org\apache\tomcat\protocol\WARConnec
tion.java:157: Method getFileNameMap() not found in class
org.apache.tomcat.protocol.WARConnection.
        return getFileNameMap().getContentTypeFor(path);
                             ^
1 error
BUILD FATAL ERROR: Compile failed, messages should have been provided.
Process completed successfully
----
getFileNameMap() does not seem to exist anywhere...


Re: PATCH: explicit build.bat for watchdog

Posted by Harish Prabandham <Ha...@eng.sun.com>.


Costin.Manolache@eng.sun.com wrote:

> "Preston L. Bannister" wrote:
>
> > Replacement for the build.bat file in watchdog to exactly control the
> > build environment.
> > Downside is you have edit JAVA_HOME to match your installation.
>
> Is it any way to do an "if" in a BAT file?
> AFAIK, java installer sets JAVA_HOME to something, so it would be
> nice to use whatever is set ( "if" it is set :-)
>
> Also, is there any way to call a sort of sub-routine in BAT?
> Something like  TomcatEnv.BAT that will set all the env variables?

Yes there is a way.... Do something like this


if not  "%JAVA_HOME%" == "foobar" goto label
rem if block here....
goto end

:label
rem else block here...

:end
rem out of the wretched if-else loop


>
>
> That would be very usefull because you can then easily compile individual
> files (and servlets) - you have the right classpath, and it can also be
> called
> from a .bashrc file ( or whatever is the BAT equivalent ) - that saves
> typing.
>
> Since we are here, it would also be nice to have a TOMCAT_HOME env
> and do a cd - this way we might be able to start tomcat from any directory.
>
> ( I can do the sh side, but I'm not sure if it is possible on Windows,
> and we need the same "style" on both platforms )
>
> Costin
>
> >
> > FILE build.bat
> > ----
> > @echo off
> >
> > REM Explicitly specify the JDK to be used.
> >
> > REM JAVA_HOME=d:\jdk1.1.6
> > REM JAVA_HOME=d:\jdk1.1.7
> > set JAVA_HOME=d:\jdk1.1.8
> > REM JAVA_HOME=d:\jdk1.2.1
> >
> > set CLASSPATH=%JAVA_HOME%\lib\classes.zip
> > set CLASSPATH=%CLASSPATH%;%JAVA_HOME%\lib\tools.jar
> >
> > set
> > CLASSPATH_ANT=..\jakarta-tools\ant.jar;..\jakarta-tools\moo.jar;..\jakar
> > ta-tools\projectx-tr2.jar;..\jakarta-tools\servlet-2.2.0.jar;%CLASSPATH%
> >
> > REM Just so we can tell from the log which compiler we used:
> >
> > echo JAVA_HOME=%JAVA_HOME%
> > echo CLASSPATH=%CLASSPATH%
> > echo CLASSPATH_ANT=%CLASSPATH_ANT%
> >
> > %JAVA_HOME%\bin\java -version
> >
> > %JAVA_HOME%\bin\java -classpath %CLASSPATH_ANT%
> > org.apache.tools.ant.Main %*
> >
> > REM Note no attempt to clean up altered CLASSPATH.
> > REM Kind'a a lost cause as ^C will leave them in changed state.
> > ----
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: tomcat-dev-help@jakarta.apache.org
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-dev-help@jakarta.apache.org


RE: PATCH: explicit build.bat for watchdog

Posted by "Preston L. Bannister" <pr...@home.com>.
From: costin@eng.sun.com
> Is it any way to do an "if" in a BAT file?
> AFAIK, java installer sets JAVA_HOME to something, so it would be
> nice to use whatever is set ( "if" it is set :-)

In fact you *don't* want to use whatever is set in the environment when
building, *especially* when building for release.

I've got lots of java's installed: Microsoft, Visual Cafe, JBuilder,
VisualAge and various JDK versions.  Clearly I don't want to build with
whichever was installed last :).  In real practice I will want to build
with specific older and newer versions, at least to insure
compatibility.


> Also, is there any way to call a sort of sub-routine in BAT?
> Something like  TomcatEnv.BAT that will set all the env variables?

Sure.  Something like:

FILE TomcatEnv.bat
----
@echo off

REM Explicitly specify the JDK to be used.

REM JAVA_HOME=d:\jdk1.1.6
REM JAVA_HOME=d:\jdk1.1.7
set JAVA_HOME=d:\jdk1.1.8
REM JAVA_HOME=d:\jdk1.2.1

set CLASSPATH=%JAVA_HOME%\lib\classes.zip
set CLASSPATH=%CLASSPATH%;%JAVA_HOME%\lib\tools.jar
----

FILE jakarta-watchdog\build.bat
----
@echo off
call TomcatEnv.bat

set
CLASSPATH_ANT=..\jakarta-tools\ant.jar;..\jakarta-tools\moo.jar;..\jakar
ta-tools\projectx-tr2.jar;..\jakarta-tools\servlet-2.2.0.jar;%CLASSPATH%

REM Just so we can tell from the log which compiler we used:

echo JAVA_HOME=%JAVA_HOME%
echo CLASSPATH=%CLASSPATH%
echo CLASSPATH_ANT=%CLASSPATH_ANT%

%JAVA_HOME%\bin\java -version

%JAVA_HOME%\bin\java -classpath %CLASSPATH_ANT%
org.apache.tools.ant.Main %*
----

> That would be very usefull because you can then easily
> compile individual files (and servlets) - you have the
> right classpath, and it can also be called from a .bashrc
> file ( or whatever is the BAT equivalent ) - that saves
> typing.

OTOH, I don't feel any particular need for the above to compile
individual files in a different way.  The "build" script runs fairly
quickly (I've wired calls to the "build" scripts into TextPad) even on
my pokey little 300 Mhz box :).  Plus there are advantages to always
building the *same* way...


> Since we are here, it would also be nice to have a TOMCAT_HOME env
> and do a cd - this way we might be able to start tomcat from
> any directory.

Or perhaps a JAKARTA_HOME environment variable instead, with Tomcat
under Jakarta?

I've used exactly this convention on both Unix and Windows.


Re: PATCH: explicit build.bat for watchdog

Posted by co...@eng.sun.com.
"Preston L. Bannister" wrote:

> Replacement for the build.bat file in watchdog to exactly control the
> build environment.
> Downside is you have edit JAVA_HOME to match your installation.

Is it any way to do an "if" in a BAT file?
AFAIK, java installer sets JAVA_HOME to something, so it would be
nice to use whatever is set ( "if" it is set :-)

Also, is there any way to call a sort of sub-routine in BAT?
Something like  TomcatEnv.BAT that will set all the env variables?

That would be very usefull because you can then easily compile individual
files (and servlets) - you have the right classpath, and it can also be
called
from a .bashrc file ( or whatever is the BAT equivalent ) - that saves
typing.

Since we are here, it would also be nice to have a TOMCAT_HOME env
and do a cd - this way we might be able to start tomcat from any directory.

( I can do the sh side, but I'm not sure if it is possible on Windows,
and we need the same "style" on both platforms )

Costin



>
> FILE build.bat
> ----
> @echo off
>
> REM Explicitly specify the JDK to be used.
>
> REM JAVA_HOME=d:\jdk1.1.6
> REM JAVA_HOME=d:\jdk1.1.7
> set JAVA_HOME=d:\jdk1.1.8
> REM JAVA_HOME=d:\jdk1.2.1
>
> set CLASSPATH=%JAVA_HOME%\lib\classes.zip
> set CLASSPATH=%CLASSPATH%;%JAVA_HOME%\lib\tools.jar
>
> set
> CLASSPATH_ANT=..\jakarta-tools\ant.jar;..\jakarta-tools\moo.jar;..\jakar
> ta-tools\projectx-tr2.jar;..\jakarta-tools\servlet-2.2.0.jar;%CLASSPATH%
>
> REM Just so we can tell from the log which compiler we used:
>
> echo JAVA_HOME=%JAVA_HOME%
> echo CLASSPATH=%CLASSPATH%
> echo CLASSPATH_ANT=%CLASSPATH_ANT%
>
> %JAVA_HOME%\bin\java -version
>
> %JAVA_HOME%\bin\java -classpath %CLASSPATH_ANT%
> org.apache.tools.ant.Main %*
>
> REM Note no attempt to clean up altered CLASSPATH.
> REM Kind'a a lost cause as ^C will leave them in changed state.
> ----
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-dev-help@jakarta.apache.org


PATCH: explicit build.bat for watchdog

Posted by "Preston L. Bannister" <pr...@home.com>.
Replacement for the build.bat file in watchdog to exactly control the
build environment.
Downside is you have edit JAVA_HOME to match your installation.

FILE build.bat
----
@echo off

REM Explicitly specify the JDK to be used.

REM JAVA_HOME=d:\jdk1.1.6
REM JAVA_HOME=d:\jdk1.1.7
set JAVA_HOME=d:\jdk1.1.8
REM JAVA_HOME=d:\jdk1.2.1

set CLASSPATH=%JAVA_HOME%\lib\classes.zip
set CLASSPATH=%CLASSPATH%;%JAVA_HOME%\lib\tools.jar

set
CLASSPATH_ANT=..\jakarta-tools\ant.jar;..\jakarta-tools\moo.jar;..\jakar
ta-tools\projectx-tr2.jar;..\jakarta-tools\servlet-2.2.0.jar;%CLASSPATH%

REM Just so we can tell from the log which compiler we used:

echo JAVA_HOME=%JAVA_HOME%
echo CLASSPATH=%CLASSPATH%
echo CLASSPATH_ANT=%CLASSPATH_ANT%

%JAVA_HOME%\bin\java -version

%JAVA_HOME%\bin\java -classpath %CLASSPATH_ANT%
org.apache.tools.ant.Main %*

REM Note no attempt to clean up altered CLASSPATH.
REM Kind'a a lost cause as ^C will leave them in changed state.
----


RE: Tomcat build failing?

Posted by "Preston L. Bannister" <pr...@home.com>.
From: Anil Vijendran
> What JDK are you using?
>
> WARConnection extends URLConnection which should contain the
> getFileNameMap() method.

JDK 1.1.8 from IBM, and also in Visual Cafe 2.5a.  Oh I see...

Visual Cafe modified my CLASSPATH, and the (older) Symantec classes were
picked up first.

I'd suggest the build.bat more exactly control the build environment to
preclude this sort of surprise.

FILE build.bat
----
@echo off

REM Explicitly specify the JDK to be used.

REM JAVA_HOME=d:\jdk1.1.6
REM JAVA_HOME=d:\jdk1.1.7
set JAVA_HOME=d:\jdk1.1.8
REM JAVA_HOME=d:\jdk1.2.1

set CLASSPATH=%JAVA_HOME%\lib\classes.zip
set CLASSPATH=%CLASSPATH%;%JAVA_HOME%\lib\tools.jar

set
CLASSPATH_ANT=..\jakarta-tools\ant.jar;..\jakarta-tools\projectx-tr2.jar
;%CLASSPATH%

REM Just so we can tell from the log which compiler we used:

echo JAVA_HOME=%JAVA_HOME%
echo CLASSPATH=%CLASSPATH%
echo CLASSPATH_ANT=%CLASSPATH_ANT%

%JAVA_HOME%\bin\java -version

%JAVA_HOME%\bin\java -classpath %CLASSPATH_ANT%
org.apache.tools.ant.Main %1 %2 %3 %4 %5
----

With JDK 1.1.8
----
JAVA_HOME=d:\jdk1.1.8
CLASSPATH=d:\jdk1.1.8\lib\classes.zip;d:\jdk1.1.8\lib\tools.jar
CLASSPATH_ANT=..\jakarta-tools\ant.jar;..\jakarta-tools\projectx-tr2.jar
;d:\jdk1.1.8\lib\classes.zip;d:\jdk1.1.8\lib\tools.jar
java version "1.1.8"
Buildfile: build.xml
Detected Java Version: 1.1
Project base dir set to: D:\Jakarta\jakarta-tomcat
Executing Target: prepare
Created dir: D:\Jakarta\build\tomcat
Created dir: D:\Jakarta\build\tomcat\classes
Created dir: D:\Jakarta\build\tomcat\etc
Created dir: D:\Jakarta\build\tomcat\src
Created dir: D:\Jakarta\build\tomcat\lib
Copying 114 files to D:\Jakarta\build\tomcat\webpages
Copying 98 files to D:\Jakarta\build\tomcat\examples
Copying 42 files to D:\Jakarta\build\tomcat\src\javax
Copying 6 files to D:\Jakarta\build\tomcat
Executing Target: main
Compiling 269 source files to D:\Jakarta\build\tomcat\classes
Copying 29 support files to D:\Jakarta\build\tomcat\classes
Compiling 22 source files to
D:\Jakarta\build\tomcat\examples\WEB-INF\classes
Compiling 1 source files to
D:\Jakarta\build\tomcat\webpages\WEB-INF\classes
Compiling 1 source files to
D:\Jakarta\build\tomcat\examples\jsp\plugin\applet
Completed in 36 seconds
Process completed successfully
----

With JDK 1.2.1
----
JAVA_HOME=d:\jdk1.2.1
CLASSPATH=d:\jdk1.2.1\lib\classes.zip;d:\jdk1.2.1\lib\tools.jar
CLASSPATH_ANT=..\jakarta-tools\ant.jar;..\jakarta-tools\projectx-tr2.jar
;d:\jdk1.2.1\lib\classes.zip;d:\jdk1.2.1\lib\tools.jar
java version "1.2.1"
HotSpot VM (1.0fcs, mixed mode, build E)
Buildfile: build.xml
Detected Java Version: 1.2
Project base dir set to: D:\Jakarta\jakarta-tomcat
Executing Target: prepare
Executing Target: main
Compiling 1 source files to D:\Jakarta\build\tomcat\classes
Copying 29 support files to D:\Jakarta\build\tomcat\classes
Compiling 22 source files to
D:\Jakarta\build\tomcat\examples\WEB-INF\classes
Compiling 1 source files to
D:\Jakarta\build\tomcat\webpages\WEB-INF\classes
Compiling 1 source files to
D:\Jakarta\build\tomcat\examples\jsp\plugin\applet
Completed in 21 seconds
Process completed successfully
----


Re: Tomcat build failing?

Posted by Anil Vijendran <an...@pacbell.net>.
Hi Preston,

What JDK are you using?

WARConnection extends URLConnection which should contain the
getFileNameMap() method.

Thanks. (I've been able to build suscessfully on jdk1.1.8.)

"Preston L. Bannister" wrote:

> I updated the jakarta- tomcat/tools/watchdog directories from CVS this
> morning, ran the build, and got the following error:
> ----
> Buildfile: build.xml
> Detected Java Version: 1.1
> Project base dir set to: D:\Jakarta\jakarta-tomcat
> Executing Target: prepare
> Executing Target: main
> Compiling 1 source files to D:\Jakarta\build\tomcat\classes
> D:\Jakarta\jakarta-tomcat\src\share\org\apache\tomcat\protocol\WARConnec
> tion.java:157: Method getFileNameMap() not found in class
> org.apache.tomcat.protocol.WARConnection.
>         return getFileNameMap().getContentTypeFor(path);
>                              ^
> 1 error
> BUILD FATAL ERROR: Compile failed, messages should have been provided.
> Process completed successfully
> ----
> getFileNameMap() does not seem to exist anywhere...
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-dev-help@jakarta.apache.org

--
Peace, Anil +<:-)