0

I am trying to override the abstract method of the class "NamespacePrefixMapper" to provide my custom name space for the xml attribute . But it keeps giving the following error message .

.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

Below is the method code i am trying to overide.

 @Override
    public String getPreferredPrefix(String namespaceUri, String suggestion, boolean requirePrefix) {
    namespaceUri = "http://base.google.com/ns/1.0";
    suggestion="g";
    requirePrefix=true;
    return suggestion;
    }

What cloud be the reason. Help will be greatly appreciated.

4
  • 2
    Related: What happened to JAXB's NamespacePrefixMapper in JDK6u18? Short answer: you're not supposed to use this class, let alone overriding its methods. Commented May 6, 2013 at 19:52
  • @dasblinkenlight I was just about to link that.
    – Brian
    Commented May 6, 2013 at 19:53
  • Your problem is with the import statement. Look at the very first error, the others are cascading from this one.
    – PM 77-1
    Commented May 6, 2013 at 19:54
  • @dasblinkenlight thanks a lot your linke helped me
    – user964147
    Commented May 6, 2013 at 20:15

1 Answer 1

1

package com.sun.xml.internal.bind.marshaller does not exist should be your key. Check your classpath.

Not the answer you're looking for? Browse other questions tagged or ask your own question.