SageTV Community

SageTV Community (http://forums.sagetv.com/forums/index.php)
-   SageTV v7 Customizations (http://forums.sagetv.com/forums/forumdisplay.php?f=47)
-   -   Plugin: Jetty Web Server 2.0 (http://forums.sagetv.com/forums/showthread.php?t=48818)

jreichen 05-28-2010 10:27 PM

Plugin: Jetty Web Server 2.0
 
1 Attachment(s)
Version 2.0 of the Jetty Web Server plugin is now available in SageTV v7's plugin repository. It can be installed and configured from the Plugin Manager in the SageTV UI. The Jetty wiki has information about installing and configuring the plugin. Please note there are different pages for SageTV v6 and v7.

Upgrades: For questions related to the upgrading of Jetty from SageTV v6 to SageTV v7, please continue to use the existing thread.

Developers: If you have a web application, please take a look at the updated wiki page with information on how to customize your application's appearance on the new web applications page delivered with Jetty (screenshot above).

What's New: Version 2.0 adds several new features. Some of these include:
  • Support for the SageTV v7 Plugin Manager
    • Restart the web server without restarting SageTV
    • Configure primary user and password, HTTP port, HTTPS port, UPnP router configuration, and log level from SageTV's UI
  • Built-in web application for viewing all web applications currently installed, whether from the plugin manager or manually. To access it go to http://<server>:<port>/apps. Note that the links to the Web UI and Mobile Web UI aren't quite correct and the application names on your server may be different from the screenshot until each app is updated to support this feature.
http://forums.sagetv.com/forums/atta...1&d=1275106689

GKusnick 05-29-2010 01:33 AM

Installing this upgrade seemed to delete *.jsp from my existing webapps (Web Server, Mobile Web Server, and SageAlert). To get them working again after the upgrade I had to manually stop the service, delete the deployments, and restart the service to force a redeploy.

Much as I like these plugins, I'm sorry to have to say this has been pretty typical of my experience with Jetty so far under V7. Almost anything I do in the way of installing or upgrading Jetty plugins breaks something that then requires manual intervention and multiple restarts to fix.

Peter_h 05-29-2010 04:57 AM

I also tried installing this and it is not working. It gives the following error page.

Quote:

Error 404 - Not Found.
No context on this server matched or handled this request.
Contexts known to this server are:

* / ---> org.mortbay.jetty.handler.ContextHandler@1ce5421{/,file:/C:/Program%20Files/SageTV/SageTV/jetty/static}
* /sage ---> org.mortbay.jetty.webapp.WebAppContext@af88e3{/sage,C:\Program Files\SageTV\SageTV\jetty/webapps/nielm_sagewebserver.war}
* /sre ---> org.mortbay.jetty.webapp.WebAppContext@1a42493{/sre,C:\Program Files\SageTV\SageTV\jetty/webapps/sre.war}
* /bmt ---> org.mortbay.jetty.webapp.WebAppContext@15d3d12{/bmt,C:\Program Files\SageTV\SageTV\jetty/webapps/bmt.war}
* /sjq ---> org.mortbay.jetty.webapp.WebAppContext@ad8a09{/sjq,C:\Program Files\SageTV\SageTV\jetty/webapps/sjq.war}
* /apps ---> org.mortbay.jetty.webapp.WebAppContext@1415d6c{/apps,C:\Program Files\SageTV\SageTV\jetty/webapps/apps.war}
* /sagealert ---> org.mortbay.jetty.webapp.WebAppContext@5c978a{/sagealert,C:\Program Files\SageTV\SageTV\jetty/webapps/SageAlert.war}
I have both SJQ and the Web Server installed and working.

jreichen 05-29-2010 08:00 AM

Quote:

Originally Posted by Peter_h (Post 427898)
I also tried installing this and it is not working. It gives the following error page.



I have both SJQ and the Web Server installed and working.

That's what Jetty prints when there's no path in the URL. Try http://<server>:<port>/apps.

Peter_h 05-29-2010 11:33 AM

Ok, that works, thanks. Sorry, I didn't see that listed anywhere in the first post.

Can I customze what the links say? Also, my web interface link just shows up as "sage". It doesn't say "SageTV Web Interface" like your setup.

alfi33 05-29-2010 01:14 PM

When I go to http://<server>:<port>/apps, I get a page that looks like this.

Quote:

Directory: /apps/

SageLogo256small.png 15084 bytes May 24, 2010 9:22:48 PM
apps.css 2067 bytes May 24, 2010 9:22:48 PM
favicon.ico 2238 bytes May 24, 2010 9:22:48 PM
I am able to get to the apps by using the url for each individual app. Any idea why the built-in web application start page doesn't work for me?

titanium 05-29-2010 01:42 PM

Quote:

Originally Posted by alfi33 (Post 427983)
When I go to http://<server>:<port>/apps, I get a page that looks like this.


I am able to get to the apps by using the url for each individual app. Any idea why the built-in web application start page doesn't work for me?

I have the same exact problem

lotusvball 05-29-2010 02:34 PM

everything works fine for me. Thanks.

GKusnick 05-29-2010 04:01 PM

1 Attachment(s)
OK, I seem to have a repeatable scenario in which restarting Jetty (using the button on its plugin configuration page) hoses all my webapps.

Attached are two directory listings of the contents of my jetty\webapps tree. Before the reset, with all apps working, the tree contains 1715 files. After the reset, the tree contains 70 files, and (not surprisingly) all the apps are broken (including Jetty's own "apps" app).

All I did in between was restart Jetty. I did not change any WARs that would have entailed redeployment.

I have Jetty logging set to Verbose and have included a copy of sagetv_0.txt, but I'm not seeing anything in there that would account for this behavior.

As I noted earlier, getting back to a working state after this requires stopping the service and manually deleting the deployments.

If there's any further experimentation I can do or information I can gather to help debug this, let me know.

jreichen 05-29-2010 08:03 PM

Quote:

Originally Posted by Peter_h (Post 427968)
Ok, that works, thanks. Sorry, I didn't see that listed anywhere in the first post.

Sometimes developers make assumptions that others know as much about their code as they do :) I updated the first post.

Quote:

Originally Posted by Peter_h (Post 427968)
Can I customze what the links say? Also, my web interface link just shows up as "sage". It doesn't say "SageTV Web Interface" like your setup.

The app developer can change it but users can't. Mine is different than what you see because I changed it on my setup to test it. That will be included in the next update for the web UI. If devs don't customize it then it will be the context path of the app (i.e. bmt, sre, sjq, sage, etc).

jreichen 05-29-2010 08:04 PM

Quote:

Originally Posted by alfi33 (Post 427983)
When I go to http://<server>:<port>/apps, I get a page that looks like this.


I am able to get to the apps by using the url for each individual app. Any idea why the built-in web application start page doesn't work for me?

You're having the same problem GKusnick is talking about.

jreichen 05-29-2010 08:07 PM

Quote:

Originally Posted by lotusvball (Post 427993)
everything works fine for me. Thanks.

That's strange. I'm suspecting it only happens on Windows so I would expect you to have the same problem. I don't know what OS everyone is using but I see you're on WHS so maybe that's why :confused:

stuckless 05-29-2010 08:21 PM

Quote:

Originally Posted by jreichen (Post 428018)
That's strange. I'm suspecting it only happens on Windows so I would expect you to have the same problem. I don't know what OS everyone is using but I see you're on WHS so maybe that's why :confused:

I thought I was experiencing a similar issue as greg because when I clicked the on the sagem app it just saw a directory listing... then I realized that needed to drill down to "m" to get the home page. Maybe you could add "m/home.jsp" to the welcome pages in the web.xml.

I'm on linux and upgraded jetty without issue. So, maybe it's a windows thing.

jreichen 05-29-2010 08:23 PM

Quote:

Originally Posted by GKusnick (Post 427998)
OK, I seem to have a repeatable scenario in which restarting Jetty (using the button on its plugin configuration page) hoses all my webapps.

Attached are two directory listings of the contents of my jetty\webapps tree. Before the reset, with all apps working, the tree contains 1715 files. After the reset, the tree contains 70 files, and (not surprisingly) all the apps are broken (including Jetty's own "apps" app).

All I did in between was restart Jetty. I did not change any WARs that would have entailed redeployment.

I have Jetty logging set to Verbose and have included a copy of sagetv_0.txt, but I'm not seeing anything in there that would account for this behavior.

As I noted earlier, getting back to a working state after this requires stopping the service and manually deleting the deployments.

If there's any further experimentation I can do or information I can gather to help debug this, let me know.

Thanks Greg. I've been thinking about this and I think it's the Windows file-locking issue. When Jetty stops a web app it tries to clean up the temp folder. Any file with static content (.css, .jpg, etc) is locked but .jsp files are not. That's why the jsps are missing when the web app is started again. Since the folder already exists when the web app is started, Jetty will not try to extract the war again.

I'm not sure why sometimes it shows up as a 404 error and other times as a 503 error. Or why it seems to be happening much more frequently in SageTV v7.

I was able to create a Windows installation and recreate the issue so that helps a lot. I have a few things to try, hopefully one of those will give us a good resolution.

FYI I'm also getting reports of the same problem over in the Mobile Web UI for v7 thread.

jreichen 05-29-2010 08:27 PM

Quote:

Originally Posted by stuckless (Post 428020)
I thought I was experiencing a similar issue as greg because when I clicked the on the sagem app it just saw a directory listing... then I realized that needed to drill down to "m" to get the home page. Maybe you could add "m/home.jsp" to the welcome pages in the web.xml.

I just updated the OP with that shortly before you posted. The context xml needs to be updated for web apps that need more in their URL than just the context path. That's part of what is on the dev wiki page.

Quote:

Originally Posted by stuckless (Post 428020)
I'm on linux and upgraded jetty without issue. So, maybe it's a windows thing.

Looks like we cross-posted...

darcilicious 05-30-2010 08:51 PM

Just another "me too" post of sorts.

I'm getting the same issue after having installed the new/beta SageAlert. The Mobile App and regular Web Interface still both work fine after updating Jetty (did that first) but as soon as I installed SageAlert (did that second), the /apps/ stopped working and SageAlert comes up as 503 Service not available.

Let me know if there's any additional info I can provide / help with. Thanks so much for all this -- it really helps to make SageTV a superior PVR solution!

GKusnick 05-30-2010 09:38 PM

Quote:

Originally Posted by jreichen (Post 428021)
Thanks Greg. I've been thinking about this and I think it's the Windows file-locking issue. When Jetty stops a web app it tries to clean up the temp folder. Any file with static content (.css, .jpg, etc) is locked but .jsp files are not. That's why the jsps are missing when the web app is started again. Since the folder already exists when the web app is started, Jetty will not try to extract the war again.

I've found a workaround, which is to change the tempDirectory in the context file from /webapps/apps to /webapps/apps/work. This apparently tells Jetty not to delete the deployment on shutdown, so the apps still work after a Jetty restart.

I'll still have to manually delete the deployments when I want to force a redeploy, but for now that's better than having the apps break every time I cycle the service.

This workaround works for Niel's webserver and SageAlert. It did not work for the mobile web app without some extra fiddling, because that app apparently has the deployment path hard-coded in menu.jsp. (I'll make a note of that in the Mobile Web UI thread as well.)

Peter_h 05-30-2010 11:23 PM

Quote:

Originally Posted by alfi33 (Post 427983)
When I go to http://<server>:<port>/apps, I get a page that looks like this.


I am able to get to the apps by using the url for each individual app. Any idea why the built-in web application start page doesn't work for me?


OK, the "apps" page was working for me. However, after installing SRE, I now get the same "problem" page as everyone else is reporting.

RandyJohnson 05-31-2010 09:46 AM

when i type in http://192.168.1.209:8080/apps and after entering the user/password I get the following error dump:

Any idea what I might be missing?

Thanks in advance...

Randy

HTTP ERROR 500

Problem accessing /apps/. Reason:
Code:

    /index.jsp(16,62) PWC6188: The absolute uri: http://java.sun.com/jsp/jstl/core cannot be resolved in either web.xml or the jar files deployed with this application

Caused by:

org.apache.jasper.JasperException: /index.jsp(16,62) PWC6188: The absolute uri: http://java.sun.com/jsp/jstl/core cannot be resolved in either web.xml or the jar files deployed with this application
        at org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:89)
        at org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:375)
        at org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:169)
        at org.apache.jasper.compiler.TagLibraryInfoImpl.generateTLDLocation(TagLibraryInfoImpl.java:433)
        at org.apache.jasper.compiler.TagLibraryInfoImpl.<init>(TagLibraryInfoImpl.java:238)
        at org.apache.jasper.compiler.Parser.parseTaglibDirective(Parser.java:498)
        at org.apache.jasper.compiler.Parser.parseDirective(Parser.java:578)
        at org.apache.jasper.compiler.Parser.parseElements(Parser.java:1642)
        at org.apache.jasper.compiler.Parser.parse(Parser.java:181)
        at org.apache.jasper.compiler.ParserController.doParse(ParserController.java:239)
        at org.apache.jasper.compiler.ParserController.parse(ParserController.java:140)
        at org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:199)
        at org.apache.jasper.compiler.Compiler.compile(Compiler.java:435)
        at org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:608)
        at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:360)
        at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:486)
        at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:380)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
        at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:502)
        at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:389)
        at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)
        at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:181)
        at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:765)
        at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:417)
        at org.mortbay.jetty.servlet.Dispatcher.forward(Dispatcher.java:334)
        at org.mortbay.jetty.servlet.Dispatcher.forward(Dispatcher.java:126)
        at org.mortbay.jetty.servlet.DefaultServlet.doGet(DefaultServlet.java:493)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:707)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
        at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:502)
        at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
        at org.mortbay.servlet.UserAgentFilter.doFilter(UserAgentFilter.java:81)
        at org.mortbay.servlet.GzipFilter.doFilter(GzipFilter.java:131)
        at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1148)
        at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:387)
        at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)
        at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:181)
        at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:765)
        at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:417)
        at org.mortbay.jetty.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:230)
        at org.mortbay.jetty.handler.HandlerCollection.handle(HandlerCollection.java:114)
        at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
        at org.mortbay.jetty.handler.rewrite.RewriteHandler.handle(RewriteHandler.java:230)
        at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
        at org.mortbay.jetty.Server.handle(Server.java:326)
        at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:534)
        at org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:864)
        at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:539)
        at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:212)
        at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404)
        at org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:409)
        at org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:520)


