archiver | Easily create & extract archives | Compression library

 by   mholt Go Version: v4.0.0-alpha.6 License: MIT

kandi X-RAY | archiver Summary

archiver is a Go library typically used in Utilities, Compression applications. archiver has no bugs, it has a Permissive License and it has medium support. However archiver has 1 vulnerabilities. You can download it from GitHub.
Introducing Archiver 4.0 - a cross-platform, multi-format archive utility and Go library. A powerful and flexible library meets an elegant CLI in this generic replacement for several platform-specific or format-specific archive utilities.
    Support
      Quality
        Security
          License
            Reuse
            Support
              Quality
                Security
                  License
                    Reuse

                      kandi-support Support

                        summary
                        archiver has a medium active ecosystem.
                        summary
                        It has 3906 star(s) with 352 fork(s). There are 54 watchers for this library.
                        summary
                        It had no major release in the last 12 months.
                        summary
                        There are 11 open issues and 195 have been closed. On average issues are closed in 117 days. There are no pull requests.
                        summary
                        It has a neutral sentiment in the developer community.
                        summary
                        The latest version of archiver is v4.0.0-alpha.6
                        archiver Support
                          Best in #Compression
                            Average in #Compression
                            archiver Support
                              Best in #Compression
                                Average in #Compression

                                  kandi-Quality Quality

                                    summary
                                    archiver has 0 bugs and 0 code smells.
                                    archiver Quality
                                      Best in #Compression
                                        Average in #Compression
                                        archiver Quality
                                          Best in #Compression
                                            Average in #Compression

                                              kandi-Security Security

                                                summary
                                                archiver has 1 vulnerability issues reported (0 critical, 0 high, 1 medium, 0 low).
                                                summary
                                                archiver code analysis shows 0 unresolved vulnerabilities.
                                                summary
                                                There are 0 security hotspots that need review.
                                                archiver Security
                                                  Best in #Compression
                                                    Average in #Compression
                                                    archiver Security
                                                      Best in #Compression
                                                        Average in #Compression

                                                          kandi-License License

                                                            summary
                                                            archiver is licensed under the MIT License. This license is Permissive.
                                                            summary
                                                            Permissive licenses have the least restrictions, and you can use them in most projects.
                                                            archiver License
                                                              Best in #Compression
                                                                Average in #Compression
                                                                archiver License
                                                                  Best in #Compression
                                                                    Average in #Compression

                                                                      kandi-Reuse Reuse

                                                                        summary
                                                                        archiver releases are available to install and integrate.
                                                                        summary
                                                                        Installation instructions are not available. Examples and code snippets are available.
                                                                        summary
                                                                        It has 1721 lines of code, 107 functions and 17 files.
                                                                        summary
                                                                        It has medium code complexity. Code complexity directly impacts maintainability of the code.
                                                                        archiver Reuse
                                                                          Best in #Compression
                                                                            Average in #Compression
                                                                            archiver Reuse
                                                                              Best in #Compression
                                                                                Average in #Compression
                                                                                  Top functions reviewed by kandi - BETA
                                                                                  kandi's functional review helps you automatically verify the functionalities of the libraries and avoid rework.
                                                                                  Currently covering the most popular Java, JavaScript and Python libraries. See a Sample Here
                                                                                  Get all kandi verified functions for this library.
                                                                                  Get all kandi verified functions for this library.

                                                                                  archiver Key Features

                                                                                  Stream-oriented APIs
                                                                                  Automatically identify archive and compression formats: By file name By header
                                                                                  Traverse directories, archive files, and any other file uniformly as io/fs file systems: DirFS FileFS ArchiveFS
                                                                                  Compress and decompress files
                                                                                  Create and extract archive files
                                                                                  Walk or traverse into archive files
                                                                                  Extract only specific files from archives
                                                                                  Insert (append) into .tar files
                                                                                  Numerous archive and compression formats supported
                                                                                  Extensible (add more formats just by registering them)
                                                                                  Cross-platform, static binary
                                                                                  Pure Go (no cgo)
                                                                                  Multithreaded Gzip
                                                                                  Adjust compression levels
                                                                                  Automatically add compressed files to zip archives without re-compressing
                                                                                  Open password-protected RAR archives

                                                                                  archiver Examples and Code Snippets

                                                                                  No Code Snippets are available at this moment for archiver.
                                                                                  Community Discussions

                                                                                  Trending Discussions on archiver

                                                                                  Why my implementation of `InputStream` not working with `StreamingReader` from `com.monitorjbl:xlsx-streamer:2.2.0`
                                                                                  chevron right
                                                                                  Node.js AWS Lambda + Archiver lib - Error in zip file creation
                                                                                  chevron right
                                                                                  OWL API NoSuchMethodError in saveOntology() call
                                                                                  chevron right
                                                                                  angular 13: Module not found: Error: Can't resolve 'rxjs/operators'
                                                                                  chevron right
                                                                                  Apache Ranger compile failed at assembly stage
                                                                                  chevron right
                                                                                  How does the pgadmin encodes the file path in backups?
                                                                                  chevron right
                                                                                  How to build the resultant docker image file directory?
                                                                                  chevron right
                                                                                  Sagemaker Serverless Inference & custom container: Model archiver subprocess fails
                                                                                  chevron right
                                                                                  Caused by: java.lang.IllegalAccessError: superclass access check class apache (in module x) that cannot access another apache class (in mod y)
                                                                                  chevron right
                                                                                  Java Web Application Failed to run as maven project
                                                                                  chevron right

                                                                                  QUESTION

                                                                                  Why my implementation of `InputStream` not working with `StreamingReader` from `com.monitorjbl:xlsx-streamer:2.2.0`
                                                                                  Asked 2022-Feb-21 at 06:04

                                                                                  Due to the lack of activity of the library's GitHub site, I decide to drop this question here hoping for any support.

                                                                                  The problem I am working on is to read an Excel file in a streaming fashion. Specially, the Excel file is stored in a SQLite database, as blob, after being split into multiple rows using a certain block size. For example a 3MB file is split into three rows, each contains 1MB of raw data. Rows are property ordered, so if I pipe out the blob column of each row by order to the file system, I can get a copy of the Excel file.

                                                                                  Since StreamingReader works with InputStream, I decide to implement an InputStream on top of those rows in the SQLite database, so that StreamingReader reads data directly from the db.

                                                                                  I first construct a Sequence on top of the query result, sequencing the bytes from all the blob columns:

                                                                                      fun blocksByteSequence(id: String): Sequence {
                                                                                          return sequence {
                                                                                              val conn = source.connection
                                                                                              val stmt = conn.createStatement()
                                                                                              val r = stmt.executeQuery(findFileQuery(id))
                                                                                              while (r.next()) yieldAll(r.getBytes(raw_data_column).asIterable())
                                                                                              stmt.close()
                                                                                              conn.close()
                                                                                          }
                                                                                      }
                                                                                  

                                                                                  then It is fairly straightforward to turn Sequence into InputStream:

                                                                                  class ByteSequenceInputStreamFactory(
                                                                                      private val seq: Sequence,
                                                                                  ) {
                                                                                      fun inputStreamProvider(): InputStream = object : InputStream() {
                                                                                          private val iter = seq.iterator()
                                                                                          override fun read(): Int {
                                                                                              return if (iter.hasNext()) iter.next().toInt() else -1
                                                                                          }
                                                                                      }
                                                                                  }
                                                                                  

                                                                                  error arises when I am trying to construct a StreamingReader using such InputStream:

                                                                                  val byteSeq = blocksByteSequence(id)
                                                                                  val ins = ByteSequenceInputStreamFactory(byteSeq).inputStreamProvider()
                                                                                  val reader = StreamingReader.builder().open(ins) // error
                                                                                  

                                                                                  Error Message:

                                                                                  Could not open the specified zip entry source stream
                                                                                  org.apache.poi.openxml4j.exceptions.InvalidOperationException: Could not open the specified zip entry source stream
                                                                                      at app//org.apache.poi.openxml4j.opc.ZipPackage.openZipEntrySourceStream(ZipPackage.java:212)
                                                                                      at app//org.apache.poi.openxml4j.opc.ZipPackage.openZipEntrySourceStream(ZipPackage.java:194)
                                                                                      ...
                                                                                  Caused by: java.util.zip.ZipException: invalid distances set
                                                                                      at org.apache.commons.compress.archivers.zip.ZipArchiveInputStream.readFromInflater(ZipArchiveInputStream.java:586)
                                                                                      at org.apache.commons.compress.archivers.zip.ZipArchiveInputStream.readDeflated(ZipArchiveInputStream.java:551)
                                                                                     ...
                                                                                  Caused by: java.util.zip.DataFormatException: invalid distances set
                                                                                      at java.base/java.util.zip.Inflater.inflateBytesBytes(Native Method)
                                                                                      at java.base/java.util.zip.Inflater.inflate(Inflater.java:378)
                                                                                     ...
                                                                                  

                                                                                  However, if I dump all the bytes from SQLite into a Excel File at some path:

                                                                                  val byteSeq = manager.blocksByteSequence(id)
                                                                                  val out = java.nio.file.Path.of("./private/test.xlsx")
                                                                                  out.outputStream().use { o -> byteSeq.forEach {  o.write(it.toInt()) } }
                                                                                  

                                                                                  and use the InputStream produced by that file, the error is gone.

                                                                                  val reader = StreamingReader.builder().open(out.inputStream())
                                                                                  

                                                                                  ANSWER

                                                                                  Answered 2022-Feb-21 at 06:04

                                                                                  I think I solved the problem.

                                                                                  The trouble is here

                                                                                  class ByteSequenceInputStreamFactory(
                                                                                      private val seq: Sequence,
                                                                                  ) {
                                                                                      fun inputStreamProvider(): InputStream = object : InputStream() {
                                                                                          private val iter = seq.iterator()
                                                                                          override fun read(): Int {
                                                                                              return if (iter.hasNext()) iter.next().toInt() /* this is not OK */  else -1
                                                                                          }
                                                                                      }
                                                                                  }
                                                                                  

                                                                                  The invocation of method Byte.intoInt() doesn't have the intended result expected by the InputStream.

                                                                                  According to Java Doc, method InputStream.read()

                                                                                  Reads the next byte of data from the input stream. The value byte is returned as an int in the range 0 to 255. If no byte is available because the end of the stream has been reached, the value -1 is returned. This method blocks until input data is available, the end of the stream is detected, or an exception is thrown.

                                                                                  The tricky part is, the Int returned from Byte.toInt() is not an int in the range 0 to 255.

                                                                                  In kotlin, a Byte:

                                                                                  Represents a 8-bit signed integer. On the JVM, non-nullable values of this type are represented as values of the primitive type byte.

                                                                                  and the Byte.toInt() method:

                                                                                  Converts this Byte value to Int. The resulting Int value represents the same numerical value as this Byte. The least significant 8 bits of the resulting Int value are the same as the bits of this Byte value, whereas the most significant 24 bits are filled with the sign bit of this value.

                                                                                  Simply invocation of Byte.toInt() will return the signed integer underlying this Byte. To have the 0-255 representation of it, I need to extract the lease 8 significant bits by doing this:

                                                                                  val the_0_255_int = someByte.toInt().and(0xff) // extract the last 8 bits
                                                                                  

                                                                                  so the correct code for my problem looks like this:

                                                                                  class ByteSequenceInputStreamFactory(
                                                                                      private val seq: Sequence,
                                                                                  ) {
                                                                                      fun inputStreamProvider(): InputStream = object : InputStream() {
                                                                                          private val iter = seq.iterator()
                                                                                          override fun read(): Int {
                                                                                              return if (iter.hasNext()) iter.next().toInt().and(0xff)  else -1
                                                                                          }
                                                                                      }
                                                                                  }
                                                                                  

                                                                                  Source https://stackoverflow.com/questions/70800930

                                                                                  QUESTION

                                                                                  Node.js AWS Lambda + Archiver lib - Error in zip file creation
                                                                                  Asked 2022-Feb-17 at 15:52

                                                                                  everyone,

                                                                                  I have written a lambda in Node.js that takes a folder and zips its contents. To do this I used the Archiver library: Archiver

                                                                                  The following is my code to create the File:

                                                                                  const zipFilePath = '/tmp/' + 'filename' + '.zip'
                                                                                  const output = fs.createWriteStream(zipFilePath);
                                                                                  
                                                                                  const archive = archiver('zip', {
                                                                                      zlib: { level: 9 }
                                                                                  });
                                                                                  
                                                                                  output.on('close', function () {
                                                                                      console.log(archive.pointer() + ' total bytes');
                                                                                      console.log('archiver has been finalized and the output file descriptor has closed.');
                                                                                  });
                                                                                  
                                                                                  archive.on('error', function(err){
                                                                                      throw err;
                                                                                  });
                                                                                  
                                                                                  await archive.pipe(output);
                                                                                  await archive.directory(destFolder, false);
                                                                                  await archive.finalize();
                                                                                  

                                                                                  To write the files I am using the /tmp folder of the lambdas, which is the only folder with write permissions.

                                                                                  The flow is as follows:

                                                                                  1. I get the path to the folder
                                                                                  2. Zip the content and save it in the folder destFolder

                                                                                  The file is then saved on an S3 bucket:

                                                                                  const file = await fs.readFileSync(filePath)
                                                                                  const params = {
                                                                                      Bucket: bucketName,
                                                                                      Key: fileName,
                                                                                      Body: file
                                                                                  };
                                                                                  const res = await s3.upload(params).promise()
                                                                                  return res.Location
                                                                                  

                                                                                  The zip file is generated, the problem is that when I download it, it is corrupted. I tried analysing it with an online zip file analyser (this) and the result of the analysis is the following:

                                                                                  Type = zip
                                                                                  ERRORS:
                                                                                  Unexpected end of archive
                                                                                  WARNINGS:
                                                                                  There are data after the end of archive
                                                                                  Physical Size = 118916
                                                                                  Tail Size = 19
                                                                                  Characteristics = Local
                                                                                  

                                                                                  and the analyser shows that the files are all present in the .zip (I can see their names).

                                                                                  The strangest thing is that if instead of .zip the file (again with the same library) I create it in .tar

                                                                                  const archive = archiver('tar', {
                                                                                      zlib: { level: 9 }
                                                                                  });
                                                                                  

                                                                                  The file is generated correctly and I can extract it as an archive. Basically, it is as if something is wrong with the .zip format alone.

                                                                                  Has anyone ever experienced a similar episode? Can you help me find a solution? I need to create files in .zip format. Thank you.

                                                                                  ANSWER

                                                                                  Answered 2022-Feb-17 at 15:52

                                                                                  The problem is that you are not being able to zip your files properly, this can occurs by many issues, including:

                                                                                  • You are not waiting the file to be processed, you need to use .close() event to do this.
                                                                                  • You are not sending the correct path to the files or dirs to zipped, normally the files that you upload together with the lambda files on the root dir of your project stay on /var/task/ on the Lambda dir system, so to send the correct file use __dirname + '/file.name'
                                                                                  • You are not appending correctly the files, check the .file() and .append() methods if you are sending the files correctly

                                                                                  If you have the following Lambda structure:

                                                                                  ~/my-function
                                                                                  ├── index.js
                                                                                  └── node_modules
                                                                                  ├── package.json
                                                                                  ├── package-lock.json
                                                                                  ├── test.txt //file to be sent zipped on s3
                                                                                  

                                                                                  The following example will works for you:

                                                                                  const archiver = require('archiver')
                                                                                  const fs = require('fs')
                                                                                  const AWS = require('aws-sdk');
                                                                                  const s3 = new AWS.S3({apiVersion: '2006-03-01'});
                                                                                  
                                                                                  
                                                                                  const sendToS3 = async (filePath) => {
                                                                                      const bucketName = "bucket_name";
                                                                                      const fileName = "zipped.zip"
                                                                                      const file = await fs.readFileSync(filePath)
                                                                                      const params = {
                                                                                          Bucket: bucketName,
                                                                                          Key: fileName,
                                                                                          Body: file
                                                                                      };
                                                                                      const res = await s3.upload(params).promise()
                                                                                      return res.Location
                                                                                  }
                                                                                  
                                                                                  exports.handler = async event => {
                                                                                    return new Promise((resolve, reject) => {
                                                                                      const zippedPathName = '/tmp/example.zip';
                                                                                      const output = fs.createWriteStream(zippedPathName);
                                                                                      const fileToBeZipped = __dirname + '/test.txt';
                                                                                      const zip = archiver('zip')
                                                                                  
                                                                                      zip
                                                                                        .append(fs.createReadStream(fileToBeZipped), { name: 'test.txt' })
                                                                                        .pipe(output)
                                                                                  
                                                                                      zip.finalize()
                                                                                  
                                                                                      output.on('close', (result => {
                                                                                          sendToS3(zippedPathName).then(result => {
                                                                                              resolve(result)
                                                                                          })
                                                                                      }))
                                                                                    })
                                                                                  }
                                                                                  

                                                                                  Source https://stackoverflow.com/questions/71157508

                                                                                  QUESTION

                                                                                  OWL API NoSuchMethodError in saveOntology() call
                                                                                  Asked 2022-Jan-31 at 10:43

                                                                                  I am trying to call an OWL API java program through terminal and it crashes, while the exact same code is running ok when I run it in IntelliJ.

                                                                                  The exception that rises in my main code is this:

                                                                                  Exception in thread "main" java.lang.NoSuchMethodError: 'boolean org.semanticweb.owlapi.io.RDFResource.idRequiredForIndividualOrAxiom()'
                                                                                          at org.semanticweb.owlapi.rdf.rdfxml.renderer.RDFXMLRenderer.render(RDFXMLRenderer.java:204)
                                                                                          at org.semanticweb.owlapi.rdf.RDFRendererBase.render(RDFRendererBase.java:448)
                                                                                          at org.semanticweb.owlapi.rdf.RDFRendererBase.renderOntologyHeader(RDFRendererBase.java:441)
                                                                                          at org.semanticweb.owlapi.rdf.RDFRendererBase.render(RDFRendererBase.java:247)
                                                                                          at org.semanticweb.owlapi.rdf.rdfxml.renderer.RDFXMLStorer.storeOntology(RDFXMLStorer.java:51)
                                                                                          at org.semanticweb.owlapi.util.AbstractOWLStorer.storeOntology(AbstractOWLStorer.java:142)
                                                                                          at org.semanticweb.owlapi.util.AbstractOWLStorer.storeOntology(AbstractOWLStorer.java:106)
                                                                                          at uk.ac.manchester.cs.owl.owlapi.OWLOntologyManagerImpl.saveOntology(OWLOntologyManagerImpl.java:1347)
                                                                                          at uk.ac.manchester.cs.owl.owlapi.OWLOntologyManagerImpl.saveOntology(OWLOntologyManagerImpl.java:1333)
                                                                                          at com.stelios.JavaExplanations.main(JavaExplanations.java:112)
                                                                                  
                                                                                  

                                                                                  It seems as if calling idRequiredForIndividualOrAxiom() on an RDFResource object doesn't find the method that is inherited by RDFNode class, but I have no clue why.

                                                                                  In order to post here, I kept only the saveOntology call in a minimal example and the exception that is thrown is the same with extra steps:

                                                                                  Exception in thread "main" java.lang.NoSuchMethodError: 'boolean org.semanticweb.owlapi.io.RDFResource.idRequiredForIndividualOrAxiom()'
                                                                                          at org.semanticweb.owlapi.rdf.rdfxml.renderer.RDFXMLRenderer.render(RDFXMLRenderer.java:204)
                                                                                          at org.semanticweb.owlapi.rdf.rdfxml.renderer.RDFXMLRenderer.render(RDFXMLRenderer.java:249)
                                                                                          at org.semanticweb.owlapi.rdf.RDFRendererBase.renderEntity(RDFRendererBase.java:298)
                                                                                          at org.semanticweb.owlapi.rdf.RDFRendererBase.render(RDFRendererBase.java:292)
                                                                                          at org.semanticweb.owlapi.rdf.RDFRendererBase.lambda$renderEntities$6(RDFRendererBase.java:285)
                                                                                          at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:183)
                                                                                          at java.base/java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:177)
                                                                                          at java.base/java.util.ArrayList$Itr.forEachRemaining(ArrayList.java:1033)
                                                                                          at java.base/java.util.Spliterators$IteratorSpliterator.forEachRemaining(Spliterators.java:1801)
                                                                                          at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:484)
                                                                                          at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:474)
                                                                                          at java.base/java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:150)
                                                                                          at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:173)
                                                                                          at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
                                                                                          at java.base/java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:497)
                                                                                          at org.semanticweb.owlapi.rdf.RDFRendererBase.renderEntities(RDFRendererBase.java:285)
                                                                                          at org.semanticweb.owlapi.rdf.RDFRendererBase.renderInOntologySignatureEntities(RDFRendererBase.java:269)
                                                                                          at org.semanticweb.owlapi.rdf.RDFRendererBase.renderOntologyComponents(RDFRendererBase.java:253)
                                                                                          at org.semanticweb.owlapi.rdf.RDFRendererBase.render(RDFRendererBase.java:248)
                                                                                          at org.semanticweb.owlapi.rdf.rdfxml.renderer.RDFXMLStorer.storeOntology(RDFXMLStorer.java:51)
                                                                                          at org.semanticweb.owlapi.util.AbstractOWLStorer.storeOntology(AbstractOWLStorer.java:142)
                                                                                          at org.semanticweb.owlapi.util.AbstractOWLStorer.storeOntology(AbstractOWLStorer.java:106)
                                                                                          at uk.ac.manchester.cs.owl.owlapi.OWLOntologyManagerImpl.saveOntology(OWLOntologyManagerImpl.java:1347)
                                                                                          at uk.ac.manchester.cs.owl.owlapi.OWLOntologyManagerImpl.saveOntology(OWLOntologyManagerImpl.java:1333)
                                                                                          at com.stelios.JavaExplanations.main(JavaExplanations.java:47)
                                                                                  

                                                                                  In both my original code and the minimal example I call java with: java -cp /home/stelios/java_explanations/target/java_explanations-1.0-SNAPSHOT-jar-with-dependencies.jar com.stelios.JavaExplanations

                                                                                  Here is the minimal example that repeats this behavior for me. This is the Java code:

                                                                                  package com.stelios;
                                                                                  
                                                                                  import java.io.File;
                                                                                  import java.io.FileNotFoundException;
                                                                                  import java.io.FileOutputStream;
                                                                                  import java.util.*;
                                                                                  
                                                                                  import org.semanticweb.owlapi.apibinding.OWLManager;
                                                                                  import org.semanticweb.owlapi.io.*;
                                                                                  import org.semanticweb.owlapi.model.*;
                                                                                  
                                                                                  public class JavaExplanations {
                                                                                      public static void main(String[] args) throws OWLOntologyCreationException, FileNotFoundException, OWLOntologyStorageException {
                                                                                          String ontology1 = "/home/stelios/Desktop/huiyfgds/ONTO_ASRTD_hz162pai";
                                                                                          String ontology2 = "/home/stelios/Desktop/huiyfgds/ONTO_INFRD_hz162pai";
                                                                                  
                                                                                          OWLOntologyManager ontology_manager = OWLManager.createOWLOntologyManager();
                                                                                          OWLOntology asserted_ontology = ontology_manager.loadOntologyFromOntologyDocument(new File(ontology1));
                                                                                          ontology_manager.saveOntology(asserted_ontology, new StreamDocumentTarget(new FileOutputStream(ontology2)));
                                                                                      }
                                                                                  }
                                                                                  

                                                                                  This is the pom.xml in IntelliJ:

                                                                                  
                                                                                  
                                                                                      4.0.0
                                                                                  
                                                                                      com.stelios.expl
                                                                                      java_explanations
                                                                                      1.0-SNAPSHOT
                                                                                  
                                                                                      
                                                                                          11
                                                                                          11
                                                                                      
                                                                                  
                                                                                      
                                                                                          
                                                                                          
                                                                                              net.sourceforge.owlapi
                                                                                              owlexplanation
                                                                                              5.0.0
                                                                                          
                                                                                          
                                                                                              net.sourceforge.owlapi
                                                                                              owlapi-distribution
                                                                                              5.1.9
                                                                                          
                                                                                          
                                                                                              net.sourceforge.owlapi
                                                                                              org.semanticweb.hermit
                                                                                              1.4.5.519
                                                                                          
                                                                                  
                                                                                          
                                                                                              org.slf4j
                                                                                              slf4j-api
                                                                                              1.7.32
                                                                                          
                                                                                          
                                                                                              org.slf4j
                                                                                              slf4j-nop
                                                                                              1.7.32
                                                                                          
                                                                                      
                                                                                  
                                                                                  
                                                                                      
                                                                                          
                                                                                              
                                                                                                  org.apache.maven.plugins
                                                                                                  maven-jar-plugin
                                                                                                  
                                                                                                      
                                                                                                          src/main/resources/META-INF/MANIFEST.MF
                                                                                                      
                                                                                                  
                                                                                              
                                                                                              
                                                                                                  maven-assembly-plugin
                                                                                                  
                                                                                                      
                                                                                                          package
                                                                                                          
                                                                                                              single
                                                                                                          
                                                                                                      
                                                                                                  
                                                                                                  
                                                                                                      
                                                                                                          jar-with-dependencies
                                                                                                      
                                                                                                  
                                                                                              
                                                                                          
                                                                                  
                                                                                          
                                                                                              
                                                                                                  src/main/java
                                                                                                  
                                                                                                      **/*.java
                                                                                                  
                                                                                              
                                                                                          
                                                                                      
                                                                                      
                                                                                  
                                                                                  

                                                                                  I think that most probably it is some dependency/version error but I don't see how this can be. I package everything I need in the jar file I give as classpath, defining the wanted versions in pom.xml, and in this jar I can find only one org/semanticweb/owlapi/io/RDFResource.class file.

                                                                                  Reading this and this I thought about having 2 different versions of OWL API, as I had another .jar with OWL API version 3.4.9 in it, in the directory tree. I moved the file and rebuilt the maven package just to be sure, and (as expected) no change.

                                                                                  Other than the saveOntology() call, my original program is working as intended.

                                                                                  The only thing out of the ordinary is that IntelliJ is giving me a Plugin 'maven-assembly-plugin:' not found problem, which I haven't managed to solve in any way, and have been ignoring as it hasn't been an issue in any of the operations I have needed. (If you know how to solve it of course, give me suggestions, but my main problem is the earlier mentioned exception).

                                                                                  EDIT Here is the mvn dependency:tree output.

                                                                                  [INFO] Scanning for projects...
                                                                                  [INFO] 
                                                                                  [INFO] -----------------< com.stelios.expl:java_explanations >-----------------
                                                                                  [INFO] Building java_explanations 1.0-SNAPSHOT
                                                                                  [INFO] --------------------------------[ jar ]---------------------------------
                                                                                  [INFO] 
                                                                                  [INFO] --- maven-dependency-plugin:2.8:tree (default-cli) @ java_explanations ---
                                                                                  [INFO] com.stelios.expl:java_explanations:jar:1.0-SNAPSHOT
                                                                                  [INFO] +- net.sourceforge.owlapi:owlexplanation:jar:5.0.0:compile
                                                                                  [INFO] |  +- net.sourceforge.owlapi:owlapi-api:jar:5.1.19:compile (version selected from constraint [5.0.0,5.9.9])
                                                                                  [INFO] |  |  \- javax.inject:javax.inject:jar:1:compile
                                                                                  [INFO] |  +- net.sourceforge.owlapi:owlapi-tools:jar:5.1.19:compile (version selected from constraint [5.0.0,5.9.9])
                                                                                  [INFO] |  \- net.sourceforge.owlapi:telemetry:jar:5.0.0:compile
                                                                                  [INFO] |     \- net.sourceforge.owlapi:owlapi-parsers:jar:5.1.19:compile (version selected from constraint [5.0.0,5.9.9])
                                                                                  [INFO] +- net.sourceforge.owlapi:owlapi-distribution:jar:5.1.9:compile
                                                                                  [INFO] |  +- net.sourceforge.owlapi:owlapi-compatibility:jar:5.1.9:compile
                                                                                  [INFO] |  |  \- net.sourceforge.owlapi:owlapi-apibinding:jar:5.1.9:compile
                                                                                  [INFO] |  |     +- net.sourceforge.owlapi:owlapi-impl:jar:5.1.9:compile
                                                                                  [INFO] |  |     +- net.sourceforge.owlapi:owlapi-oboformat:jar:5.1.9:compile
                                                                                  [INFO] |  |     \- net.sourceforge.owlapi:owlapi-rio:jar:5.1.9:compile
                                                                                  [INFO] |  +- com.fasterxml.jackson.core:jackson-core:jar:2.9.7:compile
                                                                                  [INFO] |  +- com.fasterxml.jackson.core:jackson-databind:jar:2.9.7:compile
                                                                                  [INFO] |  +- com.fasterxml.jackson.core:jackson-annotations:jar:2.9.7:compile
                                                                                  [INFO] |  +- org.apache.commons:commons-rdf-api:jar:0.5.0:compile
                                                                                  [INFO] |  +- org.tukaani:xz:jar:1.6:compile
                                                                                  [INFO] |  +- org.slf4j:jcl-over-slf4j:jar:1.7.22:compile
                                                                                  [INFO] |  +- org.eclipse.rdf4j:rdf4j-model:jar:2.3.2:compile
                                                                                  [INFO] |  +- org.eclipse.rdf4j:rdf4j-rio-api:jar:2.3.2:compile
                                                                                  [INFO] |  +- org.eclipse.rdf4j:rdf4j-rio-languages:jar:2.3.2:compile
                                                                                  [INFO] |  +- org.eclipse.rdf4j:rdf4j-rio-datatypes:jar:2.3.2:compile
                                                                                  [INFO] |  +- org.eclipse.rdf4j:rdf4j-rio-binary:jar:2.3.2:compile
                                                                                  [INFO] |  +- org.eclipse.rdf4j:rdf4j-rio-n3:jar:2.3.2:compile
                                                                                  [INFO] |  +- org.eclipse.rdf4j:rdf4j-rio-nquads:jar:2.3.2:compile
                                                                                  [INFO] |  +- org.eclipse.rdf4j:rdf4j-rio-ntriples:jar:2.3.2:compile
                                                                                  [INFO] |  +- org.eclipse.rdf4j:rdf4j-rio-rdfjson:jar:2.3.2:compile
                                                                                  [INFO] |  +- org.eclipse.rdf4j:rdf4j-rio-jsonld:jar:2.3.2:compile
                                                                                  [INFO] |  |  +- org.apache.httpcomponents:httpclient:jar:4.5.2:compile
                                                                                  [INFO] |  |  |  \- org.apache.httpcomponents:httpcore:jar:4.4.4:compile
                                                                                  [INFO] |  |  \- org.apache.httpcomponents:httpclient-cache:jar:4.5.2:compile
                                                                                  [INFO] |  +- org.eclipse.rdf4j:rdf4j-rio-rdfxml:jar:2.3.2:compile
                                                                                  [INFO] |  +- org.eclipse.rdf4j:rdf4j-rio-trix:jar:2.3.2:compile
                                                                                  [INFO] |  +- org.eclipse.rdf4j:rdf4j-rio-turtle:jar:2.3.2:compile
                                                                                  [INFO] |  +- org.eclipse.rdf4j:rdf4j-rio-trig:jar:2.3.2:compile
                                                                                  [INFO] |  +- org.eclipse.rdf4j:rdf4j-util:jar:2.3.2:compile
                                                                                  [INFO] |  +- com.github.jsonld-java:jsonld-java:jar:0.12.0:compile
                                                                                  [INFO] |  |  +- org.apache.httpcomponents:httpclient-osgi:jar:4.5.5:compile
                                                                                  [INFO] |  |  |  +- org.apache.httpcomponents:httpmime:jar:4.5.5:compile
                                                                                  [INFO] |  |  |  \- org.apache.httpcomponents:fluent-hc:jar:4.5.5:compile
                                                                                  [INFO] |  |  \- org.apache.httpcomponents:httpcore-osgi:jar:4.4.9:compile
                                                                                  [INFO] |  |     \- org.apache.httpcomponents:httpcore-nio:jar:4.4.9:compile
                                                                                  [INFO] |  +- com.github.vsonnier:hppcrt:jar:0.7.5:compile
                                                                                  [INFO] |  +- com.github.ben-manes.caffeine:caffeine:jar:2.6.1:compile
                                                                                  [INFO] |  +- com.google.guava:guava:jar:22.0:compile (version selected from constraint [18.0,22.0])
                                                                                  [INFO] |  |  +- com.google.errorprone:error_prone_annotations:jar:2.0.18:compile
                                                                                  [INFO] |  |  +- com.google.j2objc:j2objc-annotations:jar:1.1:compile
                                                                                  [INFO] |  |  \- org.codehaus.mojo:animal-sniffer-annotations:jar:1.14:compile
                                                                                  [INFO] |  +- com.google.code.findbugs:jsr305:jar:3.0.2:compile (version selected from constraint [2.0.0,4))
                                                                                  [INFO] |  \- commons-io:commons-io:jar:2.5:compile
                                                                                  [INFO] +- net.sourceforge.owlapi:org.semanticweb.hermit:jar:1.4.5.519:compile
                                                                                  [INFO] |  +- commons-logging:commons-logging:jar:1.1.3:compile
                                                                                  [INFO] |  +- org.apache.ws.commons.axiom:axiom-api:jar:1.2.14:compile
                                                                                  [INFO] |  |  +- org.apache.geronimo.specs:geronimo-activation_1.1_spec:jar:1.1:compile
                                                                                  [INFO] |  |  +- org.apache.geronimo.specs:geronimo-javamail_1.4_spec:jar:1.7.1:compile
                                                                                  [INFO] |  |  +- jaxen:jaxen:jar:1.1.4:compile
                                                                                  [INFO] |  |  +- org.apache.geronimo.specs:geronimo-stax-api_1.0_spec:jar:1.0.1:compile
                                                                                  [INFO] |  |  \- org.apache.james:apache-mime4j-core:jar:0.7.2:compile
                                                                                  [INFO] |  +- org.apache.ws.commons.axiom:axiom-c14n:jar:1.2.14:compile
                                                                                  [INFO] |  +- org.apache.ws.commons.axiom:axiom-impl:jar:1.2.14:compile
                                                                                  [INFO] |  |  \- org.codehaus.woodstox:woodstox-core-asl:jar:4.1.4:compile
                                                                                  [INFO] |  |     \- org.codehaus.woodstox:stax2-api:jar:3.1.1:compile
                                                                                  [INFO] |  +- org.apache.ws.commons.axiom:axiom-dom:jar:1.2.14:compile
                                                                                  [INFO] |  +- dk.brics.automaton:automaton:jar:1.11-8:compile
                                                                                  [INFO] |  +- gnu.getopt:java-getopt:jar:1.0.13:compile
                                                                                  [INFO] |  \- net.sf.trove4j:trove4j:jar:3.0.3:compile
                                                                                  [INFO] +- org.slf4j:slf4j-api:jar:1.7.22:compile
                                                                                  [INFO] +- org.slf4j:slf4j-nop:jar:1.7.32:compile
                                                                                  [INFO] \- org.apache.maven.plugins:maven-assembly-plugin:maven-plugin:3.3.0:compile
                                                                                  [INFO]    +- org.apache.maven:maven-plugin-api:jar:3.0:compile
                                                                                  [INFO]    |  \- org.sonatype.sisu:sisu-inject-plexus:jar:1.4.2:compile
                                                                                  [INFO]    |     \- org.sonatype.sisu:sisu-inject-bean:jar:1.4.2:compile
                                                                                  [INFO]    |        \- org.sonatype.sisu:sisu-guice:jar:noaop:2.1.7:compile
                                                                                  [INFO]    +- org.apache.maven:maven-core:jar:3.0:compile
                                                                                  [INFO]    |  +- org.apache.maven:maven-settings:jar:3.0:compile
                                                                                  [INFO]    |  +- org.apache.maven:maven-settings-builder:jar:3.0:compile
                                                                                  [INFO]    |  +- org.apache.maven:maven-repository-metadata:jar:3.0:compile
                                                                                  [INFO]    |  +- org.apache.maven:maven-model-builder:jar:3.0:compile
                                                                                  [INFO]    |  +- org.apache.maven:maven-aether-provider:jar:3.0:runtime
                                                                                  [INFO]    |  +- org.sonatype.aether:aether-impl:jar:1.7:compile
                                                                                  [INFO]    |  |  \- org.sonatype.aether:aether-spi:jar:1.7:compile
                                                                                  [INFO]    |  +- org.sonatype.aether:aether-api:jar:1.7:compile
                                                                                  [INFO]    |  +- org.sonatype.aether:aether-util:jar:1.7:compile
                                                                                  [INFO]    |  +- org.codehaus.plexus:plexus-classworlds:jar:2.2.3:compile
                                                                                  [INFO]    |  +- org.codehaus.plexus:plexus-component-annotations:jar:1.5.5:compile
                                                                                  [INFO]    |  \- org.sonatype.plexus:plexus-sec-dispatcher:jar:1.3:compile
                                                                                  [INFO]    |     \- org.sonatype.plexus:plexus-cipher:jar:1.4:compile
                                                                                  [INFO]    +- org.apache.maven:maven-artifact:jar:3.0:compile
                                                                                  [INFO]    +- org.apache.maven:maven-model:jar:3.0:compile
                                                                                  [INFO]    +- org.apache.maven.shared:maven-common-artifact-filters:jar:3.1.0:compile
                                                                                  [INFO]    |  \- org.apache.maven.shared:maven-shared-utils:jar:3.1.0:compile
                                                                                  [INFO]    +- org.apache.maven.shared:maven-artifact-transfer:jar:0.11.0:compile
                                                                                  [INFO]    +- org.codehaus.plexus:plexus-interpolation:jar:1.25:compile
                                                                                  [INFO]    +- org.codehaus.plexus:plexus-archiver:jar:4.2.1:compile
                                                                                  [INFO]    |  +- org.apache.commons:commons-compress:jar:1.19:compile
                                                                                  [INFO]    |  \- org.iq80.snappy:snappy:jar:0.4:compile
                                                                                  [INFO]    +- org.apache.maven.shared:file-management:jar:3.0.0:compile
                                                                                  [INFO]    +- org.apache.maven.shared:maven-shared-io:jar:3.0.0:compile
                                                                                  [INFO]    |  +- org.apache.maven:maven-compat:jar:3.0:compile
                                                                                  [INFO]    |  \- org.apache.maven.wagon:wagon-provider-api:jar:2.10:compile
                                                                                  [INFO]    +- org.apache.maven.shared:maven-filtering:jar:3.1.1:compile
                                                                                  [INFO]    |  \- org.sonatype.plexus:plexus-build-api:jar:0.0.7:compile
                                                                                  [INFO]    +- org.codehaus.plexus:plexus-io:jar:3.2.0:compile
                                                                                  [INFO]    +- org.apache.maven:maven-archiver:jar:3.5.0:compile
                                                                                  [INFO]    +- org.codehaus.plexus:plexus-utils:jar:3.3.0:compile
                                                                                  [INFO]    \- commons-codec:commons-codec:jar:1.6:compile
                                                                                  [INFO] ------------------------------------------------------------------------
                                                                                  [INFO] BUILD SUCCESS
                                                                                  [INFO] ------------------------------------------------------------------------
                                                                                  [INFO] Total time:  1.339 s
                                                                                  [INFO] Finished at: 2022-01-27T13:06:01+02:00
                                                                                  [INFO] ------------------------------------------------------------------------
                                                                                  
                                                                                  Process finished with exit code 0
                                                                                  
                                                                                  

                                                                                  ANSWER

                                                                                  Answered 2022-Jan-31 at 10:43

                                                                                  As can be seen in the comments of the post, my problem is fixed, so I thought I'd collect a closing answer here to not leave the post pending.

                                                                                  The actual solution: As explained here nicely by @UninformedUser, the issue was that I had conflicting maven package versions in my dependencies. Bringing everything in sync with each other solved the issue.

                                                                                  Incidental solution: As I wrote in the comments above, specifically defining 3.3.0 for the maven-assembly-plugin happened to solve the issue. But this was only chance, as explained here by @Ignazio, just because the order of "assembling" things changed, overwriting the conflicting package.

                                                                                  Huge thanks to both for the help.

                                                                                  Source https://stackoverflow.com/questions/70854565

                                                                                  QUESTION

                                                                                  angular 13: Module not found: Error: Can't resolve 'rxjs/operators'
                                                                                  Asked 2022-Jan-22 at 05:29

                                                                                  I have upgraded my angular to angular 13. when I run to build SSR it gives me following error.

                                                                                  ERROR in ./node_modules/@angular/common/fesm2015/http.mjs 12:0-56
                                                                                  Module not found: Error: Can't resolve 'rxjs/operators' in '/Users/nr/aws/jobsaf-website-staging/application/node_modules/@angular/common/fesm2015'
                                                                                  Did you mean 'index.js'?
                                                                                  BREAKING CHANGE: The request 'rxjs/operators' failed to resolve only because it was resolved as fully specified
                                                                                  (probably because the origin is strict EcmaScript Module, e. g. a module with javascript mimetype, a '*.mjs' file, or a '*.js' file where the package.json contains '"type": "module"').
                                                                                  The extension in the request is mandatory for it to be fully specified.
                                                                                  Add the extension to the request.
                                                                                   @ ./src/app/app.server.module.ts 6:0-57 16:25-42
                                                                                   @ ./src/main.server.ts 3:0-58 3:0-58
                                                                                   @ ./server.ts 32:0-52 40:15-30 44:0-34 44:0-34
                                                                                  
                                                                                  ERROR in ./node_modules/@angular/core/fesm2015/core.mjs 8:0-39
                                                                                  Module not found: Error: Can't resolve 'rxjs/operators' in '/Users/nr/aws/jobsaf-website-staging/application/node_modules/@angular/core/fesm2015'
                                                                                  Did you mean 'index.js'?
                                                                                  BREAKING CHANGE: The request 'rxjs/operators' failed to resolve only because it was resolved as fully specified
                                                                                  (probably because the origin is strict EcmaScript Module, e. g. a module with javascript mimetype, a '*.mjs' file, or a '*.js' file where the package.json contains '"type": "module"').
                                                                                  The extension in the request is mandatory for it to be fully specified.
                                                                                  Add the extension to the request.
                                                                                   @ ./server.ts 30:0-47 35:0-14
                                                                                  
                                                                                  ERROR in ./node_modules/@angular/forms/fesm2015/forms.mjs 11:0-37
                                                                                  Module not found: Error: Can't resolve 'rxjs/operators' in '/Users/nr/aws/jobsaf-website-staging/application/node_modules/@angular/forms/fesm2015'
                                                                                  Did you mean 'index.js'?
                                                                                  BREAKING CHANGE: The request 'rxjs/operators' failed to resolve only because it was resolved as fully specified
                                                                                  (probably because the origin is strict EcmaScript Module, e. g. a module with javascript mimetype, a '*.mjs' file, or a '*.js' file where the package.json contains '"type": "module"').
                                                                                  The extension in the request is mandatory for it to be fully specified.
                                                                                  Add the extension to the request.
                                                                                   @ ./src/app/app.module.ts 12:0-45 78:12-23
                                                                                   @ ./src/app/app.server.module.ts 3:0-41 12:18-27
                                                                                   @ ./src/main.server.ts 3:0-58 3:0-58
                                                                                   @ ./server.ts 32:0-52 40:15-30 44:0-34 44:0-34
                                                                                  
                                                                                  ERROR in ./node_modules/@angular/platform-server/fesm2015/platform-server.mjs 21:0-39
                                                                                  Module not found: Error: Can't resolve 'rxjs/operators' in '/Users/nr/aws/jobsaf-website-staging/application/node_modules/@angular/platform-server/fesm2015'
                                                                                  Did you mean 'index.js'?
                                                                                  BREAKING CHANGE: The request 'rxjs/operators' failed to resolve only because it was resolved as fully specified
                                                                                  (probably because the origin is strict EcmaScript Module, e. g. a module with javascript mimetype, a '*.mjs' file, or a '*.js' file where the package.json contains '"type": "module"').
                                                                                  The extension in the request is mandatory for it to be fully specified.
                                                                                  Add the extension to the request.
                                                                                   @ ./src/main.server.ts 4:0-77 4:0-77 4:0-77
                                                                                   @ ./server.ts 32:0-52 40:15-30 44:0-34 44:0-34
                                                                                  
                                                                                  ERROR in ./node_modules/@angular/router/fesm2015/router.mjs 10:0-180
                                                                                  Module not found: Error: Can't resolve 'rxjs/operators' in '/Users/nr/aws/jobsaf-website-staging/application/node_modules/@angular/router/fesm2015'
                                                                                  Did you mean 'index.js'?
                                                                                  BREAKING CHANGE: The request 'rxjs/operators' failed to resolve only because it was resolved as fully specified
                                                                                  (probably because the origin is strict EcmaScript Module, e. g. a module with javascript mimetype, a '*.mjs' file, or a '*.js' file where the package.json contains '"type": "module"').
                                                                                  The extension in the request is mandatory for it to be fully specified.
                                                                                  Add the extension to the request.
                                                                                   @ ./src/app/app.component.ts 2:0-48 35:31-44
                                                                                   @ ./src/app/app.server.module.ts 2:0-47 13:20-32
                                                                                   @ ./src/main.server.ts 3:0-58 3:0-58
                                                                                   @ ./server.ts 32:0-52 40:15-30 44:0-34 44:0-34
                                                                                  

                                                                                  my package.json file:

                                                                                  {
                                                                                    "name": "admin-panel",
                                                                                    "version": "0.0.0",
                                                                                    "license": "MIT",
                                                                                    "angular-cli": {},
                                                                                    "scripts": {
                                                                                      "start": "DEBUG=jobsaf-website:* nodemon --inspect --trace-warnings --legacy-watch  --trace-warnings ./bin/www",
                                                                                      "seed": "node ./seeds/static-tables.js",
                                                                                      "test-jobsaf": "mocha --timeout 10000",
                                                                                      "rm-web": "rm -rf ./public/web/*",
                                                                                      "ng": "node ./node_modules/@angular/cli/bin/ng serve --host 0.0.0.0",
                                                                                      "ng:build": "node --max_old_space_size=5048 ./node_modules/@angular/cli/bin/ng  build --configuration production --aot",
                                                                                      "build:server:prod": "node --max_old_space_size=4048 ./node_modules/@angular/cli/bin/ng run jobsaf-website:server:prod && webpack --config webpack.server.config.js",
                                                                                      "build:browser:prod": "node --max_old_space_size=4048 ./node_modules/@angular/cli/bin/ng build --configuration production --aot --vendor-chunk --deleteOutputPath=true --buildOptimizer  --progress=true",
                                                                                      "build:server:staging": "node --max_old_space_size=4048 ./node_modules/@angular/cli/bin/ng run jobsaf-website:server:staging && webpack --config webpack.server.config.js",
                                                                                      "build:browser:staging": "node --max_old_space_size=4048 ./node_modules/@angular/cli/bin/ng build --configuration production --configuration=staging --aot --vendor-chunk --deleteOutputPath=true --buildOptimizer",
                                                                                      "build:stats": "node --max_old_space_size=3192 node_modules/@angular/cli/bin/ng build --configuration production --aot --vendor-chunk --deleteOutputPath=true --buildOptimizer  --progress=true --configuration production --stats-json",
                                                                                      "build:prod": "npm run rm-web && npm run build:server:prod && npm run build:browser:prod",
                                                                                      "build:staging": "npm run rm-web && npm run build:server:staging && npm run build:browser:staging",
                                                                                      "server": "node local.js",
                                                                                      "file:migration": "APP_FILE_MIGRATION=true node ./migration/file-migration.js",
                                                                                      "test_env": "set NODE_ENV=test",
                                                                                      "jest": "jest --detectOpenHandles --watchAll --config ./jest.config.js",
                                                                                      "coverage": "jest -i --coverage",
                                                                                      "jest:ci": "jest --detectOpenHandles --forceExit --config ./jest.config.js",
                                                                                      "test": "npm run test_env && npm run jest",
                                                                                      "test:ci": "npm run test_env && npm run seed && npm run jest:ci",
                                                                                      "dev:ssr": "ng run jobsaf-website:serve-ssr",
                                                                                      "serve:ssr": "node public/web/server/main.js",
                                                                                      "build:ssr": "ng build --configuration production && ng run jobsaf-website:server:prod",
                                                                                      "prerender": "ng run jobsaf-website:prerender",
                                                                                      "postinstall": "ngcc"
                                                                                    },
                                                                                    "private": true,
                                                                                    "napa": {
                                                                                      "jquery.flot.spline": "miloszfalinski/jquery.flot.spline",
                                                                                      "ika.jvectormap": "kakirigi/ika.jvectormap"
                                                                                    },
                                                                                    "dependencies": {
                                                                                      "@angular/animations": "^13.0.2",
                                                                                      "@angular/common": "^13.0.2",
                                                                                      "@angular/compiler": "^13.0.2",
                                                                                      "@angular/compiler-cli": "^13.0.2",
                                                                                      "@angular/core": "^13.0.2",
                                                                                      "@angular/forms": "^13.0.2",
                                                                                      "@angular/material": "^13.0.2",
                                                                                      "@angular/platform-browser": "^13.0.2",
                                                                                      "@angular/platform-browser-dynamic": "^13.0.2",
                                                                                      "@angular/platform-server": "^13.0.2",
                                                                                      "@angular/pwa": "^13.0.3",
                                                                                      "@angular/router": "^13.0.2",
                                                                                      "@angular/service-worker": "^13.0.2",
                                                                                      "@fortawesome/angular-fontawesome": "^0.10.1",
                                                                                      "@fortawesome/fontawesome-svg-core": "^1.2.36",
                                                                                      "@fortawesome/free-brands-svg-icons": "^5.15.4",
                                                                                      "@fortawesome/free-solid-svg-icons": "^5.15.4",
                                                                                      "@fullcalendar/core": "^5.10.1",
                                                                                      "@hapi/joi": "^15.1.0",
                                                                                      "@ng-select/ng-select": "^8.1.1",
                                                                                      "@nguniversal/common": "^13.0.1",
                                                                                      "@nguniversal/express-engine": "^13.0.1",
                                                                                      "@ngx-loading-bar/core": "^5.1.2",
                                                                                      "@ngxs/store": "^3.7.3-dev.master-1e7127b",
                                                                                      "@schematics/angular": "^13.0.3",
                                                                                      "@sindresorhus/slugify": "^1.1.0",
                                                                                      "@trademe/ng-defer-load": "^8.2.1",
                                                                                      "@types/jquery": "^3.5.8",
                                                                                      "angular-archwizard": "^7.0.0",
                                                                                      "angular2-uuid": "^1.1.1",
                                                                                      "apicache": "^1.6.3",
                                                                                      "archiver": "^5.3.0",
                                                                                      "aws-sdk": "^2.1031.0",
                                                                                      "bluebird": "^3.7.2",
                                                                                      "bootstrap": "5.1.3",
                                                                                      "compression": "^1.7.4",
                                                                                      "compromise": "^13.11.4",
                                                                                      "cookie-parser": "^1.4.6",
                                                                                      "core-js": "3.19.1",
                                                                                      "cors": "~2.8.5",
                                                                                      "debug": "^4.3.2",
                                                                                      "dotenv": "^10.0.0",
                                                                                      "easyimage": "^3.1.1",
                                                                                      "ejs": "^3.1.6",
                                                                                      "exceljs": "^4.3.0",
                                                                                      "express": "^4.17.1",
                                                                                      "express-jwt": "^6.1.0",
                                                                                      "express-mongo-sanitize": "^2.1.0",
                                                                                      "express-rate-limit": "^5.5.1",
                                                                                      "express-useragent": "^1.0.15",
                                                                                      "express-validator": "^6.13.0",
                                                                                      "feed": "^4.2.2",
                                                                                      "file-saver": "^2.0.5",
                                                                                      "firebase-admin": "^10.0.0",
                                                                                      "font-awesome": "^4.7.0",
                                                                                      "generate-password": "^1.7.0",
                                                                                      "google-auth-library": "^7.10.2",
                                                                                      "hammerjs": "^2.0.8",
                                                                                      "helmet": "^4.6.0",
                                                                                      "html-pdf": "^3.0.1",
                                                                                      "http-status": "^1.5.0",
                                                                                      "intl-tel-input": "^17.0.13",
                                                                                      "izitoast": "1.4.0",
                                                                                      "joi-objectid": "^4.0.2",
                                                                                      "jquery": "^3.6.0",
                                                                                      "jsonwebtoken": "^8.5.1",
                                                                                      "jwt-decode": "^3.1.2",
                                                                                      "keyword-extractor": "0.0.20",
                                                                                      "kickbox": "^2.0.4",
                                                                                      "libphonenumber-js": "^1.9.43",
                                                                                      "localstorage-polyfill": "^1.0.1",
                                                                                      "lodash": "^4.17.21",
                                                                                      "lodash.uniq": "^4.5.0",
                                                                                      "md5": "^2.3.0",
                                                                                      "moment": "^2.29.1",
                                                                                      "mongoose": "5.8.11",
                                                                                      "mongoose-history": "^0.8.0",
                                                                                      "mongoose-unique-validator": "^2.0.3",
                                                                                      "mongoose-url-slugs": "^1.0.2",
                                                                                      "multer": "^1.4.3",
                                                                                      "multer-s3": "^2.10.0",
                                                                                      "multer-s3-transform": "^2.10.3",
                                                                                      "mysql": "^2.18.1",
                                                                                      "ng-recaptcha": "^9.0.0",
                                                                                      "ng2-file-upload": "^1.4.0",
                                                                                      "ngx-auth": "^5.4.0",
                                                                                      "ngx-bootstrap": "^6.1.0",
                                                                                      "ngx-facebook": "^3.0.0-0",
                                                                                      "ngx-img-cropper": "^11.0.0",
                                                                                      "ngx-infinite-scroll": "^10.0.1",
                                                                                      "ngx-moment": "^5.0.0",
                                                                                      "ngx-pagination": "^5.1.1",
                                                                                      "ngx-quill-editor": "^2.2.2",
                                                                                      "ngx-toastr": "^14.2.0",
                                                                                      "node-schedule": "^2.0.0",
                                                                                      "nodemailer": "^6.7.1",
                                                                                      "passport": "^0.5.0",
                                                                                      "passport-facebook-token": "^4.0.0",
                                                                                      "passport-google-id-token": "^0.4.7",
                                                                                      "passport-google-token": "^0.1.2",
                                                                                      "passport-linkedin-token": "^0.1.1",
                                                                                      "passport-local": "^1.0.0",
                                                                                      "pdf-to-text": "0.0.7",
                                                                                      "phantomjs-prebuilt": "^2.1.16",
                                                                                      "phone": "^3.1.10",
                                                                                      "phpass": "^0.1.1",
                                                                                      "rand-token": "^1.0.1",
                                                                                      "request": "^2.88.2",
                                                                                      "request-ip": "^2.1.3",
                                                                                      "rxjs": "^6.5.5",
                                                                                      "sharp": "^0.29.3",
                                                                                      "showdown": "^1.9.1",
                                                                                      "simple-line-icons": "^2.5.5",
                                                                                      "socket.io": "^4.3.2",
                                                                                      "socket.io-client": "^4.3.2",
                                                                                      "socket.io-redis": "^5.4.0",
                                                                                      "socketio-auth": "^0.1.1",
                                                                                      "textract": "^2.5.0",
                                                                                      "ts-loader": "9.2.6",
                                                                                      "underscore": "^1.13.1",
                                                                                      "unique-random-array": "^2.0.0",
                                                                                      "url": "^0.11.0",
                                                                                      "util": "^0.12.4",
                                                                                      "uuid": "^8.3.2",
                                                                                      "winston": "^3.3.3",
                                                                                      "xlsx": "^0.17.4",
                                                                                      "xss-clean": "^0.1.1",
                                                                                      "zone.js": "~0.11.4",
                                                                                      "zxcvbn": "^4.4.2"
                                                                                    },
                                                                                    "devDependencies": {
                                                                                      "@angular-devkit/build-angular": "~13.0.3",
                                                                                      "@angular/cli": "^13.0.3",
                                                                                      "@types/express": "^4.17.13",
                                                                                      "@types/hammerjs": "^2.0.40",
                                                                                      "@types/mocha": "^9.0.0",
                                                                                      "@types/node": "^16.11.7",
                                                                                      "@types/underscore": "^1.11.3",
                                                                                      "husky": "^7.0.0",
                                                                                      "jasmine-core": "~3.10.1",
                                                                                      "jasmine-spec-reporter": "~7.0.0",
                                                                                      "jest": "^27.3.1",
                                                                                      "karma": "^6.3.9",
                                                                                      "karma-chrome-launcher": "~3.1.0",
                                                                                      "karma-coverage-istanbul-reporter": "^3.0.3",
                                                                                      "karma-jasmine": "~4.0.1",
                                                                                      "karma-jasmine-html-reporter": "^1.7.0",
                                                                                      "lint-staged": "^12.0.2",
                                                                                      "mocha": "^9.1.3",
                                                                                      "ng-diff-match-patch": "^3.0.1",
                                                                                      "nodemon": "^2.0.15",
                                                                                      "protractor": "^7.0.0",
                                                                                      "supertest": "^6.1.6",
                                                                                      "tslib": "^2.3.1",
                                                                                      "tslint": "^6.1.3",
                                                                                      "typescript": "4.4.3",
                                                                                      "webpack": "^5.64.1",
                                                                                      "webpack-cli": "^4.9.1"
                                                                                    }
                                                                                  }
                                                                                  
                                                                                  

                                                                                  Any Idea

                                                                                  ANSWER

                                                                                  Answered 2022-Jan-22 at 05:29

                                                                                  I just solve this issue by correcting the RxJS version to 7.4.0. I hope this can solve others issue as well.

                                                                                  Source https://stackoverflow.com/questions/70589846

                                                                                  QUESTION

                                                                                  Apache Ranger compile failed at assembly stage
                                                                                  Asked 2022-Jan-13 at 09:11

                                                                                  I was compiling Apache Ranger following the steps from offcial webstie and encounter below error. Can anyone help to deal with this issue?

                                                                                  The Ranger version: 2.2-release.

                                                                                  hadoop@machiunbuntu:~/apps/ranger-2.2.0$ git branch
                                                                                    master
                                                                                  * ranger-2.2
                                                                                  

                                                                                  Then I type mvn -DskipTests clean compile package install assembly:assembly, at the assembly stage compilation failed.

                                                                                  [ERROR] Failed to execute goal org.apache.maven.plugins:maven-assembly-plugin:2.6:single (default) on project ranger-distro: Failed to create assembly: Error creating assembly archive admin: Problem creating TAR: entry 'ranger-2.2.0-admin/ews/lib/commons-collections-3.2.2.jar' closed at '14336' before the '588337' bytes specified in the header were written -> [Help 1]
                                                                                  org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-assembly-plugin:2.6:single (default) on project ranger-distro: Failed to create assembly: Error creating assembly archive admin: Problem creating TAR: entry 'ranger-2.2.0-admin/ews/lib/commons-collections-3.2.2.jar' closed at '14336' before the '588337' bytes specified in the header were written
                                                                                      at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:215)
                                                                                      at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156)
                                                                                      at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148)
                                                                                      at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
                                                                                      at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
                                                                                      at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
                                                                                      at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
                                                                                      at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
                                                                                      at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
                                                                                      at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
                                                                                      at org.apache.maven.cli.MavenCli.execute (MavenCli.java:957)
                                                                                      at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:289)
                                                                                      at org.apache.maven.cli.MavenCli.main (MavenCli.java:193)
                                                                                      at sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
                                                                                      at sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
                                                                                      at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
                                                                                      at java.lang.reflect.Method.invoke (Method.java:498)
                                                                                      at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282)
                                                                                      at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225)
                                                                                      at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406)
                                                                                      at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347)
                                                                                  Caused by: org.apache.maven.plugin.MojoExecutionException: Failed to create assembly: Error creating assembly archive admin: Problem creating TAR: entry 'ranger-2.2.0-admin/ews/lib/commons-collections-3.2.2.jar' closed at '14336' before the '588337' bytes specified in the header were written
                                                                                      at org.apache.maven.plugin.assembly.mojos.AbstractAssemblyMojo.execute (AbstractAssemblyMojo.java:541)
                                                                                      at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:137)
                                                                                      at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:210)
                                                                                      at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156)
                                                                                      at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148)
                                                                                      at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
                                                                                      at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
                                                                                      at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
                                                                                      at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
                                                                                      at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
                                                                                      at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
                                                                                      at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
                                                                                      at org.apache.maven.cli.MavenCli.execute (MavenCli.java:957)
                                                                                      at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:289)
                                                                                      at org.apache.maven.cli.MavenCli.main (MavenCli.java:193)
                                                                                      at sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
                                                                                      at sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
                                                                                      at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
                                                                                      at java.lang.reflect.Method.invoke (Method.java:498)
                                                                                      at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282)
                                                                                      at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225)
                                                                                      at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406)
                                                                                      at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347)
                                                                                  Caused by: org.apache.maven.plugin.assembly.archive.ArchiveCreationException: Error creating assembly archive admin: Problem creating TAR: entry 'ranger-2.2.0-admin/ews/lib/commons-collections-3.2.2.jar' closed at '14336' before the '588337' bytes specified in the header were written
                                                                                      at org.apache.maven.plugin.assembly.archive.DefaultAssemblyArchiver.createArchive (DefaultAssemblyArchiver.java:185)
                                                                                      at org.apache.maven.plugin.assembly.mojos.AbstractAssemblyMojo.execute (AbstractAssemblyMojo.java:484)
                                                                                      at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:137)
                                                                                      at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:210)
                                                                                      at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156)
                                                                                      at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148)
                                                                                      at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
                                                                                      at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
                                                                                      at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
                                                                                      at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
                                                                                      at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
                                                                                      at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
                                                                                      at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
                                                                                      at org.apache.maven.cli.MavenCli.execute (MavenCli.java:957)
                                                                                      at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:289)
                                                                                      at org.apache.maven.cli.MavenCli.main (MavenCli.java:193)
                                                                                      at sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
                                                                                      at sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
                                                                                      at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
                                                                                      at java.lang.reflect.Method.invoke (Method.java:498)
                                                                                      at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282)
                                                                                      at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225)
                                                                                      at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406)
                                                                                      at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347)
                                                                                  Caused by: org.codehaus.plexus.archiver.ArchiverException: Problem creating TAR: entry 'ranger-2.2.0-admin/ews/lib/commons-collections-3.2.2.jar' closed at '14336' before the '588337' bytes specified in the header were written
                                                                                      at org.codehaus.plexus.archiver.AbstractArchiver.createArchive (AbstractArchiver.java:933)
                                                                                      at org.apache.maven.plugin.assembly.archive.archiver.AssemblyProxyArchiver.createArchive (AssemblyProxyArchiver.java:445)
                                                                                      at org.apache.maven.plugin.assembly.archive.DefaultAssemblyArchiver.createArchive (DefaultAssemblyArchiver.java:181)
                                                                                      at org.apache.maven.plugin.assembly.mojos.AbstractAssemblyMojo.execute (AbstractAssemblyMojo.java:484)
                                                                                      at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:137)
                                                                                      at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:210)
                                                                                      at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156)
                                                                                      at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148)
                                                                                      at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
                                                                                      at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
                                                                                      at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
                                                                                      at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
                                                                                      at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
                                                                                      at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
                                                                                      at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
                                                                                      at org.apache.maven.cli.MavenCli.execute (MavenCli.java:957)
                                                                                      at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:289)
                                                                                      at org.apache.maven.cli.MavenCli.main (MavenCli.java:193)
                                                                                      at sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
                                                                                      at sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
                                                                                      at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
                                                                                      at java.lang.reflect.Method.invoke (Method.java:498)
                                                                                      at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282)
                                                                                      at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225)
                                                                                      at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406)
                                                                                      at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347)
                                                                                  Caused by: java.io.IOException: entry 'ranger-2.2.0-admin/ews/lib/commons-collections-3.2.2.jar' closed at '14336' before the '588337' bytes specified in the header were written
                                                                                      at org.codehaus.plexus.archiver.commonscompress.archivers.tar.TarArchiveOutputStream.closeArchiveEntry (TarArchiveOutputStream.java:353)
                                                                                      at org.codehaus.plexus.archiver.tar.TarArchiver.tarFile (TarArchiver.java:324)
                                                                                      at org.codehaus.plexus.archiver.tar.TarArchiver.execute (TarArchiver.java:171)
                                                                                      at org.codehaus.plexus.archiver.AbstractArchiver.createArchive (AbstractArchiver.java:916)
                                                                                      at org.apache.maven.plugin.assembly.archive.archiver.AssemblyProxyArchiver.createArchive (AssemblyProxyArchiver.java:445)
                                                                                      at org.apache.maven.plugin.assembly.archive.DefaultAssemblyArchiver.createArchive (DefaultAssemblyArchiver.java:181)
                                                                                      at org.apache.maven.plugin.assembly.mojos.AbstractAssemblyMojo.execute (AbstractAssemblyMojo.java:484)
                                                                                      at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:137)
                                                                                      at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:210)
                                                                                      at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156)
                                                                                      at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148)
                                                                                      at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
                                                                                      at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
                                                                                      at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
                                                                                      at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
                                                                                      at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
                                                                                      at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
                                                                                      at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
                                                                                      at org.apache.maven.cli.MavenCli.execute (MavenCli.java:957)
                                                                                      at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:289)
                                                                                      at org.apache.maven.cli.MavenCli.main (MavenCli.java:193)
                                                                                      at sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
                                                                                      at sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
                                                                                      at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
                                                                                      at java.lang.reflect.Method.invoke (Method.java:498)
                                                                                      at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282)
                                                                                      at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225)
                                                                                      at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406)
                                                                                      at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347)
                                                                                  [ERROR] 
                                                                                  [ERROR] 
                                                                                  [ERROR] For more information about the errors and possible solutions, please read the following articles:
                                                                                  [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
                                                                                  [ERROR] 
                                                                                  [ERROR] After correcting the problems, you can resume the build with the command
                                                                                  [ERROR]   mvn  -rf :ranger-distro
                                                                                  

                                                                                  ANSWER

                                                                                  Answered 2022-Jan-13 at 09:11

                                                                                  This seems to be some File system error more than maven issue, check if your disk has enough space to / you have the correct permissions to complete the build. Usually when I am building ranger this works for me the fastest and best.

                                                                                  mvn clean compile package install -Dmaven.test.skip=true -Drat.skip=true -Dpmd.skip=true -Dfindbugs.skip=true -Dspotbugs.skip=true -Dcheckstyle.skip=true
                                                                                  

                                                                                  You can try this after ensuring the above.

                                                                                  Source https://stackoverflow.com/questions/70678985

                                                                                  QUESTION

                                                                                  How does the pgadmin encodes the file path in backups?
                                                                                  Asked 2022-Jan-04 at 09:46

                                                                                  I'm trying to restore dump files from locations that contain character from other languages besides English.

                                                                                  So here is what I did:

                                                                                  From inside the pgadmin I used the backup tool like:

                                                                                  And inside the FileName input provided an actual real folder named "א":

                                                                                  C:\א\toc.dump

                                                                                  The actual file argument (-f file) has been auto decoded into:

                                                                                  pg_dump.exe --file "C:\\0F04~1\\TOC~1.DUM"

                                                                                  My question is what is the decoding system pgadmin uses in order to decode the file path argument?

                                                                                  How did it came up with 0F04~1 from א?

                                                                                  I'm asking it because pg_restore is not supporting file path that contains not English chars (from cmd):

                                                                                  pg_dump.exe --file "C:\\0F04~1\\TOC1.DUMP" .... WORKS OK!
                                                                                  
                                                                                  pg_dump.exe --file "C:\\א\\TOC1.DUMP" ... Not Working!
                                                                                  

                                                                                  pg_restore: [custom archiver] could not open input file "..."

                                                                                  As in this question, so if I'll find the encoding system for pgadmin I'll use it from code.

                                                                                  My goal is to encode the path that contain not-English chars from a batch code so it will work.

                                                                                  ANSWER

                                                                                  Answered 2022-Jan-04 at 01:01

                                                                                  This is not something weird pgadmin does, but rather it is something weird Windows itself does when needing to represent such file names in a DOS-like setting. Like when the name is more than 8 chars, or extension more than 3.

                                                                                  In my hands the weird presentation is only there in the logs and status messages. If I use the GUI file chooser, the file names look normal, and replay successfully.

                                                                                  If you really want to know what Windows is doing, I think that is a better question for superuser with a Windows tag. I don't know why you can't restore these files. Are you using the pgAdmin GUI file chooser or trying to type the names in directly to something?

                                                                                  Source https://stackoverflow.com/questions/70567560

                                                                                  QUESTION

                                                                                  How to build the resultant docker image file directory?
                                                                                  Asked 2021-Dec-20 at 17:41

                                                                                  I have the following Dockerfile:

                                                                                  FROM busybox
                                                                                  COPY ./manifest.json /usr/manifest.json
                                                                                  RUN rm /usr/manifest.json
                                                                                  

                                                                                  where manifest.json is just some random file I found..

                                                                                  When I build an image from this Dockerfile, there will be 3 layers as expected.. And when I inspect these 3 layers, I will see the file hierarchies as expected.. So the first one will be pretty lengthy like..

                                                                                  bin/acpid
                                                                                  bin/add-shell
                                                                                  bin/addgroup
                                                                                  bin/adduser
                                                                                  bin/adjtimex
                                                                                  bin/ar
                                                                                  bin/arch
                                                                                  bin/arp
                                                                                  bin/arping
                                                                                  bin/ash
                                                                                  ... many more
                                                                                  

                                                                                  Second layer will be:

                                                                                  usr/manifest.json
                                                                                  

                                                                                  And the third layer will be:

                                                                                  proc/.wh..wh..opq
                                                                                  sys/.wh..wh..opq
                                                                                  usr/.wh.manifest.json
                                                                                  

                                                                                  I am guessing .wh.manifest.json means remove this file when applying this layer? (Not sure, just guessing..)

                                                                                  My ultimate goal is to actually create the folder structure that the resulting image will have. So for the above case it should essentially be equal to the first layer since first I am adding a file then deleting it.

                                                                                  I could not find any documentation on what .wh stands for.. Does it make sense to iterate through layers like this and keep adding files (to some target, does not matter for now) and deleting the added files in case they are found with a .wh prefix? Or am I totally off and is there a much better way?

                                                                                  If anyone is interested, I have some Java code that downloads and inspects existing layers for an image:

                                                                                  package com.docker.poc;
                                                                                  
                                                                                  import java.io.File;
                                                                                  import java.io.FileInputStream;
                                                                                  import java.io.FileOutputStream;
                                                                                  import java.io.InputStream;
                                                                                  import java.io.OutputStream;
                                                                                  import java.nio.charset.StandardCharsets;
                                                                                  import java.util.ArrayList;
                                                                                  import java.util.List;
                                                                                  import java.util.zip.GZIPInputStream;
                                                                                  
                                                                                  import com.google.gson.Gson;
                                                                                  import org.apache.commons.compress.archivers.tar.TarArchiveEntry;
                                                                                  import org.apache.commons.compress.archivers.tar.TarArchiveInputStream;
                                                                                  import org.apache.commons.io.IOUtils;
                                                                                  import org.apache.http.client.methods.CloseableHttpResponse;
                                                                                  import org.apache.http.client.methods.HttpGet;
                                                                                  import org.apache.http.impl.client.CloseableHttpClient;
                                                                                  import org.apache.http.impl.client.HttpClients;
                                                                                  
                                                                                  public class Main
                                                                                  {
                                                                                    static class TokenResponse
                                                                                    {
                                                                                      String access_token;
                                                                                    }
                                                                                  
                                                                                    static class Layer
                                                                                    {
                                                                                      String digest;
                                                                                  
                                                                                      long size;
                                                                                    }
                                                                                  
                                                                                    static class ManifestResponse
                                                                                    {
                                                                                      List layers;
                                                                                    }
                                                                                  
                                                                                    static String imageName = "your-image-name";
                                                                                  
                                                                                    static String repoName = "your-repo-name";
                                                                                  
                                                                                    static String base64EncodedUsernamePassword = "not-gonna-tell-ya";
                                                                                  
                                                                                    public static void main(String[] args) throws Exception {
                                                                                      try (CloseableHttpClient httpclient = HttpClients.createDefault()) {
                                                                                        HttpGet httpget = new HttpGet(
                                                                                            "https://auth.docker.io/token?service=registry.docker.io&scope=repository:" + repoName + "/" + imageName +
                                                                                                ":pull");
                                                                                        httpget.setHeader("Authorization", "Basic " + base64EncodedUsernamePassword);
                                                                                  
                                                                                        CloseableHttpResponse response = httpclient.execute(httpget);
                                                                                        String text = IOUtils.toString(response.getEntity().getContent(), StandardCharsets.UTF_8.name());
                                                                                        String token = new Gson().fromJson(text, TokenResponse.class).access_token;
                                                                                  
                                                                                        httpget = new HttpGet("https://registry-1.docker.io/v2/" + repoName + "/" + imageName + "/manifests/latest");
                                                                                        httpget.setHeader("Authorization", "Bearer " + token);
                                                                                        httpget.setHeader("Accept", "application/vnd.docker.distribution.manifest.v2+json");
                                                                                  
                                                                                        response = httpclient.execute(httpget);
                                                                                        text = IOUtils.toString(response.getEntity().getContent(), StandardCharsets.UTF_8.name());
                                                                                        ManifestResponse manifestResponse = new Gson().fromJson(text, ManifestResponse.class);
                                                                                  
                                                                                        List files = new ArrayList<>();
                                                                                  
                                                                                        int counter = 100;
                                                                                  
                                                                                        for (Layer layer : manifestResponse.layers) {
                                                                                          System.out.println("Downloading layer: " + layer.digest);
                                                                                          System.out.println("Layer size:" + layer.size + " bytes.(" + ((double) layer.size) / 1_000_000 + " MB)");
                                                                                          httpget =
                                                                                              new HttpGet("https://registry-1.docker.io/v2/" + repoName + "/" + imageName + "/blobs/" + layer.digest);
                                                                                          httpget.setHeader("Authorization", "Bearer " + token);
                                                                                          httpget.setHeader("Accept", "application/vnd.docker.distribution.manifest.v2+json");
                                                                                  
                                                                                          response = httpclient.execute(httpget);
                                                                                          File targetFile = new File(counter + "_" + layer.digest.substring(7, 17) + ".tar");
                                                                                          counter++;
                                                                                          files.add(targetFile);
                                                                                  
                                                                                          InputStream inputStream = response.getEntity().getContent();
                                                                                          OutputStream outputStream = new FileOutputStream(targetFile);
                                                                                          IOUtils.copy(inputStream, outputStream);
                                                                                          outputStream.close();
                                                                                        }
                                                                                  
                                                                                        for (File file : files) {
                                                                                          TarArchiveInputStream tarInput = new TarArchiveInputStream(new GZIPInputStream(new FileInputStream(file)));
                                                                                          TarArchiveEntry entry;
                                                                                          while (null != (entry = tarInput.getNextTarEntry())) {
                                                                                            System.out.println(entry.getName());
                                                                                          }
                                                                                          System.out.println("==========");
                                                                                        }
                                                                                      }
                                                                                    }
                                                                                  }
                                                                                  

                                                                                  ANSWER

                                                                                  Answered 2021-Dec-05 at 23:05

                                                                                  Does it make sense to iterate through layers like this and keep adding files (to some target, does not matter for now) and deleting the added files in case they are found with a .wh prefix? Or am I totally off and is there a much better way?

                                                                                  There is a much better way, you do not want to reimplement (with worse performances) what Docker already does. The main reason is that Docker uses a mount filesystem called overlay2 by default that allows the creation of images and containers leveraging the concepts of a Union Filesystem: lowerdir, upperdir, workdir and mergeddir.

                                                                                  What you might not expect is that you can reproduce an image or container building process using the mount command available in almost any Unix-like machine.

                                                                                  I found a very interesting article that explains how the overlay storage system works and how Docker internally uses it, I highly recommend the reading.

                                                                                  Actually, if you have read the article, the solution is there: you can mount the image data you have by docker inspecting its LowerDir, UpperDir, WorkDir and by setting the merged dir to a custom path. To make the process simpler, you can run a script like:

                                                                                  image="testing"
                                                                                  targetDir="target"
                                                                                  lowerDir="$(docker inspect --format "{{ .GraphDriver.Data.LowerDir }}" $image)"
                                                                                  upperDir="$(docker inspect --format "{{ .GraphDriver.Data.UpperDir }}" $image)"
                                                                                  workDir="$(docker inspect --format "{{ .GraphDriver.Data.WorkDir }}" $image)"
                                                                                  mergedDir="/mnt/$targetDir"
                                                                                  
                                                                                  sudo mkdir "$mergedDir"
                                                                                  echo "mounting in $mergedDir ..."
                                                                                  sudo mount -t overlay -o lowerdir=$lowerDir,upperdir=$upperDir,workdir=$workDir overlay "$mergedDir"
                                                                                  echo "copying $mergedDir in $targetDir/ ..."
                                                                                  sudo cp -a "$mergedDir/." "$targetDir/" 
                                                                                  echo "unmounting $mergedDir ..."
                                                                                  sudo umount overlay
                                                                                  sudo rmdir "$mergedDir"
                                                                                  

                                                                                  Perhaps you can mount the image filesystem directly in the target directory instead of passing through /mnt/$targetDir. I am not an expert on this topic, therefore I have preferred an intermediate step so that I can eventually umount it.

                                                                                  Alternative solution (... not quite)

                                                                                  The first thing I thought when I read your question was the docker cp command. Basically, a not completely correct solution would be to create a container (not run it) and then copy the entire filesystem of it in the hosting machine. This is done with:

                                                                                  docker create your_image sh
                                                                                  

                                                                                  Instead of sh you can put whatever you want, it will not be executed anyway because you are not interested in starting the container

                                                                                  Next, copying and exporting the root folder with:

                                                                                  docker cp your_container_name:/ custom_directory
                                                                                  
                                                                                  Why is this not a completely correct answer?

                                                                                  By inspecting the LowerDir of the container, with

                                                                                  docker inspect --format "{{ json .GraphDriver.Data }}" container_name
                                                                                  

                                                                                  You will notice that there is an additional layer in the form of -init, used to initialize the container.

                                                                                  You can even find the files added in this layer by running a tree on that directory.

                                                                                  Extra 1

                                                                                  I could not find any documentation on what .wh stands for..

                                                                                  I have found the image specification that explains what a .wh file means. Basically every layer stores the changeset applied to that layer instead of the entire image created up to that moment. How can you store a deletion? By reserving a special file format that tells to the following layers that the deleted file does not exist anymore. These files are called white-out files and

                                                                                  For this reason, it is not possible to create an image root filesystem which contains a file or directory with a name beginning with .wh.

                                                                                  Extra 2

                                                                                  If you need a command-line tool that inspect image layers, I suggest you skopeo. I discovered it by watching a talk in this year's DockerCON and it seems very good. To export the layers of an image you can run:

                                                                                  skopeo copy docker-daemon:your_image:your_tag "dir:$(pwd)/dir_for_layers"
                                                                                  

                                                                                  Source https://stackoverflow.com/questions/70176754

                                                                                  QUESTION

                                                                                  Sagemaker Serverless Inference & custom container: Model archiver subprocess fails
                                                                                  Asked 2021-Dec-16 at 16:11

                                                                                  I would like to host a model on Sagemaker using the new Serverless Inference.

                                                                                  I wrote my own container for inference and handler following several guides. These are the requirements:

                                                                                  mxnet
                                                                                  multi-model-server
                                                                                  sagemaker-inference
                                                                                  retrying
                                                                                  nltk
                                                                                  transformers==4.12.4
                                                                                  torch==1.10.0
                                                                                  

                                                                                  On non-serverless endpoints, this container works perfectly well. However, with the serverless version I get the following error message when loading the model:

                                                                                  ERROR - /.sagemaker/mms/models/model already exists.
                                                                                  

                                                                                  The error is thrown by the following subprocess

                                                                                  ['model-archiver', '--model-name', 'model', '--handler', '/home/model-server/handler_service.py:handle', '--model-path', '/opt/ml/model', '--export-path', '/.sagemaker/mms/models', '--archive-format', 'no-archive']
                                                                                  

                                                                                  So something that has to do with the model-archiver (which I guess is a process from the MMS package?).

                                                                                  ANSWER

                                                                                  Answered 2021-Dec-14 at 09:30

                                                                                  One possibility is that the serverless sagemaker version is trying to write the model in the same place that you have already wrote it in your inference container.

                                                                                  Maybe review your custom inference code and don't load the model there.

                                                                                  Source https://stackoverflow.com/questions/70335049

                                                                                  QUESTION

                                                                                  Caused by: java.lang.IllegalAccessError: superclass access check class apache (in module x) that cannot access another apache class (in mod y)
                                                                                  Asked 2021-Dec-13 at 13:26

                                                                                  I'm new to modularized java 16 projects as well as using the maven build system whilst trying to implement the program using IntelliJ, JAVAFX and APACHE POI-OOXML.

                                                                                  For simplicity, I am implementing a button's event handler that instantiates a class that is responsible for using Apache: ControllerCode

                                                                                  The problem then happens here: line 24 of this code

                                                                                  Here is the stack trace:

                                                                                  Exception in thread "JavaFX Application Thread" java.lang.RuntimeException: java.lang.reflect.InvocationTargetException
                                                                                      at javafx.fxml/javafx.fxml.FXMLLoader$MethodHandler.invoke(FXMLLoader.java:1862)
                                                                                      at javafx.fxml/javafx.fxml.FXMLLoader$ControllerMethodEventHandler.handle(FXMLLoader.java:1729)
                                                                                      at javafx.base/com.sun.javafx.event.CompositeEventHandler.dispatchBubblingEvent(CompositeEventHandler.java:86)
                                                                                      at javafx.base/com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:234)
                                                                                      at javafx.base/com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:191)
                                                                                      at javafx.base/com.sun.javafx.event.CompositeEventDispatcher.dispatchBubblingEvent(CompositeEventDispatcher.java:59)
                                                                                      at javafx.base/com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:58)
                                                                                      at javafx.base/com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
                                                                                      at javafx.base/com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56)
                                                                                      at javafx.base/com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
                                                                                      at javafx.base/com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56)
                                                                                      at javafx.base/com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
                                                                                      at javafx.base/com.sun.javafx.event.EventUtil.fireEventImpl(EventUtil.java:74)
                                                                                      at javafx.base/com.sun.javafx.event.EventUtil.fireEvent(EventUtil.java:49)
                                                                                      at javafx.base/javafx.event.Event.fireEvent(Event.java:198)
                                                                                      at javafx.graphics/javafx.scene.Node.fireEvent(Node.java:8889)
                                                                                      at javafx.controls/javafx.scene.control.Button.fire(Button.java:203)
                                                                                      at javafx.controls/com.sun.javafx.scene.control.behavior.ButtonBehavior.mouseReleased(ButtonBehavior.java:208)
                                                                                      at javafx.controls/com.sun.javafx.scene.control.inputmap.InputMap.handle(InputMap.java:274)
                                                                                      at javafx.base/com.sun.javafx.event.CompositeEventHandler$NormalEventHandlerRecord.handleBubblingEvent(CompositeEventHandler.java:247)
                                                                                      at javafx.base/com.sun.javafx.event.CompositeEventHandler.dispatchBubblingEvent(CompositeEventHandler.java:80)
                                                                                      at javafx.base/com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:234)
                                                                                      at javafx.base/com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:191)
                                                                                      at javafx.base/com.sun.javafx.event.CompositeEventDispatcher.dispatchBubblingEvent(CompositeEventDispatcher.java:59)
                                                                                      at javafx.base/com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:58)
                                                                                      at javafx.base/com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
                                                                                      at javafx.base/com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56)
                                                                                      at javafx.base/com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
                                                                                      at javafx.base/com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56)
                                                                                      at javafx.base/com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
                                                                                      at javafx.base/com.sun.javafx.event.EventUtil.fireEventImpl(EventUtil.java:74)
                                                                                      at javafx.base/com.sun.javafx.event.EventUtil.fireEvent(EventUtil.java:54)
                                                                                      at javafx.base/javafx.event.Event.fireEvent(Event.java:198)
                                                                                      at javafx.graphics/javafx.scene.Scene$MouseHandler.process(Scene.java:3856)
                                                                                      at javafx.graphics/javafx.scene.Scene.processMouseEvent(Scene.java:1851)
                                                                                      at javafx.graphics/javafx.scene.Scene$ScenePeerListener.mouseEvent(Scene.java:2584)
                                                                                      at javafx.graphics/com.sun.javafx.tk.quantum.GlassViewEventHandler$MouseEventNotification.run(GlassViewEventHandler.java:409)
                                                                                      at javafx.graphics/com.sun.javafx.tk.quantum.GlassViewEventHandler$MouseEventNotification.run(GlassViewEventHandler.java:299)
                                                                                      at java.base/java.security.AccessController.doPrivileged(AccessController.java:391)
                                                                                      at javafx.graphics/com.sun.javafx.tk.quantum.GlassViewEventHandler.lambda$handleMouseEvent$2(GlassViewEventHandler.java:447)
                                                                                      at javafx.graphics/com.sun.javafx.tk.quantum.QuantumToolkit.runWithoutRenderLock(QuantumToolkit.java:412)
                                                                                      at javafx.graphics/com.sun.javafx.tk.quantum.GlassViewEventHandler.handleMouseEvent(GlassViewEventHandler.java:446)
                                                                                      at javafx.graphics/com.sun.glass.ui.View.handleMouseEvent(View.java:556)
                                                                                      at javafx.graphics/com.sun.glass.ui.View.notifyMouse(View.java:942)
                                                                                      at javafx.graphics/com.sun.glass.ui.mac.MacView.notifyMouse(MacView.java:127)
                                                                                  Caused by: java.lang.reflect.InvocationTargetException
                                                                                      at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                                                                                      at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:78)
                                                                                      at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
                                                                                      at java.base/java.lang.reflect.Method.invoke(Method.java:567)
                                                                                      at com.sun.javafx.reflect.Trampoline.invoke(MethodUtil.java:76)
                                                                                      at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                                                                                      at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:78)
                                                                                      at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
                                                                                      at java.base/java.lang.reflect.Method.invoke(Method.java:567)
                                                                                      at javafx.base/com.sun.javafx.reflect.MethodUtil.invoke(MethodUtil.java:273)
                                                                                      at javafx.fxml/com.sun.javafx.fxml.MethodHelper.invoke(MethodHelper.java:83)
                                                                                      at javafx.fxml/javafx.fxml.FXMLLoader$MethodHandler.invoke(FXMLLoader.java:1859)
                                                                                      ... 44 more
                                                                                  Caused by: java.lang.IllegalAccessError: superclass access check failed: class org.apache.poi.openxml4j.util.ZipSecureFile (in module org.apache.poi.ooxml) cannot access class org.apache.commons.compress.archivers.zip.ZipFile (in unnamed module @0x2db197a2) because module org.apache.poi.ooxml does not read unnamed module @0x2db197a2
                                                                                      at java.base/java.lang.ClassLoader.defineClass1(Native Method)
                                                                                      at java.base/java.lang.ClassLoader.defineClass(ClassLoader.java:1010)
                                                                                      at java.base/java.lang.ClassLoader.defineClass(ClassLoader.java:1088)
                                                                                      at java.base/java.security.SecureClassLoader.defineClass(SecureClassLoader.java:182)
                                                                                      at java.base/jdk.internal.loader.BuiltinClassLoader.defineClass(BuiltinClassLoader.java:814)
                                                                                      at java.base/jdk.internal.loader.BuiltinClassLoader.findClassInModuleOrNull(BuiltinClassLoader.java:735)
                                                                                      at java.base/jdk.internal.loader.BuiltinClassLoader.loadClassOrNull(BuiltinClassLoader.java:660)
                                                                                      at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:634)
                                                                                      at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:182)
                                                                                      at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:519)
                                                                                      at org.apache.poi.ooxml/org.apache.poi.openxml4j.opc.OPCPackage.create(OPCPackage.java:379)
                                                                                      at org.apache.poi.ooxml/org.apache.poi.xwpf.usermodel.XWPFDocument.newPackage(XWPFDocument.java:140)
                                                                                      at org.apache.poi.ooxml/org.apache.poi.xwpf.usermodel.XWPFDocument.(XWPFDocument.java:130)
                                                                                      at com.example.demo3/com.example.demo3.DataManager.createLessonWord(DataManager.java:24)
                                                                                      at com.example.demo3/com.example.demo3.HelloController.onHelloButtonClick(HelloController.java:23)
                                                                                      ... 56 more
                                                                                  

                                                                                  I am completely new to all of these but I feel as though this line from the stack trace above is the culprit:

                                                                                  Caused by: java.lang.IllegalAccessError: superclass access check failed: class org.apache.poi.openxml4j.util.ZipSecureFile (in module org.apache.poi.ooxml) cannot access class org.apache.commons.compress.archivers.zip.ZipFile (in unnamed module @0x2db197a2) because module org.apache.poi.ooxml does not read unnamed module @0x2db197a2
                                                                                  

                                                                                  Here is the module-info:

                                                                                  module com.example.demo3 {
                                                                                      requires javafx.controls;
                                                                                      requires javafx.fxml;
                                                                                      requires org.apache.poi.ooxml;
                                                                                  
                                                                                  
                                                                                      opens com.example.demo3 to javafx.fxml;
                                                                                  
                                                                                      exports com.example.demo3;
                                                                                  } 
                                                                                  

                                                                                  My maven dependencies:

                                                                                  
                                                                                      
                                                                                          org.openjfx
                                                                                          javafx-controls
                                                                                          16
                                                                                      
                                                                                      
                                                                                          org.controlsfx
                                                                                          controlsfx
                                                                                          11.1.0
                                                                                      
                                                                                      
                                                                                          org.junit.jupiter
                                                                                          junit-jupiter-engine
                                                                                          ${junit.version}
                                                                                          test
                                                                                      
                                                                                      
                                                                                          org.apache.poi
                                                                                          poi-ooxml
                                                                                          5.0.0
                                                                                      
                                                                                   
                                                                                  

                                                                                  I would appreciate all help that I can get :)

                                                                                  ANSWER

                                                                                  Answered 2021-Dec-12 at 05:38

                                                                                  A piece as it says about a zip archive in the error. There is no actual stream assigned with the place e,g, you have a String path but analogous there is not actually so much as an actual .io.File related part of the code. There is however a constructor for such document that takes a Stream argument on construction.

                                                                                  Source https://stackoverflow.com/questions/70320899

                                                                                  QUESTION

                                                                                  Java Web Application Failed to run as maven project
                                                                                  Asked 2021-Dec-09 at 03:11

                                                                                  I am new to java . I am using apache netbeans 12.2 version to create new project and the java version is 17 . I followed the step to create java web application with maven but when I build it and try to run it I am getting following errors in the console window.

                                                                                  Failed to execute goal org.apache.maven.plugins:maven-war-plugin:2.3:war (default-war) on project JavaProject: Execution default-war of goal org.apache.maven.plugins:maven-war-plugin:2.3:war failed: Unable to load the mojo 'war' in the plugin 'org.apache.maven.plugins:maven-war-plugin:2.3' due to an API incompatibility: org.codehaus.plexus.component.repository.exception.ComponentLookupException: null

                                                                                  I checked in pom.xml file the required dependency already there , But why it not able to run?.

                                                                                  Here is the Pom.xml code .

                                                                                  
                                                                                      4.0.0
                                                                                      com.mycompany
                                                                                      JavaProject
                                                                                      1.0-SNAPSHOT
                                                                                      war
                                                                                      JavaProject-1.0-SNAPSHOT
                                                                                      
                                                                                      
                                                                                          1.8
                                                                                          1.8
                                                                                          ${project.build.directory}/endorsed
                                                                                          UTF-8
                                                                                          false
                                                                                          8.0
                                                                                      
                                                                                      
                                                                                      
                                                                                          
                                                                                              javax
                                                                                              javaee-api
                                                                                              ${jakartaee}
                                                                                              provided
                                                                                          
                                                                                      
                                                                                      
                                                                                       
                                                                                          
                                                                                              
                                                                                                  org.apache.maven.plugins
                                                                                                  maven-compiler-plugin
                                                                                                  3.1
                                                                                                  
                                                                                                      1.8
                                                                                                      1.8
                                                                                                      
                                                                                                          ${endorsed.dir}
                                                                                                      
                                                                                                  
                                                                                              
                                                                                              
                                                                                                  org.apache.maven.plugins
                                                                                                  maven-war-plugin
                                                                                                  2.3
                                                                                                  
                                                                                                      false
                                                                                                  
                                                                                              
                                                                                             
                                                                                              
                                                                                                  org.apache.maven.plugins
                                                                                                  maven-dependency-plugin
                                                                                                  2.6
                                                                                                  
                                                                                                      
                                                                                                          validate
                                                                                                          
                                                                                                              copy
                                                                                                          
                                                                                                          
                                                                                                              ${endorsed.dir}
                                                                                                              true
                                                                                                              
                                                                                                                  
                                                                                                                      javax
                                                                                                                      javaee-api
                                                                                                                      ${jakartaee}
                                                                                                                      jar
                                                                                                                  
                                                                                                              
                                                                                                          
                                                                                                      
                                                                                                  
                                                                                              
                                                                                          
                                                                                      
                                                                                  
                                                                                  

                                                                                  Here is the entire console with error message.

                                                                                  Failed to execute goal org.apache.maven.plugins:maven-war-plugin:2.3:war (default-war) on project JavaProject: Execution default-war of goal org.apache.maven.plugins:maven-war-plugin:2.3:war failed: Unable to load the mojo 'war' in the plugin 'org.apache.maven.plugins:maven-war-plugin:2.3' due to an API incompatibility: org.codehaus.plexus.component.repository.exception.ComponentLookupException: null
                                                                                  -----------------------------------------------------
                                                                                  realm =    plugin>org.apache.maven.plugins:maven-war-plugin:2.3
                                                                                  strategy = org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy
                                                                                  urls[0] = file:/Users/mohammadhossan/.m2/repository/org/apache/maven/plugins/maven-war-plugin/2.3/maven-war-plugin-2.3.jar
                                                                                  urls[1] = file:/Users/mohammadhossan/.m2/repository/org/apache/maven/reporting/maven-reporting-api/2.0.6/maven-reporting-api-2.0.6.jar
                                                                                  urls[2] = file:/Users/mohammadhossan/.m2/repository/org/apache/maven/doxia/doxia-sink-api/1.0-alpha-7/doxia-sink-api-1.0-alpha-7.jar
                                                                                  urls[3] = file:/Users/mohammadhossan/.m2/repository/commons-cli/commons-cli/1.0/commons-cli-1.0.jar
                                                                                  urls[4] = file:/Users/mohammadhossan/.m2/repository/org/codehaus/plexus/plexus-interactivity-api/1.0-alpha-4/plexus-interactivity-api-1.0-alpha-4.jar
                                                                                  urls[5] = file:/Users/mohammadhossan/.m2/repository/org/apache/maven/maven-archiver/2.5/maven-archiver-2.5.jar
                                                                                  urls[6] = file:/Users/mohammadhossan/.m2/repository/org/codehaus/plexus/plexus-io/2.0.5/plexus-io-2.0.5.jar
                                                                                  urls[7] = file:/Users/mohammadhossan/.m2/repository/org/codehaus/plexus/plexus-archiver/2.2/plexus-archiver-2.2.jar
                                                                                  urls[8] = file:/Users/mohammadhossan/.m2/repository/org/codehaus/plexus/plexus-interpolation/1.15/plexus-interpolation-1.15.jar
                                                                                  urls[9] = file:/Users/mohammadhossan/.m2/repository/junit/junit/3.8.1/junit-3.8.1.jar
                                                                                  urls[10] = file:/Users/mohammadhossan/.m2/repository/com/thoughtworks/xstream/xstream/1.4.3/xstream-1.4.3.jar
                                                                                  urls[11] = file:/Users/mohammadhossan/.m2/repository/xmlpull/xmlpull/1.1.3.1/xmlpull-1.1.3.1.jar
                                                                                  urls[12] = file:/Users/mohammadhossan/.m2/repository/xpp3/xpp3_min/1.1.4c/xpp3_min-1.1.4c.jar
                                                                                  urls[13] = file:/Users/mohammadhossan/.m2/repository/org/codehaus/plexus/plexus-utils/3.0.8/plexus-utils-3.0.8.jar
                                                                                  urls[14] = file:/Users/mohammadhossan/.m2/repository/org/apache/maven/shared/maven-filtering/1.0-beta-2/maven-filtering-1.0-beta-2.jar
                                                                                  Number of foreign imports: 1
                                                                                  import: Entry[import  from realm ClassRealm[maven.api, parent: null]]
                                                                                  
                                                                                  -----------------------------------------------------
                                                                                  : ExceptionInInitializerError: Unable to make field private final java.util.Comparator java.util.TreeMap.comparator accessible: module java.base does not "opens java.util" to unnamed module @73bb1337
                                                                                  -> [Help 1]
                                                                                  
                                                                                  To see the full stack trace of the errors, re-run Maven with the -e switch.
                                                                                  Re-run Maven using the -X switch to enable full debug logging.
                                                                                  
                                                                                  For more information about the errors and possible solutions, please read the following articles:
                                                                                  [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginContainerException
                                                                                  

                                                                                  ANSWER

                                                                                  Answered 2021-Dec-09 at 03:11

                                                                                  Your version of Java is incompatible with your version of NetBeans because NetBeans 12.2 does not support the use of JDK 17. From the NetBeans 12.2 Release notes Downloading Apache NetBeans 12.2:

                                                                                  Apache NetBeans 12.2 runs on JDK LTS releases 8 and 11, as well as on JDK 15, i.e., the current JDK release at the time of this NetBeans release.

                                                                                  In general, when changing your version of NetBeans and/or Java, make sure that the versions are compatible. This is always documented in the NetBeans release notes.

                                                                                  You have two options to resolve this:

                                                                                  • Upgrade to NetBeans 12.6 which supports Java 17.
                                                                                  • Stay on NetBeans 12.2, but downgrade to Java 15 or lower. That is, make JDK 15 (or lower) your default platform for NetBeans 12.2.

                                                                                  Of course you may also have other issues with your project, but there is no point in worrying about those until you have fixed this problem.

                                                                                  Source https://stackoverflow.com/questions/70199864

                                                                                  Community Discussions, Code Snippets contain sources that include Stack Exchange Network

                                                                                  Vulnerabilities

                                                                                  No vulnerabilities reported

                                                                                  Install archiver

                                                                                  You can download it from GitHub.

                                                                                  Support

                                                                                  brotli (br)bzip2 (bz2)flate (zip)gzip (gz)lz4snappy (sz)xzzstandard (zst)
                                                                                  Find more information at:
                                                                                  Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
                                                                                  Find more libraries
                                                                                  Explore Kits - Develop, implement, customize Projects, Custom Functions and Applications with kandi kits​
                                                                                  Save this library and start creating your kit

                                                                                  Share this Page

                                                                                  share link

                                                                                  Explore Related Topics

                                                                                  Reuse Pre-built Kits with archiver

                                                                                  Consider Popular Compression Libraries

                                                                                  zstd

                                                                                  by facebook

                                                                                  Luban

                                                                                  by Curzibn

                                                                                  brotli

                                                                                  by google

                                                                                  upx

                                                                                  by upx

                                                                                  jszip

                                                                                  by Stuk

                                                                                  Try Top Libraries by mholt

                                                                                  PapaParse

                                                                                  by mholtJavaScript

                                                                                  json-to-go

                                                                                  by mholtJavaScript

                                                                                  timeliner

                                                                                  by mholtGo

                                                                                  curl-to-go

                                                                                  by mholtJavaScript

                                                                                  binding

                                                                                  by mholtGo

                                                                                  Compare Compression Libraries with Highest Support

                                                                                  zstd

                                                                                  by facebook

                                                                                  brotli

                                                                                  by google

                                                                                  ZipArchive

                                                                                  by ZipArchive

                                                                                  SharpZipLib

                                                                                  by icsharpcode

                                                                                  Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
                                                                                  Find more libraries
                                                                                  Explore Kits - Develop, implement, customize Projects, Custom Functions and Applications with kandi kits​
                                                                                  Save this library and start creating your kit