Eclipse dynamic project hit java.lang.NoClassDefFoundError even add dependencies in build.gradle

Good day,

Base on Eclipse WTP Tutorials - Creating Top Down Web Service via Apache Axis2 , I successful up the web service with my wsdl file. The different thing from the website is, I start my webservice in Jboss EAP , the tutorial was using TomCat as example.

I can curl request to http://localhost:8080/eai/services/MyDelegateBeanService successfully.

I would like to make some changes inside the file, and I need some third party library, for example, . Thus, I try to add gradle on this project.

I create a build.gradle as follow:

apply plugin: 'java'
apply plugin: 'eclipse'
apply plugin: 'application'

mainClassName = "myeai"

repositories { 

sourceCompatibility = 1.8
targetCompatibility = 1.8

dependencies {
    implementation ""
    testImplementation "junit:junit:4.12"

I can run gradle build , gradle eclipse successfully without error, and I can see the guava library appear in the reference library: enter image description here

In my java code, I can see my import is without compilation error as well:


System.out.println("item is " + Strings.isNullOrEmpty(reader.getText()));

However, when I curl again, I will hit the following error:

[ERROR] com/google/common/base/Strings
java.lang.NoClassDefFoundError: com/google/common/base/Strings

Caused by: java.lang.ClassNotFoundException: from [Module "deployment.allpocEAR.ear.eai.war" from Service Module Loader]
    at org.jboss.modules.ModuleClassLoader.findClass(
    at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(
    at org.jboss.modules.ConcurrentClassLoader.performLoadClass(
    at org.jboss.modules.ConcurrentClassLoader.loadClass(
    ... 47 more

May I know what is my mistaken?

I have try to restart my EAP server in jboss also the same.