Solucionado (ver solução)
Solucionado
(ver solução)
1
resposta

Erro ao requisitar após desafio

Fiz o ajuste do adapter para formatar a data, o serviço sobe, mas ao requisitar estoura esse erro abaixo:

jun 02, 2017 6:53:28 PM com.sun.xml.internal.bind.v2.ClassFactory create
INFORMAÇÕES: failed to create a new instance of class br.com.caelum.estoque.adapter.DateAdapter
java.lang.InstantiationException
    at sun.reflect.InstantiationExceptionConstructorAccessorImpl.newInstance(InstantiationExceptionConstructorAccessorImpl.java:48)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
    at com.sun.xml.internal.bind.v2.ClassFactory.create0(ClassFactory.java:118)
    at com.sun.xml.internal.bind.v2.ClassFactory.create(ClassFactory.java:127)
    at com.sun.xml.internal.bind.v2.runtime.Coordinator.getAdapter(Coordinator.java:87)
    at com.sun.xml.internal.bind.v2.runtime.reflect.AdaptedAccessor.getAdapter(AdaptedAccessor.java:94)
    at com.sun.xml.internal.bind.v2.runtime.reflect.AdaptedAccessor.set(AdaptedAccessor.java:68)
    at com.sun.xml.internal.bind.v2.runtime.reflect.TransducedAccessor$CompositeTransducedAccessorImpl.parse(TransducedAccessor.java:230)
    at com.sun.xml.internal.bind.v2.runtime.unmarshaller.LeafPropertyLoader.text(LeafPropertyLoader.java:50)
    at com.sun.xml.internal.bind.v2.runtime.unmarshaller.UnmarshallingContext.text(UnmarshallingContext.java:572)
    at com.sun.xml.internal.bind.v2.runtime.unmarshaller.InterningXmlVisitor.text(InterningXmlVisitor.java:78)
    at com.sun.xml.internal.bind.v2.runtime.unmarshaller.StAXStreamConnector.processText(StAXStreamConnector.java:323)
    at com.sun.xml.internal.bind.v2.runtime.unmarshaller.StAXStreamConnector.handleEndElement(StAXStreamConnector.java:201)
    at com.sun.xml.internal.bind.v2.runtime.unmarshaller.StAXStreamConnector.bridge(StAXStreamConnector.java:170)
    at com.sun.xml.internal.bind.v2.runtime.unmarshaller.UnmarshallerImpl.unmarshal0(UnmarshallerImpl.java:400)
    at com.sun.xml.internal.bind.v2.runtime.BridgeImpl.unmarshal(BridgeImpl.java:109)
    at com.sun.xml.internal.bind.api.Bridge.unmarshal(Bridge.java:222)
    at com.sun.xml.internal.ws.db.glassfish.BridgeWrapper.unmarshal(BridgeWrapper.java:257)
    at com.sun.xml.internal.ws.message.AbstractHeaderImpl.readAsJAXB(AbstractHeaderImpl.java:86)
    at com.sun.xml.internal.ws.server.sei.EndpointArgumentsBuilder$Header.readRequest(EndpointArgumentsBuilder.java:517)
    at com.sun.xml.internal.ws.server.sei.EndpointArgumentsBuilder$Composite.readRequest(EndpointArgumentsBuilder.java:246)
    at com.sun.xml.internal.ws.server.sei.TieHandler.readRequest(TieHandler.java:236)
    at com.sun.xml.internal.ws.db.DatabindingImpl.deserializeRequest(DatabindingImpl.java:178)
    at com.sun.xml.internal.ws.db.DatabindingImpl.deserializeRequest(DatabindingImpl.java:281)
    at com.sun.xml.internal.ws.server.sei.SEIInvokerTube.processRequest(SEIInvokerTube.java:67)
    at com.sun.xml.internal.ws.api.pipe.Fiber.__doRun(Fiber.java:1121)
    at com.sun.xml.internal.ws.api.pipe.Fiber._doRun(Fiber.java:1035)
    at com.sun.xml.internal.ws.api.pipe.Fiber.doRun(Fiber.java:1004)
    at com.sun.xml.internal.ws.api.pipe.Fiber.runSync(Fiber.java:862)
    at com.sun.xml.internal.ws.server.WSEndpointImpl$2.process(WSEndpointImpl.java:404)
    at com.sun.xml.internal.ws.transport.http.HttpAdapter$HttpToolkit.handle(HttpAdapter.java:706)
    at com.sun.xml.internal.ws.transport.http.HttpAdapter.handle(HttpAdapter.java:260)
    at com.sun.xml.internal.ws.transport.http.server.WSHttpHandler.handleExchange(WSHttpHandler.java:98)
    at com.sun.xml.internal.ws.transport.http.server.WSHttpHandler.handle(WSHttpHandler.java:82)
    at com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:79)
    at sun.net.httpserver.AuthFilter.doFilter(AuthFilter.java:83)
    at com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:82)
    at sun.net.httpserver.ServerImpl$Exchange$LinkHandler.handle(ServerImpl.java:675)
    at com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:79)
    at sun.net.httpserver.ServerImpl$Exchange.run(ServerImpl.java:647)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at java.lang.Thread.run(Thread.java:745)

