Tomcat 7 compatibility fixes

General discussions.

Moderator: moderators

Tomcat 7 compatibility fixes

Postby gekkio » Mon Jan 09, 2012 2:17 pm

I'm testing out Subsonic and I really want to use Tomcat 7, so I fixed some of the problems the current version (4.6) has with TC7.
This information is mainly for the Subsonic developer(s), but might be useful for anyone else trying to use Tomcat 7. :)

1. CSRF error popups
This happens because TC7 sets httpOnly cookie flag to true by default and DWR 3.0.RC1 requires cookies to not have httpOnly.

More information
Relevant DWR bug (fixed in 3.0.RC2)

Solution: Upgrade to DWR 3.0.RC2

2. ELException in userSettings.jsp
Tomcat 7 is stricter regarding property names in EL expressions. All property names must be valid Java identifiers, but userSettings.jsp contains command.new references which aren't valid because "new" is a Java keyword.

Solution: Replace command.new with command['new'] in userSettings.jsp

More information

I haven't seen any other showstoppers yet, but I'll report further findings here!
I'll make a proper bug report in sourceforge once I've found enough problems and fixes.
Last edited by gekkio on Mon Jan 09, 2012 2:59 pm, edited 1 time in total.
gekkio
 
Posts: 4
Joined: Mon Jan 09, 2012 2:04 pm

Re: Tomcat 7 compatibility fixes

Postby gekkio » Mon Jan 09, 2012 2:26 pm

3. ELException in personalSettings.jsp
Same as problem 2, but here the reserved keyword is "default".

Solution: Change the variable name to defaultMsg (var="default" -> var="defaultMsg"). Change the expression to ${defaultMsg}.
gekkio
 
Posts: 4
Joined: Mon Jan 09, 2012 2:04 pm

Re: Tomcat 7 compatibility fixes

Postby gekkio » Mon Jan 09, 2012 2:43 pm

4. ELExceptions in main.jsp, shareSettings.jsp, podcastReceiver.jsp
Once again the same problem, but in these files the reserved keyword is "class".

Solution: Change the variable name to htmlClass (var="class" -> var="htmlClass"). Change the expressions to ${htmlClass}
gekkio
 
Posts: 4
Joined: Mon Jan 09, 2012 2:04 pm

Re: Tomcat 7 compatibility fixes

Postby gekkio » Mon Jan 09, 2012 2:53 pm

5. Javascript errors and the flash player doesn't work
This is probably related to the DWR 3.0.RC2 upgrade. The problem is that in playlist.jsp DWR "engine.js" and "util.js" are included after, not before the scripts that require DWR (e.g nowPlayingService.js).

Solution: Move "/dwr/engine.js" and "/dwr/util.js" script tags before "/dwr/interface/nowPlayingService.js".
gekkio
 
Posts: 4
Joined: Mon Jan 09, 2012 2:04 pm

Re: Tomcat 7 compatibility fixes

Postby chugmonkey » Sat Jan 14, 2012 11:39 pm

Hi Gekkio,

I am relieved that someone has posted fixes so soon after my move to Tomcat 7 on x64 build Win7. Thank you so much for your time and effort, you make it seem so simple!

I would also suggest changing ${empty class} to ${empty htmlClass} in podcastReceiver.jsp

Cheers,
Pete
chugmonkey
 
Posts: 20
Joined: Wed Jun 25, 2008 10:11 am

Re: Tomcat 7 compatibility fixes

Postby Robandcathy » Tue Jan 17, 2012 12:53 am

Thank you too, I have acutally have no clue on the posts, but do know when I tried to run tomcat 7 subsonic would not function without errors, would be grat if you would be abel to make a patch file for us that do not know any better. Probably eaiser then explaining it in lame mans terms.
Pain is a state of mind
Weak minded people feel pain
User avatar
Robandcathy
 
Posts: 64
Joined: Mon Sep 12, 2011 12:31 am

Re: Tomcat 7 compatibility fixes

Postby Robandcathy » Sat Feb 11, 2012 7:10 pm

Im really happy someone is working on this, and would be great if subsonic worked seamless with tomcat. Its only a benifit to have the two go hand in hand, as one software advances so should the other. I know not everyone uses it it, but for people like my self who have a dedicated server, this was my only option. Hope the info keeps coming or a update will be in place soon.
Pain is a state of mind
Weak minded people feel pain
User avatar
Robandcathy
 
