I'm using Maven to get cxf-bundle-2.0.3 and I've been unable to get the REST
mode to work properly.

The error appears to be javax.xml.bind.JAXBException: property
"com.sun.xml.bind.defaultNamespaceRemap" is not supported

This is on java 1.6.0_03.

Sample class that causes an error:

import java.util.*;

import org.apache.cxf.endpoint.Server;
import org.apache.cxf.jaxws.JaxWsServerFactoryBean;
import org.apache.cxf.service.invoker.BeanInvoker;


public class Bob
{
    public static void main(String... args)
    {
        try
        {
            JaxWsServerFactoryBean sf = new JaxWsServerFactoryBean();
            sf.setServiceClass( Bob.class );
            sf.setAddress( "http://localhost:9999/"; );
            sf.getServiceFactory().setInvoker( new BeanInvoker( new Bob() )
);
            Server server = sf.create();
            server.start();
        }
        catch (Throwable t)
        {
            dump(t);
        }
    }
    
    private static void dump(Throwable t)
    {
        System.err.println(t.toString());
        for (StackTraceElement e : t.getStackTrace())
            System.err.println(e);
        Throwable cause = t.getCause();
        if (cause != null)
        {
            System.err.println("Caused by:");
            dump(cause);
        }
    }

    public String getGreeting()
    {
        return "Hello!";
    }
    
    public List<String> getColors()
    {
        String[] a = "red,orange,yellow,green,blue,violet".split( "," );
        return Arrays.asList( a );
    }
}

Sample error:

14-Jan-2008 13:26:19
org.apache.cxf.service.factory.ReflectionServiceFactoryBean
buildServiceFromClass
INFO: Creating Service {http://unknown.namespace/}BobService from class Bob
org.apache.cxf.service.factory.ServiceConstructionException
org.apache.cxf.jaxb.JAXBDataBinding.initialize(JAXBDataBinding.java:197)
org.apache.cxf.service.factory.ReflectionServiceFactoryBean.buildServiceFromClass(ReflectionServiceFactoryBean.java:293)
org.apache.cxf.service.factory.ReflectionServiceFactoryBean.initializeServiceModel(ReflectionServiceFactoryBean.java:333)
org.apache.cxf.service.factory.ReflectionServiceFactoryBean.create(ReflectionServiceFactoryBean.java:151)
org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean.create(JaxWsServiceFactoryBean.java:93)
org.apache.cxf.frontend.AbstractWSDLBasedEndpointFactory.createEndpoint(AbstractWSDLBasedEndpointFactory.java:74)
org.apache.cxf.frontend.ServerFactoryBean.create(ServerFactoryBean.java:108)
org.apache.cxf.jaxws.JaxWsServerFactoryBean.create(JaxWsServerFactoryBean.java:147)
Bob.main(Bob.java:18)
Caused by:
javax.xml.bind.JAXBException: property
"com.sun.xml.bind.defaultNamespaceRemap" is not supported
com.sun.xml.internal.bind.v2.ContextFactory.createContext(ContextFactory.java:52)
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
java.lang.reflect.Method.invoke(Method.java:597)
javax.xml.bind.ContextFinder.newInstance(ContextFinder.java:210)
javax.xml.bind.ContextFinder.find(ContextFinder.java:381)
javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:574)
org.apache.cxf.jaxb.JAXBDataBinding.createJAXBContext(JAXBDataBinding.java:369)
org.apache.cxf.jaxb.JAXBDataBinding.initialize(JAXBDataBinding.java:180)
org.apache.cxf.service.factory.ReflectionServiceFactoryBean.buildServiceFromClass(ReflectionServiceFactoryBean.java:293)
org.apache.cxf.service.factory.ReflectionServiceFactoryBean.initializeServiceModel(ReflectionServiceFactoryBean.java:333)
org.apache.cxf.service.factory.ReflectionServiceFactoryBean.create(ReflectionServiceFactoryBean.java:151)
org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean.create(JaxWsServiceFactoryBean.java:93)
org.apache.cxf.frontend.AbstractWSDLBasedEndpointFactory.createEndpoint(AbstractWSDLBasedEndpointFactory.java:74)
org.apache.cxf.frontend.ServerFactoryBean.create(ServerFactoryBean.java:108)
org.apache.cxf.jaxws.JaxWsServerFactoryBean.create(JaxWsServerFactoryBean.java:147)
Bob.main(Bob.java:18)

-- 
View this message in context: 
http://www.nabble.com/Crash-in-REST-mode-in-CXF-2.0.3-tp14802376p14802376.html
Sent from the cxf-user mailing list archive at Nabble.com.

Reply via email to