You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@openjpa.apache.org by Stefan Arentz <st...@gmail.com> on 2006/10/07 10:44:15 UTC
Some integration questions
When OpenJPA is used in a Spring 2.0 environment that is deployed in
say Jetty 6.0, does that count as a J2EE or J2SE environment?
OpenJPA works with 'enhanced' classes. If I want do not want to run
with an JVM agent or pre-compile/enhance my classes then it needs to
be done at runtime. Actually, at class loading time. Right?
Is it technically possible to create a war file that without servlet
container support contains code to correctly enhance classes? Or does
this always need help from the code (in the container) that is
actually loading the .war file and it's containing classes and .jar
files?
S.
Re: Re: RE: Some integration questions
Posted by Stefan Arentz <st...@gmail.com>.
What I forgot to mention is that I start Jetty from IDEA using a
simple main() that basically does a "new Server().start()". Maybe this
makes a difference for classloading?
S.
Re: RE: Some integration questions
Posted by Stefan Arentz <st...@gmail.com>.
On 10/7/06, Patrick Linskey <pl...@bea.com> wrote:
...
Patrick, thanks for the hints.
> Also, in the specific case (Spring 2.0 + Jetty), you'll get
> auto-enhancement out-of-the-box, modulo any bugs that haven't been
> surfaced yet by us or the Spring team (thanks, Costin!).
That is also the reason why I am trying to understand how all the
pieces fit together. I'm currently in a situation where I keep getting
the following error:
the type "class wicket.quickstart.entities.Message" has not been enhanced.
even though I see the following in the OpenJPA TRACE log:
4296 INFO [btpool0-6] openjpa.MetaData - Found 1 classes with
metadata in 0 milliseconds.
4459 TRACE [btpool0-6] openjpa.Enhance -
"wicket/quickstart/entities/Message" requires runtime enhancement:
true
4541 TRACE [btpool0-6] openjpa.MetaData - Loading metadata for
"class wicket.quickstart.entities.Message" under mode "[META][QUERY]".
4559 INFO [btpool0-6] openjpa.MetaData - Parsing class
"wicket.quickstart.entities.Message".
4559 INFO [btpool0-6] openjpa.MetaData - Parsing package
"wicket.quickstart.entities.Message".
4578 TRACE [btpool0-6] openjpa.MetaData - Generating default
metadata for type "wicket.quickstart.entities.Message".
4578 TRACE [btpool0-6] openjpa.MetaData - Using reflection for
metadata generation.
4596 TRACE [btpool0-6] openjpa.MetaData - Set persistence-capable
superclass of "wicket.quickstart.entities.Message" to "null".
4596 TRACE [btpool0-6] openjpa.MetaData - Resolving metadata for
"wicket.quickstart.entities.Message@5779080".
4596 TRACE [btpool0-6] openjpa.MetaData - Resolving field
"wicket.quickstart.entities.Message@5779080.id".
4604 TRACE [btpool0-6] openjpa.MetaData - Resolving field
"wicket.quickstart.entities.Message@5779080.text".
4606 TRACE [btpool0-6] openjpa.Enhance - Enhancing type "class
wicket.quickstart.entities.Message".
I'm not sure this is a Spring issue or an OpenJPA issue though. That
is why I'm trying to understand how all this should work.
(I'm trying to build a quickstart project for http://wicket.sf.net
that uses OpenJPA and Spring)
S.
Re: Some integration questions
Posted by Craig L Russell <Cr...@Sun.COM>.
Hi,
On Oct 7, 2006, at 1:55 AM, Patrick Linskey wrote:
>> When OpenJPA is used in a Spring 2.0 environment that is deployed in
>> say Jetty 6.0, does that count as a J2EE or J2SE environment?
>
> I'm going to stay far far away from any attempts to define what
> constitutes a J2EE environment. Or a Java EE environment, for that
> matter.
Both J2EE (1.4 and earlier) and Java EE (5 and later) define an
environment that provides a wide range of services, including but not
limited to, a web container, a CMP container, management, naming
services, ORB services, and several other JSRs. There is no similar
definition of a "web server" in this world.
I'm not an expert in Jetty, but it seems to be "just a component"
that is intended for integration with other products to provide a
complete solution. So it doesn't appear to be even close to a Java EE
server.
So you will usually be correct if you think of a web container as
operating in a Java SE, not a Java EE environment.
Craig
Craig Russell
clr@apache.org http://db.apache.org/jdo
RE: Some integration questions
Posted by Patrick Linskey <pl...@bea.com>.
> When OpenJPA is used in a Spring 2.0 environment that is deployed in
> say Jetty 6.0, does that count as a J2EE or J2SE environment?
I'm going to stay far far away from any attempts to define what
constitutes a J2EE environment. Or a Java EE environment, for that
matter.
However, I think that the answer to your question is "approximately Java
EE". The JPA spec defines a contract between itself and a "container".
The spec implies that this is an EJB container, but really, the contract
is between the JPA persistence provider and a "persistence container".
That persistence container is responsible for doing a number of things.
Spring 2.0 is a persistence container.
> OpenJPA works with 'enhanced' classes. If I want do not want to run
> with an JVM agent or pre-compile/enhance my classes then it needs to
> be done at runtime. Actually, at class loading time. Right?
Correct.
> Is it technically possible to create a war file that without servlet
> container support contains code to correctly enhance classes? Or does
> this always need help from the code (in the container) that is
> actually loading the .war file and it's containing classes and .jar
> files?
In the general case, it should be technically possible -- just do some
classloading work in the war file. However, I expect more and more
servlet containers to become persistence containers.
Also, in the specific case (Spring 2.0 + Jetty), you'll get
auto-enhancement out-of-the-box, modulo any bugs that haven't been
surfaced yet by us or the Spring team (thanks, Costin!).
-Patrick
_______________________________________________________________________
Notice: This email message, together with any attachments, may contain
information of BEA Systems, Inc., its subsidiaries and affiliated
entities, that may be confidential, proprietary, copyrighted and/or
legally privileged, and is intended solely for the use of the individual
or entity named in this message. If you are not the intended recipient,
and have received this message in error, please immediately return this
by email and then delete it.