can not load xml files?

37 views
Skip to first unread message

Meg Peter

unread,
Feb 9, 2016, 12:22:25 AM2/9/16
to LittleProxy
Browser stuck on a page, which includes javascript to open non-html files. E.g. XML and plain text.

error msg: invalid version format <XML.....

and NPE on HttpRequest in ProxyToServerConnection.respond(), and in same method, httpObject is with error code 999, unknown.

Thanks!

Sivasubramaniam Sivakumar

unread,
Feb 9, 2016, 1:36:43 AM2/9/16
to littl...@googlegroups.com
Hi,

Can you post your bootstrap code with filters code (if any) and if possible the URL for which this error occurs? Thanks.

--
You received this message because you are subscribed to the Google Groups "LittleProxy" group.
To unsubscribe from this group and stop receiving emails from it, send an email to littleproxy...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Meg Peter

unread,
Feb 9, 2016, 11:22:55 AM2/9/16
to LittleProxy
HttpProxyServer server =
    DefaultHttpProxyServer.bootstrap()
        .withPort(8080)
        .withAllowLocalOnly(false)
        .start();
and the URL is an internal web page. The page uses javascirpt to open xml:
xmlhttp = new XMLHttpRequest();
...
xmlhttp.load("/AlarmBannerXML");

Sivasubramaniam Sivakumar

unread,
Feb 9, 2016, 1:38:58 PM2/9/16
to littl...@googlegroups.com
Okay. Does not help much. Can you post the full stack trace?

Thanks.

Meg Peter

unread,
Feb 9, 2016, 4:51:26 PM2/9/16
to LittleProxy
2016-02-09 13:49:50,647 ERROR [LittleProxy-0-ProxyToServerWorker-3] impl.ProxyToServerConnection (ProxyToServerConnection.java:431).exceptionCaught() - (AWAITING_INITIAL) [id: 0x3cc1e228, /10.25.41.106:54676 => /10.10.16.235:20080]: Caught an exception on ProxyToServerConnection
java.lang.NullPointerException
at org.littleshoot.proxy.impl.ProxyUtils.isHead(ProxyUtils.java:389)
at org.littleshoot.proxy.impl.ClientToProxyConnection.respond(ClientToProxyConnection.java:430)
at org.littleshoot.proxy.impl.ProxyToServerConnection.respondWith(ProxyToServerConnection.java:528)
at org.littleshoot.proxy.impl.ProxyToServerConnection.readHTTPInitial(ProxyToServerConnection.java:221)
at org.littleshoot.proxy.impl.ProxyToServerConnection.readHTTPInitial(ProxyToServerConnection.java:74)
at org.littleshoot.proxy.impl.ProxyConnection.readHTTP(ProxyConnection.java:135)
at org.littleshoot.proxy.impl.ProxyConnection.read(ProxyConnection.java:120)
at org.littleshoot.proxy.impl.ProxyToServerConnection.read(ProxyToServerConnection.java:210)
at org.littleshoot.proxy.impl.ProxyConnection.channelRead0(ProxyConnection.java:587)
at io.netty.channel.SimpleChannelInboundHandler.channelRead(SimpleChannelInboundHandler.java:105)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:333)
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:319)
at io.netty.handler.timeout.IdleStateHandler.channelRead(IdleStateHandler.java:254)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:333)
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:319)
at io.netty.channel.ChannelInboundHandlerAdapter.channelRead(ChannelInboundHandlerAdapter.java:86)
at org.littleshoot.proxy.impl.ProxyConnection$ResponseReadMonitor.channelRead(ProxyConnection.java:738)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:333)
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:319)
at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:163)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:333)
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:319)
at io.netty.channel.ChannelInboundHandlerAdapter.channelRead(ChannelInboundHandlerAdapter.java:86)
at org.littleshoot.proxy.impl.ProxyConnection$BytesReadMonitor.channelRead(ProxyConnection.java:692)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:333)
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:319)
at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:787)
at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:130)
at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:511)
at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:468)
at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:382)
at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:354)
at io.netty.util.concurrent.SingleThreadEventExecutor$2.run(SingleThreadEventExecutor.java:116)
at java.lang.Thread.run(Thread.java:745)

Sivasubramaniam Sivakumar

unread,
Feb 10, 2016, 8:29:14 AM2/10/16
to littl...@googlegroups.com
Thanks for the info. Unfortunately I am unable to reproduce the issue. I am not familiar with JS development, but I tried making some basic XMLHttpRequests and they worked fine via littleproxy with the bootstrap configurations that you have shared. The code I tried with is here - http://jsfiddle.net/fnqk8hp2/2/

Something I noticed during my trails is an error for xmlhttprequest.load('/xml'). I get an error saying 'load' is not a function. You had used this function.

To help reproducing this issue, can you share -

(1) Is the URL a 'http://" or "https://" URL?
(2) What is the HTTP method type? GET or POST or ?
(3) Can you share more of your XMLHttpRequest code without private info? Or if you could modify code here (http://jsfiddle.net/fnqk8hp2/2/) to reproduce the issue, it will be great!

Thanks

Meg Peter

unread,
Feb 10, 2016, 11:46:20 AM2/10/16
to LittleProxy
Thanks for your help. 
"load()" works for IE, and "send()" for FF and Chrome. 
1) it's http://
2) it's GET
3) I use async call, like: request.open("GET", url, true);  Do you think async is a problem?

Sivasubramaniam Sivakumar

unread,
Feb 11, 2016, 1:53:35 PM2/11/16
to littl...@googlegroups.com
Hi,

I tried with MS IE 9 on Windows 7 and I tried out the JS code here (http://jsfiddle.net/fnqk8hp2/7/). I still get the error below on the IE developer tools console - 

SCRIPT438: Object doesn't support property or method 'load' 

Also, I checked this page which documents XMLHttpRequest support for IE and the 'load' method is missing here as well - https://msdn.microsoft.com/en-us/library/ms535874(v=vs.85).aspx

I am not sure what I am missing. It would be great if you could share a way to easily reproduce the issue. Also, does your code work without setting a proxy on the browser?

Thanks


Reply all
Reply to author
Forward
0 new messages