<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div><br></div><div>The upper part is the operation (request) send to the http api.</div><div>the base64 part is the encoded response. you should be able to reproduce it&nbsp;</div><div>like this:</div><div><br></div><div>1.) start jboss7 in domain mode</div><div>2.) curl -H "Accept:application/dmr-encoded" <a href="http://localhost:9990/domain-api/profile/default">http://localhost:9990/domain-api/profile/default</a></div><div><br></div><div><br></div><div>But you are right, there seems to be something strange going on.</div><div>I get a different encoded string this time.</div><div><br></div><div>Let me double check first. Maybe the error is my side (very likely)</div><div><br></div><div>Ike</div><br><div><div>On Mar 18, 2011, at 2:12 AM, Jonathan Pearlin wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite">Hi Heiko,<br><br>&nbsp;&nbsp;&nbsp; Something odd is definitely going on here.&nbsp; First, from what I can tell the two values you added to the gist are not equal (the plain text DMR string to does not produce that Base64 string).&nbsp; Second, it appears that the Base64 encoded string is cut off (when I decode it using some external tools, the resultant plain text does not look like a complete string, based on the fact that what I assume is the value "localhost" is cut off as "loca").&nbsp; Regardless, it does appear that the issue is due to the fact that readUTF requests to read more bytes than are available in the stream.&nbsp; Because the underlying Base64 stream must decode the data on the fly when read() is called, it is possible that the requested number of bytes does not equal the actual remaining number of bytes after decoding (this is obviously an edge case that needs to be corrected).&nbsp; However, I am still not sure if the issue is due to the stream code or the fact that the Base64 encoded string appears to be incomplete.&nbsp; How was the Base64 value generated?&nbsp; Do you have the original DMR string that generated it?&nbsp; I would like to run the original DMR string through the Base64 encoder in the jboss-dmr project to see what it produces to verify that we are getting well-formed Base64 encoded strings in the first place.<br>
<br>Thanks,<br><br>--Jonathan<br><br><div class="gmail_quote">On Thu, Mar 17, 2011 at 10:27 AM, Heiko Braun <span dir="ltr">&lt;<a href="mailto:hbraun@redhat.com">hbraun@redhat.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin-top: 0pt; margin-right: 0pt; margin-bottom: 0pt; margin-left: 0.8ex; border-left-width: 1px; border-left-style: solid; border-left-color: rgb(204, 204, 204); padding-left: 1ex; position: static; z-index: auto; ">
<div style="word-wrap: break-word;"><div><br></div><div><br></div><div>Thanks for your help Jonathan,</div><div>I've attached it to the previously created gist:</div><div class="im"><div><br></div><div><a href="https://gist.github.com/872328" target="_blank">https://gist.github.com/872328</a></div>
<div><br></div></div><font color="#888888"><div>/Heiko</div></font><div><div></div><div class="h5"><br><div><div>On Mar 17, 2011, at 1:47 PM, Jonathan Pearlin wrote:</div><br><blockquote type="cite">I can dig into this as well (since it is probably my fault!).&nbsp; Can you provide the DMR string in question that you are trying to convert/encode?<br>
<br>Thanks,<br><br>--Jonathan<br><br><div class="gmail_quote">On Thu, Mar 17, 2011 at 12:40 AM, Jason Greene <span dir="ltr">&lt;<a href="mailto:jgreene@redhat.com" target="_blank">jgreene@redhat.com</a>&gt;</span> wrote:<br>

<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">It could be a bug in a recently contributed base64 routine on the server end. You can try reverting back to the original base64 impl. I can look into it when I get back on the weekend.<br>


<br>
Sent from my iPad<br>
<div><div></div><div><br>
On Mar 16, 2011, at 4:12 AM, Heiko Braun &lt;<a href="mailto:hbraun@redhat.com" target="_blank">hbraun@redhat.com</a>&gt; wrote:<br>
<br>
&gt; Jason, I've moved the DMR lib to the console codebase:<br>
&gt; <a href="https://github.com/jbossas/console/tree/master/standalone/src/main/java/org/jboss/dmr" target="_blank">https://github.com/jbossas/console/tree/master/standalone/src/main/java/org/jboss/dmr</a><br>
&gt;<br>
&gt; However when I invoke it the Base64 decoding fails:<br>
&gt; <a href="https://gist.github.com/872328" target="_blank">https://gist.github.com/872328</a><br>
&gt;<br>
&gt;<br>
&gt; Any idea what might be causing this?<br>
&gt;<br>
&gt; /Ike<br>
&gt; _______________________________________________<br>
&gt; jboss-as7-dev mailing list<br>
&gt; <a href="mailto:jboss-as7-dev@lists.jboss.org" target="_blank">jboss-as7-dev@lists.jboss.org</a><br>
&gt; <a href="https://lists.jboss.org/mailman/listinfo/jboss-as7-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/jboss-as7-dev</a><br>
<br>
_______________________________________________<br>
jboss-as7-dev mailing list<br>
<a href="mailto:jboss-as7-dev@lists.jboss.org" target="_blank">jboss-as7-dev@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/jboss-as7-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/jboss-as7-dev</a><br>
</div></div></blockquote></div><br>
</blockquote></div><br></div></div></div></blockquote></div><br>
</blockquote></div><br></body></html>