You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Wendy Smoak <ja...@wendysmoak.com> on 2005/06/03 02:28:58 UTC

Tomcat + HP-UX = NoSuchMethodError java.lang.String.contains(Ljava/lang/String;)

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
        at
edu.asu.vpia.benweb.dao.ResolutionImpl.getSortField(ResolutionImpl.java:47)

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:
http://wiki.wendysmoak.com/cgi-bin/wiki.pl?TomcatNoSuchMethodError )

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
1.5:

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 =
/opt/java1.5/jre/lib/PA_RISC2.0:/opt/java1.5/jre/lib/PA_RISC2.0/server:/opt/
java1.5/jre/../lib/PA_RISC2.0:/usr/lib

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.)

Thanks,
Wendy Smoak


---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Re: Tomcat + HP-UX = NoSuchMethodError java.lang.String.contains(Ljava/lang/String;)

Posted by Wendy Smoak <ja...@wendysmoak.com>.
From: "QM" <qm...@brandxdev.net>

> On Thu, Jun 02, 2005 at 05:37:23PM -0700, Wendy Smoak wrote:
> : > Any idea why String.contains(String) wouldn't work within Tomcat 4.1
on
> : > HP-UX and Java 1.5?
>
> Doesn't Tomcat 4.1 even support JDK 1.5?

Tomcat 4.1 works fine under JDK 1.5 on Windows 2000... I see that Tomcat 5.5
requires Java 1.5 by default, but that's the only restriction I've seen.

> Are you using 1.5 to build, run, or both?

Both... but Sun's version on Windows to build, and HP's on HP-UX to run.

-- 
Wendy Smoak


---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Re: Tomcat + HP-UX = NoSuchMethodError java.lang.String.contains(Ljava/lang/String;)

Posted by QM <qm...@brandxdev.net>.
On Thu, Jun 02, 2005 at 05:37:23PM -0700, Wendy Smoak wrote:
: > Any idea why String.contains(String) wouldn't work within Tomcat 4.1 on
: > HP-UX and Java 1.5?

Doesn't Tomcat 4.1 even support JDK 1.5?

Are you using 1.5 to build, run, or both?


-QM

-- 

software   -- http://www.brandxdev.net/
tech news  -- http://www.RoarNetworX.com/
code scan  -- http://www.JxRef.org/

---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


NotifyUtil::java.net.ConnectException: Connection refused: connect

Posted by Otgonbayar <co...@itpark.mn>.
My application works fine but following log is streaming.
I don't know the reason, what should I do?
Thanks
Otgo

NotifyUtil::java.net.ConnectException: Connection refused: connect
	at java.net.PlainSocketImpl.socketConnect(Native Method)
	at java.net.PlainSocketImpl.doConnect(Unknown Source)
	at java.net.PlainSocketImpl.connectToAddress(Unknown Source)
	at java.net.PlainSocketImpl.connect(Unknown Source)
	at java.net.Socket.connect(Unknown Source)
	at java.net.Socket.connect(Unknown Source)
	at sun.net.NetworkClient.doConnect(Unknown Source)
	at sun.net.www.http.HttpClient.openServer(Unknown Source)
	at sun.net.www.http.HttpClient.openServer(Unknown Source)
	at sun.net.www.http.HttpClient.<init>(Unknown Source)
	at sun.net.www.http.HttpClient.<init>(Unknown Source)
	at sun.net.www.http.HttpClient.New(Unknown Source)
	at sun.net.www.http.HttpClient.New(Unknown Source)
	at sun.net.www.http.HttpClient.New(Unknown Source)
	at sun.net.www.protocol.http.HttpURLConnection.plainConnect(Unknown
Source)
	at sun.net.www.protocol.http.HttpURLConnection.connect(Unknown
Source)
	at
sun.net.www.protocol.http.HttpURLConnection.getOutputStream(Unknown Source)
	at
org.netbeans.modules.web.monitor.server.NotifyUtil$RecordSender.run(NotifyUt
il.java:237)



---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Re: Tomcat + HP-UX = NoSuchMethodError java.lang.String.contains(Ljava/lang/String;)

Posted by Wendy Smoak <ja...@wendysmoak.com>.
From: "Wendy Smoak" <ja...@wendysmoak.com>

> Any idea why String.contains(String) wouldn't work within Tomcat 4.1 on
> HP-UX and Java 1.5?

Now I'm *completely* mystified...

     test.jsp:
     <%  out.println( "ABC".contains( "A" ) );  %>

works fine (prints 'true' on the page).

Has anyone EVER seen behavior like this?  The same method works in a JSP but
does not work in .class files included in the .war?

I'm leaning towards 'obscure classloader issue in the HP-UX JVM' but I don't
really feel qualified to make that statement.  Can you help me prove it or
suggest an alternative?

-- 
Wendy Smoak


---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org