Don Lawton
Don Lawton

Reputation: 13

Only a type can be imported. org.apache.poi.hssf.usermodel.HSSFWorkbook resolves to a package

Trying to use Apache POI in a Eclipse JSP project. The POI jar is in the project's Java Resources Library list.

<%@ page import="org.apache.poi.hssf.usermodel.HSSFSheet"%>

at run the following error occurs:

An error occurred at line: 7 in the generated java file Only a type can be imported. org.apache.poi.hssf.usermodel.HSSFWorkbook resolves to a package

Any ideas? Thanks Don Lawton

Upvotes: 1

Views: 9060

Answers (2)

Neets
Neets

Reputation: 4222

Same happened to me, even when the needed jars were indeed in the WEB-INF folder. I was using the provided server in SpringSource ToolSuite (STS). It took me several attempts to clean, republish, etc... before it finally worked.

Upvotes: 0

Torsten
Torsten

Reputation: 6204

The message indicates that the class could not be found on the classpath of your deployed application. Did you make sure that the POI jar is in your WEB-INF/lib folder?

Upvotes: 4

Related Questions