Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9196207
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T21:48:02+00:00 2026-06-17T21:48:02+00:00

I am building a web application for feature extraction and comparing the feature of

  • 0

I am building a web application for feature extraction and comparing the feature of images, using JSP, Java, and PostgreSQL.

My feature extraction is extracting some features from images, so that then I can compare them (some features are about color, some on the histogram of the image and so. I have special methods that extract them using specific libraries (jars that I add into lib) as you can see in the following example!

Those features are then successfully being added into my PostgreSQL database.

public void GetImageProperties(String targetPath, ImageProperties imagesProperties) throws Exception
{
    // load image
    FileInputStream imageStream;
    imageStream = new FileInputStream(targetPath);
    BufferedImage bimg = ImageIO.read(imageStream);        

    // get properties
    imagesProperties.cl = new ColorLayoutImpl(bimg);
    imagesProperties.eh = new EdgeHistogramImplementation(bimg);
    imagesProperties.sc = new ScalableColorImpl(bimg);
}

Then I add them into a postgresql database(only the features, not the images)

String query = "CREATE TABLE Images (" +
               "  imageid SERIAL PRIMARY KEY," +
               "  fname VARCHAR(128)," +
               "  colorlayout VARCHAR(512), " +
               "  edgehist VARCHAR(512), " +
               "  scalablecolor VARCHAR(512) " +
               ")";

I get this error every time I had loaded an image and want to compare it with all the other images in a directory.

HTTP Status 500 -     
type Exception report

message:

description The server encountered an internal error () that prevented it from fulfilling this request.

exception:

org.apache.jasper.JasperException: An exception occurred processing JSP page /query.jsp at line 124

121:  if (bSearch) { 
122:    // get form params 
123:    query.setTopK(new Integer(request.getParameter("frm_topk"))); 
124:    query.setColorHistogramWeight(new Integer(request.getParameter("frm_weight_c1"))); 
125:    query.setColorDistributionWeight(new Integer(request.getParameter("frm_weight_c2"))); 
126:    query.setTextureWeight(new Integer(request.getParameter("frm_weight_c3"))); 
127:  }

Stacktrace:

org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:568)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:470)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:390)    
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:334)   
javax.servlet.http.HttpServlet.service(HttpServlet.java:722)    
org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:393)

root cause:

java.lang.NumberFormatException: For input string: "1.0"
java.lang.NumberFormatException.forInputString(NumberFormatException.java:65)   
java.lang.Integer.parseInt(Integer.java:492)    java.lang.Integer.<init>
(Integer.java:677)  org.apache.jsp.query_jsp._jspService(query_jsp.java:256)    
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)  
javax.servlet.http.HttpServlet.service(HttpServlet.java:722)    
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:432)     
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:390)    
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:334)   
javax.servlet.http.HttpServlet.service(HttpServlet.java:722)    
org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:393)

note The full stack trace of the root cause is available in the Apache Tomcat/7.0.27 logs.
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T21:48:03+00:00Added an answer on June 17, 2026 at 9:48 pm

    Your problem is here

    query.setTopK(new Integer(request.getParameter("frm_topk")));
    

    should be

    String parFrm_topk = request.getParameter("frm_topk");
    Integer frm_topk = null;
    if (parFrm_topk != null && parFrm_topk.length() > 0 && !parFrm_topk.equals("null"))
    try {
      frm_topk = Integer.valueOf(parFrm_topk);
    } catch (NumberFormatException nfe){
      throw nfe;
    }
    if (frm_topk ! = null) {
       query.setTopK(frm_topk);
    

    this code is trying to check the parameter that could be empty, why it is empty depends on how flow the app and how parameters are passed through url.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am building a Web Application using asp.net (C#). I come from windows forms
I am building a web application as college project (using Python), where I need
I'm building a web-application in JavaScript using the dojo framework. I want to create
I am building a web application that needs to print directly from browser, however,
I am building a web application using ASP.NET MVC that has two very distinct
I am building a web application and have been told that using object oriented
I'm building a web application. One of the major feature of this application is,
I have just created a mid-sized web-application using Java, a custom MVC framework, javascript.
I'm building a web application using the Twitter API, and was wondering if there
I'm building a web application and using lazy-loading as default. I would like the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.