0

I am trying to build a webapp with JavaEE and glassfish server with firebase admin sdk. The server runs properly until it crashes after a login screen with a java.lang.NoClassDefFoundError:

com/google/firebase/FirebaseOptions$Builder root cause : java.lang.ClassNotFoundException: com.google.firebase.FirebaseOptions$Builder in my browser.

I searched and tried many solutions but none have led me anywhere. For example it was recommended to make sure my artifact has all the dependencies. I've done that, and still now.... I do get the fact that the firebase classes are available at compile time but somehow are not available at runtime.

My pom.xml :

    <?xml version="1.0" encoding="UTF-8"?>
    <project xmlns="http://maven.apache.org/POM/4.0.0"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
         http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<groupId>groupId</groupId>
<artifactId>CustomerNetwork</artifactId>
<version>1.0-SNAPSHOT</version>

<dependencies>
    <dependency>
        <groupId>com.google.guava</groupId>
        <artifactId>guava</artifactId>
        <version>23.6-jre</version>
    </dependency>
    <dependency>
        <groupId>javax</groupId>
        <artifactId>javaee-api</artifactId>
        <version>8.0</version>
        <scope>provided</scope>
    </dependency>
    <dependency>
        <groupId>com.google.firebase</groupId>
        <artifactId>firebase-admin</artifactId>
        <version>6.12.2</version>
    </dependency>
</dependencies>

My artifact: (a screenshot from intellij)

enter image description here

If you need more info or the code in my classes, let me know. Or if this question is a duplicate, lead me to the question that hopefully has the answer am looking for.

Cindy Meister
  • 25,071
  • 21
  • 34
  • 43
itwabi
  • 125
  • 10

0 Answers0