# groovy : unable to resolv class org.apache.pdfbox...

**URL:** <https://community.ofelia.com/t/groovy-unable-to-resolv-class-org-apache-pdfbox/11070>\
**Category:** Q&A\
**Created:** [21 January 2022 12:22 UTC](https://community.ofelia.com/t/groovy-unable-to-resolv-class-org-apache-pdfbox/11070 "2022-01-21T12:22:15Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![loze](https://avatars.discourse-cdn.com/v4/letter/l/7bcc69/32.png) [@loze](https://community.ofelia.com/u/loze)\
**Post date:** [21 January 2022 12:22 UTC](https://community.ofelia.com/t/groovy-unable-to-resolv-class-org-apache-pdfbox/11070/1 "2022-01-21T12:22:15Z")

</div>

```
Bonjour :-)
```

&nbsp;

When I upload this pdfbox-2.0.13.jar in Resources, it doesn't work. I cannot figure why.

My groovy script always failed on the line:

```
import org.apache.pdfbox.pdmodel.PDDocument
```

with this message 'cannot resolv class'.

I also notice that the automatic completion does not work when I am editing.

For Instance, the autocompletion&nbsp;should suggest several methods, like this one :

```
PDDocument.load()
```

So I upgraded my Bonita Studio and I tested a script with a completely different jar file in Resources : commons.math3-3.6.1.jar

This time, the behaviour is correct. Autocompletion and execution are fine.

&nbsp;

I suspect that&nbsp;my pdfbox jar is not accepted, maybe because it depends on others libs but I can't find what they are. So I run the same script outside Bonita, in Visual Studio Code, and the script runs fine because&nbsp;Grab() gets all the dependencies needed.

commons-logging-1.2.jar , pdfbox-2.0.13.jar , fontbox-2.0.13.jar

&nbsp;

But adding these&nbsp;libs in Resources does not solve the problem. Changing the version neither, I tried the latest 2.0.25.

What am I missing ? Is there anywhere a log file to trick the mystery bug ?

&nbsp;

Thanks a lot for your help.

---

<div class="post-metadata">

**Author:** ![romain.bioteau](https://dub1.discourse-cdn.com/flex013/user_avatar/community.ofelia.com/romain.bioteau/32/720_2.png) [@romain.bioteau](https://community.ofelia.com/u/romain.bioteau)\
**Post date:** [25 January 2022 09:38 UTC](https://community.ofelia.com/t/groovy-unable-to-resolv-class-org-apache-pdfbox/11070/2 "2022-01-25T09:38:35Z")

</div>

Hi Ioze,

In 2021.2 the dependency mechanism has been updated to use maven under the hood.  
It means that you should not have to take too much care of guessing what transitive dependencies are required for a given dep.  
The easiest way to add a dependency to a process (or a script used in that process) is to go in the project Overview \> Extension view. Then you click on Add a custom extension \> other…  
From there, you can select the proper maven coordinate for your dependency (this dependency must be available on [Maven Central](https://search.maven.org/) or whatever remote repository you have configured).

So in your case, it is something like:

- groupId: `org.apache.pdfbox`
- artifactId: `pdfbox`
- version: `2.0.13`

Then in the process configuration of your process, navigate to `Process dependencies > Other > Add...` and select `pdfbox-2.0.13`. It should add pdfbox and its transitive dependencies in your process class-path.

HTH  
Romain

---

<div class="post-metadata">

**Author:** ![romain.bioteau](https://dub1.discourse-cdn.com/flex013/user_avatar/community.ofelia.com/romain.bioteau/32/720_2.png) [@romain.bioteau](https://community.ofelia.com/u/romain.bioteau)\
**Post date:** [24 January 2022 10:11 UTC](https://community.ofelia.com/t/groovy-unable-to-resolv-class-org-apache-pdfbox/11070/3 "2022-01-24T10:11:05Z")

</div>

Hi,

What version of Bonita are you using ?

---

<div class="post-metadata">

**Author:** ![loze](https://avatars.discourse-cdn.com/v4/letter/l/7bcc69/32.png) [@loze](https://community.ofelia.com/u/loze)\
**Post date:** [24 January 2022 13:22 UTC](https://community.ofelia.com/t/groovy-unable-to-resolv-class-org-apache-pdfbox/11070/4 "2022-01-24T13:22:39Z")

</div>

The last one, installed on windows 10

Bonita Community Edition  
Version : 2021.2  
Version id : u0  
Build id : 7.13.0  
&nbsp;

Thank you, Romain. :)

---

<div class="post-metadata">

**Author:** ![loze](https://avatars.discourse-cdn.com/v4/letter/l/7bcc69/32.png) [@loze](https://community.ofelia.com/u/loze)\
**Post date:** [28 January 2022 10:09 UTC](https://community.ofelia.com/t/groovy-unable-to-resolv-class-org-apache-pdfbox/11070/5 "2022-01-28T10:09:02Z")

</div>

Merci Romain. It is working fine now.

Right Click on "My project" \> Maven \> Add Dependency