Brent94Z 05-31-2010 10:30 AM

I got this all working but had to do some "extra" stuff.

First, I know I updated the plugin but then didn't try anything so not sure when/where the problems came about but here is what I noticed that might help you troubleshoot some of these problems...

When I went into my installed plugins I had several that were "Failed" and all appeared to be related to Jetty. I just did a complete reload of my entire system so wasn't sure if this is what broke it so wanted to check the settings. Under Jetty there was no longer a "configure" button??? I could reset it but not configure it? So, I decided to just uninstall all the web related stuff and Jetty. I then re-installed Jetty and it was showing as "Installed" but I still had no configure button. If I would exit Sage then restart and go back into the plugins, it would again tell me that Jetty "Failed". I uninstalled and reinstalled the Jetty plugin a couple times with the same results. I finally decided to just delete EVERY plugin in every tab on the plugins page (even all the Library plugins).

After I had every plugin removed, I reinstalled the Jetty plugin. This indicated it worked but it didn't untill I exited Sage and then went back to the Jetty plugin. I finally had the "Configure" button back! I configured it to my settings, installed the web app and mobile web app and both are working as well as the "apps" page you talk about above.

I'm no expert but to me it seems like the "Uninstall" button for Jetty doesn't remove enough "stuff". Mine only worked after I manually uninstalled the library files. Also, after installation of "Jetty", Sage needed to be restarted but the plugin install never asked me to do this... I had to restart manually.

Also, what took me for a bit of a loop and not sure if this changed or I just changed the way I input it but when configuring the password for Jetty, I used my keyboard and entered a 4 digit number. I could have swore this is the way I did this last week when I first set this up but maybe not??? Anyway, from a different computer I couldn't get into it... I knew it was at least kinda working because the password box popped up but it wouldn't take my password! On a whim, I remembered seeing some letters pop up when I was entering the numbers so re-entered the password from my HTPC and it worked so I took note of the LETTERS that popped up when I was entering the numbers. I tried these and they worked from my remote computer. I tried to change my password using the remote and same thing happened. I'm pretty certain I didn't press the "6" key like four times just to get the number "6" for a password so I think this changed as well and is something to be aware of. Might be obvious to "texters" but I didn't really pay much attention when entering the password and didn't at first notice that when hitting "6" on the remote or keyboard, it really isn't "6". LOL

Thanks for the hard work. Just wanted to post what I did to get it working. Thanks!


All times are GMT -6. The time now is 01:48 AM.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2019, vBulletin Solutions, Inc.
Copyright 2003-2005 SageTV, LLC. All rights reserved.