You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Rick <ri...@gmail.com> on 2008/10/14 00:11:55 UTC

Would really appreciate some feedback on this Maven2-EJB3/JPA example that I've posted, to make it better

Thanks to those on this list helping me start to get a handle on Maven.

I made my first attempt at a decent simple lesson that can work as an
EJB3/JPA skeleton app that builds with Maven2. (There are some things
out there but many of them are a bit outdated, or else they cover too
much, or too little. I tried to get the core basics down in this demo
that I wish I had when starting out.)

I'd appreciate if some of you could at least look over the pom.xml
files that you see posted:

http://learntechnology.net/content/ejb/maven-ejb3.jsp

I'm not sure I'm using provided and optional correctly (although the
generate ear seems to look ok to me.) I'm obviously still a maven newb
so any recommendations I'll kindly take to get it fixed up.

Thanks

-- 
Rick

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: Would really appreciate some feedback on this Maven2-EJB3/JPA example that I've posted, to make it better

Posted by Rusty Wright <ru...@gmail.com>.
(Sorry to be noising up the list with my non-Maven questions.)

Rusty Wright wrote:
> I guess what I'm asking is, what's the difference between EJB3 and JPA?  
> For example, if I want to use JPA I could use Hibernate and Tomcat and 
> use only the JPA annotations.  When you say EJB3 does that mean that 
> you're using JPA in a J2EE app server, or is there more to it than that?
> 
> 
> Rick wrote:
>> On Mon, Oct 13, 2008 at 6:26 PM, Rusty Wright <ru...@gmail.com> 
>> wrote:
>>> I was wondering if you need to use JBoss?  Couldn't you do it as a war
>>> instead of an ear?
>>
>> Mine is an EJB3 example.  (For a decent spring/jpa example, look at 
>> appfuse)
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>> For additional commands, e-mail: users-help@maven.apache.org
>>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: Would really appreciate some feedback on this Maven2-EJB3/JPA example that I've posted, to make it better

Posted by Rick <ri...@gmail.com>.
I
On Tue, Oct 14, 2008 at 2:35 PM, Martin Gainty <mg...@hotmail.com> wrote:

> would be nice if we could start at the top of Pikes Peak to look down on the Spring vs EJB debate
> Spring promotes the use of Factories and EJB doesnt

Well, the both use DI to inject things, so maybe I'm missing that
value of the Factories to which you speak.

> Spring works well with all ORM methodologies including Hibernate and iBatis

Yes, that is Spring's awesome strength... super flexible. +1 for
Spring there, and I've been the biggest supporter of iBATIS for years
(still am.) However, if your company is decided on using ORM and you
are going to use JPA, whatever is underneath doesn't matter 'too' much
- hibernate/toplink,etc. I don't see it a big deal using JBoss or
Glassfish in that case and just 'go'.

> EJB supports implementation of Local vs Remote access for stateful and stateless beans
> latest version of EJB supports Annotations to implement interfaces
> more salient points?

Yea, that's what is nice now, is setting up any kind of EJB is super
easy. Also, if you are using a JEE container you get some other things
out of the box like JMS as well without having to use third party jars
to handle things.

>
> with regards to MVC who wins and for what reasons?

Not sure what you mean there.. you mean MVC in regard to web apps? In
that case, you can use anything you want. (I haven't used Seam and it
seems overly complicated. I prefer simple Stripes for my web front
ends. )

> is this as simple as EJB is good ?
> and Spring is bad ?

I don't think it's an either/or. I think they are BOTH good. However,
here's my personal preference at this stage... (and this can change
next week:) - if I need a simple CRUD app that is all self contained
and isn't going to be a corporate behemoth...I'd use Rails. If it's
going to be a large corporate application I currently lean towards JEE
(EJB3).

In my short endeavor with Spring/JPA/Tomcat, I  found setting up
Spring to work with JPA and Tomcat to be a pain. .. .had issues with
the load time weaving and looking at the docs and googling on the
setup for Tomcat was confusing. Plus I had to start looking over a
Spring book - all for what gain? The only main benefit I found was
that it was easier to test my Spring pojos. With Spring/Tomcat, I also
had to start importing all kinds of different jars into my application
lib and tomcat lib (aspectj jars, spring jars, etc.) Overall it was
just more of a pain to me getting started. Again, I'm by no means
against a Spring/JPA/Tomcat or Resin solution. I just disagree that
things are now easier' with Spring vs using JEE5 (granted this used to
not be the case.

For those bashing JEE and EJB3 (not saying you are) do take a look at
even the simple example I posted. Look at how little configuration
there is. I'm not saying learning the spring setup is super hard...
but I (and others) have had issues trying to get it to work with
Tomcat. Sure it can work, but I was up and running in less time with
EJB3 on JBoss (and I had the same experience with Glassfish also.) And
yes, I am aware there will be some container specific files I'll need
to modify (ie pool sizes, etc. But I don't find that too big a deal..
even on Tomcat or Resin there are files you could tweak.)

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


RE: Would really appreciate some feedback on this Maven2-EJB3/JPA example that I've posted, to make it better

Posted by Martin Gainty <mg...@hotmail.com>.
Hi Rick

would be nice if we could start at the top of Pikes Peak to look down on the Spring vs EJB debate
Spring promotes the use of Factories and EJB doesnt
Spring works well with all ORM methodologies including Hibernate and iBatis
EJB supports implementation of Local vs Remote access for stateful and stateless beans
latest version of EJB supports Annotations to implement interfaces
more salient points?

with regards to MVC who wins and for what reasons?
is this as simple as EJB is good ?
and Spring is bad ?
or vice-versa?

