iText 7 java.lang.NoSuchMethodError - itext

I just started developing a new function to convert HTML page to PDF. I use iText 7. Followed the instruction here!.
And now i get the error Exception in thread "main" java.lang.NoSuchMethodError: com.itextpdf.layout.font.FontSet.getFonts()Ljava/util/Set;
I have created pom.xml following the instruction here! but still received the same error.
I use eclipse. I put the pom.xml in the WebContent folder and received the error. Same result when moved the pom.xml into the WEB-INF folder.
Is the directory for the pom.xml wrong?
I've gone through the question here! and also here! but still doesn't work
Please advice.

pdfHTML 1.0.0 is not compatible with iText Core 7.0.3, it is only compatible with iText Core 7.0.2. Please refer to the compatibility matrix on GitHub for details: https://github.com/itext/itext7/releases/tag/7.0.3
iText Core 7.0.4 and pdfHTML 1.0.1, scheduled to be released together later this month, will also be compatible.
Meanwile if you want to use snapshot builds, you can add this to your pom.xml and use iText Core 7.0.4-SNAPSHOT and pdfHTML 1.0.1-SNAPSHOT:
<repositories>
<repository>
<id>itext-snapshots</id>
<name>iText Repository - snapshots</name>
<url>https://repo.itextsupport.com/snapshots</url>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
</repositories>
Use at your own risk, because snapshot builds are unsupported and are only for experienced developers who are willing to contribute to iText by following the latest development and submitting pull requests.
NEVER USE SNAPSHOT BUILDS IN A PRODUCTION ENVIRONMENT
Or just wait until the end of the month, when you can use iText Core 7.0.4 and pdfHTML 1.0.1.

Related

Spring boot not compiling

