Java Apache POI NoClassDefFoundError WorkbookFacory
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 er开发者_Go百科ror.
Now, Server and Client are both running on the same machine(localhost).
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.
精彩评论