#824 ✓wontfix

Dependencies in module PDF-0.2 gets loaded before Play! framework libraries

Reported by nicmarti | May 12th, 2011 @ 07:53 AM | in 1.3 (closed)

Play! Framework will load some classes from PDF libs module subfolder instead of framework libs.

I discovered this issue with OpenID : my users can't authenticate anymore on my application. The reason is that I recently added a new feature that use PDF module. When this module is active, since it bundles some libraries such as XML/SAX/DOM utilities, it crashes.

Framework version: 1.1, 1.1.1 and 1.2
Platform you're using: macos and playapps

Reproduction steps:
- create a new application - copy/paste the OpenID play! sample in this new application - authenticate on a secure HTTPS OpenID provider such as Google : https://www.google.com/accounts/o8/id - it works - stop the application - install the PDF module on your application - add-it to application.conf - restart - try to authenticate on Google : it won't work

If you want to remove the pdf module:
- comment-out the pdf module in your application.conf - stop your app - do a "play clean" (else it won't work) - restart the app and the openID will work

Diagnostic and possible reason:
This error is due to a classpath issue with some XML/SAX/DOM libraries in the PDF-0.2 libs folder that are loaded before the default Play! libraries. What is not expected is that the module classpath has a higher priority than the default Play! Framework libs folder. Thus, one can corrupt its Play! setup with a bad library. There's no classloader isolation between the module and the core play! framework application.

If one starts its application with "play run -verbose:class" it is then easy to see that Play! loads some dependencies not from Play! Framework lib but from the module libs/ subfolder.

I attached the verbose classloader output with/without the PDF module activated.
Chec the classloader activity

I don't really know how to fix this issue.
If a user creates a module and has to configure a dedicated classloader for a specific set of jars, it should not impact Play! Framework


Nicolas Martignole

Comments and changes to this ticket

  • Adam Brimo

    Adam Brimo August 23rd, 2011 @ 11:29 AM

    We recently came across this problem when using OpenID and we were able to get around it (although that doesn't solve the greater issue).

    In short, OpenID uses the standard DocumentBuilderFactory to find the appropriate xml parser. Getting a new instance with the factory causes it to dynamically work out which factory to use and the problematic jar (shanijar-yahp.jar) higher up the class path causes it to pick an incompatible one (org.allcolor.xml.parser.CDocumentBuilderFactory).

    The correct (or at least working/default) factory OpenID expects is com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderFactoryImpl - according to the documentation, we can tell it which one to choose: http://download.oracle.com/javase/1.5.0/docs/api/javax/xml/parsers/...

    The easiest way to do that is by setting the system property before we use OpenID.
    System.setProperty("javax.xml.parsers.DocumentBuilderFactory", "com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderFactoryImpl");

    I'm not sure the best way to solve the general problem but hopefully this helps some other people stuck on this issue.

  • Nicolas Leroux

    Nicolas Leroux September 1st, 2011 @ 10:04 AM

    • State changed from “new” to “confirmed”
    • Assigned user changed from “Guillaume Bort” to “Nicolas Leroux”
  • Nicolas Leroux

    Nicolas Leroux October 18th, 2011 @ 06:34 PM

    • State changed from “confirmed” to “inprogress”
    • Milestone set to 1.3
    • Milestone order changed from “398” to “0”
  • Nicolas Leroux

    Nicolas Leroux October 18th, 2011 @ 07:08 PM

    • State changed from “inprogress” to “wontfix”

    Latest pdf module solve the issue and workaround is applicable.

  • Martha Wilson

    Martha Wilson December 27th, 2017 @ 07:29 AM

    I managed to get this to work by using Ivy instead of Maven to publish the artifact, and writing the ivy.xml manually.
    fnaf free full games, best survival games online

  • Lillian Mcneil

    Lillian Mcneil January 5th, 2018 @ 10:38 AM

    The content seems wonderful though, I have been working on a few superior papers review and they were pretty brilliant with regards to the framework libraries. I appreciate the way you have presented this guide with us, Have a great day ahead.

  • suzain lian

    suzain lian January 15th, 2018 @ 12:43 PM

    Yeah seriously, i am a self taught programmer who is going to highschool Essay Help for my diploma now because almost every business enterprise that I desired to use to required one.

  • derryfin

    derryfin January 18th, 2018 @ 09:09 AM

    I just want to let you know that i just check out your site and I find it very interesting and informative.. Long Settlement

  • Stephen Hawking

    Stephen Hawking January 19th, 2018 @ 06:11 AM

    What isn't normal is that the module classpath has a higher need than the default Play! Structure libs envelope. Along these lines, one can degenerate its Play! setup with an awful library. Write my Essay There's no classloader separation between the module and the center play! system application. On the off chance that one begins its application with "play run - verbose: class" it is then simple to see that Play! stacks a few conditions not from Play! System lib however from the module libs/subfolder.

  • Alex ferguson

    Alex ferguson January 20th, 2018 @ 07:23 AM

    We as of late went over this issue when utilizing OpenID and we could get around it (despite the fact that that doesn't comprehend the more noteworthy issue). To put it plainly, OpenID utilizes the standard Custom Essay Writing Service UK to locate the suitable XML parser. Getting another occurrence with the production line makes it progressively work out which manufacturing plant to utilize and the tricky jug

  • derryfin

    derryfin January 24th, 2018 @ 11:20 AM

    While i acquired on your web log however adding awareness just a bit touch submits. Nice technique for potential, We are book-marking during a period find versions conclude spgs way up. kids summer day care

  • derryfin

    derryfin January 27th, 2018 @ 11:45 AM

    I enjoy kinds very own post. It'll be respectable to get a single describe inside terms from the central and also chastity on this distinct essential specialized niche will probably be commonly knowledgeable. قیمت طراحی سایت

  • melisaann

    melisaann March 16th, 2018 @ 06:11 PM

    This one makes me snigger because i was speaking about 'epitome' mainly with woman i was seeing. And positive enough, that night time while at a ceremonial dinner honoring a group of different people from her work, one of the audio system used the mispronounced Best Essay Writers of epitome twice in the same speech. My date and that i had to work truely tough at not busting out giggling. now not due to the fact she said it wrong, but due to the fact we were just talking about it. It became a funny coincidence.

  • John Crane

    John Crane March 31st, 2018 @ 07:54 AM

    Play’s dependency management system allows you to express your application’s external dependencies in a single dependencies.yml file.

    A Play application can have three kinds of dependencies:

    The Play framework itself, since a Play application always depends on the Play framework.
    Any Java library, provided as JAR file installed in your application’s lib/ directory.
    A Play module (in fact an application fragment) installed in your application’s modules/ directory.
    write an essay on your family

  • Joesph Jolly

    Joesph Jolly June 20th, 2018 @ 07:44 PM

    I think it might be available now I need it badly Cheap Proxies

  • Joesph Jolly
  • SheritaGreen456
  • SheritaGreen456

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.

New-ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

<h2>Play framework</h2>

Play makes it easier to build Web applications with Java. It is a clean alternative to bloated Enterprise Java stacks. It focuses on developer productivity and targets RESTful architectures. Learn more on the <a href="http://www.playframework.org">http://www.playframework.org</a> website.<br><br>

<h2>Source code is hosted on github</h2>Check out our repository at <a href="http://github.com/playframework/play">http://github.com/playframework/play</a><br><br>

<h2>Contributing, creating a patch</h2> Please read the <a href="http://play.lighthouseapp.com/projects/57987/contributor-guide">contributor guide</a><br><br>

<h2>Reporting Security Vulnerabilities</h2> Since all bug reports are public, please report any security vulnerability directly to <em>guillaume dot bort at gmail dot com</em>.<br><br>

<h2>Creating a bug report</h2> Bug reports are incredibly helpful, so take time to report bugs and request features in our ticket tracker. We’re always grateful for patches to Play’s code. Indeed, bug reports with attached patches will get fixed far quickly than those without any.<br><br>

Please include as much relevant information as possible including the exact framework version you're using and a code snippet that reproduces the problem.<br><br>

Don't have too much expectations. Unless the bug is really a serious "everything is broken" thing, you're creating a ticket to start a discussion. Having a patch (or a branch on Github we can pull from) is better, but then again we'll only pull high quality branches that make sense to be in the core of Play.