thanks/
Martin 
______________________________________________ 
Disclaimer and confidentiality note 
Everything in this e-mail and any attachments relates to the official business of Sender. This transmission is of a confidential nature and Sender does not endorse distribution to any party other than intended recipient. Sender does not necessarily endorse content contained within this transmission. 


> Date: Tue, 14 Oct 2008 13:58:38 -0400
> From: rickcr@gmail.com
> To: users@maven.apache.org
> Subject: Re: Would really appreciate some feedback on this Maven2-EJB3/JPA example that I've posted, to make it better
> 
> On Tue, Oct 14, 2008 at 1:00 PM, Rusty Wright <ru...@gmail.com> wrote:
> > I guess what I'm asking is, what's the difference between EJB3 and JPA?  For
> > example, if I want to use JPA I could use Hibernate and Tomcat and use only
> > the JPA annotations.  When you say EJB3 does that mean that you're using JPA
> > in a J2EE app server, or is there more to it than that?
> 
> You are correct. However if you are going to do like you say and "Use
> JPA with Hibernate and Tomcat" you will also STILL need some sort of
> container to manage things which is where Spring comes in. You'll also
> want Spring to manage transactions (which you get for free with EJB3,
> etc) I don't want to start a whole Spring vs EJB3 war, but suffice it
> to say I found the setup much easier with EJB3. You can follow some of
> the 'war' so to speak if you look at some of the comments in this blog
> post
> http://java.dzone.com/articles/the-cost-springsource-enterpri  Both a
> Spring/JPA/Hibernate solution and an EJB3/JPA/Hibernate solution will
> work and they both have some pros and cons.
> 
> 
> (For those catching this post out of context  it started with some
> comments I was requesting in the maven setup for this tutorial I
> posted: http://www.learntechnology.net/content/ejb/maven-ejb3.jsp Any
> helpful changes are welcome, thanks.)
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
> 

_________________________________________________________________
Stay up to date on your PC, the Web, and your mobile phone with Windows Live.
http://clk.atdmt.com/MRT/go/msnnkwxp1020093185mrt/direct/01/

Re: Would really appreciate some feedback on this Maven2-EJB3/JPA example that I've posted, to make it better

Posted by Rick <ri...@gmail.com>.
On Tue, Oct 14, 2008 at 1:00 PM, Rusty Wright <ru...@gmail.com> wrote:
> I guess what I'm asking is, what's the difference between EJB3 and JPA?  For
> example, if I want to use JPA I could use Hibernate and Tomcat and use only
> the JPA annotations.  When you say EJB3 does that mean that you're using JPA
> in a J2EE app server, or is there more to it than that?

You are correct. However if you are going to do like you say and "Use
JPA with Hibernate and Tomcat" you will also STILL need some sort of
container to manage things which is where Spring comes in. You'll also
want Spring to manage transactions (which you get for free with EJB3,
etc) I don't want to start a whole Spring vs EJB3 war, but suffice it
to say I found the setup much easier with EJB3. You can follow some of
the 'war' so to speak if you look at some of the comments in this blog
post
http://java.dzone.com/articles/the-cost-springsource-enterpri  Both a
Spring/JPA/Hibernate solution and an EJB3/JPA/Hibernate solution will
work and they both have some pros and cons.


(For those catching this post out of context  it started with some
comments I was requesting in the maven setup for this tutorial I
posted: http://www.learntechnology.net/content/ejb/maven-ejb3.jsp Any
helpful changes are welcome, thanks.)

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: Would really appreciate some feedback on this Maven2-EJB3/JPA example that I've posted, to make it better

Posted by Rusty Wright <ru...@gmail.com>.
I guess what I'm asking is, what's the difference between EJB3 and JPA?  For example, if I want to use JPA I could use Hibernate and Tomcat and use only the JPA annotations.  When you say EJB3 does that mean that you're using JPA in a J2EE app server, or is there more to it than that?


Rick wrote:
> On Mon, Oct 13, 2008 at 6:26 PM, Rusty Wright <ru...@gmail.com> wrote:
>> I was wondering if you need to use JBoss?  Couldn't you do it as a war
>> instead of an ear?
> 
> Mine is an EJB3 example.  (For a decent spring/jpa example, look at appfuse)
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: Would really appreciate some feedback on this Maven2-EJB3/JPA example that I've posted, to make it better

Posted by Rick <ri...@gmail.com>.
On Mon, Oct 13, 2008 at 6:26 PM, Rusty Wright <ru...@gmail.com> wrote:
> I was wondering if you need to use JBoss?  Couldn't you do it as a war
> instead of an ear?

Mine is an EJB3 example.  (For a decent spring/jpa example, look at appfuse)

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: Would really appreciate some feedback on this Maven2-EJB3/JPA example that I've posted, to make it better

Posted by Rusty Wright <ru...@gmail.com>.
I was wondering if you need to use JBoss?  Couldn't you do it as a war instead of an ear?

Rick wrote:
> Thanks to those on this list helping me start to get a handle on Maven.
> 
> I made my first attempt at a decent simple lesson that can work as an
> EJB3/JPA skeleton app that builds with Maven2. (There are some things
> out there but many of them are a bit outdated, or else they cover too
> much, or too little. I tried to get the core basics down in this demo
> that I wish I had when starting out.)
> 
> I'd appreciate if some of you could at least look over the pom.xml
> files that you see posted:
> 
> http://learntechnology.net/content/ejb/maven-ejb3.jsp
> 
> I'm not sure I'm using provided and optional correctly (although the
> generate ear seems to look ok to me.) I'm obviously still a maven newb
> so any recommendations I'll kindly take to get it fixed up.
> 
> Thanks
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org