tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Wendy Smoak <>
Subject Tomcat + HP-UX = NoSuchMethodError java.lang.String.contains(Ljava/lang/String;)
Date Fri, 03 Jun 2005 00:28:58 GMT
Any idea why String.contains(String) wouldn't work within Tomcat 4.1 on
HP-UX and Java 1.5?

I'm getting the following error in the localhost log:

java.lang.NoSuchMethodError: java.lang.String.contains(Ljava/lang/String;)Z

The line in question says:     if( statusDesc.contains("HQ") ) {

Immediately suspecting that HP's JVM was being flaky [again], I tried using
that method in a simple test program at the command line, which worked.
(Details here: )

Then I thought maybe I was somehow accidentally using Java 1.4, which did
not contain that method, but everything I can find says I *am* using Java

When I use the manager app, the bottom of the page says (reformatted for
plain text):
Server Information
Tomcat Version  Apache Tomcat/4.1
JVM Version      1.5.0-_24_nov_2004_16_29
JVM Vendor       Hewlett-Packard Company
OS Name            HP-UX
OS Version         B.11.11
OS Architecture  PA_RISC2.0

I put a scriptlet in a JSP to print out all the system properties, and it
lists things like:
   java.vm.version = 1.5.0 FCS (JS B64) jinteg:11.24.04-15:51 PA2.0 (aCC_AP)
   java.runtime.version = 1.5.0-_24_nov_2004_16_29
   java.library.path =

What else can I check?  I'd really like to use the new methods in Java 1.5,
but I keep having to remove them from my code so it will work once I deploy
to the HP-UX production server.  (The development box is Win2000/Tomcat
4.1/Sun Java 1.5, and everything works fine there.)

Wendy Smoak

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message