1

i imported Jena packages into my JSP page.

<%@ page import="com.hp.hpl.jena.datatypes.xsd.XSDDatatype" %>
<%@ page import="com.hp.hpl.jena.ontology.DatatypeProperty" %>
<%@ page import="com.hp.hpl.jena.ontology.Individual" %>
<%@ page import="com.hp.hpl.jena.ontology.OntClass" %>
<%@ page import="com.hp.hpl.jena.ontology.OntModel" %>
<%@ page import="com.hp.hpl.jena.ontology.OntModelSpec" %>
<%@ page import="com.hp.hpl.jena.rdf.model.Literal" %>
<%@ page import="com.hp.hpl.jena.rdf.model.ModelFactory" %>
<%@ page import="com.hp.hpl.jena.rdf.model.Statement" %>
<%@ page import="com.hp.hpl.jena.util.FileManager" %>

When I run it, the error will prompt:

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

An error occurred at line: 9 in the generated java file
Only a type can be imported. com.hp.hpl.jena.datatypes.xsd.XSDDatatype resolves to a package

An error occurred at line: 10 in the generated java file
Only a type can be imported. com.hp.hpl.jena.ontology.DatatypeProperty resolves to a package

An error occurred at line: 11 in the generated java file
Only a type can be imported. com.hp.hpl.jena.ontology.Individual resolves to a package

An error occurred at line: 12 in the generated java file
Only a type can be imported. com.hp.hpl.jena.ontology.OntClass resolves to a package

How can I correct this?

BalusC
  • 1,082,665
  • 372
  • 3,610
  • 3,555
LaknathR
  • 195
  • 1
  • 6
  • 17
  • it'l sort out some example that i did it in separate JAVA class. – LaknathR Jul 09 '10 at 07:58
  • problem solved ::: web-inf/lib folder is empty.. we have to copy jar files in to it ..:: :) – LaknathR Jul 09 '10 at 08:56
  • 1
    You should then post this as an **answer** yourself and accept it. Further, writing Java code in a JSP file is an extremely bad practice. [How to avoid Java code in JSP files](http://stackoverflow.com/questions/3177733/howto-avoid-java-code-in-jsp-files) – BalusC Jul 09 '10 at 12:02
  • nope.. i did lot of works with separate class and it' l give the error. then i did it in JSP and the error was same.. after that i put did it correctly.. any way thanks for your reply... – LaknathR Jul 09 '10 at 17:32

0 Answers0