Posts: 64
Joined: Mon Sep 12, 2011 12:31 am

Re: Tomcat 7 compatibility fixes

Postby ace518 » Wed Feb 22, 2012 9:46 am

very helpful. thank you.
ace518
 
Posts: 13
Joined: Mon Apr 04, 2011 3:32 pm

Re: Tomcat 7 compatibility fixes

Postby porkcharsui » Thu Mar 08, 2012 7:57 am

Thank you for all the pointers! I ran into the same issue with the EL error so incorporated the changes into Supersonic, a opensource collaborative fork of Subsonic (issue). And to answer Robandcathy's question ... a Tomcat 7 ready WAR is ready for download :)

For some more background on the fork: viewtopic.php?f=3&t=3521
porkcharsui
 
Posts: 15
Joined: Mon Jun 14, 2010 3:15 am

Re: Tomcat 7 compatibility fixes

Postby jdubso » Sun Mar 25, 2012 5:23 pm

I installed the supersonic 4.7 WAR file and I am still receiving the CSRF error messages in Tomcat 7.
jdubso
 
Posts: 40
Joined: Tue Mar 15, 2011 11:55 am
Location: United States

Re: Tomcat 7 compatibility fixes

Postby porkcharsui » Mon Mar 26, 2012 1:04 am

This should have been fixed here: https://github.com/Mach5/supersonic/pull/28

I've only made the EL tag changes since I modified my server.xml
porkcharsui
 
Posts: 15
Joined: Mon Jun 14, 2010 3:15 am

Re: Tomcat 7 compatibility fixes

Postby Robandcathy » Sun Apr 15, 2012 10:39 pm

Im getting the same error, just downloaded the newest version 7.2.7 I think and no luck on how to fix this.
Also could use some help, I followed this viewtopic.php?f=6&t=7566
well written, but Im stuck with the bindings and url redirect, I managed to get bout subsonic and tomcat working on my local machine but no longer can access it outside the server. Not sure what in this tutorial is misplaced, or if there might be a different way to do this with Tomcat 7? any help would make me grateful.
Pain is a state of mind
Weak minded people feel pain
User avatar
Robandcathy
 
Posts: 64
Joined: Mon Sep 12, 2011 12:31 am

Re: Tomcat 7 compatibility fixes

Postby Robandcathy » Wed Apr 18, 2012 1:12 am

Ok reverted to tomcat 6 using this viewtopic.php?f=6&t=7566
But... that same setup will not work with tomcat 7, allows you to connect via the local server but not via network, I did not even resetup IIS, just installed tomcat and the current .war file and it was back online, using the same settings that I had previously set up for tomcat 7 settings, does anyone care to make a walk through. I know there are many gifted and talanted people that know how to do this, and might be abel to share a lame mans version for us not so code oriented people.
Pain is a state of mind
Weak minded people feel pain
User avatar
Robandcathy
 
Posts: 64
Joined: Mon Sep 12, 2011 12:31 am

Re: Tomcat 7 compatibility fixes

Postby kwak300 » Sat Apr 13, 2013 9:24 pm

I just add this line in /etc/tomcat7/catalina.properties and I restart tomcat :
Code: Select all
org.apache.el.parser.SKIP_IDENTIFIER_CHECK=true

It fix the EL excepotions '2.3.4.) without changing source code.
With this only change Subsonic work's fine for me.I don't know if it fix the other issues, I just install subsonic since 2 hours and i didn't test everything.

Excuse me for my english, I'm french and my english is not perfect.
kwak300
 
Posts: 2
Joined: Sat Apr 13, 2013 9:09 pm

Re: Tomcat 7 compatibility fixes

Postby kwak300 » Sun Apr 14, 2013 9:41 pm

To fix the CSRF error popups (1.)
Edite the tomcat7 config file context.xml (in linux debian the files is /ect/tomact7/context.xml) and change the line:
Code: Select all
<Context>

by
Code: Select all
<Context useHttpOnly="false">

source : http://blog.2partsmagic.com/2010/11/res ... or-popups/
kwak300
 
Posts: 2
Joined: Sat Apr 13, 2013 9:09 pm

Next

Return to General

Who is online

Users browsing this forum: No registered users and 5 guests