簡體   English   中英

package javax.xml.namespace 可以從多個模塊訪問:<unnamed> , eclipse 網絡服務中的 java.xml</unnamed>

[英]The package javax.xml.namespace is accessible from more than one module: <unnamed>, java.xml in eclipse webservice

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 . 不知道如何處理這個 output

得分 class

package startAgain;

import javax.xml.bind.annotation.*;
@XmlType
@XmlAccessorType(XmlAccessType.FIELD)
public class Score {
public int wins, losses, ties;
}   

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; }

}

有關清除此 package javax.xml.namespace 錯誤的任何幫助謝謝

幾天前,我遇到了與 Eclipse 相同的問題。

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的圖書館。 我剛剛從構建中刪除了它,如下所示:

dependencies {
...
  configurations {
       compile.exclude group: 'stax', module: 'stax-api'
  }
...
}

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM