Archive for 2006/08


XPath Issues with JBoss 4.0.3 SP1

I recently ran across this error message when running Flex Data Services 2 inside JBoss 4.0.3 SP1:
ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[localhost].[/samples].[MessageBrokerServlet]:145]
Allocate exception for servlet MessageBrokerServlet
java.lang.RuntimeException: XPathFactory#newInstance() failed to create an XPathFactory for the default object model: http://java.sun.com/jaxp/xpath/dom with the XPathFactoryConfigurationException: javax.xml.xpath.XPathFactoryConfigurationException: No XPathFctory implementation found for the object model: http://java.sun.com/jaxp/xpath/dom
The problem is with JBoss 4.0.3 SP1 and is […]

ActionScript Package Name Case Sensitvity

I checked out some mxml / action script code from our CVS repository today and recieved an error when trying to compile it:
 Error: Type was not found or was not a compile-time constant: <ActionScript Class Name>
It seemed from the error message that someone must have 1) forgotten to add an import in action script or 2) had messed up with the […]

How to Access HttpRequest from Flex Data Services 2

Sometimes in a flex app that is deployed as part of a java web app you will need to know who is the currently logged in user.  To do this in Flex 1.5 you could use the flashGateway.Gateway class.  In Flex 2.0 this is done using the flex.messaging.FlexContext class (part of the flex-messaging.jar file).  Use […]

Maven Build for Flex Applications

First see related blog Directory Structure for Integrated Flex and Java Web Applications.  This blog shows how easily one can build such project using maven with sample maven.xml, project.xml, project.properties files.  The samples are for maven version 1.0.2 and not version 2.x.             
<to be continued>
NOTE: You will get an error in maven on the call […]

Integrating Flex and Java in an Eclipse Web App Project

Requirements
1. Eclipse Web Tools Platform (WTP) from http://www.eclipse.org/webtools/, specifically the Web Standard Tools (WST) is used in this tutorial.
2. Flex 2 Builder Eclipse Plug-In from http://www.adobe.com/products/flex/flexbuilder/
Create the Eclipse Web App Project
1. Create a new project as “Web > Dynamic Web Project”.
2. Give it a descriptive project name.
3. Uncheck “Use default” and set “Directory” to the root directory where the project […]

Directory Structure for Integrated Flex and Java Web Applications

This blog describes a proposed directory structure for web applications that contain a mix of flex applications, java presentation layer code, and java integration layer code.  From this structure you could easily build projects using ant or maven (preferred). 

FDS 2 and Flex Builder 2

I have found that Flex Builder 2 does not properly recognize any flex data services 2 mx components because it does not include the fds2.swc file by default in its install and thus cannot use the FDS2 controls.  To fix this problem, simply copy fds2.swc from <fds2 install folder>\flex_sdk_2\frameworks\libs to <flex builder 2 plug-in install […]

Quick and Easy POJO Web Services with JBossWS

Here is a step-by-step tutorial explaining the quickest and easiest way to expose a plain old java object (POJO) as a web service.  This example uses jboss’s new web services stack (JBossWS-1.0.2.GA).  With this method you can quickly convert any java object into a web service.  For example, you could expose data access objects to a […]

Maven Build with Eclipse

I have found that the best way to run maven from inside eclipse is to create only one external tool named “Maven” and use the project_loc variable to specify the working directory in which maven will run. 
Here is a step-by-step guide:
1. Run > External Tools > External Tools…
2. Right click on “Program” and select “New”
3. For “Name”, type […]

Maven versus Ant comparison

Here are the short and concise reasons why maven is a better choice than ant for project builds:

Maven can run any ant scripts you need, so maven can do any thing ant does.
Maven does not need to be explicitly told to compile java files or build a war or ear file, so there is less […]