isis-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jayesh Prajapati <jayesh...@gmail.com>
Subject Application fail to start when dependencies on PDFBox is added
Date Fri, 09 Nov 2018 13:58:50 GMT
Hi,

I am using Apache ISIS 2.x for a project that can read various documents
like excel, csv, pdf, etc.

When I add below dependencies in application pom.xml and try to start
application using jetty:run it fails with "Exception: Timeout scanning
annotations"

<dependency>
<groupId>org.apache.pdfbox</groupId>
<artifactId>pdfbox</artifactId>
<version>2.0.11</version>
</dependency>

<dependency>
<groupId>org.bouncycastle</groupId>
<artifactId>bcprov-jdk15on</artifactId>
<version>1.60</version>
</dependency>

<dependency>
<groupId>org.bouncycastle</groupId>
<artifactId>bcmail-jdk15on</artifactId>
<version>1.60</version>
</dependency>

<dependency>
<groupId>org.bouncycastle</groupId>
<artifactId>bcpkix-jdk15on</artifactId>
<version>1.60</version>
</dependency>

It is very easy to replicate, simply add these dependencies in simple app's
application pom.xml file and try to run it using jetty:run.

It took me very long to troubleshoot this issue and finally came to know
that it is related to jetty & bouncycastle. Refer [1]

The way I have fixed it is ...
1) Add below plugin entry in pom.xml of webapp

<plugin>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-maven-plugin</artifactId>
<configuration>
<contextXml>jetty-web.xml</contextXml>
</configuration>
</plugin>

2) Create jetty-web.xml with below content in the working directory of
jetty:run

<?xml version="1.0" encoding="UTF-8"?>
<Configure class="org.eclipse.jetty.webapp.WebAppContext">
    <Call name="setAttribute">
        <Arg>org.eclipse.jetty.server.webapp.WebInfIncludeJarPattern</Arg>
        <Arg>^((?!bcprov).)*$</Arg>
    </Call>
</Configure>

Is there any better way to solve this?

Thanks,
Jayesh
[1] -
https://stackoverflow.com/questions/31513037/jetty-startup-is-slow-with-bouncycastle-included-in-classpath

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message