6

Hello good people of StackOverflow!

I've tried many tutorials on using JBoss Seam and looked at the "Restbay" example in the Seam distro. But I cannot get a working REST web service with the following tech stack:

  • JBoss 4.2.3
  • Seam 2.2.*
  • Resteasy 2.2.*
  • Hibernate 3
  • Maven 3 (critical)

The project layout I've been attempting looks like:

ProjX

  • pom.xml
  • ProjX-ear
  • ProjX-ejb
  • ProjX-web

The EAR layout looks like:

ProjX.ear

  • lib
  • META-INF
  • ProjX-web.war
  • ProjX-ejb.jar

Is this impossible? Ultimately I want to treat my REST resources as Seam action components and reap the benefits of "seamless" injection. Is this an impossible achievement on the mighty JBoss 4.2 Application Server?

(Note: I'm using the maven-ear-plugin to layout my EAR)

[UPDATE: this is not impossible I almost had it! I just ran out of time...]

Reuben Peter-Paul
  • 1,550
  • 3
  • 15
  • 25
  • Project is constrained to use JBoss 4.2.3, no time to see if there is a clear migration path to 5. – Reuben Peter-Paul Jul 25 '11 at 13:50
  • 6
    What is actually your problem? The right Maven project structure or JBoss configuration? – Michael-O Jul 25 '11 at 21:00
  • I agree with Michael-O. Maven 3 is probably not related to whatever issues you are having, although you may need some workarounds if one of the libraries you are using has a bad pom.xml file or something. What exactly is the problem? – Joshua Davis Jul 28 '11 at 11:15
  • I'm looking for a "recipe", or even a maven archetype. However the seam archetypes I've tried are out of date. I would say the greatest issue is making the above stack work on JBoss AS 4.2 which doesn't have proper EJB 3 support. – Reuben Peter-Paul Jul 28 '11 at 12:31
  • 1
    I still don't think I answered you @michael-o fully. The problem is how can the above configuration be made to work. Maven is significant because the an ear and war must be laid out (I am aware of the Seam examples using Ant to build their applications). Maven builds are trickier where you have to be aware of transitive dependencies being pulled in and potentially overshadowing a lib in your ear with a conflicting version (i.e. JAR-Hell). – Reuben Peter-Paul Jul 28 '11 at 13:23
  • Reuben, I assume now that you are looking for a same Maven project setup right? Well, Maven cannot help your to maintain the correct dependencies but it can help you to maintain them in general. You have to figure your which versions you need. The JAR hell won't happen if you use the `mvn dependency:tree` mojo and m2eclipse with graphical dep analysis. Consider an archetype as an template to speed up development, it is nothing more nor nothing less. Your ProjX layout can be made in a snap with Maven. – Michael-O Jul 28 '11 at 14:01
  • 1
    Did you try [this one](http://seam-archetype.sourceforge.net/jbosscc-seam-archetype/1.1/quickstart.html)? – Michael-O Jul 28 '11 at 14:04
  • 2
    Hibernate 3 won't work on JBoss 4.2.3; there are incompatibilities between some of the EJB3 components on 4.2.3 and some of the Hibernate dependencies. – atrain Jul 31 '11 at 16:21

1 Answers1

1

Long time ago that you asked, but maybe you are still interested to hear (if you haven't already found out for yourself) that Seam 2.3 is available in alpha version, which is based on a maven build.

Besides that you should definitely abandon JBoss 4.x and at least take 5.1.

And if you use REST webservices, you may as well take a bigger step and switch to Java EE 6.

Arjan Tijms
  • 37,782
  • 12
  • 108
  • 140
Alexander Rühl
  • 6,769
  • 9
  • 53
  • 96