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

Marek Kopecký (JIRA) issues at jboss.org
Mon May 28 09:52:00 EDT 2018


    [ https://issues.jboss.org/browse/WFLY-10230?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13582933#comment-13582933 ] 

Marek Kopecký commented on WFLY-10230:
--------------------------------------

[~raytucson] (cc [~mmarusic]) I'm unable to reproduce this issue on WF11/WF12/WF13, see my experiments in [RESTEasy TS|https://github.com/marekkopecky/Resteasy/commit/e1018fb391683e290fc5833a9fab9d3e97ab3253]

I enabled debug logs, so I know that JAXB was really used:

{noformat}
15:45:10,626 DEBUG [org.jboss.resteasy.resteasy_jaxrs.i18n] (default task-1) RESTEASY002315: PathInfo: /parameter/put
15:45:10,864 DEBUG [org.jboss.resteasy.resteasy_jaxrs.i18n] (default task-1) Interceptor Context: org.jboss.resteasy.core.interception.ServerReaderInterceptorContext,  Method : proceed
15:45:10,864 DEBUG [org.jboss.resteasy.resteasy_jaxrs.i18n] (default task-1) ReaderInterceptor: org.jboss.resteasy.security.doseta.DigitalVerificationInterceptor
15:45:10,865 DEBUG [org.jboss.resteasy.security.doseta.i18n] (default task-1) Interceptor : org.jboss.resteasy.security.doseta.DigitalVerificationInterceptor,  Method : aroundReadFrom
15:45:10,865 DEBUG [org.jboss.resteasy.resteasy_jaxrs.i18n] (default task-1) Interceptor Context: org.jboss.resteasy.core.interception.ServerReaderInterceptorContext,  Method : proceed
15:45:10,868 DEBUG [org.jboss.resteasy.resteasy_jaxrs.i18n] (default task-1) MessageBodyReader: org.jboss.resteasy.spi.ResteasyProviderFactory$SortedKey
15:45:10,868 DEBUG [org.jboss.resteasy.resteasy_jaxrs.i18n] (default task-1) MessageBodyReader: org.jboss.resteasy.plugins.providers.jaxb.JAXBXmlRootElementProvider
15:45:10,868 DEBUG [org.jboss.resteasy.plugins.providers.jaxb.i18n] (default task-1) Provider : org.jboss.resteasy.plugins.providers.jaxb.JAXBXmlRootElementProvider,  Method : readFrom
15:45:10,873 FINE  [javax.xml.bind] (default task-1) Trying to locate org/jboss/resteasy/test/providers/jaxb/resource/jaxb.properties
15:45:10,873 FINE  [javax.xml.bind] (default task-1)   not found
15:45:10,873 FINE  [javax.xml.bind] (default task-1) Checking system property javax.xml.bind.JAXBContext
15:45:10,873 FINE  [javax.xml.bind] (default task-1)   not found
15:45:10,874 FINE  [javax.xml.bind] (default task-1) Checking META-INF/services
15:45:10,875 FINE  [javax.xml.bind] (default task-1) Reading jar:file:/home/mkopecky/playground/wf/wfly.26/wfly.26/modules/system/layers/base/com/sun/xml/bind/main/jaxb-runtime-2.3.0.jar!/META-INF/services/javax.xml.bind.JAXBContext
15:45:10,875 FINE  [javax.xml.bind] (default task-1) Trying to load com.sun.xml.bind.v2.ContextFactory
15:45:10,880 FINE  [javax.xml.bind] (default task-1) loaded com.sun.xml.bind.v2.ContextFactory from jar:file:/home/mkopecky/playground/wf/wfly.26/wfly.26/modules/system/layers/base/com/sun/xml/bind/main/jaxb-runtime-2.3.0.jar!/com/sun/xml/bind/v2/ContextFactory.class
{noformat}

Can you provide more details about this issue?

> 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: REST
>    Affects Versions: 11.0.0.Final
>            Reporter: Ray Ramos
>            Assignee: Marek Marusic
>
> The below fails with "Premature End of File".  It is a PUT with a PathParam and a JAXB serializeable entity.
> {code:java}
> @PUT
> @Path("{tenant}")
> @Consumes(MediaType.APPLICATION_XML)
> public void upsert(@PathParam("tenant") String tenant, DataTransferModel model)
> {code}
> {noformat}
> 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)
> {noformat}
> However, if you remove the PathParam, it works.
> {code:java}
> @PUT
> @Path("tenant")
> @Consumes(MediaType.APPLICATION_XML)
> public void upsert(DataTransferModel model)
> {code}
> 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