This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
I also tried doing parts of the TrailBlazer application example from JBoss but obviously it's out of date and JNDI has changed in the EJB3 spec since the time that app was created.
I'm puzzled, this all appears very simple yet I can't find one, single working example app! Can someone help me out?
I don't know squat about EJB (2.x *or* 3.0) and I don't know anything about JNDI except what it is, conceptually. I'm literally starting from the very beginning. I want to use JBoss because I'm familiar w/ Hibernate and would prefer to stick w/ a Hibernate-backed EJB3 implementation. I also like the look of Seam and will try and use it when I get comfortable w/ basic EJB3 concepts.
Joined: Apr 26, 2004
I was able to fenagle this into working by packaging it as an EAR project in MyEclipse and by tweaking the JNDI lookup to use the EAR name in the path.
EJB 3.0 is pretty neat! I hope the spec is finalized soon!
Cool. Yeah the idea of putting everything in an ear makes things easier.
Yeah EJB3 is very nice.
What we do here is create the interface with no annotations. Then create two seperate interfaces that extend the first interface, each of these will be the local and remote interfaces. Then we create the bean class that implements both the local and remote interfaces. I am still using the bean as a thin facade to the actual POJOs that provide the service. So the service class implements just the first interface that has no annotations.
Sounds like you've got a nice, simple design for keeping clean boundaries.
I'm trying to decide on a basic design for a storefront I've got to build at work. By all means, it's your basic shopping cart but w/ some heavier integration on the back-end. We'll be tying into PeopleSoft Financials, our bank (cc processing), and a remote inventory system hosted on a different platform - should be a fun project and a good one to take EJB3 out on the road and open 'er up.
I figured I'd use JAX-WS 2.0 for some of the integration tasks...it looks so damn easy to use! I'll be more convinced when I've got a working example.
I'm shocked at how well EJB3 works in JBoss...I've been playing w/ examples and testing it out all day and I'm *really* impressed. I thought Hibernate made life easy - this is a great leap forward!
Anyhow, I'm trying to figure out how to proceed w/ this project...obviously a stateful session bean for shopping cart functionality would work (and I've seen plenty of examples of that now.) Since I'm new to EJB style development I'm just trying to figure out how to package it all up. Should I put my domain model and all of my other EJB3 code in a single ejb-jar? What's the best way to abstract JSF from my session beans? (i.e. - what's a good facade/proxy approach?)
I still remember those comments you made when you first started with Hibernate.
Yes using Web Services for your integration is key. Look also at JDom, and now Java 1.4 has aslo the XMLEncoder and XMLDecoder objects to transform you DTO POJO object into an XML document and back using Serialization.
I would still recommend not using a Stateful Session Bean. Makes for more interesting.
Joined: Apr 26, 2004
OK, let me rephrase that then, hibernate makes life easy once you get around all of the initial headaches such as; session management & application design *around* Hibernate.
For me, the only way to correctly learn Hibernate is to go out and buy the Hibernate in Action book...at least to get started.
Once over the initial screaming and ripping-out of the hair...it's a great tool for 3/4 of your projects. The rest is still best-suited to JDBC (i.e. complex report queries.)
I'll also go as far as to say that EJB3 is Hibernate done right...or whatever persistence technology you want to put in the place of Hibernate, I love it!