Showing posts with label Blaze. Show all posts
Showing posts with label Blaze. Show all posts

2008-07-29

Remote deployment on JBoss

Not completely Flex related, but I am thinking of deploying our latest AIR application with an LCDS backend on a JBoss 4.2 server (maybe 5.0). Question is, and I've been searching but can't find the answer so far, does anyone know how to do remote deployments of a WAR/EAR to a JBoss server?

2008-07-09

Different MessageBrokerServlet in the same EAR

If you work with LCDS or BlazeDS and are about to configure a second web application inside the same EAR, then you might see an error like this when the application starts up:

javax.servlet.UnavailableException: MessageBroker already defined from MessageBrokerServlet with init parameter messageBrokerId = '__default__'

This is because the declaration of both the MessageBroker servlets in both web.xml files looks like so:

<servlet>
<servlet-name>MessageBrokerServlet</servlet-name>
<display-name>MessageBrokerServlet</display-name>
<servlet-class>flex.messaging.MessageBrokerServlet</servlet-class>
<init-param>
<param-name>services.configuration.file</param-name>
<param-value>/WEB-INF/flex/services-config.xml</param-value>
</init-param>
<init-param>
<param-name>flex.write.path</param-name>
<param-value>/WEB-INF/flex</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>


The above declaration is the default, and when both servlets are initialized, both are given a default identifier of '__default__'. Thus when a second web application in the EAR is initialized, it fails with the above error. They must have different identifiers and you do this by specifying an additional parameter in the declaration of the servlets in each respective web.xml. The declaration of the identifier should be like so:

<init-param>
<param-name>messageBrokerId</param-name>
<param-value>55</param-value>
</init-param>

So now one of MessageBroker servlet's will have an identifier of '55'. Add the same parameter for the other servlet in the web.xml file of the other web application, with a different identifer and both web applications should operate properly.

2008-06-05

Flex easy to learn for Java developers

Since the first release of Flex back in 2004 the main target audience has been Java developers. And this continues to be true even today, especially when you consider the server-side compliments of BlazeDS and LiveCycle Data Services are both Java based solutions. And this is also easily apparent in the real-world and I see it first hand everyday at my company, where everything we built is in Flex and Java.

One of the guys I work with the most, Jade, has developed Java Applets in the past and he picked up Flex very easily, to the point where he is using it for his own personal home projects. Another good example is our architect, who worked with me recently on a brand new project. I let him do a portion of the Flex UI and at one point he even went as far to create a new validator component that received the error messages from the server-side. Like I said, its easy to pick up :) One last example, I upgraded one project from Flex 2 to 3 with another fellow developer at his request, so that he could some of the new APIs that deal with Bitmaps objects.

The similarities between the two languages is uncanny and that really helps bring people over. Thus we use the best technology for creating UIs - Flex - and continue to use Java on the server-side to implement the business logic. It's the best of both worlds.

To get into more details, read my Flex/Java article on the Developer Center.