Adding BouncyCastle Dependency bcprov-jdk15on-1.49.jar to iText Java Application in Eclipse Fails - eclipse

I am using iText version 5.5.2 and trying to implement passwords to stop users from editing our generated static XFA pdf reports. I don't think I am able to flatten a static XFA PDF Form (so correct me if I am wrong). My only option at this point, would be to use iText's ability to password protect the form in a way where users will not have to worry about putting in a password to edit the form, but still be able to view it.
Anyway here is the problem. According to the Lowagie's book, implementing a password requires the use of the bouncastle APIs. To do this right, I implemented the iText-5.5.2. Searching through this iText dependencies, I found that the maven POM for iText-5.5.2 shows that I have a need a couple of bouncycastle jars:
<dependency>
<groupId>org.bouncycastle</groupId>
<artifactId>bcprov-jdk15on</artifactId>
<version>1.49</version>
<type>jar</type>
<scope>compile</scope>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.bouncycastle</groupId>
<artifactId>bcpkix-jdk15on</artifactId>
<version>1.49</version>
<type>jar</type>
<scope>compile</scope>
<optional>true</optional>
</dependency>
When I add these to my project within eclipse of (IBM's CICS Explorer), eclipse complains as follows:
Description Resource Path Location Type Archive for required library: 'C:/Users/nuo3545/jars/bcprov-jdk15on-1.49.jar' in project 'jCicsPdfUtility' cannot be read or is not a valid ZIP file jCicsPdfUtility Build path Build Path Problem
So this indicates that the jar being added (bcprov-jdk15on-1.49.jar) to my project properties libraries or class path is bad, or not being recognized. Is there a solution for this?
Q. Are bouncycastle jars still an issue or broken for usage within iText? What is my recourse of fix to this problem?
Any help or direction with this regard is much appreciated.

Related

com.itextpdf.text which itext jar last version was included?

what is the jar version com.itextpdf.text package was included ?
I was using this code below maven code updating package version 7.0.0
Showing errors while building the application and cloud not generate the jar file in the maven repository location ,I thought will able to get the external jar file use it.
<dependency>
<groupId>com.itextpdf</groupId>
<artifactId>itextpdf</artifactId>
<version>7.0.0</version>
iText was rewritten from scratch a couple of years ago. During this operation, the package names were changed so that there wouldn't be any clashes if people used both versions next to each other.
The package name com.itextpdf.text was used with the iText 5 series. All iText 5 versions are being phased out. If you start a new project, you should start with iText 7, not iText 5.
If you are working on an existing project, then there are two options:
Either you are distributing iText in an open source context (using the AGPL license); in that case, please show us where you have published the full source code of your project (making your own code open source is required if you're using iText for free under the AGPL).
Or you are distributing iText in a closed source context. In that case, you should be a paying customer (if not, you are in violation with the AGPL). As a paying customer, you have the right to updates of iText 5 with bug fixes. We won't add new functionality to iText 5, but we make maintenance releases at the request of our paying customers.
Summarized: either use iText 7 (but then don't use the com.itextpdf.text packages); or use iText 5 (5.5.13 was the latest maintenance release), but only if you have to support legacy software. In both cases, make sure that you purchased a commercial license if you are working in a closed source context.
First of all: read and understand Bruno's answer.
iText 7
<!-- https://mvnrepository.com/artifact/com.itextpdf/itext7-core -->
<dependency>
<groupId>com.itextpdf</groupId>
<artifactId>itext7-core</artifactId>
<version>7.1.1</version>
<type>pom</type>
</dependency>
This is a pom-only dependency that pulls in all iText modules, even the ones you don't need. See https://developers.itextpdf.com/itext7/download-and-install-information/Java for detailed installation instructions (so you only pull in the dependencies you really need) and a compatibility matrix.
iText 5
<!-- https://mvnrepository.com/artifact/com.itextpdf/itextpdf -->
<dependency>
<groupId>com.itextpdf</groupId>
<artifactId>itextpdf</artifactId>
<version>5.5.13</version>
</dependency>
Information valid as of 17 April 2018. In a few days this information will already will be obsolete, when iText 7.1.2 comes out.

Integrating SmartGWT in Gerrit (Maven project)

I want to add some feature to this project and I need smartgwt for all those fancy UI stuff. I modified the pom.xml to add the dependencies (smartgwt2.4 and skins).
<dependency>
<groupId>com.smartgwt</groupId>
<artifactId>smartgwt</artifactId>
<version>2.4</version>
</dependency>
<dependency>
<groupId>com.smartgwt</groupId>
<artifactId>smartgwt-skins</artifactId>
<version>2.4</version>
</dependency>
And inherits smartgwt to my project.gwt.xml ... So far so good, I add the new ui and implemented my stuff. Works geat on hosted mode/debug, etc...
But when I do a mvn clean install, my build is a great success. But when I try to load the daemon and check my application locally I get stuck on the hosted.html... So basically, I get stuck on the loading page..
I was wondering if that as to do with conflicting package between smartgwt and the current gwt in the project. Anyone has worked with gerrit or any similar application before that could help me out. And the great thing about this, I have no error to display...
It is not about your smartgwt dependency. I think there are missing files which are stopping your module from loading. It used to happen to me. I would advise you to add some SC.say("I'm here") at the start of your entry point to see if it is reaching this far. Also, check the server logs for any errors.
EDIT :
I would have to guess that the problem is in your empty web.xml. You should at least define a servlet-mapping

IDE features in NetBeans platform application

I am developing application based on the NetBeans platform. I use Maven to build it and I need to provide IDE features in my app (text editing, syntax highliting for XML files and so on).
Which libraries do I need to declare as dependencies to be able to provide the editor support? And what about XML syntax highliting (or full XML files support)? I am kinda lost in those dozens of JARs. Is there any way to include whole NB cluster? (To make sure everyone gets it, once again, I use Maven.)
Thanks for any help.
Have a look at the NetBeans API index in the content section there is a short description about what each API provides. At a guess I think you're wanting to use the Editor Module and maybe the XML API
I think that if you include the following dependency you will get the entire NetBeans (This is not something that I've tried) IDE as a dependecy
<dependency>
<groupId>org.netbeans.cluster</groupId>
<artifactId>ide</artifactId>
<version>RELEASE70</version>
<type>pom</type>
</dependency>

Using Guava in a Maven GWT Project

I have a project which would like to utilize the Google Guava libraries (on both the server-side and the client-side), however, I am having trouble setting it up.
I was able to add GWT and Guava as dependencies, and my GWT projects are compiling correctly. My server-side code using Guava also works correctly.
But if I try to add it to my GWT project using the following:
<inherits name="com.google.common.collect.Collect" />
And use the application in development mode via mvn gwt:run, it brings up the Google Development Mode interface and gives errors of the flavor:
Unable to find 'com/google/common/collect/Collect.gwt.xml' on your classpath...
Presumably because the maven dependency is just the compiled class files, and not the source/.gwt.xml files it needs to compile down to the Javascript. I found that if I go to the guava website, and download the files, there is a file called guava-r08-gwt.jar, which I think is heading in the direction of a solution.
Ideally, there would be some dependency I could add in Maven that just lets me use the inherits command, but any other workarounds would be welcomed.
As mentioned in one of the answers, this is in the works.
In the meantime, I have set up a temporary public maven-repo for this purpose. I make no guarantees about it staying up, but here is the repo/dependency stuff:
<repository>
<id>deepthought</id>
<name>Deepthought Public Repository</name>
<url>http://deepthought.co/maven-repo</url>
</repository>
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava-gwt</artifactId>
<version>r08</version>
</dependency>
Feel free to use it for now, though.
It's in the works.
http://code.google.com/p/guava-libraries/issues/detail?id=501

In Maven: how to attach sources to tools.jar

I have to use libraries in tools.jar and have therefor added this dependency:
<dependency>
<groupId>com.sun</groupId>
<artifactId>tools</artifactId>
<version>1.6.0</version>
<scope>system</scope>
<systemPath>${java.home}/../lib/tools.jar</systemPath>
</dependency>
Now I would like to attach the sources in Eclipse, so I see what I develop against.
I guess nothing will be available in the standard maven repositories (I can't even find anything in download.java.net/com/sun).
I know there is a source archive available, but it contains everything and I would at least need to know what parts of it need to go in the source jar.
Has someone done this? Is there a tools-sources.jar available somewhere? Or can you tell me what parts of the jdk sources I need?
Here's what I did. I downloaded the source archive from openjdk, extracted it and manually linked the jar source to
External Folder -> [unpacked archive basedir]/langtools/src/share/classes
This is not a maven solution, it's eclipse only, but it works.