[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 381
  • Last Modified:

JSP error: No match was found for method

Hi,

I edited my JSP file to reference a java class which has two definitions for a function. The JSP file initially referenced version one of the function and was operating just fine. I then changed it to reference version two with different parameters and I am receiving a "No match was found for method" error. I then cut and paste version two into an entirely new function and am getting the same error. Rebuilt the java class with no errors, restarted the jrun server. What could I possibly be missing here?

Thanks.
0
lcftahoe
Asked:
lcftahoe
  • 5
  • 4
  • 3
  • +1
1 Solution
 
kjayaramanCommented:
Hi,
Seems absurd, but can you change something in your jsp [mightbe a newline] and reload the jsp in a new browser window.

The jsp needs to be rebuilt to use the new version of your class. But you restarted jrun. Hmmm.
0
 
TimYatesCommented:
can you post the JSP and the class?  Sounds like you have got your parameter types wrong in one of them...
0
 
KuldeepchaturvediCommented:
Sometimes it happens with me.. the best way that I use is to delete the .class file that JSP creates in the work folder..
it forces to recompile the JSP page...
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
lcftahoeAuthor Commented:
The parameter types are correct. I am able to make other changes to the jsp file that are showing up. I deleted the class file and restarted Jrun again, still no luck.
0
 
KuldeepchaturvediCommented:
Hmm are you sure that your changed class have the same package name as previous one? and also the same name as the previous class that you were using??
Can you post the full stack trace to we can look at it??
0
 
TimYatesCommented:
And can you post your java code and the bit of your JSP that calls it?
0
 
lcftahoeAuthor Commented:
Yes, the changed class is the same name. Furthermore the previous one contained the function definition I want to use but it is not recognized, nor is the function I added with a different name.

Not sure what you mean by post - I re-made the java class and uploaded it to the server. Then checked the class and the new function definition is there. Then changed the jsp file (in which some of the changes I made ARE showing up). Then deleted the class files for the JSP file. Then restarted JRun. What am I missing here?
0
 
KuldeepchaturvediCommented:
when we say post.. we were meaning to cut & paste your class file and jsp code in this forum so that we can look at it..:-)
0
 
lcftahoeAuthor Commented:
Ah, gotcha :). So in the java code there are three functions I copied here: only the 3rd one is working (the first part of the if statement in the jsp code).

JSP code:

<tsb:param name="sendFilter" default="" />
...
TSB.Parameters params = TSB.Parameters.getInstance(pageContext);
TSB.Configuration config = new TSB.Configuration();
...

if (params.isEmpty("sendFilter")) {
      List      users = config.getParticipants(conn);
      }
else
      {
      List      users = config.getParticipants_byStatus(conn,params.getInteger("sendFilter"));
      }


Configuration.java code:

/** Return list of participants in a given status */
      public List getParticipants(Connection conn, int status) throws SQLException
      {
            Statement      stmt = conn.createStatement();
            ResultSet      rs = stmt.executeQuery("SELECT cpUser FROM tsbConfigParticipants,tsbUsers WHERE cpConfig=" +
                  getPrimaryKey() + " AND cpStatus=" + String.valueOf(status) +
                  " AND usId=cpUser ORDER BY usLastName,usFirstName");
            List      results = new ArrayList();
            while (rs.next())
                  results.add(new Integer(rs.getInt(1)));
            rs.close();
            stmt.close();
            return results;
      }
      
      /** Return list of participants in a given status */
      public List getParticipants_byStatus(Connection conn, int status) throws SQLException
      {
            Statement      stmt = conn.createStatement();
            ResultSet      rs = stmt.executeQuery("SELECT cpUser FROM tsbConfigParticipants,tsbUsers WHERE cpConfig=" +
                  getPrimaryKey() + " AND cpStatus=" + String.valueOf(status) +
                  " AND usId=cpUser ORDER BY usLastName,usFirstName");
            List      results = new ArrayList();
            while (rs.next())
                  results.add(new Integer(rs.getInt(1)));
            rs.close();
            stmt.close();
            return results;
      }

      /** Return list of participants of all statuses
      public List getParticipants(Connection conn) throws SQLException
      {
            Statement      stmt = conn.createStatement();
            ResultSet      rs = stmt.executeQuery("SELECT cpUser FROM tsbConfigParticipants,tsbUsers WHERE cpConfig=" +
                  getPrimaryKey() + " AND usId=cpUser ORDER BY usLastName,usFirstName");
            List      results = new ArrayList();
            while (rs.next())
                  results.add(new Integer(rs.getInt(1)));
            rs.close();
            stmt.close();
            return results;
      }
0
 
lcftahoeAuthor Commented:
Up-ing the points as this seems elusive and I've got to figure it out!
0
 
TimYatesCommented:
doesn't params.getInteger("sendFilter") return an Integer?

And all your methods take an int

0
 
KuldeepchaturvediCommented:
>> users = config.getParticipants_byStatus(conn,params.getInteger("sendFilter"));

Are you sure that params.getInteger(String) takes an string as input and returns a interger?
If not then thats where your problem is...
0
 
lcftahoeAuthor Commented:
bingo, forced the int conversion in the jsp code instead of the class file.
0

Featured Post

Prep for the ITIL® Foundation Certification Exam

December’s Course of the Month is now available! Enroll to learn ITIL® Foundation best practices for delivering IT services effectively and efficiently.

  • 5
  • 4
  • 3
  • +1
Tackle projects and never again get stuck behind a technical roadblock.
Join Now