• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

java.lang.VerifyError:

 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello,

I am working with java again after a several year layoff and wonder if things have changed that much...

From a jsp, I am calling a class method and the server is bombing on (what I would think to be) a simple string concatenation.

Here is the full error:

Apr 3, 2005 7:06:30 PM org.apache.catalina.core.StandardWrapperValve invoke
SEVERE: Servlet.service() for servlet jsp threw exception
java.lang.VerifyError: (class: util/eMainUserLogin, method: insertDBtest signature: (Ljava/lang/String Ljava/lang/String Incompatible object argument for function call
at org.apache.jsp.net._1login_jsp._jspService(org.apache.jsp.net._1login_jsp:64)
blah, blah, blah...


Here is my jsp, which is very simply a login page:

<%@ page import="util.eMainUserLogin"%>
<%@ page import="java.io.*" %>

<html>
<head>
<title>New Client</title>
</head>
<%
if(request.getMethod().equalsIgnoreCase("post")){
String userId = request.getParameter("ulogin");
String pWord = request.getParameter("upword");

System.out.print(userId);

int i = 0;

eMainUserLogin emUL = new eMainUserLogin();
String imback = emUL.insertDBtest(userId);

i = 1;
System.out.print(imback);
}
%>

<body>
<table border="0">
<tr>

<td>
<form method="POST" action="">
<p></b><font color="#FF0000" size="4">*</font><font face="Arial" size="2"><b>denotes required information</b></font></p>
<table border="0" width="100%">


<tr>
<td width="30%" align="right"><font face="Arial" size="2">Login:</font></td>
<td width="20%" align="left"><input type="text" name="ulogin" size="20"><font color="#FF0000" size="4">*</font></td>
<td width="30%" align="right"><font face="Arial" size="2"></font></td>
</tr>
<tr>
<td width="30%" align="right"><font face="Arial" size="2">Email Address:</font></td>
<td width="20%" align="left"> <input type="text" name="upword" size="20"><font color="#FF0000" size="4">*</font></td>
</tr>

<tr>
<td width="30%" align="right"></td>
<td width="20%" align="left"><input type="submit" value=" Complete Registration " name="btnAddUser"></td>
<td width="30%" align="right"></td>
<td width="20%" align="left"></td>
</tr>
</table>

</form>
</tr>
</table>
</body>
</html>

NOW... here is the class that bombs (all lines indicated are also commented out when I am running this):

package util;

import java.util.ArrayList;
import java.sql.ResultSet;
import java.io.*;
import util.jdbcConnection;


public class eMainUserLogin {

public String insertDBtest(String uLogin) throws Exception{

String p = "";

System.out.println("inproc insertDB = " +uLogin);

if(uLogin==null){
p = "NULLVALUE";
}else{
if(uLogin.equals("")==true){
p = "EMPTYSTRING";
} else{
p = uLogin;
}

}

ResultSet rs = null;
jdbcConnection jc = new jdbcConnection();
// int x = 1;


String qry = "select count(clientid) as cnt from menu_client "+
"where login = lower('"+ p +"')";
// "where login = lower('test')";



//System.out.println(qry);

// rs = jc.getResultSetfromSql(qry);

// while (rs.next()) {
// x = Integer.parseInt(rs.getObject("cnt").toString());
// p = rs.getObject("cnt").toString();
// }

p = qry;
return p;
}
}

All I want to do is verify that my query string is correct.

If I comment out: "where login = lower('"+ p +"')"; and replace it with the line below, all is well... I have used this code on a previous project with no issues at all...

I know that once I get to the DB all is well, but for my life I cannot understand the problem with this syntax, nor can some more experienced java folks I have queried (pun intended).

I am building the class using JBuilder and JDK 1.5 and then running the JSP on tomcat 5.5.8

Does that have anything to do with it? And if so what can I do?

Any insight will be greatly appreciated...









 
Bartender
Posts: 9626
16
Mac OS X Linux Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
My wild-assed guess is that at one time you had a method in class eMainUserLogin that looked something like this:

and that when you changed your JSP to look like it does now it was not recompiled so the JSP's generated class file is still looking for the two-string method.
Take a look under TOMCAT_HOME/work/Catalina/localhost and you should see a directory for your web application. Delete all the files in it. This will force a recompile of your JSP.
 
Vin Maxie
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What I did just do: I have been using JBuilder with JDK 1.5 and my class compiles fine but doesn't run on Tomcat 5.5.8

Out of frustration (and as a last resort) I switched my JBuilder back to JDK 1.3 and the class still compiles fine... BUT now things work on Tomcat as they should !!!

I don't think the issue is with JBuilder and I don't think the issue is with Tomcat... so I submitted a report w/ the Sun Co...
 
Joe Ess
Bartender
Posts: 9626
16
Mac OS X Linux Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I really Really REALLY doubt that you have found a bug. I don't suppose you are running Tomcat with an earlier version of Java than 1.5 (i.e. 1.3, since you seem to have that handy)? That would cause problems if you compile your class with JDK 1.5.
 
Vin Maxie
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Actually, I had installed Tomcat on a clean XP box with the latest version of the JDK per all of the instructions. All that is on this box is Tomcat, the JDK and PostgresDB and appropriate CLASSPATH definitions. I was having these issues there, so I decided to work for a while on my personal machine to avoid toggling between screens/machines all of the time (and to see if it was environment-specific - though I would be clueless as to how to address that issue...)

On my machine I also had 're-defined' my CLASSPATH to point JDK1.5 and defined it for JBuilder as well and pretty much just left JDK1.3 in my java folder... All I did was re-point my JBuilder back to 1.3, recompile the same class (which was compiling fine anyway) and move this class into the corresponding Tomcat folder.

You are probably correct in stating that there is no bug. It's most likely a matter of Tomcat not being in sync with the JDK version and I have entered a ticket there (after attempting to see if this has/had already been addressed and I didn't follow instructions)...

However it also seems to me that by Tomcat 5.5.8, this should be a non-issue... This has truly been a major frustration and I'm not thrilled with my workaround so I hope there will be a more definite explanation and resolution forthcoming soon.

I'm just glad to be able to begin coding my application!

Thanks for your interest; and I'll update this when i have an answer (even if Tomcat points out my own ignorance is the root).
 
Joe Ess
Bartender
Posts: 9626
16
Mac OS X Linux Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Vin Maxie:

On my machine I also had 're-defined' my CLASSPATH to point JDK1.5



Just a housekeeping point, you should not point your classpath to any JDK or JRE JAR files or directories. They are picked up from the JRE LIB directory. This can cause problems should you have more than one JDK/JRE installed.
Tomcat determines the JDK version to use from the JAVA_HOME environment setting. You may want to check that.
My money is on the JSP recompile. It's easy enough to duplicate. Compile the following code (you can use one source file, test.java):

then comment out class test and switch the commented-out method in testB. Recompile. Now test calls a method that doesn't exist in testB:

Your code coughed up a VerifyError rather than NoSuchMethodError because Tomcat "verifies" the JSP and its dependencies (it does this by compiling the JSP into a servlet).
You probably restarted Tomcat between your last test and when you switched the JRE in JBuilder and that triggered a JSP recompile.
Is my original assumption that you changed insertDBtest correct?
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic