[ 
https://issues.apache.org/jira/browse/OPENJPA-148?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12493730
 ] 

David Jencks commented on OPENJPA-148:
--------------------------------------

Marc did not apply this part of the patch, which was actually the crucial part 
to get this to work for geronimo :-).  As I noted before this may well not be 
the best way to solve the problem, its only virtue is that it works:

+                if ("file".equals(url.getProtocol())) {
+                    File file = new File(url.getFile()).getAbsoluteFile();
+                    if (files.contains(file)) {
+                        continue;
+                    }
+                }

For reasons that are not entirely clear to me yet, the war WEB-INF/classes 
directory is showing up both in the files list (where it is processed 
correctly) and the urls list where it is causing an error since the code tries 
to treat it as an xml file.  The patch excerpt above is a bit of a hack but it 
checks each url to see if it matches a file in the files list and if so skips 
it.  In particular the directory WEB-INF/classes is matched so it is skipped, 
thus sidestepping the problem.

IMO it would be better to avoid duplicating locations in the files and urls 
list but I haven't figured out how to make that happen yet.  I don't see much 
harm in this patch in any case since AFAICT there is never a reason to process 
a location twice.

> Parsing exception while using an "exploded" archive
> ---------------------------------------------------
>
>                 Key: OPENJPA-148
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-148
>             Project: OpenJPA
>          Issue Type: Bug
>          Components: jpa
>         Environment: Sun JDK 5.0 / EasyBeans / OpenJPA snapshot 0.9.7
>            Reporter: Florent BENOIT
>            Priority: Minor
>             Fix For: 0.9.8
>
>         Attachments: debug_traces_directorymode.txt, 
> debug_traces_filemode_working.txt, OPENJPA-148.patch, stacktrace-error.txt, 
> steps.txt
>
>
> This happens when using OpenJPA as persistence provider for the EasyBeans 
> ObjectWeb container.
> The error is happening with "exploded" archive.
> Exploded means that there is a directory, named "entitybean.jar" with a 
> folder META-INF which contains a file named persistence.xml, and other 
> directories/files for the classes.
> It seems that when using this mode, OpenJPA is trying to parse the directory 
> inputstream (which is failing).
> This exception is not occuring if a jar file is used instead of the 
> "exploded" mode, but the exploded mode is the default mode for EasyBeans.
> Note also that this exception don't occur by using Hibernate Entity Manager 
> or Oracle TopLink Essentials as persistence provider.
> I will attach to this issue a stack trace (with the exploded directory) which 
> fails and at the end with a jar file (which work)
> And 4 steps used to reproduce this problem

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to