0

When I am trying to run my app I have the following error message :

cannot Deploy pro_jpa
deploy is failing=Error occurred during deployment: Exception while deploying the app [pro_jpa] : java.lang.NoClassDefFoundError: com/google/common/cache/CacheLoader. Please see server.log for more details.

So I add this to my pom :

<!-- https://mvnrepository.com/artifact/com.google.guava/guava -->
    <dependency>
        <groupId>com.google.guava</groupId>
        <artifactId>guava</artifactId>
        <version>10.0.1</version>
    </dependency>

But it didn't fix the issue even if it supposed to add the needed jar to the app.

I also tried to add the guava.jar to the server lib but it doesn't change anything.

If anyone has an idea thank you.

Federico klez Culloca
  • 26,308
  • 17
  • 56
  • 95
Quentin M
  • 171
  • 2
  • 11

2 Answers2

0

Add the runtime scope to the dependency in pom.xml, to get it available at runtime:

<scope>runtime</scope>
Serge
  • 194
  • 6
  • Hi, same issue with the runtime scope. BTW I thought that if you do not declare scope the dependency is available for all scope, am I wrong ? – Quentin M Jun 03 '20 at 13:02
  • Default is compile scope. It´s not quite clear how the app is structured / built / deployed. In any case, the guava jar has to be on the class path at run time (the lib directory?). – Serge Jun 03 '20 at 18:57
0

I have no more this issues when I am working with version 2.3 of the web app it is only appearing when I am using version 3.0. I am using BoneCP and glassfish so the issue may comes from it. To solve it I need to add the jar to the domaine itself in glassfish under : glassfish5\glassfish\domains[domain name]\lib\ext

I end with this jar :

  • bonecp-0.8.0-rc1.jar
  • guava-29.0-jre.jar
  • mysql-connector-java-8.0.20.jar
  • slf4j-api-1.7.30.jar
Quentin M
  • 171
  • 2
  • 11