From: <leg...@at...> - 2003-12-26 22:04:25
|
The following comment has been added to this issue: Author: Max Rydahl Andersen Created: Fri, 26 Dec 2003 4:03 PM Body: oh - sorry, to quick ;) use the ugly: addJar(Thread.currentThread().getContextClassLoader().getResource(resourceName).getFile()); instead. --------------------------------------------------------------------- View the issue: http://opensource.atlassian.com/projects/hibernate/secure/ViewIssue.jspa?key=HB-580 Here is an overview of the issue: --------------------------------------------------------------------- Key: HB-580 Summary: Undo deprecation of Configuration.addJar(String) Type: Improvement Status: Closed Priority: Critical Resolution: WON'T FIX Project: Hibernate2 Components: core Versions: 2.1.1 Assignee: Reporter: tom quas Created: Fri, 26 Dec 2003 3:51 PM Updated: Fri, 26 Dec 2003 4:03 PM Environment: API Description: I just realized that Configuration.addJar( String filename ) has been deprecated. I regularly use it to load mappings from the classpath. Could you please leave it in for convenience? --------------------------------------------------------------------- JIRA INFORMATION: This message is automatically generated by JIRA. If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators.jspa If you want more information on JIRA, or have a bug to report see: http://www.atlassian.com/software/jira |
From: <leg...@at...> - 2003-12-27 07:09:25
|
The following comment has been added to this issue: Author: tom quas Created: Sat, 27 Dec 2003 1:08 AM Body: Max, I checked the source code and stumbled over that ugly Thread.currentThread()... statement. I could of courseuse it, however, what I'm saying is that the API is much more convenient to clients if you leave the old method in. An alternative would be to provide addJar( InputStream) so that one can easily do a X.class.getResourceAsStream(). This is the way to get resources from a WAR or EAR; generating a File object unnecessarily complicates things for the client. Please reconsider your design decision. Max' response: I follow ya', but i think the reason we deprecated it is that the method is not "safe" - it is not gauranteed that you can getFile() a jar via the classloader. And thus, if the user want uglinees then the user get it very explicitly ;) --------------------------------------------------------------------- View the issue: http://opensource.atlassian.com/projects/hibernate/secure/ViewIssue.jspa?key=HB-580 Here is an overview of the issue: --------------------------------------------------------------------- Key: HB-580 Summary: Undo deprecation of Configuration.addJar(String) Type: Improvement Status: Closed Priority: Critical Resolution: WON'T FIX Project: Hibernate2 Components: core Versions: 2.1.1 Assignee: Reporter: tom quas Created: Fri, 26 Dec 2003 3:51 PM Updated: Sat, 27 Dec 2003 1:08 AM Environment: API Description: I just realized that Configuration.addJar( String filename ) has been deprecated. I regularly use it to load mappings from the classpath. Could you please leave it in for convenience? --------------------------------------------------------------------- JIRA INFORMATION: This message is automatically generated by JIRA. If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators.jspa If you want more information on JIRA, or have a bug to report see: http://www.atlassian.com/software/jira |
From: <leg...@at...> - 2003-12-27 07:22:25
|
The following comment has been added to this issue: Author: tom quas Created: Sat, 27 Dec 2003 1:21 AM Body: If "it is not gauranteed that you can getFile() a jar via the classloader"--could you please explain why--then I do not understand why the method is still there in the first place. Sounds to me like it might break an application that uses Hibernate. Please let me know how I can register a JAR contained in a WAR file with an instance of class Configuration. Obviously, I *do not* want to access the file system since it would introduce location dependencies. Thanks, -tom --------------------------------------------------------------------- View the issue: http://opensource.atlassian.com/projects/hibernate/secure/ViewIssue.jspa?key=HB-580 Here is an overview of the issue: --------------------------------------------------------------------- Key: HB-580 Summary: Undo deprecation of Configuration.addJar(String) Type: Improvement Status: Closed Priority: Critical Resolution: WON'T FIX Project: Hibernate2 Components: core Versions: 2.1.1 Assignee: Reporter: tom quas Created: Fri, 26 Dec 2003 3:51 PM Updated: Sat, 27 Dec 2003 1:21 AM Environment: API Description: I just realized that Configuration.addJar( String filename ) has been deprecated. I regularly use it to load mappings from the classpath. Could you please leave it in for convenience? --------------------------------------------------------------------- JIRA INFORMATION: This message is automatically generated by JIRA. If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators.jspa If you want more information on JIRA, or have a bug to report see: http://www.atlassian.com/software/jira |
From: <leg...@at...> - 2003-12-27 17:53:29
|
The following comment has been added to this issue: Author: Max Rydahl Andersen Created: Sat, 27 Dec 2003 11:52 AM Body: The reason it is still there is like any other deprecation - to be as much backwards compatiable as possible. Being deprecated does not make the method "not-work", it is just a hint to users that we might/would like to remove the method in the next major release. You second answer i do not know the concrete answer for (i normally don't mess with stuff that cannot be reliably used across VM's) - post it in the forum, and you will probably get a better answer ;) Regarding "safenes" of addJar(String resname) is that according to the java lang spec .class files and resources does not necessarily need to be a file system. Furthermore your program is not allowed to access the contents of META-INF/ and below via the classloaders - thus making it really hard to access that stuff ;) Thus relying on being able to use File() on them (addJar(String) does) is not good. --------------------------------------------------------------------- View the issue: http://opensource.atlassian.com/projects/hibernate/secure/ViewIssue.jspa?key=HB-580 Here is an overview of the issue: --------------------------------------------------------------------- Key: HB-580 Summary: Undo deprecation of Configuration.addJar(String) Type: Improvement Status: Closed Priority: Critical Resolution: WON'T FIX Project: Hibernate2 Components: core Versions: 2.1.1 Assignee: Reporter: tom quas Created: Fri, 26 Dec 2003 3:51 PM Updated: Sat, 27 Dec 2003 11:52 AM Environment: API Description: I just realized that Configuration.addJar( String filename ) has been deprecated. I regularly use it to load mappings from the classpath. Could you please leave it in for convenience? --------------------------------------------------------------------- JIRA INFORMATION: This message is automatically generated by JIRA. If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators.jspa If you want more information on JIRA, or have a bug to report see: http://www.atlassian.com/software/jira |
From: <leg...@at...> - 2003-12-29 10:33:25
|
The following comment has been added to this issue: Author: tom quas Created: Mon, 29 Dec 2003 4:33 AM Body: Max, I might not have made myself clear enough. The point is not to access information under META-INF but to bundle a mappings.jar with a WAR (under WEB-INF/classes) or EAR and access it from there--preferably via Class.getResource() or getResourceAsStream since those methods are guaranteed to work on the classpath. I agree with you that java.io.File is not appropriate for this case. This is exactly the point why I'm asking for a convenience API to retrieve such a bundled mappings archive. Configration.addJar(String resource) provided that API till it's been deprecated. --------------------------------------------------------------------- View the issue: http://opensource.atlassian.com/projects/hibernate/secure/ViewIssue.jspa?key=HB-580 Here is an overview of the issue: --------------------------------------------------------------------- Key: HB-580 Summary: Undo deprecation of Configuration.addJar(String) Type: Improvement Status: Closed Priority: Critical Resolution: WON'T FIX Project: Hibernate2 Components: core Versions: 2.1.1 Assignee: Reporter: tom quas Created: Fri, 26 Dec 2003 3:51 PM Updated: Mon, 29 Dec 2003 4:33 AM Environment: API Description: I just realized that Configuration.addJar( String filename ) has been deprecated. I regularly use it to load mappings from the classpath. Could you please leave it in for convenience? --------------------------------------------------------------------- JIRA INFORMATION: This message is automatically generated by JIRA. If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators.jspa If you want more information on JIRA, or have a bug to report see: http://www.atlassian.com/software/jira |