If you switch to Java6 OpenJPA will use the dynamic class rewriting
stuff in the Java6 vm when enhancing. It also doesn't need the
javaagent arg, since in Java6 you can late start the agent.
-dain
On May 13, 2008, at 11:23 AM, JimOR wrote:
I'm running into a mild annoyance running a junit test suite
directly from
within Eclipse. I have the -javaagent VM arg in my run
configuration, and
the problem does goes away if I run an ant task to call the enhancer
directly prior to running my test suite.
The problem is that access to any collection from the first Entity
listed as
'subclassed' gives an NPE, which in my configuration is a failure.
The
remaining Entities test fine, and you'll notice that the enhancer
happily
processes that Entity after reporting it being subclassed.
As I stated, it's a mild annoyance because when any tests fail, I
only have
to launch that ant enhancer task and re-run the test. Any thoughts?
following is a portion of my test suite output:
INFO- portfolio.data.junit.suite.InitialTestSetup.suiteSetUp(Line:
45) -
InitialTestSetup Started
Apache OpenEJB 3.0 build: 20080408-04:13
http://openejb.apache.org/
656 PortfolioData INFO [main] openjpa.Runtime - Starting OpenJPA
1.0.1
1250 PortfolioData INFO [main] openjpa.jdbc.JDBC - Using
dictionary
class "org.apache.openjpa.jdbc.sql.PostgresDictionary" (PostgreSQL
8.1.4
,PostgreSQL Native Driver PostgreSQL 8.1 JDBC3 with SSL (build 405)).
1625 PortfolioData INFO [main] openjpa.Enhance - Creating
subclass for
"[class portfolio.data.entities.Category, class
portfolio.data.entities.Account, class
portfolio.data.entities.Accounttype,
class portfolio.data.entities.Owner]". This means that your
application will
be less efficient and will consume more memory than it would if you
ran the
OpenJPA enhancer. Additionally, lazy loading will not be available for
one-to-one and many-to-one persistent attributes in types using field
access; they will be loaded eagerly instead.
2578 PortfolioData TRACE [main] openjpa.Enhance - Enhancing type
"class
portfolio.data.entities.Category".
2938 PortfolioData TRACE [main] openjpa.Enhance - Enhancing type
"class
portfolio.data.entities.Account".
3328 PortfolioData TRACE [main] openjpa.Enhance - Enhancing type
"class
portfolio.data.entities.Accounttype".
3594 PortfolioData TRACE [main] openjpa.Enhance - Enhancing type
"class
portfolio.data.entities.Owner".
INFO- portfolio.data.junit.suite.InitialTestSetup.suiteSetUp(Line:
54) -
Context is Set, ejb in Context:
.=
AccountBeanLocal
=
proxy
=
portfolio
.data
.beans
.PortfolioCRUD;deployment=AccountBean;pk=2291cc984d5ae5a2:-3af9f98d:
119e366778c:-8000
AccounttypeBeanLocal
=
proxy
=
portfolio
.data
.beans
.AccounttypeManager
;deployment=AccounttypeBean;pk=2291cc984d5ae5a2:-3af9f98d:
119e366778c:-7fff
CategoryBeanLocal
=
proxy
=
portfolio
.data
.beans
.PortfolioCRUD;deployment=CategoryBean;pk=2291cc984d5ae5a2:-3af9f98d:
119e366778c:-7ffd
OwnerBeanLocal
=
proxy
=
portfolio
.data
.beans
.PortfolioCRUD;deployment=OwnerBean;pk=2291cc984d5ae5a2:-3af9f98d:
119e366778c:-7ffc
PortFolioCRUDBeanLocal
=
proxy
=
portfolio
.data
.beans
.PortfolioCRUD
;deployment=PortFolioCRUDBean;pk=2291cc984d5ae5a2:-3af9f98d:
119e366778c:-7ffe
INFO- portfolio.data.junit.suite.InitialTestSetup.suiteSetUp(Line:
64) -
Framework initialization and bean lookup took 8.844
--
View this message in context:
http://www.nabble.com/Enhancer-annoyance-tp17215212p17215212.html
Sent from the OpenEJB User mailing list archive at Nabble.com.