You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@openjpa.apache.org by David Jencks <da...@yahoo.com> on 2007/05/02 21:31:25 UTC
Can openjpa scan directories for classes (such as WEB-INF/classes)?
I'm having some trouble getting openjpa to work properly with
persistence units directly in unpacked wars in geronimo, and before I
spend a lot of time looking for dead ends I wonder if anyone knows if
there are some circumstances in which openjpa can scan for classes in
an unpacked directory such as WEB-INF/classes? Right now in the
geronimo integration openjpa seems to be trying to read the directory
as if it is an xml file, which fails with a SAX exception:
Caused by: java.io.IOException: org.xml.sax.SAXException: file:/Users/
david/geronimo/svn/(.....).war/WEB-INF/classes/ [Location: Line: 1,
C: 1]: org.xml.sax.SAXParseException: Content is not allowed in prolog.
at
org.apache.openjpa.lib.meta.XMLMetaDataParser.parseNewResource
(XMLMetaDataParser.java:376)
at org.apache.openjpa.lib.meta.XMLMetaDataParser.parse
(XMLMetaDataParser.java:315)
at org.apache.openjpa.lib.meta.XMLMetaDataParser.parse
(XMLMetaDataParser.java:292)
at org.apache.openjpa.lib.meta.XMLMetaDataParser.parse
(XMLMetaDataParser.java:266)
at
org.apache.openjpa.persistence.PersistenceMetaDataFactory.parseXML
(PersistenceMetaDataFactory.java:234)
thanks
david jencks
Re: Can openjpa scan directories for classes (such as WEB-INF/classes)?
Posted by Florent BENOIT <Fl...@objectweb.org>.
David,
I think I provided some tips for the solution but no attached patch.
In the comments of this bug, I explained why OpenJPA take the wrong path
with exploded archive.
But I'm interested in any solution :)
Best Regards,
Florent
David Jencks wrote:
> I think so too :-)
>
> I take it you don't have a solution for this? I will see what I can
> come up with. Thanks for your detailed analysis!
>
> david jencks
>
> On May 2, 2007, at 12:39 PM, Florent BENOIT wrote:
>
>> Hi,
>>
>> I reported a bug a couple of months ago.
>> I think that it is the same issue:
>> http://issues.apache.org/jira/browse/OPENJPA-148
>>
>> Regards,
>>
>> Florent
>>
>> David Jencks wrote:
>>> I'm having some trouble getting openjpa to work properly with
>>> persistence units directly in unpacked wars in geronimo, and before
>>> I spend a lot of time looking for dead ends I wonder if anyone knows
>>> if there are some circumstances in which openjpa can scan for
>>> classes in an unpacked directory such as WEB-INF/classes? Right now
>>> in the geronimo integration openjpa seems to be trying to read the
>>> directory as if it is an xml file, which fails with a SAX exception:
>>>
>>> Caused by: java.io.IOException: org.xml.sax.SAXException:
>>> file:/Users/david/geronimo/svn/(.....).war/WEB-INF/classes/
>>> [Location: Line: 1, C: 1]: org.xml.sax.SAXParseException: Content is
>>> not allowed in prolog.
>>> at
>>> org.apache.openjpa.lib.meta.XMLMetaDataParser.parseNewResource(XMLMetaDataParser.java:376)
>>>
>>> at
>>> org.apache.openjpa.lib.meta.XMLMetaDataParser.parse(XMLMetaDataParser.java:315)
>>>
>>> at
>>> org.apache.openjpa.lib.meta.XMLMetaDataParser.parse(XMLMetaDataParser.java:292)
>>>
>>> at
>>> org.apache.openjpa.lib.meta.XMLMetaDataParser.parse(XMLMetaDataParser.java:266)
>>>
>>> at
>>> org.apache.openjpa.persistence.PersistenceMetaDataFactory.parseXML(PersistenceMetaDataFactory.java:234)
>>>
>>>
>>> thanks
>>> david jencks
>>>
>>>
>>
>
>
>
Re: Can openjpa scan directories for classes (such as WEB-INF/classes)?
Posted by David Jencks <da...@yahoo.com>.
I think so too :-)
I take it you don't have a solution for this? I will see what I can
come up with. Thanks for your detailed analysis!
david jencks
On May 2, 2007, at 12:39 PM, Florent BENOIT wrote:
> Hi,
>
> I reported a bug a couple of months ago.
> I think that it is the same issue: http://issues.apache.org/jira/
> browse/OPENJPA-148
>
> Regards,
>
> Florent
>
> David Jencks wrote:
>> I'm having some trouble getting openjpa to work properly with
>> persistence units directly in unpacked wars in geronimo, and
>> before I spend a lot of time looking for dead ends I wonder if
>> anyone knows if there are some circumstances in which openjpa can
>> scan for classes in an unpacked directory such as WEB-INF/
>> classes? Right now in the geronimo integration openjpa seems to
>> be trying to read the directory as if it is an xml file, which
>> fails with a SAX exception:
>>
>> Caused by: java.io.IOException: org.xml.sax.SAXException: file:/
>> Users/david/geronimo/svn/(.....).war/WEB-INF/classes/ [Location:
>> Line: 1, C: 1]: org.xml.sax.SAXParseException: Content is not
>> allowed in prolog.
>> at
>> org.apache.openjpa.lib.meta.XMLMetaDataParser.parseNewResource
>> (XMLMetaDataParser.java:376)
>> at org.apache.openjpa.lib.meta.XMLMetaDataParser.parse
>> (XMLMetaDataParser.java:315)
>> at org.apache.openjpa.lib.meta.XMLMetaDataParser.parse
>> (XMLMetaDataParser.java:292)
>> at org.apache.openjpa.lib.meta.XMLMetaDataParser.parse
>> (XMLMetaDataParser.java:266)
>> at
>> org.apache.openjpa.persistence.PersistenceMetaDataFactory.parseXML
>> (PersistenceMetaDataFactory.java:234)
>>
>> thanks
>> david jencks
>>
>>
>
Re: Can openjpa scan directories for classes (such as WEB-INF/classes)?
Posted by Florent BENOIT <Fl...@objectweb.org>.
Hi,
I reported a bug a couple of months ago.
I think that it is the same issue:
http://issues.apache.org/jira/browse/OPENJPA-148
Regards,
Florent
David Jencks wrote:
> I'm having some trouble getting openjpa to work properly with
> persistence units directly in unpacked wars in geronimo, and before I
> spend a lot of time looking for dead ends I wonder if anyone knows if
> there are some circumstances in which openjpa can scan for classes in
> an unpacked directory such as WEB-INF/classes? Right now in the
> geronimo integration openjpa seems to be trying to read the directory
> as if it is an xml file, which fails with a SAX exception:
>
> Caused by: java.io.IOException: org.xml.sax.SAXException:
> file:/Users/david/geronimo/svn/(.....).war/WEB-INF/classes/ [Location:
> Line: 1, C: 1]: org.xml.sax.SAXParseException: Content is not allowed
> in prolog.
> at
> org.apache.openjpa.lib.meta.XMLMetaDataParser.parseNewResource(XMLMetaDataParser.java:376)
>
> at
> org.apache.openjpa.lib.meta.XMLMetaDataParser.parse(XMLMetaDataParser.java:315)
>
> at
> org.apache.openjpa.lib.meta.XMLMetaDataParser.parse(XMLMetaDataParser.java:292)
>
> at
> org.apache.openjpa.lib.meta.XMLMetaDataParser.parse(XMLMetaDataParser.java:266)
>
> at
> org.apache.openjpa.persistence.PersistenceMetaDataFactory.parseXML(PersistenceMetaDataFactory.java:234)
>
>
> thanks
> david jencks
>
>