[rules-dev] getting images from guvnor - jaxrs

Jervis Liu jliu at redhat.com
Mon Jun 13 09:49:26 EDT 2011


Hi Tiho,

I tried to access the URL from both browser and from a java client using 
HttpURLConnection, both worked. The file extension is missing, but this 
is not the reason why you got the exception. The problem is the REST 
server receives funny media types from your client, thus it can not 
parse. Thats the reason why you got "java.lang.IllegalArgumentException: 
Media type separator is missing" from "at 
javax.ws.rs.core.MediaType.valueOf(MediaType.java:119)".  A valid medial 
is sth like "application/atom+xml" or "text/plain, */*".  Its has to be 
a value from this list: 
http://docs.jboss.org/resteasy/docs/1.0.0.GA/javadocs/javax/ws/rs/core/MediaType.html#valueOf%28java.lang.String%29

The best way to find out the problem is to use an HTTP interceptor tool 
to intercept the exact content that the client sends to the server. I 
normally use tcpmon from axis. It could be related to the xlink.

Jervis


Media type separator is missing

On 2011/6/10 7:05, Tihomir Surdilovic wrote:
> Thanks Antoine, one thing I found out is that this behavior depend on 
> the Transcoder used. For example when converting this same SVG to PDF 
> with PDFTranscoder the error does not happen and the images coming 
> from Guvnor show fine. Same error happens with JPEGTranscode however.
> The image tag inside SVG requires the href attribute to be xlink. Do 
> you know if there is any other way, possibly to embed an external 
> image inside the svg?
>
> Thanks.
>
>
> On 6/9/11 5:29 PM, Antoine Toulme wrote:
>> Maybe the .png extension missing is confusing CXF. It is babbling 
>> about media types in there.
>>
>> Otherwise:
>> Your href is a xlink, so maybe it behaves differently:
>>
>> http://www.w3.org/TR/xlink/
>>
>> On Thu, Jun 9, 2011 at 17:40, Tihomir Surdilovic <tsurdilo at redhat.com 
>> <mailto:tsurdilo at redhat.com>> wrote:
>>
>>     Hi guys, I am using apache batik to convert some svg to png image
>>     and am
>>     running into a weird problem:
>>     the svg includes image tags which point to guvnor (rest api), for
>>     example:
>>
>>     <image oryx:anchors="top" x="1.6399999999999988" y="2" width="20"
>>     height="20"
>>     xlink:href="http://localhost:8080/drools-guvnor/rest/packages/defaultPackage/assets/fault/binary"
>>     id="_28EB8C09-7BF0-4401-98C4-8ECDCE8D987E__28EB8C09-7BF0-4401-98C4-8ECDCE8D987E_19"/>
>>
>>     where "fault" is fault.png which I uploaded into Guvnor in the
>>     defaultPackage.
>>
>>     When the batik transcoders evaluate this image url
>>     (http://localhost:8080/drools-guvnor/rest/packages/defaultPackage/assets/fault/binary)
>>     jaxrs on the Guvnor side throws this error:
>>
>>     https://gist.github.com/1017665
>>
>>     Anyone got any hints on this error?
>>
>>     Thanks!
>>     Tihomir
>>     _______________________________________________
>>     rules-dev mailing list
>>     rules-dev at lists.jboss.org <mailto:rules-dev at lists.jboss.org>
>>     https://lists.jboss.org/mailman/listinfo/rules-dev
>>
>>
>>
>> _______________________________________________
>> rules-dev mailing list
>> rules-dev at lists.jboss.org
>> https://lists.jboss.org/mailman/listinfo/rules-dev
>
>
> _______________________________________________
> rules-dev mailing list
> rules-dev at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-dev

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/rules-dev/attachments/20110613/492b9ce8/attachment.html 


More information about the rules-dev mailing list