0

I am trying to call a method on server-side implemented by Java RMI. This method will open, read and do some data manipulation in the excel spreadsheet.

Workbook wb = WorkbookFactory.create(inp); 

This is the code which I get the following exception. inp is a InputStream with specified filepath.

Exception: java.rmi.ServerError: Error occurred in server thread; nested exception is: java.lang.NoClassDefFoundError: org/apache/poi/ss/usermodel/WorkbookFacory

I did also try to call this method locally, which gave no error.

Now, Server and Client are both running on the same machine(localhost).

Gagravarr
  • 43,370
  • 9
  • 94
  • 140
  • 1
    On the server side, did you forget to add the JAR file that contains the POI classes to your classpath? `NoClassDefFoundError` (almost) always means that there's something missing from your classpath. – Jesper Feb 01 '11 at 16:21

1 Answers1

2

Add the POI classes to your server's classpath. Just because the client and server are running on the same machine doesn't mean that both share a common classpath.

Fil
  • 1,996
  • 17
  • 29