Link to home
Start Free TrialLog in
Avatar of gudii9
gudii9Flag for United States of America

asked on

HSSFWorkbook cannot be resolved error

Hi,

I am gerring below error

Multiple markers at this line
      - HSSFWorkbook cannot be resolved
       to a type
      - HSSFWorkbook cannot be resolved
       to a type
i downloaded below jars

https://poi.apache.org/download.html


Binary Distribution#
poi-bin-3.16-beta1-20161120.tar.gz (18.64 MB, signature (.asc))
MD5 checksum: 53eb92ff0bd7a65b7f22b2b2dc1d98f1
SHA1 checksum: 41454518a91b3f30aff2c148060ca675378b71e6
poi-bin-3.16-beta1-20161120.zip
(26.92 MB, signature (.asc))
MD5 checksum: 72d32ef7d53eb8bf041cbdcbca6e3f0d
SHA1 checksum: 8d85b48f8ff150689b90cd6f1f92dbdcdfd23a35

and included in the build path from eclipse. all other errors goe except this one.

I am trying a Apache poi sample project.

how to generally know under which jar HSSFWorkbook class resides in?

please advise
Avatar of gudii9
gudii9
Flag of United States of America image

ASKER

Avatar of gudii9

ASKER

import org.apache.poi.hssf.usermodel.HSSFSheet;
import org.apache.poi.hssf.usermodel.HSSFWorkbook;

above two resolved.

below two still show error
import org.apache.poi.ss.usermodel.Cell;
import org.apache.poi.ss.usermodel.Row;
Avatar of gudii9

ASKER

when i search as below in google
import org.apache.poi.hssf.usermodel.HSSFSheet; jar

it pointed in java2s as attached
poi.png
Avatar of gudii9

ASKER

i saw
poi2.png
Avatar of gudii9

ASKER

below jars i have to include not sure which are extra
poi3.png
Avatar of gudii9

ASKER

getting below err
java.net.ConnectException: Connection timed out: connect
      at java.net.DualStackPlainSocketImpl.connect0(Native Method)
      at java.net.DualStackPlainSocketImpl.socketConnect(Unknown Source)
      at java.net.AbstractPlainSocketImpl.doConnect(Unknown Source)
      at java.net.AbstractPlainSocketImpl.connectToAddress(Unknown Source)
      at java.net.AbstractPlainSocketImpl.connect(Unknown Source)
      at java.net.PlainSocketImpl.connect(Unknown Source)
      at java.net.SocksSocketImpl.connect(Unknown Source)
      at java.net.Socket.connect(Unknown Source)
      at java.net.Socket.connect(Unknown Source)
      at sun.net.NetworkClient.doConnect(Unknown Source)
      at sun.net.www.http.HttpClient.openServer(Unknown Source)
      at sun.net.www.http.HttpClient.openServer(Unknown Source)
      at sun.net.www.http.HttpClient.<init>(Unknown Source)
      at sun.net.www.http.HttpClient.New(Unknown Source)
      at sun.net.www.http.HttpClient.New(Unknown Source)
      at sun.net.www.protocol.http.HttpURLConnection.getNewHttpClient(Unknown Source)
      at sun.net.www.protocol.http.HttpURLConnection.plainConnect0(Unknown Source)
      at sun.net.www.protocol.http.HttpURLConnection.plainConnect(Unknown Source)
      at sun.net.www.protocol.http.HttpURLConnection.connect(Unknown Source)
      at sun.net.www.protocol.http.HttpURLConnection.getInputStream0(Unknown Source)
      at sun.net.www.protocol.http.HttpURLConnection.getInputStream(Unknown Source)
      at com.company.UnzipUtility.downloadAndUnzip(UnzipUtility.java:51)
      at com.company.Main.main(Main.java:19)
SOLUTION
Avatar of Gerwin Jansen
Gerwin Jansen
Flag of Netherlands image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Hi,

The above error is at line number 51. can you show the code what you are trying to do? I think the URL is incorrect. your POI issues are resolved and you are facing a different issue.

at com.company.UnzipUtility.downloadAndUnzip(UnzipUtility.java:51)

Open in new window

Avatar of gudii9

ASKER

i tried from my home machine

all i needed was below jar. all othersnot needed looks like
http://www.java2s.com/Code/Jar/p/Downloadpoi35FINALjar.htm

java.io.IOException: Server returned HTTP response code: 403 for URL: http://www.nseindia.com/content/historical/EQUITIES/2015/JUL/cm17JUL2015bhav.csv.zip
      at sun.net.www.protocol.http.HttpURLConnection.getInputStream0(Unknown Source)
      at sun.net.www.protocol.http.HttpURLConnection.getInputStream(Unknown Source)
      at com.company.UnzipUtility.downloadAndUnzip(UnzipUtility.java:51)
      at com.company.Main.main(Main.java:19)
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial