openjpa-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Laird Nelson <ljnel...@gmail.com>
Subject Getting META-INF/persistence.xml read?
Date Wed, 27 Jan 2010 18:53:00 GMT
I'm creating a tool that uses the JDBCConfigurationImpl() class.

I was under the impression that somehow this class is capable of finding the
META-INF/persistence.xml file if it is present on the classpath, thus
setting things like the database user name, the password, the connection
url, and so forth.

Despite the fact that my JUnit test case that I'm trying to make pass is
running with a classpath that serves as the root for an existing
META-INF/persistence.xml file, that file is never seen, and the moment I try
to get JDBCConfigurationImpl to get a DataSource, everything blows up.

I looked at the source code of the ReverseMappingTool's main() method to see
how it does it, on the theory that maybe this was a case of
cut-and-paste-development--perhaps the ReverseMappingTool, the SchemaTool,
etc. all have their own way of locating this file?  But I saw (a) no such
code, and (b) no code anywhere inside ReverseMappingTool that tries to
process the "-properties" command line argument.  This leads me to believe
that some other class is processing the "-properties" command line argument,
and I thought that if such an argument were not present, then it would
suffice to simply have a META-INF/persistence.xml on the classpath.  No such
luck.

Any ideas?  For the record, I find the whole "plugin" pseudo-dependency
injection approach arcane, unreliable and confusing.

Best,
Laird

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message