ClassNotFoundException BouncyCastleProvider exception
GroupDocs.Viewer for Java API depends on Bouncy Castle for encryption and decryption features, that is; if the program is required to load or save encrypted spreadsheets, it is required to add reference of
bcprov-jdk16-1.46.jar in the project’s class path.
You may get exception like
The solution is actually very simple as detailed below.
bcprov-jdk16-1.46.jarlibrary as JAR file from Maven repository.
- Put the file into your project directory.
- Reference the
bcprov-jdk16-1.46.jarin the class path of the project.
Alternatively, you can add the dependency in the pom.xml and let the project resolve the dependency via maven.
<dependency> <groupId>org.bouncycastle</groupId> <artifactId>bcprov-jdk16</artifactId> <version>1.46</version> </dependency>
You may easily run the code above and see the feature in action in our GitHub examples:
- GroupDocs.Viewer for Java examples, plugins, and showcase
- Document Viewer for .NET App WebForms UI Modern Example
- Document Viewer for Java App Dropwizard UI Modern Example
- Document Viewer for Java Spring UI Example
- GroupDocs.Viewer for .NET samples, plugins and showcase
- Document Viewer for .NET MVC UI Example
Free Online App
Along with full-featured Java library we provide simple but powerful free Apps. You are welcome to view Word, PDF, Excel, PowerPoint documents with free to use online GroupDocs Viewer App.