Regardless how the two sides are packaged, as long as they are in the same EAR, you can use classloader to getResourceAsStream(META-INF/persistence.xml) to load the current persistence.xml, and then parse it. You don't need to find it by yourself.
Other options I can think of may be a bit easier, but all involves duplicate the datasource name in other config files, which should be avoided, IMO.
[Message sent by forum member 'cf126330']
http://forums.java.net/jive/thread.jspa?messageID=399517