PDA

View Full Version : Upgrading Jetty from SageTV 6 to SageTV 7


jreichen
05-20-2010, 12:00 AM
In SageTV 7, it is no longer necessary to go to various web sites (SourceForge.net, Google Code, etc) to install plugins. They can be installed from one place in the SageTV Plugin Manager. In addition to that, in order to make the migration of Jetty from SageTV 6 to SageTV 7 as smooth as possible, the Jetty plugin does some magic the first time it's run on SageTV 7.

Cleans up the load_at_startup_runnable_classes entry
V7 plugins like Jetty are started differently than in previous SageTV versions. The load_at_startup_runnable_classes entry in Sage.properties is no longer used and the Jetty-specific classes will be automatically removed when Jetty starts in V7.

Migrates properties
Originally I wanted users to be able to change Jetty's properties and restart it without restarting SageTV. To do that, I put all the properties in JettyStarter.properties so the user wouldn't have to shut down SageTV to edit the properties file. However I never got around to supporting the restarting of Jetty.

Since Jetty can now be restarted within the new plugin editor in SageTV 7, I'm moving all the properties to Sage.properties. The plugin reads all your existing properties from JettyStarter.properties and moves them to the set of properties prefixed by jetty/ in Sage.properties. You will not need to be concerned about details of this unless you decided to set up an SSL keystore in V7 (more information about this will be posted on the Jetty wiki). If you already had an SSL keystore in V6 then that will be automatically set up in V7 for you.

