persistence@glassfish.java.net

URL handling in Toplink Essential

From: Sanjeeb Kumar Sahoo <Sanjeeb.Sahoo_at_Sun.COM>
Date: Tue, 06 Jun 2006 20:21:31 +0530

Hi Tom,

The javadocs of PersistenceUnitInfo#getPersistenceUnitRootUrl()
http://java.sun.com/javaee/5/docs/api/javax/persistence/spi/PersistenceUnitInfo.html#getPersistenceUnitRootUrl()
allows a container to return a URL that does not use file protocol. I
think we don't correctly process such URL in our code. Currently, the
code
https://glassfish.dev.java.net/source/browse/glassfish/entity-persistence/src/java/oracle/toplink/essentials/ejb/cmp3/persistence/PersistenceUnitProcessor.java?rev=1.15&only_with_tag=HEAD&view=auto&content-type=text/vnd.viewcvs-markup
in
oracle.toplink.essentials.ejb.cmp3.persistence.PersistenceUnitProcessor#getClassNamesFromURL
passes the URI returned by URL#toURI() to create a File object. Will it
work when the URL is not a file: URL?
I think, in such a case, we should use URL#openStream() to create a
JarInputStream and read from there. What do you think?

Thanks,
Sahoo