I am trying to compile the project https://github.com/spring-cloud/spring-cloud-aws but the parent project has references to flatten-maven-plugin thus i am getting the error.
If this plugin is public i am not sure why i am getting the error as below. I am not able to get rid of this plugin. I opened a ticket on the git project but as it may not gather any answer.
Error resolving version for plugin 'org.codehaus.mojo:flatten-maven-plugin' from the repositories [local (C:\Users\ranajit.jana\.m2\repository), central (https://repo.maven.apache.org/maven2)]: Plugin not found in any plugin repository pom.xml /spring-cloud-aws-**** line 1 Maven pom Loading Problem
I am compiling this code as i want to make some changes.
Anyone has idea what can be done ?
=============================
This is resolved now.
This is was repo issue the plugin repo was pointing to repo1.maven.apache.org/maven2 which could not resolve this plugin.
I had to add the following to resolve this issue..
This is added as one additional plugin repo
<pluginRepository>
<id>maven-plugin-repo-mvn</id>
<name>Maven plugin repo maven</name>
<url>https://repo.maven.apache.org/maven2</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</pluginRepository>
Open the .m2/repository and proceed to the path org/codehaus/mojo/flatten-maven-plugin/. There delete the subdirectory version number. and all contained files. Maven will automatically download them the next time they are required.

Citrus version and Cucumber version issue

Citrus 2.7.7 is not compatible with cucumber 3.0.2 or later and when I check the sample from GitHub, they are using 2.8.0-SNAPSHOT with cucumber 3.0.2. So when is the 2.8.0 release version will be out? For me, I am able to get the 2.8.0-SNAPSHOT without any issue. But for some of my colleague they are not able to get it even with this.
<repositories>
<repository>
<id>consol-labs-snapshots</id>
<url>http://labs.consol.de/maven/snapshots-repository/</url>
<snapshots>
<enabled>true</enabled>
<updatePolicy>interval:10080</updatePolicy>
</snapshots>
</repository>
</repositories>
#Sven Hettwer,
There is no error message, it just says not able to find the artifact!
We're planning to release 2.8.0 no later than by the end of the year. Stay tuned on twitter or on http://citrusframework.org/.
The maven config seems to be okay so far. Could you provide some information about the error message?
Edit:
Have your tried the -U flag for maven? E.g. mvn clean install -U to force updates on snapshots?
BR,
Sven

Jenkins Plugin debug "Dependency ui-samples-plugin (1.509) doesn't exist"

I ran into this problem debugging a Jenkins plugin with Eclipse and I wanted to post the solution here so that when people googled it, they could get a good answer.
I added:
<pluginRepositories>
<pluginRepository>
<id>repo.jenkins-ci.org</id>
<url>http://repo.jenkins-ci.org/public/</url>
</pluginRepository>
</pluginRepositories>
<dependencies>
<dependency>
<groupId>org.jenkins-ci.main</groupId>
<artifactId>ui-samples-plugin</artifactId>
<version>1.509</version>
<scope>compile</scope>
</dependency>
</dependencies>
To my paren pom and I was able to build and debug. I just wanted to let people know, because I couldn't find anything after a couple hours of searching.
http://jenkins-ci.org/changelog
What's new in 1.535 (2013/10/14)
UI Samples plugin fully separated from core. To view samples during
plugin development or at any other time, just install from the update
center.
During plugin development, you may want to lock your Jenkins version to the an older version so you don't end up in latest and greatest hell, LTS is 1.509.
Do you have the proper parent definition?
Here is an example from the artifactory plugin pom that defines the Jenkins version to lock to (They lock against 1.428):
<parent>
<groupId>org.jenkins-ci.plugins</groupId>
<artifactId>plugin</artifactId>
<version>1.428</version>
</parent>

Unable to update EclipseLink with M2Eclipse

I am using Eclipse with Maven (using m2eclipse) and attempting to add the EclipseLink repository.
Within my pom.xml I have set the following:
<repositories>
<repository>
<id>eclipselink</id>
<url>http://www.eclipse.org/downloads/download.phpr=1&nf=1&file=/rt/eclipselink/maven.repo</url>
</repository>
</repositories>
I then navigate to the Maven Repository Window and right click the repository and select Full Index Enabled.
This results in the following message being displayed:
4/23/11 1:45:53 PM BST: Updating index eclipselink|http://www.eclipse.org/downloads/download.php?r=1&nf=1&file=/rt/eclipselink/maven.repo
4/23/11 1:45:54 PM BST: Unable to update index for eclipselink|http://www.eclipse.org/downloads/download.php?r=1&nf=1&file=/rt/eclipselink/maven.repo
Any help in solving this problem would be appreciated.
If you call that page you will get an 404 page not found...so the url must be wrong.
There may not be anything to worry. It is possible that Eclipselink repository is not having a repository index file which is requested by m2eclipse.
What is important is to check if dependencies specified in your pom, present in Eclipselink repository are getting downloaded correctly.
You have a typo in URL:
It should be:
http://www.eclipse.org/downloads/download.php?r=1&nf=1&file=/rt/eclipselink/maven.repo
You missed question mark.
Source:
Can't find the "org.eclipse.persistence" Maven dependency

building spring batch sample application

I am trying to build the sample application for spring batch 2.1.6. (ie. spring-batch-2.1.6.RELEASE/samples/spring-batch-samples) using maven but am getting this error for a missing plugin:
[ERROR] Plugin
com.springsource.bundlor:com.springsource.bundlor.maven:1.0.0.RELEASE
or one of its dependencies could not be resolved: Failure to find
com.springsource.bundlor:com.springsource.bundlor.maven:jar:1.0.0.RELEASE
in http://repo1.maven.org/maven2 was cached in the local repository,
resolution will not be reattempted until the update interval of
central has elapsed or updates are forced ->
Is there another repository I can set up to get this plugin? I am a bit suprised to be getting this errror as this is the latest realease version of spring batch.
Here is the repository section from the pom as it came in the download:
<repositories>
<repository>
<id>com.springsource.repository.bundles.external</id>
<name>SpringSource Enterprise Bundle Repository - SpringSource Bundle External</name>
<url>http://repository.springsource.com/maven/bundles/external</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
</repositories>
The project's parent pom has a bootstrap profile which contains the necessary repository definitions. Build the project with the command mvn test -P bootstrap and it will download the dependencies.
P.S. This is explained in the readme's instructions that how to build Spring Batch. It would be good if they would also tell how to do it in the instructions for using the samples - maybe you could file a bug report?
i am using maven3 and was able to solve this problem by adding this to my pom:
<pluginRepositories>
<pluginRepository>
<id>plugin.repo.maven.central2</id>
<url>http://objectstyle.org/maven2/</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</pluginRepository>
</pluginRepositories>
The Spring batch Admin sample build is broken for sure. At least as of today.
The -Pbootstrap doesn't help and adding the repos in that profile in my local settings doens't help either.
When I attempted to build spring-batch-admin-sample, I found that I was missing dependencies of spring batch!
So I went to build that. There I found that I was missing org.neo4j:neo4j-cypher-dsl-1.9.M04 and also gemfire.7.0.1.jar. Adding repos doesn't help because of the maven2/3 incompatibility issues.
So a sure way to fix this is to go to each repo, download the missing dep and mvn install-file them.
So get the neo4j one here:
http://m2.neo4j.org/content/repositories/releases/org/neo4j/neo4j-cypher-dsl/1.9.M04/
Get the gemfire one from here:
https://repo.springsource.org/gemstone-release-cache/com/gemstone/gemfire/gemfire/7.0.1/
And then I ran into a foundrylogic.vpp dependency that I found here:
http://objectstyle.org/maven2/foundrylogic/vpp/vpp/2.2.1/
Don't forget to get the corresponding poms also to keep it clean and get all the transitives, if any.
Use the mvn install-file plugin described here to get all three deps to your local repo.
http://maven.apache.org/plugins/maven-install-plugin/usage.html
Now spring-batch should build clean.
Now if you go to build spring-batch-admin it will still fail because it depends on spring-batch-core-2.2.3.BUILD-SNAPSHOT whereas what we just built was version 3.0.0.BUILD-SNAPSHOT.
So go to spring-batch-admin-parent's pom and modify the pom like so:
<!-- <spring.batch.version>2.2.3.BUILD-SNAPSHOT</spring.batch.version> -->
<spring.batch.version>3.0.0.BUILD-SNAPSHOT</spring.batch.version>
And then step back to spring-batch-admin and mvn clean install should build the sample.
Hope this helps someone!
I installed maven 3.2.1 and it works.