Posts

Showing posts from January, 2023

AutoFirma ins and outs (5). Errors executing SimpleFirma from afirma-simple project

Image
 I have got this error In StackOverflow suggests to delete the ".metadata" file from the project. In this case, the ".metadata" file is in the WS_AUTOFIRMA4 folder. Also, this error may be produced if the peoject is not included in the section "include" of the parent's settings.gradle file

AutoFirma ins and outs (4). Errors in tests in afirma-core, jmulticard-jse

Image
 1. The package org.xml.sax is accessible from more than one module: <unnamed>, java.xml and TestMIMEDetection failure This error is produced in the afirma-core project to solve the error in TestMIMEDetection . At fist to solve it, the " Apache xerces " dependecy is added to the build.gradle, In StackOverflow explains that a package is both in the Modulepath and in the Classpath . The ModulePath is the jdk or jre that is being used and the Classpath is formed by the libraries that are imported. Usually, the packages that begin with "java." or "javax." cannot be included in the Classpath as they should be in the jdk. In the menu option " Configure build path " you can see this option. The dependencies in the build.gradle are: api libs . jmimemagic api libs . xerces The library that has conflictive dependencies is "xerces".  To solve this problem in Gradle click on "Project and External Dependencies" to see th

AutoFirma ins and outs (3). Errors and problems

0. Introduction 1. zip64 2. Fat jar and executable jar and the MANIFEST.MF is not alone in the META-INF directory 3. Project order, test failure. distTar and distZip duplicated dependencies 4. CommandLineLauncher for avoiding System.exit 5. PDF version from 1.4 to 1.7 (s/Jesus Romero) Including file Ian... 6. java.smartcardio dependency 7. Passing arguments to SimpleFirma.main()  1. zip64 When a large number of libraries need to be included in a fat jar, the zip utility is overwhelmed, so you need to indicate zip64=true when defining a jar task o equivalent jar { zip64 = true duplicatesStrategy = DuplicatesStrategy . EXCLUDE manifest { . . . . . . . 2. Fat jar/Uber jar, executable jar, and the MANIFEST.MF is not alone in the META-INF directory If you want to create a fat jar (uber jar), you must include all the dependencies in the generated jar. There are several options (when you want only a subproject to have a fat jar or if you want that every child project have its

AutoFirma ins and outs (2). Minimum configuration to run SimpleAfirma.java class from package es.gob.afirma.standalone. pkcs11

Image
0. Introduction This file is in the subproject afirma-simple 1. Convert pom.xml to build.gradle Here is the basic build.gradle file, that only needs to define dependencies as in the parent project we have defined the tasks and other definitions  //============================BEGIN======================================================= dependencies { /* Library dependencies part */ api libs . junit /* Project dependencies part */ api ( project ( " :afirma-core " ) ) } //==================================END================================================= The yellow marked code is the one you must change or add elements Let's see the pom.xml from the project " afirma-crypto-ooxml " //============================BEGIN======================================================= <? xml version = " 1.0 " encoding = " UTF-8 " ?> < project xmlns = " http : // maven.apache.org /POM/4.0.0 " xmln