我试图覆盖“NamespacePrefixMapper”类的抽象方法,为xml属性提供自定义名称空间。但它不断给出以下错误消息。
.c.compile:
[javac] Compiling 1 source file to C:\isp_development\target\dmc_ac_efulfilment\release\lib
[javac] C:\isp_development\source\dmc_ac_efulfilment\javasource\de\dmc\enfinity\adapter\efulfilment\client\JustForTest.java:3: error: package com.sun.xml.internal.bind.marshaller does not exist
[javac] import com.sun.xml.internal.bind.marshaller.NamespacePrefixMapper;
[javac] ^
[javac] C:\isp_development\source\dmc_ac_efulfilment\javasource\de\dmc\enfinity\adapter\efulfilment\client\JustForTest.java:5: error: cannot find symbol
[javac] public class JustForTest extends NamespacePrefixMapper {
[javac] ^
[javac] symbol: class NamespacePrefixMapper
[javac] C:\isp_development\source\dmc_ac_efulfilment\javasource\de\dmc\enfinity\adapter\efulfilment\client\JustForTest.java:7: error: method does not override or implement a method from a supertype
[javac] @Override
[javac] ^
[javac] 3 errors
下面是我试图覆盖的方法代码。
@Override
public String getPreferredPrefix(String namespaceUri, String suggestion, boolean requirePrefix) {
namespaceUri = "http://base.google.com/ns/1.0";
suggestion="g";
requirePrefix=true;
return suggestion;
}
云是什么原因。将非常感谢帮助。
答案 0 :(得分:1)
package com.sun.xml.internal.bind.marshaller does not exist
应该是你的关键。检查你的课程路径。