On Jun 9, 2008, at 3:53 PM, Jon Carrera wrote:
I went for the naughty option for printing out the classpath and it
worked
from within the test case, but didn't work with the bean factory.
Apparently
the problem is in org.springframework.test.jpa.AbstractJpaTests which
internally uses
org.springframework.test.jpa.OrmXmlOverridingShadowingClassLoader
(which by
the way isn't a subclass of URLClassLoader, so the PrintClasspath
class
didn't work here) and for some reason is not able to find the required
classes. I solved the problem by replacing AbstractJpaTests with
org.springframework.test.AbstractTransactionalSpringContextTests.
Now my
tests run just fine.
I also changed the factories as you suggested so that OpenEjb was
initialized by spring.
Hope this can be of use for others.
Thanks David and keep up the great job.
Many thanks to you, Jon! We definitely appreciate your time as well.
I've crafted up a doc that attempts to summarize the information in
this thread:
http://cwiki.apache.org/OPENEJBx30/spring.html
(should sync to http://openejb.apache.org/3.0/spring.html in an hour
or so)
I'd like to put a section in there about testing and some details
about which Abstract*Tests superclasses work and which do not. We
definitely know that AbstractTransactionalSpringContextTests works and
AbstractJpaTests does not. Are you game for trying out the parent of
AbstractTransactionalSpringContextTests and so on till it breaks so we
can get that data for the doc as well? Also, do you have any small
sample test case code we could possibly show?
On a side note, we actually do have a much tighter integration
planned. Nothing concrete, but we'd like to find a way so that spring
and ejb (openejb) can be mixed more easily with things like
EntityManagers declarable and referencable right there in the spring
xml obviating the need for your own custom factories, etc. You
interested in trying something like that out and giving feedback when
we get a prototype going? We're also interested in what people think
would be their dream syntax for mixing spring and ejb and other things
like entitymanagers, topics, queues, etc. Definitely feel free to
post mock bean definition examples -- don't worry about reality, feel
free to dream, there's usually a way to do anything with enough effort.
-David