美好的一天,
基于,
我用我的 wsdl
文件成功了Web服务。与网站不同的是,我在 jboss EAP
中启动我的Web服务,该教程将使用 tomcat
作为例如。
我可以成功地卷入http:// localhost:8080/eai/services/mydelegatebeanservice。
我想在 myDelegateBeanServicesKeleton.java
文件中进行一些更改,例如,我需要一些第三方库,例如 com.google.guava
。因此,我尝试在此项目上添加Gradle。
我创建一个build.gradle如下:
apply plugin: 'java'
apply plugin: 'eclipse'
apply plugin: 'application'
mainClassName = "myeai"
repositories {
mavenCentral()
}
sourceCompatibility = 1.8
targetCompatibility = 1.8
dependencies {
implementation "com.google.guava:guava:17.0"
testImplementation "junit:junit:4.12"
}
我可以运行 gradle build
, gradle eclipse
而无需错误,我可以看到 guava
库出现在参考库中:
在我的Java代码中,我可以看到我的导入也没有编译错误:
import com.google.common.base.Strings;
System.out.println("item is " + Strings.isNullOrEmpty(reader.getText()));
但是,当我再次卷曲时,我会遇到以下错误:
[ERROR] com/google/common/base/Strings
java.lang.NoClassDefFoundError: com/google/common/base/Strings
Caused by: java.lang.ClassNotFoundException: com.google.common.base.Strings from [Module "deployment.allpocEAR.ear.eai.war" from Service Module Loader]
at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:198)
at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:412)
at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:400)
at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:116)
... 47 more
我可以知道我的错误是什么?
我尝试在JBOSS中重新启动我的EAP服务器也一样:
Good day,
Base on https://www.eclipse.org/webtools/community/tutorials/TopDownAxis2WebService/td_tutorial.html ,
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 MyDelegateBeanServiceSkeleton.java
file, and I need some third party library, for example, com.google.guava
. 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 {
mavenCentral()
}
sourceCompatibility = 1.8
targetCompatibility = 1.8
dependencies {
implementation "com.google.guava:guava:17.0"
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:
In my java code, I can see my import is without compilation error as well:
import com.google.common.base.Strings;
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: com.google.common.base.Strings from [Module "deployment.allpocEAR.ear.eai.war" from Service Module Loader]
at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:198)
at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:412)
at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:400)
at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:116)
... 47 more
May I know what is my mistaken?
I have try to restart my EAP server in jboss also the same:
发布评论
评论(1)
我发现我应该使用编译而不是实现:
I found that I should use compile instead of implementation: