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

  • SEARCH
  • Home
  • 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 6553157
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T12:32:55+00:00 2026-05-25T12:32:55+00:00

I tried running this jsp program in tomcat5.5 in netbeans 6.1 <%@ page import=java.io.*

  • 0

I tried running this jsp program in tomcat5.5 in netbeans 6.1

<%@ page import="java.io.*" %>
<%@ page import="java.util.*" session="true"%>
<%@ page import="com.hp.hpl.jena.rdf.model.*"%>
<%@ page import="com.hp.hpl.jena.query.*"%>

<%
         try
          {
             String inputFile="C:\\Users\\Admin\\Documents\\NetBeansProjects\\finalview\\resumenew.rdf";

         InputStream in = new BufferedInputStream(new FileInputStream(new File(inputFile)));

         Model model = ModelFactory.createMemModelMaker().createModel("");
         model.read(in,null) ;

          String queryString =
                                  "PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> " +
                                  "PREFIX foaf: <http://www.xmlns.com/foaf/0.1> " +

                                    "SELECT ?name  ?phone WHERE { ?person foaf:name ?name . ?person foaf:phone ?phone }";



                       Query query1 = QueryFactory.create(queryString);
                       QueryExecution qe = QueryExecutionFactory.create(query1,model);
                       ResultSet results = qe.execSelect();
                       ResultSetFormatter.out(System.out, results, query1);
                       qe.close();
                       }catch(Exception e){}
%>

And I get the following exception when I run the program

exception

org.apache.jasper.JasperException: Unable to compile class for JSP

An error occurred at line: 6 in the jsp file: /test.jsp
Generated servlet error:
Model cannot be resolved to a type

An error occurred at line: 6 in the jsp file: /test.jsp
Generated servlet error:
ModelFactory cannot be resolved

An error occurred at line: 6 in the jsp file: /test.jsp
Generated servlet error:
Query cannot be resolved to a type

An error occurred at line: 6 in the jsp file: /test.jsp
Generated servlet error:
QueryFactory cannot be resolved

An error occurred at line: 6 in the jsp file: /test.jsp
Generated servlet error:
QueryExecution cannot be resolved to a type

An error occurred at line: 6 in the jsp file: /test.jsp
Generated servlet error:
QueryExecutionFactory cannot be resolved

An error occurred at line: 6 in the jsp file: /test.jsp
Generated servlet error:
ResultSet cannot be resolved to a type

An error occurred at line: 6 in the jsp file: /test.jsp
Generated servlet error:
ResultSetFormatter cannot be resolved


    org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:510)
    org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:375)
    org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
    org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:802)c

Can you tell me, where should I keep my jsp program and the file that is given as input to it.

How can I avoid this error ?

  • 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-05-25T12:32:55+00:00Added an answer on May 25, 2026 at 12:32 pm

    Your Jena libraries (and its dependencies) should be under WEB-INF/lib (case sensitive), the standard Java EE folder to put your application jar files. Make sure that your clases (Query, QueryFactory, ModelFactory, etc):

    1. Exist in any of the jar files you put under WEB-INF/lib.
    2. Belong to com.hp.hpl.jena.rdf.model.* or com.hp.hpl.jena.query.*

    Try with this application structure:

    tomcat/webapps/ROOT
     - test.jsp
     - WEB-INF
        - lib
            - your .jar files
    

    By the way, your “Model 1 code” seems to be a good candidate to be moved to a servlet (Model 2), but that is only a design advice that has nothing to do with your JSP compiler error.

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

Sidebar

Related Questions

Error I tried this page to run on local, it is running perfectly fine
I tried running this piece of code: path = '/bla/bla/bla' if path is True:
I tried running a python script: print Hello, World! And I get this error:
Eclipse was running fine last night, but this morning I tried starting it up
I am running a web application using Tomcat and Java Servlets, JSP's, etc. I
service service_name start When i tried running this from cmd line, it works. But
I tried running this simple code: puts 4 i = gets puts i It's
I tried running this JavaScript code in the address bar in Firefox 6: javascript:alert(Hello)
I'm working on a JSP page, but I'm running into a null pointer at
I've tried running this code from 2 different operating systems on a simulator, an

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.