Search code examples
javaeclipseglassfishnoclassdeffounderrorclassnotfoundexception

Deploymennt issues, class not found even if in pom


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.


Solution

  • 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