Problem using Gson on Wildfly

0

I'm trying to use GSON in a Maven EJB project but it gives the following error:

  

java.lang.NoClassDefFoundError: com/google/gson/Gson

When I test in the main class without going up the server lib works normally.

Has anyone had a similar problem?

    
asked by anonymous 24.02.2017 / 15:46

1 answer

0

In the case of the JSP / Servlet Web application, simply copy the GSon JAR into the / WEB-INF / lib folder. If it is a project using maven add

<dependency>
    <groupId>com.google.code.gson</groupId>
    <artifactId>gson</artifactId>
    <version>2.8.0</version>
</dependency>

ao pom.

link

Depending on your ide, you need to do a clean and a re-build on the project

    
27.02.2017 / 16:06