teiid-odata does not take "Accept" header
asyomichev Feb 7, 2013 2:26 PMI've been playing with the teiid-odata module and noticed that it chokes on "Accept" heders sent along with OData requests. It seems that presence of the header in general seems to cause the error, regardless of the value. Here is what I see:
$ curl -H "Accept: application/xml" http://localhost:8080/odata/ToyVDB/$metadata
<html><head><title>JBoss Web/7.0.13.Final - Error report</title><style><!--H1 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:22px;} H2 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:16px;} H3 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:14px;} BODY {font-family:Tahoma,Arial,sans-serif;color:black;background-color:white;} B {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;} P {font-family:Tahoma,Arial,sans-serif;background:white;color:black;font-size:12px;}A {color : black;}A.name {color : black;}HR {color : #525D76;}--></style> </head><body><h1>HTTP Status 500 - </h1><HR size="1" noshade="noshade"><p><b>type</b> Exception report</p><p><b>message</b> <u></u></p><p><b>description</b> <u>The server encountered an internal error () that prevented it from fulfilling this request.</u></p><p><b>exception</b> <pre>org.jboss.resteasy.spi.LoggableFailure: Unable to find contextual data of type: javax.ws.rs.core.UriInfo
org.jboss.resteasy.core.ContextParameterInjector$GenericDelegatingProxy.invoke(ContextParameterInjector.java:53)
$Proxy33.getBaseUri(Unknown Source)
org.teiid.odata.TeiidProducerProvider.getContext(TeiidProducerProvider.java:50)
org.teiid.odata.TeiidProducerProvider.getContext(TeiidProducerProvider.java:35)
org.odata4j.producer.resources.ExceptionMappingProvider.getODataProducer(ExceptionMappingProvider.java:85)
org.odata4j.producer.resources.ExceptionMappingProvider.toResponse(ExceptionMappingProvider.java:53)
org.odata4j.producer.resources.ExceptionMappingProvider.toResponse(ExceptionMappingProvider.java:1)
org.jboss.resteasy.core.SynchronousDispatcher.executeExceptionMapper(SynchronousDispatcher.java:324)
org.jboss.resteasy.core.SynchronousDispatcher.handleException(SynchronousDispatcher.java:229)
org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:123)
org.teiid.odata.ODataServletContainerDispatcher.service(ODataServletContainerDispatcher.java:97)
org.teiid.odata.ODataServlet.service(ODataServlet.java:61)
org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:50)
javax.servlet.http.HttpServlet.service(HttpServlet.java:847)
</pre></p><p><b>note</b> <u>The full stack trace of the root cause is available in the JBoss Web/7.0.13.Final logs.</u></p><HR size="1" noshade="noshade"><h3>JBoss Web/7.0.13.Final</h3></body></html>
$ curl -H "Accept:" http://localhost:8080/odata/ToyVDB/$metadata
<?xml version='1.0' encoding='utf-8'?><service xmlns="http://www.w3.org/2007/app" xml:base="http://localhost:8080/odata/ToyVDB/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:app="http://www.w3.org/2007/app"><workspace><atom:title>Default</atom:title>... etc., the rest of a long metadata document stripped
Is there anything I might have messed up in the configuration?
Environment details:
JBoss 7.1.1.Final
Teiid 8.3.0.Beta1
Teiid Designer 8.0.0.Final
Thank you,
--Alexey