[
https://issues.apache.org/jira/browse/SPARK-27795?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16844893#comment-16844893
]
Alexander Bouriakov commented on SPARK-27795:
---------------------------------------------
My ugly workaround currently is
ServerInfo serverInfo =
sparkSession.sparkContext().ui().get().serverInfo().get();
{color:#000080}try {color}{
Field serverField =
serverInfo.getClass().getDeclaredField({color:#008000}"server"{color});
serverField.setAccessible({color:#000080}true{color});
Server jettyServer = (Server) serverField.get(serverInfo);
((HttpConnectionFactory)jettyServer.getConnectors()[{color:#0000ff}0{color}].getConnectionFactory({color:#008000}"http/1.1"{color})).getHttpConfiguration().setOutputBufferSize({color:#0000ff}1{color});
} {color:#000080}catch {color}(Exception e) {
{color:#000080}throw new {color}IllegalArgumentException(e);
}
> Spark Web UI is broken when running in local mode within WildFly application
> server
> -----------------------------------------------------------------------------------
>
> Key: SPARK-27795
> URL: https://issues.apache.org/jira/browse/SPARK-27795
> Project: Spark
> Issue Type: Bug
> Components: Web UI
> Affects Versions: 2.4.3
> Environment: Steps to reproduce:
> In a Servlet, instantiate a local spark session
> SparkConf conf = {color:#000080}new
> {color}SparkConf().setMaster({color:#008000}"local[*]"{color}).setAppName({color:#008000}"My
> App"{color});
> SparkSession orCreate = SparkSession.builder().config(conf).getOrCreate();
> Try accessing the Spark Web UI (port 4040) -> UI is broken, only some basic
> text is see, JavaScript is not working.
> Reporter: Alexander Bouriakov
> Priority: Major
>
> Static files of the Web UI from
> *spark-core_2.12-2.4.3.jar/org/apache/spark/ui/static* with filesize smaller
> than the OutputBufferSize of the jetty Server (which ist 32k by default)
> return HTTP 500 because Jetty tries to load them by the path contained in
> their WildFly vfs:// URL which points to a JAR and therefore can not be read
> by RandomAccessFile.
> For bigger files (like bootstrap.min.css), the file is read differently
> (probably by using Resource.openStream()) which works.
> I know that Jetty is produced by Eclipse but post it here since it is
> integrated into Spark. Feel free to forward it to Eclipse issue tracking.
> *Steps to reproduce:*
> In a Servlet, instantiate a local spark session
> SparkConf conf = {color:#000080}new
> {color}SparkConf().setMaster({color:#008000}"local[*]"{color}).setAppName({color:#008000}"My
> App"{color});
> SparkSession orCreate = SparkSession.builder().config(conf).getOrCreate();
> Try accessing the Spark Web UI (port 4040) -> UI is broken, only some basic
> text is see, JavaScript is not working.
> *Example:*
> Problem accessing /static/spark-logo-77x50px-hd.png. Reason:
> Server Error
> h2. HTTP ERROR 500
> Problem accessing /static/spark-logo-77x50px-hd.png. Reason:
> Server Error
>
> h3. Caused by:
> java.lang.RuntimeException: java.io.FileNotFoundException:
> /content/restws-war-4.0.100-SNAPSHOT.war/WEB-INF/lib/spark-core_2.12-2.4.3.jar/org/apache/spark/ui/static/spark-logo-77x50px-hd.png
> (Datei oder Verzeichnis nicht gefunden) at
> org.spark_project.jetty.http.ResourceHttpContent.getDirectBuffer(ResourceHttpContent.java:136)
> at
> org.spark_project.jetty.server.HttpOutput.sendContent(HttpOutput.java:823) at
> org.spark_project.jetty.servlet.DefaultServlet.sendData(DefaultServlet.java:948)
> at
> org.spark_project.jetty.servlet.DefaultServlet.doGet(DefaultServlet.java:532)
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:686) at
> javax.servlet.http.HttpServlet.service(HttpServlet.java:791) at
> org.spark_project.jetty.servlet.ServletHolder.handle(ServletHolder.java:848)
> at
> org.spark_project.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:584)
> at
> org.spark_project.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1180)
> at
> org.spark_project.jetty.servlet.ServletHandler.doScope(ServletHandler.java:512)
> at
> org.spark_project.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1112)
> at
> org.spark_project.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)
> at
> org.spark_project.jetty.server.handler.gzip.GzipHandler.handle(GzipHandler.java:404)
> at
> org.spark_project.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:187)
> at
> org.spark_project.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:134)
> at org.spark_project.jetty.server.Server.handleAsync(Server.java:584) at
> org.spark_project.jetty.server.HttpChannel.handle(HttpChannel.java:423) at
> org.spark_project.jetty.server.HttpConnection.onFillable(HttpConnection.java:251)
> at
> org.spark_project.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:283)
> at org.spark_project.jetty.io.FillInterest.fillable(FillInterest.java:108)
> at
> org.spark_project.jetty.io.SelectChannelEndPoint$2.run(SelectChannelEndPoint.java:93)
> at
> org.spark_project.jetty.util.thread.strategy.ExecuteProduceConsume.executeProduceConsume(ExecuteProduceConsume.java:303)
> at
> org.spark_project.jetty.util.thread.strategy.ExecuteProduceConsume.produceConsume(ExecuteProduceConsume.java:148)
> at
> org.spark_project.jetty.util.thread.strategy.ExecuteProduceConsume.run(ExecuteProduceConsume.java:136)
> at
> org.spark_project.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:671)
> at
> org.spark_project.jetty.util.thread.QueuedThreadPool$2.run(QueuedThreadPool.java:589)
> at java.lang.Thread.run(Thread.java:745) Caused by:
> java.io.FileNotFoundException:
> /content/restws-war-4.0.100-SNAPSHOT.war/WEB-INF/lib/spark-core_2.12-2.4.3.jar/org/apache/spark/ui/static/spark-logo-77x50px-hd.png
> (Datei oder Verzeichnis nicht gefunden) at
> java.io.RandomAccessFile.open0(Native Method) at
> java.io.RandomAccessFile.open(RandomAccessFile.java:316) at
> java.io.RandomAccessFile.<init>(RandomAccessFile.java:243) at
> org.spark_project.jetty.util.BufferUtil.readFrom(BufferUtil.java:449) at
> org.spark_project.jetty.util.BufferUtil.toBuffer(BufferUtil.java:945) at
> org.spark_project.jetty.http.ResourceHttpContent.getDirectBuffer(ResourceHttpContent.java:132)
> ... 26 more
> h3. Caused by:
> java.io.FileNotFoundException:
> /content/restws-war-4.0.100-SNAPSHOT.war/WEB-INF/lib/spark-core_2.12-2.4.3.jar/org/apache/spark/ui/static/spark-logo-77x50px-hd.png
> (Datei oder Verzeichnis nicht gefunden) at
> java.io.RandomAccessFile.open0(Native Method) at
> java.io.RandomAccessFile.open(RandomAccessFile.java:316) at
> java.io.RandomAccessFile.<init>(RandomAccessFile.java:243) at
> org.spark_project.jetty.util.BufferUtil.readFrom(BufferUtil.java:449) at
> org.spark_project.jetty.util.BufferUtil.toBuffer(BufferUtil.java:945) at
> org.spark_project.jetty.http.ResourceHttpContent.getDirectBuffer(ResourceHttpContent.java:132)
> at
> org.spark_project.jetty.server.HttpOutput.sendContent(HttpOutput.java:823) at
> org.spark_project.jetty.servlet.DefaultServlet.sendData(DefaultServlet.java:948)
> at
> org.spark_project.jetty.servlet.DefaultServlet.doGet(DefaultServlet.java:532)
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:686) at
> javax.servlet.http.HttpServlet.service(HttpServlet.java:791) at
> org.spark_project.jetty.servlet.ServletHolder.handle(ServletHolder.java:848)
> at
> org.spark_project.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:584)
> at
> org.spark_project.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1180)
> at
> org.spark_project.jetty.servlet.ServletHandler.doScope(ServletHandler.java:512)
> at
> org.spark_project.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1112)
> at
> org.spark_project.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)
> at
> org.spark_project.jetty.server.handler.gzip.GzipHandler.handle(GzipHandler.java:404)
> at
> org.spark_project.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:187)
> at
> org.spark_project.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:134)
> at org.spark_project.jetty.server.Server.handleAsync(Server.java:584) at
> org.spark_project.jetty.server.HttpChannel.handle(HttpChannel.java:423) at
> org.spark_project.jetty.server.HttpConnection.onFillable(HttpConnection.java:251)
> at
> org.spark_project.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:283)
> at org.spark_project.jetty.io.FillInterest.fillable(FillInterest.java:108)
> at
> org.spark_project.jetty.io.SelectChannelEndPoint$2.run(SelectChannelEndPoint.java:93)
> at
> org.spark_project.jetty.util.thread.strategy.ExecuteProduceConsume.executeProduceConsume(ExecuteProduceConsume.java:303)
> at
> org.spark_project.jetty.util.thread.strategy.ExecuteProduceConsume.produceConsume(ExecuteProduceConsume.java:148)
> at
> org.spark_project.jetty.util.thread.strategy.ExecuteProduceConsume.run(ExecuteProduceConsume.java:136)
> at
> org.spark_project.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:671)
> at
> org.spark_project.jetty.util.thread.QueuedThreadPool$2.run(QueuedThreadPool.java:589)
> at java.lang.Thread.run(Thread.java:745)
> ----
> [Powered by Jetty:// 9.3.z-SNAPSHOT|http://eclipse.org/jetty]
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]