包 javax.xml.namespace 可以从多个模块访问:<unnamed>, eclipse webservice 中的 java.xml [英] The package javax.xml.namespace is accessible from more than one module: <unnamed>, java.xml in eclipse webservice
问题描述
我在eclipse动态项目中运行score和scoreservices类我创建了一个网络服务并运行它,但它给我错误说包 javax.xml.namespace 可以从多个模块访问:<unnamed>, java.xml
.不知道如何处理这个输出
Im running a score and scoreservices class in eclipse dynamic project
i created a webservice and ran it but it gives me errors saying The package javax.xml.namespace is accessible from more than one module: <unnamed>, java.xml
. Dont know what to do with this output
评分等级
package startAgain;
import javax.xml.bind.annotation.*;
@XmlType
@XmlAccessorType(XmlAccessType.FIELD)
public class Score {
public int wins, losses, ties;
}
ScoreServies 类
ScoreServies class
package startAgain;
import javax.ejb.*;
import javax.jws.*;
@Stateless
@WebService
public class ScoreService {
private static Score score = new Score();
public Score updateScore (int wins, int losses, int ties) {
score.wins = wins;
score.losses = losses;
score.ties = ties;
return score;
}
@WebMethod(operationName="resetScore")
public void reset() {
score.wins = score.losses = score.ties = 0;
}
public Score getScore() { return score; }
public int increaseWins() { return score.wins++; }
public int increaseTies() { return ++score.ties; }
public int increaseLosses() { return ++score.losses; }
public int getWins() { return score.wins; }
public int getTies() { return score.ties; }
public int getLosses() { return score.losses; }
}
有关清除此包 javax.xml.namespace 错误的任何帮助谢谢
Any help on this on clearing this package javax.xml.namespace error Thanks
推荐答案
几天前我在使用 Eclipse 时遇到了同样的问题.
I faced the same issue with Eclipse few days ago.
所以我试图找到在 javax.xml
Java 内置模块中已经可用的相同包(javax.xml.namespace
)的库,激发包重复.
So I tried to find the library that proposed the same package (javax.xml.namespace
) already available in the javax.xml
Java built-in module, provoking package duplication.
就我而言,它是一个名为 stax-api
的图书馆.我刚刚从构建中删除了它,如下所示:
In my case it was a lybrary under the name stax-api
.
I just removed it from the build, like this:
dependencies {
...
configurations {
compile.exclude group: 'stax', module: 'stax-api'
}
...
}
这篇关于包 javax.xml.namespace 可以从多个模块访问:<unnamed>, eclipse webservice 中的 java.xml的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!