Definitely a bug and *thank you* for digging around and finding it!
Very appreciated! It's open source and we're all volunteers, so maybe
closer to the truth is my wife appreciates it ;)
Anyway, if you can attach a patch here, I'll commit it and mark you
down as the "fixer"
https://issues.apache.org/jira/browse/OPENEJB-1127
Happy new year!
-David
On Jan 1, 2010, at 11:20 PM, thabach wrote:
Heya David
I investigated some more and observed that a resource adapter
project - a
non packed Maven module, like the one in the quartz-app, to be
precise - is
detected as a Connector module, but does NOT get loaded. A top-level
"mvn
install" only works for the quartz-app as Maven uses the jar'ed
quartz-ra as
a dependency, which does get loaded by OpenEJB.
I added the following ra.xml specific code, similar to the one for
ejb-jar.xml and applicaiton.xml in
org.apache.openejb.config.DeploymentsResolver:
public static void loadFrom(Deployments dep, FileUtils path,
List<String>
jarList) {
......
////////////////////////////////
//
// Unpacked "Jar" directory with descriptor
//
////////////////////////////////
File ejbJarXml = new File(dir, "META-INF" + File.separator +
"ejb-jar.xml");
if (ejbJarXml.exists()) {
if (!jarList.contains(dir.getAbsolutePath())) {
jarList.add(dir.getAbsolutePath());
}
return;
}
File appXml = new File(dir, "META-INF" + File.separator +
"application.xml");
if (appXml.exists()) {
if (!jarList.contains(dir.getAbsolutePath())) {
jarList.add(dir.getAbsolutePath());
}
return;
}
File raXml = new File(dir, "META-INF" + File.separator +
"ra.xml");
if (raXml.exists()) {
if (!jarList.contains(dir.getAbsolutePath())) {
jarList.add(dir.getAbsolutePath());
}
return;
}
and now it all works fine !
So to me this looks like something that got forgotten. Shall I raise
a JIRA
for this and do you want me to supply a patch with the above ?
Regards and a happy new year, Christian.
thabach wrote:
I tried what you suggested, had to actually try with
getClass().getClassLoader().getSystemResource("META-INF/ra.xml") to
succeed, but the ra.xml is on the Classpath.
The quartz-beans JUnit Test in Eclipse runs fine as soon as I move
the
ra.xml from the quartz-ra module to the quartz-beans module, but
only as
long as I do not put an ejb-jar.xml into the src/main/resources/
META-INF
as well.
It really seems that it all depends on some ordering constraint,
does one
have to manage rar before ejb deployment somehow ?
Cheers Christian.
David Blevins wrote:
On Oct 27, 2009, at 12:54 AM, thabach wrote:
Heya
I am investigating RAR support in OpenEJB and was playing with the
quartz-app from some earlier post (
http://www.nabble.com/need-help-getting-quartz-ra.rar-file-to-deploy-td18531000.html#a18538001
http://www.nabble.com/need-help-getting-quartz-ra.rar-file-to-deploy-td18531000.html#a18538001
).
When running a top-level mvn clean install the tests are executed
fine.
Running the quartz-beans module test from within Eclipse as a JUnit
test,
leads to a problem in matching the message listener interface of
the
MDB
against the message listener interface of the automatically
deployed
MdbContainer and yields this:
org.apache.openejb.OpenEJBException: Creating application failed:
classpath.ear: Error deploying 'TimerJob'. Exception: class
org.apache.openejb.OpenEJBException: Deployment 'TimerJob' has
message
listener interface org.quartz.Job but this MDB container only
supports
interface javax.jms.MessageListener: Deployment 'TimerJob' has
message
listener interface org.quartz.Job but this MDB container only
supports
interface javax.jms.MessageListener
It seems there's something about the way the Eclipse project is
setup
that does not match the Maven setup. If Eclipse isn't including the
META-INF/ra.xml file in the classpath, then OpenEJB will not be able
to see and deploy the resource adapter and create the required MDB
container.
Try a little test code like this to verify your Eclipse setup:
import junit.framework.TestCase;
import java.net.URL;
public class ClasspathTest extends TestCase {
public void test() throws Exception {
URL raXml = this.getClass().getResource("META-INF/
ra.xml");
assertNotNull("There is no resource adapter in the
classpath", raXml);
}
}
Hope that helps!
-David
--
View this message in context:
http://n4.nabble.com/Problem-Running-quartz-app-RAR-JUnit-Test-tp979722p991998.html
Sent from the OpenEJB User mailing list archive at Nabble.com.