Existing files
There are two choices for dealing with a SageTV V6 Jetty install to ensure a smooth transition. Either uninstall Jetty (http://tools.assembla.com/sageplugins/wiki/JettyUninstall), or make sure you are running Jetty plugin 1.6 (which contains the same Jetty version - 6.1.19 - as the Jetty plugin 1.7 EDIT: there will not be an official version 1.7, it will be version 2.0 instead). Either of these methods ensures that you will not end up with duplicate JAR files in your JARs folder.

Future updates
As updates are delivered in the future, you will see a message to update them in SageTV's plugin manager. Your existing settings such as port numbers (Sage.properties) and users (jetty/etc/realm.properties) will be preserved - no need to back them up!

medwynd
05-20-2010, 12:04 AM
So we can grab updates right from the plugin manager?

jreichen
05-20-2010, 12:09 AM
You can grab updates, browse for new plugins, configure plugins, etc right from the SageTV UI.

ace007
05-20-2010, 01:17 PM
If I try to set a new username and password for the web server it says incorrect password as I try to set a new password in the sage 7 UI. Are there complexity restrictions on the password.

Great job on the improvements.

jreichen
05-20-2010, 01:31 PM
No. The dialog asks for your current password first, then the new password twice. If you have the default password, then it is 'frey'. The next update will say that in the help text.

sic0048
05-21-2010, 08:14 AM
I have never installed Jetty or attempted to use any of the newer Jetty addons. Now that v7 is out, it seems like a good time to move to these plugins.

Can I simply add the "Jetty Web Server" plugin for v7 and get all the Jetty backbone parts that I need now? I'm hoping it is that simple, but wanted to make sure.

Once that plugin is installed, then I assume I can load up the new Jetty Web Browser and other plugins that are available.

jreichen
05-21-2010, 08:59 AM
Yes selecting Jetty will give you the server and you can configure the HTTP port etc from the plugin configuration screen. But that in itself won't give you anything useful, you'll then need to install the web UI, mobile web UI, recording extender (SRE), metadata tools (BMT), etc web apps.

There's still a little work to do as far as guiding the user to the right URL, but the functionality is all there. To get to the apps go to http://<server>:<port>/sage/Home (web UI), /sagem/m/menu.jsp (mobile web UI), /sre, /bmt, etc.

EDIT: You can install one of the web apps and it will pick up Jetty as a dependency and install it for you.

sic0048
05-21-2010, 09:09 AM
EDIT: You can install one of the web apps and it will pick up Jetty as a dependency and install it for you.

Even better!

It seems that this new plugin idea for V7 is going to make all this customization much easier.

Thanks,

Enormous
05-21-2010, 02:23 PM
What if I'm still running the older, non-Jetty version (v2.25 Tiny Java WS version with SSL keystore, users, port all set up)? Will installing Jetty from v7 pick up my pre-existing configuration? If not, what is my best upgrade option?

jreichen
05-21-2010, 02:35 PM
There's a wiki page (from Sage v6) about moving nielm's web server from TJWS to Jetty (http://tools.assembla.com/sageplugins/wiki/WebServerV2onJetty). That will get you up to Jetty 1.6. Once you're there you can upgrade to Jetty 1.7 from the plugin manager and it will migrate your settings to the new plugin system, including SSL.

Enormous
05-21-2010, 03:21 PM
There's a wiki page (from Sage v6) about moving nielm's web server from TJWS to Jetty (""). That will get you up to Jetty 1.6. Once you're there you can upgrade to Jetty 1.7 from the plugin manager and it will migrate your settings to the new plugin system, including SSL.
Thank you. I'll do that this evening!

jreichen
05-21-2010, 04:27 PM
OK let me know how it goes. I tried to automate the upgrade but there are too many scenarios to cover them all automatically. This is probably the most complex. My recommendation is to either manually get Jetty to version 1.6 (http://tools.assembla.com/sageplugins/wiki/JettyUpgrade), or uninstall Jetty (http://tools.assembla.com/sageplugins/wiki/JettyUninstall). Then install/upgrade Jetty 1.7 from the plugin manager. From that point forward you can always use the plugin manager.

beerandt
05-21-2010, 05:10 PM
How can I check my jetty version? I'm pretty sure it's 1.6, but I want to make sure. I didn't see it under system information. I think there was a page in SageMC that displayed it, (along with phoenix version, etc) but I don't see it anywhere in the v7 stv.

Enormous
05-21-2010, 09:03 PM
I successfully migrated the nielm's web server from TJWS to Jetty. I actually had Jetty installed already (because of BMT), so all I had to do was set up my config files.

After I installed the Jetty webserver and the web interface from within SageTV v7, the web interface still says it's at version 2.25. Other than that, everything seems to be working great! Thanks again for your help.

(Also: WOW! The Jetty version is A LOT faster!)

jreichen
05-21-2010, 10:29 PM
How can I check my jetty version? I'm pretty sure it's 1.6, but I want to make sure. I didn't see it under system information. I think there was a page in SageMC that displayed it, (along with phoenix version, etc) but I don't see it anywhere in the v7 stv.You can get it from the Sage log.

jreichen
05-21-2010, 10:33 PM
I successfully migrated the nielm's web server from TJWS to Jetty. I actually had Jetty installed already (because of BMT), so all I had to do was set up my config files.

After I installed the Jetty webserver and the web interface from within SageTV v7, the web interface still says it's at version 2.25. Other than that, everything seems to be working great! Thanks again for your help.

(Also: WOW! The Jetty version is A LOT faster!)I'm glad to hear that worked for you. I've had other reports of nielm's web ui and the mobile web ui reporting the wrong version. At first I thought there might be some old jars still around, but actually I think I forgot to update those in the code :blush:

lotusvball
05-27-2010, 08:57 PM
Has anyone seen this error?

nevermind. didn't have user behind password.

TR3 Driver
05-28-2010, 05:40 AM
Has anyone seen this error?

nevermind. didn't have user behind password.

This is exactly what I'm getting. Can you explain what your solution was?

Thanks.

lotusvball
05-28-2010, 07:14 AM
I went into the Jetty folder. and then into realm.properties (i think) and behind my user: password I added ,user right after the password.


BTW. I set this up doing the install plugin option and configured it through sage. I changed the username and password. The configuration did not add the user. This seems to be a small bug. If this could be corrected it would help others. I did a new install not an upgrade from 1.6.


Where do I change the background image for the webpage?

TR3 Driver
05-28-2010, 08:49 AM
Thank you!!! That was exactly what I needed. I now have access to Metadata tools web interface, but now I'm getting a "not_found" error when I try the SageTV web interface. I'll tackle that one now.

jreichen
05-30-2010, 12:15 PM
I went into the Jetty folder. and then into realm.properties (i think) and behind my user: password I added ,user right after the password.


BTW. I set this up doing the install plugin option and configured it through sage. I changed the username and password. The configuration did not add the user. This seems to be a small bug. If this could be corrected it would help others. I did a new install not an upgrade from 1.6.I couldn't reproduce this. Can you try it again with version 2.0 of the plugin?


Where do I change the background image for the webpage?There's no option for changing the background.

peternm22
05-31-2010, 01:34 AM
I'm trying to install SJQ, which requires Jetty. The installation and restart goes fine, and both Jetty and SJQ are listed as installed in the plugin manager. However, I can't connect to Jetty at all. I've tried http://localhost:7077/sjq/ (7077 being the port I configured Jetty to run on), but it just won't connect.

How can I verify that Jetty is in fact installed correctly and running?

Thanks.

jreichen
05-31-2010, 09:41 AM
I'm trying to install SJQ, which requires Jetty. The installation and restart goes fine, and both Jetty and SJQ are listed as installed in the plugin manager. However, I can't connect to Jetty at all. I've tried http://localhost:7077/sjq/ (7077 being the port I configured Jetty to run on), but it just won't connect.

How can I verify that Jetty is in fact installed correctly and running?

Thanks.What do you get at http://localhost:7077/ ? Does the browser show an HTTP error number on either page?

Turn on SageTV's debug log (http://forums.sagetv.com/forums/showthread.php?p=149076#post149076), then see if there's anything in there or post it here and I'll look at it. If that doesn't provide enough detail, you might also want to increase Jetty's log level using Jetty's config options in the Plugin Manager.

peternm22
05-31-2010, 11:40 AM
Here's the error message I am getting:

Unable to connect
Firefox can't establish a connection to the server at localhost:7077.

It doesn't seem to be an error coming from Jetty, it seems like it can't even connect to Jetty at all.

I've attached my SageTV log file. I took a look at it, and can't seem to find anything out of place (but then again, I'm not sure what I'm looking for).

Also note that I'm still running nielm's old webserver on port 8080, which has been functioning fine. I would like to upgrade to the new version once I get Jetty working.

Thanks for the help.

robogeek
05-31-2010, 11:53 AM
Here's the error message I am getting:



It doesn't seem to be an error coming from Jetty, it seems like it can't even connect to Jetty at all.

I've attached my SageTV log file. I took a look at it, and can't seem to find anything out of place (but then again, I'm not sure what I'm looking for).

Also note that I'm still running nielm's old webserver on port 8080, which has been functioning fine. I would like to upgrade to the new version once I get Jetty working.

Thanks for the help.

Looks like you've got some duplicate .jar files for a previous jetty version in the SageTV\JARs folder and they are probably conflicting and preventing jetty from starting.

peternm22
05-31-2010, 12:02 PM
Do you know which JARS that would be? Is there a list anywhere of the old files?

Thanks.

peternm22
05-31-2010, 12:07 PM
Hurrah! I went through my JAR directory to see if I could spot anything "old" and noticed 3 JAR files with identical names (except for the version numbers), I removed them and restarted Sage, and it's working again.

Thanks for your help guys!

robogeek
05-31-2010, 06:28 PM
Hurrah! I went through my JAR directory to see if I could spot anything "old" and noticed 3 JAR files with identical names (except for the version numbers), I removed them and restarted Sage, and it's working again.

Thanks for your help guys!

I'm guessing you found the 3 jetty files:
jetty-6.1.11.jar
jetty-sslengine-6.1.11.jar
jetty-util-6.1.11.jar

There is one other that may cause issues...if not now, possibly down the road:
servlet-api-2.5-6.1.11.jar

peternm22
05-31-2010, 06:49 PM
I'm guessing you found the 3 jetty files:
jetty-6.1.11.jar
jetty-sslengine-6.1.11.jar
jetty-util-6.1.11.jar

There is one other that may cause issues...if not now, possibly down the road:
servlet-api-2.5-6.1.11.jar

Yup, you picked the 3. I'll remove the other jar you mentioned when I get a chance.

Thanks.

lotusvball
06-01-2010, 09:30 AM
I couldn't reproduce this. Can you try it again with version 2.0 of the plugin?

Do you mean just try to upgrade the plugin or unistall, put back nielm's and then try to upgrade. I upgraded to version 2.0 with no problems but I did not try to upgrade to version 2.0 from nielm's.


There's no option for changing the background.

Do you know where the background.jpg is located in the directory. I can change it from there.

darcilicious
06-01-2010, 11:20 AM
Do you know where the background.jpg is located in the directory. I can change it from there.

On my windows install it's in: C:\Program Files\SageTV\SageTV\jetty\webapps\SageWebApp\webapp\images

lotusvball
06-01-2010, 01:38 PM
On my windows install it's in: C:\Program Files\SageTV\SageTV\jetty\webapps\SageWebApp\webapp\images

I do not have a SageWeApp folder? or an images folder?

darcilicious
06-01-2010, 01:46 PM
Oops, I got confused by which plugin / webserver we were talking about, sorry!

jreichen
06-01-2010, 10:14 PM
Do you mean just try to upgrade the plugin or unistall, put back nielm's and then try to upgrade. I upgraded to version 2.0 with no problems but I did not try to upgrade to version 2.0 from nielm's.I just meant to try changing the user and password like you did before and see if it loses the 'user' role in realm.properties again.

jreichen
06-01-2010, 10:18 PM
Do you know where the background.jpg is located in the directory. I can change it from there.There directory where it's extracted is deleted every time Jetty is stopped so your change won't last very long.

sundansx
03-15-2011, 12:48 AM
There directory where it's extracted is deleted every time Jetty is stopped so your change won't last very long.

jreichen,
Could you please add this as a feature in a future version? I had an alternate bg image working with 2.28 (dont remember how I got there) and when I updated to 2.29 (with sage7 theme) the bg image I was using was gone (from the webpage display).
thanks for all your efforts. great web server app.

jreichen
03-21-2011, 10:07 PM
I fixed the stylesheet in version 2.30 (http://forums.sagetv.com/forums/showthread.php?p=488646&postcount=130) to have a background image again, although it doesn't reference a valid image in the war file so by default users will still have the solid gray background.

If you want to customize it and have the changes stick, create a SAGE_HOME/jetty/static/sage folder and put an image in there named Background.jpg.

I have Jetty configured to always check the static folder first, so anything in there will be used first and will not be overwritten when the war is extracted every time Jetty starts.