jun 02, 2017 6:53:28 PM com.sun.xml.internal.ws.transport.http.HttpAdapter$HttpToolkit handle
GRAVE: java.lang.InstantiationException
java.lang.InstantiationError: java.lang.InstantiationException
    at com.sun.xml.internal.bind.v2.ClassFactory.create(ClassFactory.java:130)
    at com.sun.xml.internal.bind.v2.runtime.Coordinator.getAdapter(Coordinator.java:87)
    at com.sun.xml.internal.bind.v2.runtime.reflect.AdaptedAccessor.getAdapter(AdaptedAccessor.java:94)
    at com.sun.xml.internal.bind.v2.runtime.reflect.AdaptedAccessor.set(AdaptedAccessor.java:68)
    at com.sun.xml.internal.bind.v2.runtime.reflect.TransducedAccessor$CompositeTransducedAccessorImpl.parse(TransducedAccessor.java:230)
    at com.sun.xml.internal.bind.v2.runtime.unmarshaller.LeafPropertyLoader.text(LeafPropertyLoader.java:50)
    at com.sun.xml.internal.bind.v2.runtime.unmarshaller.UnmarshallingContext.text(UnmarshallingContext.java:572)
    at com.sun.xml.internal.bind.v2.runtime.unmarshaller.InterningXmlVisitor.text(InterningXmlVisitor.java:78)
    at com.sun.xml.internal.bind.v2.runtime.unmarshaller.StAXStreamConnector.processText(StAXStreamConnector.java:323)
    at com.sun.xml.internal.bind.v2.runtime.unmarshaller.StAXStreamConnector.handleEndElement(StAXStreamConnector.java:201)
    at com.sun.xml.internal.bind.v2.runtime.unmarshaller.StAXStreamConnector.bridge(StAXStreamConnector.java:170)
    at com.sun.xml.internal.bind.v2.runtime.unmarshaller.UnmarshallerImpl.unmarshal0(UnmarshallerImpl.java:400)
    at com.sun.xml.internal.bind.v2.runtime.BridgeImpl.unmarshal(BridgeImpl.java:109)
    at com.sun.xml.internal.bind.api.Bridge.unmarshal(Bridge.java:222)
    at com.sun.xml.internal.ws.db.glassfish.BridgeWrapper.unmarshal(BridgeWrapper.java:257)
    at com.sun.xml.internal.ws.message.AbstractHeaderImpl.readAsJAXB(AbstractHeaderImpl.java:86)
    at com.sun.xml.internal.ws.server.sei.EndpointArgumentsBuilder$Header.readRequest(EndpointArgumentsBuilder.java:517)
    at com.sun.xml.internal.ws.server.sei.EndpointArgumentsBuilder$Composite.readRequest(EndpointArgumentsBuilder.java:246)
    at com.sun.xml.internal.ws.server.sei.TieHandler.readRequest(TieHandler.java:236)
    at com.sun.xml.internal.ws.db.DatabindingImpl.deserializeRequest(DatabindingImpl.java:178)
    at com.sun.xml.internal.ws.db.DatabindingImpl.deserializeRequest(DatabindingImpl.java:281)
    at com.sun.xml.internal.ws.server.sei.SEIInvokerTube.processRequest(SEIInvokerTube.java:67)
    at com.sun.xml.internal.ws.api.pipe.Fiber.__doRun(Fiber.java:1121)
    at com.sun.xml.internal.ws.api.pipe.Fiber._doRun(Fiber.java:1035)
    at com.sun.xml.internal.ws.api.pipe.Fiber.doRun(Fiber.java:1004)
    at com.sun.xml.internal.ws.api.pipe.Fiber.runSync(Fiber.java:862)
    at com.sun.xml.internal.ws.server.WSEndpointImpl$2.process(WSEndpointImpl.java:404)
    at com.sun.xml.internal.ws.transport.http.HttpAdapter$HttpToolkit.handle(HttpAdapter.java:706)
    at com.sun.xml.internal.ws.transport.http.HttpAdapter.handle(HttpAdapter.java:260)
    at com.sun.xml.internal.ws.transport.http.server.WSHttpHandler.handleExchange(WSHttpHandler.java:98)
    at com.sun.xml.internal.ws.transport.http.server.WSHttpHandler.handle(WSHttpHandler.java:82)
    at com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:79)
    at sun.net.httpserver.AuthFilter.doFilter(AuthFilter.java:83)
    at com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:82)
    at sun.net.httpserver.ServerImpl$Exchange$LinkHandler.handle(ServerImpl.java:675)
    at com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:79)
    at sun.net.httpserver.ServerImpl$Exchange.run(ServerImpl.java:647)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at java.lang.Thread.run(Thread.java:745)
1 resposta
solução!

Resolvido. O problema é que criei a classe DateAdapter como abstract e o @XmlJavaTypeAdapter não conseguia instanciá-la.

//antes
public abstract class DateAdapter extends XmlAdapter<String, Date> { 
...

//depois
public class DateAdapter extends XmlAdapter<String, Date> {