Page 1 of 2

Tomcat 7 compatibility fixes

PostPosted: Mon Jan 09, 2012 2:17 pm
by gekkio
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.

Re: Tomcat 7 compatibility fixes

PostPosted: Mon Jan 09, 2012 2:26 pm
by gekkio
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}.

Re: Tomcat 7 compatibility fixes

PostPosted: Mon Jan 09, 2012 2:43 pm
by gekkio
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}

Re: Tomcat 7 compatibility fixes

PostPosted: Mon Jan 09, 2012 2:53 pm
by gekkio
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".

Re: Tomcat 7 compatibility fixes

PostPosted: Sat Jan 14, 2012 11:39 pm
by chugmonkey
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

Re: Tomcat 7 compatibility fixes

PostPosted: Tue Jan 17, 2012 12:53 am
by Robandcathy
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.

Re: Tomcat 7 compatibility fixes

PostPosted: Sat Feb 11, 2012 7:10 pm
by Robandcathy
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.

Re: Tomcat 7 compatibility fixes

PostPosted: Wed Feb 22, 2012 9:46 am
by ace518
very helpful. thank you.

Re: Tomcat 7 compatibility fixes

PostPosted: Thu Mar 08, 2012 7:57 am
by porkcharsui
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

Re: Tomcat 7 compatibility fixes

PostPosted: Sun Mar 25, 2012 5:23 pm
by jdubso
I installed the supersonic 4.7 WAR file and I am still receiving the CSRF error messages in Tomcat 7.

Re: Tomcat 7 compatibility fixes

PostPosted: Mon Mar 26, 2012 1:04 am
by porkcharsui
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

Re: Tomcat 7 compatibility fixes

PostPosted: Sun Apr 15, 2012 10:39 pm
by Robandcathy
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.

Re: Tomcat 7 compatibility fixes

PostPosted: Wed Apr 18, 2012 1:12 am
by Robandcathy
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.

Re: Tomcat 7 compatibility fixes

PostPosted: Sat Apr 13, 2013 9:24 pm
by kwak300
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.

Re: Tomcat 7 compatibility fixes

PostPosted: Sun Apr 14, 2013 9:41 pm
by kwak300
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/