[jboss-jira] [JBoss JIRA] (WFLY-10230) Premature end of file if PathParam and PUT/POST are used together

Ray Ramos (JIRA) issues at jboss.org
Thu Apr 12 16:19:00 EDT 2018


Ray Ramos created WFLY-10230:
--------------------------------

             Summary: Premature end of file if PathParam and PUT/POST are used together
                 Key: WFLY-10230
                 URL: https://issues.jboss.org/browse/WFLY-10230
             Project: WildFly
          Issue Type: Bug
          Components: JAXR, REST
    Affects Versions: 11.0.0.Final
            Reporter: Ray Ramos
            Assignee: Kurt Stam


The below fails with "Premature End of File".  It is a PUT with a PathParam and a JAXB serializeable entity.

@PUT
@Path("{tenant}")
@Consumes(MediaType.APPLICATION_XML)
public void upsert(@PathParam("tenant") String tenant, DataTransferModel model)

2:58:03,715 ERROR [org.jboss.resteasy.resteasy_jaxrs.i18n] (default task-2) RESTEASY002005: Failed executing PUT /gateway/tenant: org.jboss.resteasy.plugins.providers.jaxb.JAXBUnmarshalException: javax.xml.bind.UnmarshalException
 - with linked exception:
[org.xml.sax.SAXParseException; Premature end of file.]
	at org.jboss.resteasy.plugins.providers.jaxb.AbstractJAXBProvider.readFrom(AbstractJAXBProvider.java:136)
	at org.jboss.resteasy.core.interception.AbstractReaderInterceptorContext.readFrom(AbstractReaderInterceptorContext.java:66)
	at org.jboss.resteasy.core.interception.ServerReaderInterceptorContext.readFrom(ServerReaderInterceptorContext.java:61)
	at org.jboss.resteasy.core.interception.AbstractReaderInterceptorContext.proceed(AbstractReaderInterceptorContext.java:56)
	at org.jboss.resteasy.security.doseta.DigitalVerificationInterceptor.aroundReadFrom(DigitalVerificationInterceptor.java:36)
	at org.jboss.resteasy.core.interception.AbstractReaderInterceptorContext.proceed(AbstractReaderInterceptorContext.java:59)
	at org.jboss.resteasy.core.MessageBodyParameterInjector.inject(MessageBodyParameterInjector.java:151)
	at org.jboss.resteasy.core.MethodInjectorImpl.injectArguments(MethodInjectorImpl.java:92)
	at org.jboss.resteasy.core.MethodInjectorImpl.invoke(MethodInjectorImpl.java:115)
	at org.jboss.resteasy.core.ResourceMethodInvoker.invokeOnTarget(ResourceMethodInvoker.java:295)
	at org.jboss.resteasy.core.ResourceMethodInvoker.invoke(ResourceMethodInvoker.java:249)
	at org.jboss.resteasy.core.ResourceMethodInvoker.invoke(ResourceMethodInvoker.java:236)
	at org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:406)
	at org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:213)
	at org.jboss.resteasy.plugins.server.servlet.ServletContainerDispatcher.service(ServletContainerDispatcher.java:228)
	at org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:56)
	at org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:51)



However, if you remove the PathParam, it works.
@PUT
@Path("tenant")
@Consumes(MediaType.APPLICATION_XML)
public void upsert(DataTransferModel model)


I tried swapping the order of the parameters and I get a "Stream Closed" exception instead.



--
This message was sent by Atlassian JIRA
(v7.5.0#75005)


More information about the jboss-jira mailing list