persistence@glassfish.java.net

Re: entity-persistence CTS Issue - persistence xml with <mapping-file>

From: Tom Ware <tom.ware_at_oracle.com>
Date: Mon, 13 Mar 2006 16:10:55 -0500

Hi Mitesh,

  Looking at the code below, I would expect to see a logged message of
the form: "jarFile = {0} does not exist" in our log if there was an
issue with the URL we are providing.

  We configured logging to be FINE in our admin console and still cannot
see that message. Is there anything special we should to in order to
see that logging message?

-Tom

Mitesh Meswani wrote:

>Hi Tom,
>
>I have not yet looked into the ear. Meanwhile, here is the code from
>PersistenceunitInfoImpl that creates the list that getJarFileUrls()
>return.
>
>Thanks,
>Mitesh
>
> private List<URL> _getJarFiles() {
> List<String> jarFileNames = new ArrayList<String>(
> persistenceUnitDescriptor.getJarFiles());
> List<URL> jarFiles = new ArrayList<URL>(jarFileNames.size() + 1);
> String absolutePuRoot = getAbsolutePuRootFile().getAbsolutePath();
> for (String jarFileName : jarFileNames) {
> String nativeJarFileName = jarFileName.replace('/',
> File.separatorChar);
> // only components are exploded, hence first look for
>original archives.
> File jarFile = new File(new
>File(absolutePuRoot).getParentFile(),
> nativeJarFileName);
> if (!jarFile.exists()) {
> // if the referenced jar is itself a component, then
> // it might have been exploded, hence let's see
> // if that is the case.
> jarFile = new File(new File(absolutePuRoot).getParentFile(),
> FileUtils.makeFriendlyFileName(nativeJarFileName));
> }
> if (jarFile.exists()) {
> try {
> jarFiles.add(jarFile.toURI().toURL());
> } catch (MalformedURLException e) {
> throw new RuntimeException(e);
> }
> } else {
> // TODO: Should be a caught by verifier.
> PersistenceUnitInfoImpl.logger.logp(Level.FINE,
> "PersistenceUnitLoaderImpl$PersistenceUnitInfoImpl",
> "initJarFiles", "jarFile = {0} does not exist",
> jarFile);
> }
> }
> return jarFiles;
> }
>
>
>
>Tom Ware wrote:
>
>
>>Hi all,
>>
>> Hopefully someone can help us out. We are debugging a CTS issue in
>>the entity-persistence module and we are seeing the following problem:
>>
>> We are deploying the attached ear file and trying to make use of the
>>persistence unit defined in persistence.jar. When we call
>>getJarFileUrls() on the PersitenceUnitInfo instance we are given in
>>createContainerEntityManagerFactory(), we get an empty list. How
>>build our ear and write our persistence.xml file so the result of
>>getJarFileUrls() includes a URL to entities.jar?
>>
>>-Tom
>>
>>

-- 
Tom Ware
Principal Software Engineer
Oracle Canada Inc.
Direct: (613) 783-4598
Email: tom.ware_at_oracle.com