views:

349

answers:

1

What's the best way to develop JBoss/Seam/Flex/BlazeDS based applications?

The problem that I'm facing is in having an easy and clean way of having a deployed ear while having Flex/BlazeDS still debuggable from Flex Builder.

Everything works just fine if I'm working on an exploded war deployed under "JBOSS_HOME/server/default/deploy" directory. The same is not true if the war is deployed on an exploded ear on the same folder.

The way that I've so far found around this issue is in having a BlazeDS service stub in a different war that will allow me to work with the Flex front-end application. The problem is that I also have to replicate and maintain the Entity bean POJOs that are being serialized by BlazeDS remote services.

This is obviously very annoying. I've tried several things but so far without any success. Any help would be appreciated.

I'll be upgrading to Flash Builder 4 sometime soon. Does anyone know if these issues are better handled in it?

Thanks, B.

A: 

So this morning I went back and tried to deploy the ear and flex war together using Flex Builder 3. After some more testing I've realized that the problem is not with Flex. The error that I'm getting while making a remote call seems to be caused by the Seam Framework:

ERROR [[MessageBrokerServlet]] Servlet.service() for servlet MessageBrokerServlet threw exception java.lang.IllegalStateException: Attempted to invoke a Seam component outside an initialized application at org.jboss.seam.contexts.Lifecycle.getApplication(Lifecycle.java:36) ...

Once I've removed Seam from the project, BlazeDS calls were successfully placed.

This is still really strange because if I deploy it packed as opposed to an exploded ear then everything works just fine (except that I will not be able to use Flex debugger).

I guess that for now the solution is to not use the Seam Framework. I've tried this with both Seam 2.2.0.GA and 2.2.1.CR1 but without success.

bmsantos
It seems like Seam is trying to apply a filter to BlazeDS's MessageBrokerServlet. You can certainly get Seam and BlazeDS working together. Just make sure that you don't have a Filter or something acting on the MessageBrokerServlet.
James Ward