[SRU] DataSource JNDI lookup with javax.naming.Name failed

Bug #1012794 reported by John Svazic on 2012-06-13
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
tomcat7 (Ubuntu)
Wishlist
Unassigned
Precise
High
James Page

Bug Description

[Impact]
Users of tomcat7 are unable to deploy applications which use Name instead of String to complete JNDI lookups. This includes applications which make use of the most recent version of the popular hibernate ORM framework.

[Test Case]
sudo apt-get install tomcat7 libhsqldb-java
sudo ln -s /usr/share/hsqldb.jar /usr/share/tomcat7/lib/hsqldb.jar
sudo wget "https://bugs.launchpad.net/ubuntu/+source/tomcat7/+bug/1012794/+attachment/3221552/+files/ubuntu-test.war" -O /var/lib/tomcat7/webapps/ubuntu-test.war
sudo service tomcat7 restart

goto : http://localhost:8080/ubuntu-test
>> Big stack trace including "javax.naming.NamingException: This context must be accessed through a java: URL"

when fixed:

"Message Test

    Hello, world!
    It's Alive!!!"

[Regression Potential]
Minimal - the change is isolated to JNDI lookups by Name and is in later versions of tomcat7.

>> Original Bug Report <<
I realize that Tomcat was just upgraded to 7.0.26, but there are a few fixes in Tomcat 7.0.27, specifically issue 52830 (https://issues.apache.org/bugzilla/show_bug.cgi?id=52830) which causes a big problem for people, like me, who are trying to use the Tomcat connection pool with Hibernate 4.x, which fails without this fix.

Currently I updated my deployment by hand, but I would much rather have a proper package. I can't find a PPA, and my skill set is nil in terms of the ability to create my own PPA for this. Many thanks!

Robert Roth (evfool) on 2012-06-15
Changed in tomcat7 (Ubuntu):
importance: Undecided → Wishlist
James Page (james-page) wrote :
Changed in tomcat7 (Ubuntu):
status: New → Fix Released
Changed in tomcat7 (Ubuntu Precise):
milestone: none → ubuntu-12.04.1
James Page (james-page) wrote :

Marked 'Fix Released' for quantal which has 7.0.28.

James Page (james-page) wrote :

Hi John

Thanks for taking the time to report this bug in Ubuntu.

Unfortunately we can't upgrade the version of tomcat7 in 12.04 to the latest version; however we can apply updates via the Stable Release Update process for Important bugs such as the one you have hit.

As such I am going to re-title this bug report - we can cherry pick the required changes from the upstream VCS to resolve this issue.

summary: - Upgrade Tomcat7 to 7.0.27 for 12.04
+ DataSource JNDI lookup with javax.naming.Name failed
Changed in tomcat7 (Ubuntu Precise):
importance: Undecided → High
status: New → Confirmed
assignee: nobody → James Page (james-page)

Awesome, thank you James. I've hacked a solution together myself, but
your solution is perfect. Is there an ETA for this? Just curious.

On Tue, Jun 26, 2012 at 9:28 AM, James Page <email address hidden> wrote:
> Hi John
>
> Thanks for taking the time to report this bug in Ubuntu.
>
> Unfortunately we can't upgrade the version of tomcat7 in 12.04 to the
> latest version; however we can apply updates via the Stable Release
> Update process for Important bugs such as the one you have hit.
>
> As such I am going to re-title this bug report - we can cherry pick the
> required changes from the upstream VCS to resolve this issue.
>
>
> ** Summary changed:
>
> - Upgrade Tomcat7 to 7.0.27 for 12.04
> + DataSource JNDI lookup with javax.naming.Name failed
>
> ** Changed in: tomcat7 (Ubuntu Precise)
>   Importance: Undecided => High
>
> ** Changed in: tomcat7 (Ubuntu Precise)
>       Status: New => Confirmed
>
> ** Changed in: tomcat7 (Ubuntu Precise)
>     Assignee: (unassigned) => James Page (james-page)
>
> --
> You received this bug notification because you are subscribed to the bug
> report.
> https://bugs.launchpad.net/bugs/1012794
>
> Title:
>  DataSource JNDI lookup with javax.naming.Name failed
>
> Status in “tomcat7” package in Ubuntu:
>  Fix Released
> Status in “tomcat7” source package in Precise:
>  Confirmed
>
> Bug description:
>  I realize that Tomcat was just upgraded to 7.0.26, but there are a few
>  fixes in Tomcat 7.0.27, specifically issue 52830
>  (https://issues.apache.org/bugzilla/show_bug.cgi?id=52830) which
>  causes a big problem for people, like me, who are trying to use the
>  Tomcat connection pool with Hibernate 4.x, which fails without this
>  fix.
>
>  Currently I updated my deployment by hand, but I would much rather
>  have a proper package.  I can't find a PPA, and my skill set is nil in
>  terms of the ability to create my own PPA for this.  Many thanks!
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/ubuntu/+source/tomcat7/+bug/1012794/+subscriptions

@John

I've targeted it to 12.04.1 which is due in August - but I expect to have it ready for testing in -proposed in the next two weeks.

James Page (james-page) wrote :

@John

What would be really helpful would be a simple test case which anyone could run - is this something you could put together? This will help alot with the SRU process.

@James

I'll try to whip up a simple .war file that can be deployed and attach
it to this bug. I'll aim to get something to you by EOW.

On Tue, Jun 26, 2012 at 10:42 AM, James Page <email address hidden> wrote:
> @John
>
> What would be really helpful would be a simple test case which anyone
> could run - is this something you could put together? This will help
> alot with the SRU process.
>
> --
> You received this bug notification because you are subscribed to the bug
> report.
> https://bugs.launchpad.net/bugs/1012794
>
> Title:
>  DataSource JNDI lookup with javax.naming.Name failed
>
> Status in “tomcat7” package in Ubuntu:
>  Fix Released
> Status in “tomcat7” source package in Precise:
>  Confirmed
>
> Bug description:
>  I realize that Tomcat was just upgraded to 7.0.26, but there are a few
>  fixes in Tomcat 7.0.27, specifically issue 52830
>  (https://issues.apache.org/bugzilla/show_bug.cgi?id=52830) which
>  causes a big problem for people, like me, who are trying to use the
>  Tomcat connection pool with Hibernate 4.x, which fails without this
>  fix.
>
>  Currently I updated my deployment by hand, but I would much rather
>  have a proper package.  I can't find a PPA, and my skill set is nil in
>  terms of the ability to create my own PPA for this.  Many thanks!
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/ubuntu/+source/tomcat7/+bug/1012794/+subscriptions

James Page (james-page) wrote :

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

On 26/06/12 15:53, John Svazic wrote:
> I'll try to whip up a simple .war file that can be deployed and
> attach it to this bug. I'll aim to get something to you by EOW.

Fantastic! Thanks very much.

- --
James Page
Ubuntu Core Developer
Debian Maintainer
<email address hidden>
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iQIcBAEBCAAGBQJP6d8LAAoJEL/srsug59jDpf0P/0l6hB93zOaL4JDX/OJ6bMpZ
zDCGmbR/s6150Jtu4t+cIHwU3ILYYRxSF6uetEpzviQLQwo1dHoSv13wgvWKNwYe
b6fvLEphNdK86x0+H3KE9mUHQ8xrpcTCDg7BziRmEyLpr0w/9qDGTSHF3rmk1AGL
dwaEQswzCRNM4V4XvnHioPSt/yzr9SMgkigPCTvfG4T1O9T4qGQhmzVdRtqKVoCM
RWvAvfl0Dxbq6xJo5Q+rPL+LNtrVKmoWcswc39dsfa21g3K+JSLFgbgwRwjZo10B
QvE1EYUfDpLuHjfpoyauU+31tD98cSXkmLNbAUTLEkN5ZBW26qkVPtxrf9SGgifA
tWaDUIC4h5syiCSQiHxDtRtfL604S/DTPb/1gRjrSZ+lkvxUkW7t3buY6r8mUEjk
XXiqz5oOErCX0JYTuv1+r60pQlsT5mt2TYMtGds2XBqhHw362ssvvVmG9L5GPl8h
//1M8AhJ7RdxnrNX/dYUzwMHqk72ANOkF7kJnlGBZTKeJw1NhqJKTk6AXBm4vdtO
eQdeGGCIdtI1oLLXMfosjvKErM+5DxMYC94UMsHhdkHb7dvTls/10KqRJXNkWch2
SL7WezvcxN9dGtuS7VjZoFKL+b7He2RDX7cKFzFlVTGGAx0KLUGYXQQTo4Vj8ohS
63TezjddjApTG4S75o0p
=RgAg
-----END PGP SIGNATURE-----

Apologies for the delay, but I've finally whipped up a sample to demonstrate the issue (and can be re-used to confirm that it is fixed with 7.0.28). The .war file is attached, but I would recommend that you take a look at the Github project at https://github.com/jsvazic/ubuntu-tomcat-test to get the HSQLDB .jar file that is needed in the Tomcat path in order to run the app. Please let me know if you have any questions.

Stéphane Graber (stgraber) wrote :

Looks like we have a testcase and a fix, James, are you planning on uploading the SRU in the next few days?

Changed in tomcat7 (Ubuntu Precise):
status: Confirmed → Triaged
James Page (james-page) wrote :
description: updated
description: updated
James Page (james-page) wrote :

@John

Thanks again for the example web application - I did have to make one tweak as Ubuntu do not ship the jdbc-pool tomcat module; removing this reference from the webapp context.xml makes tomcat7 use the one which is default from commons-dbcp.

description: updated
description: updated
James Page (james-page) wrote :

Uploaded to -proposed for SRU team review.

summary: - DataSource JNDI lookup with javax.naming.Name failed
+ [SRU]DataSource JNDI lookup with javax.naming.Name failed
summary: - [SRU]DataSource JNDI lookup with javax.naming.Name failed
+ [SRU] DataSource JNDI lookup with javax.naming.Name failed
Changed in tomcat7 (Ubuntu Precise):
status: Triaged → In Progress

Hello John, or anyone else affected,

Accepted tomcat7 into precise-proposed. The package will build now and be available at http://launchpad.net/ubuntu/+source/tomcat7/7.0.26-1ubuntu1.1 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please change the bug tag from verification-needed to verification-done. If it does not, change the tag to verification-failed. In either case, details of your testing will help us make a better decision.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance!

Changed in tomcat7 (Ubuntu Precise):
status: In Progress → Fix Committed
tags: added: verification-needed
James Page (james-page) wrote :

Tested OK

ubuntu@server-266:/usr/share/activemq/bin$ curl http://localhost:8080/ubuntu-test/
<html>
<body>
<h2>Message Test</h2>
<ul>

  <li>Hello, world!</li>

  <li>It's Alive!!!</li>

</ul>
</body>
</html>

tags: added: verification-done
removed: verification-needed

The verification of this Stable Release Update has completed successfully and the package has now been released to -updates. Subsequently, the Ubuntu Stable Release Updates Team is being unsubscribed and will not receive messages about this bug report. In the event that you encounter a regression using the package from -updates please report a new bug using ubuntu-bug and tag the bug report regression-update so we can easily find any regresssions.

Launchpad Janitor (janitor) wrote :

This bug was fixed in the package tomcat7 - 7.0.26-1ubuntu1.1

---------------
tomcat7 (7.0.26-1ubuntu1.1) precise-proposed; urgency=low

  * Fix handling of JNDI lookups using javax.naming.Name (LP: #1012794):
    - d/patches/0012-lp-1012794-fix-jndi-lookup.patch: Cherry picked patch
      from upstream VCS which ensures that JNDI lookups that use Name
      rather than String don't fail.
 -- James Page <email address hidden> Thu, 12 Jul 2012 21:52:17 +0100

Changed in tomcat7 (Ubuntu Precise):
status: Fix Committed → Fix Released
James Page (james-page) wrote :

John - thanks for your help on the test case for this SRU - very much appreciated.

No worries James, thanks for the quick turnaround!

On Thu, Jul 26, 2012 at 1:12 PM, James Page <email address hidden> wrote:
> John - thanks for your help on the test case for this SRU - very much
> appreciated.
>
> --
> You received this bug notification because you are subscribed to the bug
> report.
> https://bugs.launchpad.net/bugs/1012794
>
> Title:
> [SRU] DataSource JNDI lookup with javax.naming.Name failed
>
> Status in “tomcat7” package in Ubuntu:
> Fix Released
> Status in “tomcat7” source package in Precise:
> Fix Released
>
> Bug description:
> [Impact]
> Users of tomcat7 are unable to deploy applications which use Name instead of String to complete JNDI lookups. This includes applications which make use of the most recent version of the popular hibernate ORM framework.
>
> [Test Case]
> sudo apt-get install tomcat7 libhsqldb-java
> sudo ln -s /usr/share/hsqldb.jar /usr/share/tomcat7/lib/hsqldb.jar
> sudo wget "https://bugs.launchpad.net/ubuntu/+source/tomcat7/+bug/1012794/+attachment/3221552/+files/ubuntu-test.war" -O /var/lib/tomcat7/webapps/ubuntu-test.war
> sudo service tomcat7 restart
>
> goto : http://localhost:8080/ubuntu-test
> >> Big stack trace including "javax.naming.NamingException: This context must be accessed through a java: URL"
>
> when fixed:
>
> "Message Test
>
> Hello, world!
> It's Alive!!!"
>
>
> [Regression Potential]
> Minimal - the change is isolated to JNDI lookups by Name and is in later versions of tomcat7.
>
> >> Original Bug Report <<
> I realize that Tomcat was just upgraded to 7.0.26, but there are a few fixes in Tomcat 7.0.27, specifically issue 52830 (https://issues.apache.org/bugzilla/show_bug.cgi?id=52830) which causes a big problem for people, like me, who are trying to use the Tomcat connection pool with Hibernate 4.x, which fails without this fix.
>
> Currently I updated my deployment by hand, but I would much rather
> have a proper package. I can't find a PPA, and my skill set is nil in
> terms of the ability to create my own PPA for this. Many thanks!
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/ubuntu/+source/tomcat7/+bug/1012794/+subscriptions

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers

Bug attachments

Remote bug watches

Bug watches keep track of this bug in other bug trackers.