Java :: Handling Custom Exceptions With Throwable Cause In Flex

Mar 8, 2012

I am using a custom java exception to provide the flex client with more info than the exception itself. My exception extends Exception and it has a attribute with the needed info for the client. Well, my problem is the following: when I build my exception if I invoke super() or super("message") the flex client can access all the info properly. But if I build the exception with a Throwable cause, super(cause), then the flex client can only access to stackTrace.

public class MyException extends Exception {
private String errorCode;
public String getErrorCode() {
return errorCode;
} public void setErrorCode(String errorCode) {
[Code] ......

By using MyException(String msg) the flex client can access to errorCode
By using MyException(Throwable cause) the flex client can't access to errorCode

In the flex side the code is:
var faultEvent : FaultEvent = FaultEvent( event );
var errorMessage:ErrorMessage = faultEvent.message as ErrorMessage;
var codeError:String = errorMessage.rootCause.errorCode;

View 1 Replies


Similar Posts:


ActionScript 2.0 :: Handling Exceptions When External Data Doesn't Load

Sep 23, 2010

I'm loading external data from a txt file into a MovieClip. It contains data that is crucial to the presentation viewing. It is necessary to load, not right away but at some point (the sooner the better). When the txt is on the same server it works instantly, but I'm loading data from another server.

Two problems: the onLoad code is stuck if the file doesn't load (connection problem, server down?) and in offline mode what happens if the data is purged out of browsers cache (history problem)?

How can i handle these exceptions?

1. Some code that uses a "timer" to periodically try to load the data again if the connection is slow and the txt doesn't loads the first time?

2. When it doesn't load at all, and the onLoad fails, how can I simulate notOnLoad - exception for data download fail? And retry the dataLoad?

I've already made cross-server data loading possible using crossdomain.xml policy.

The site is still in development. This problem occurred when the server which contains the data.txt was down due to maintenance, and when one of the test-visitors was downloading so much in the background that his connection didn't had enough bandwidth to load data correctly (browser thought he had connection problems).

View 3 Replies

Java :: Flex - BlazeDS Not Handling Inner Class DTO?

Aug 19, 2011

I've noticed BlazeDS has certain things it does not support and it is often difficult to find this out. Ex: polymorphism is not.One must create methods with different names as methods with the same name with different parameters create a conflict.I'm trying to find out if BlazeDS does not support Java static and non-static inner classes.

public class UserDTO {
private String name;
private AddressDTO adddress;
private PhoneDTO phone;

[code]...

The example code above will compile and the getUser method will work. A call to the updateUser or updatePhone methods on the other hand results in a BlazeDS error. Is there a special way to use inner classes in Flex or are inner classes not supported?

Here is an example of the error messages produced:

[BlazeDS]Cannot create class of type 'com.test.dto.UserDTO.PhoneDTO'.
flex.messaging.MessageException: Cannot create class of type 'com.test.dto.UserDTO.PhoneDTO'. Type 'com.test.dto.UserDTO.PhoneDTO' not found.

Example Flex code:

var thisPhone:PhoneDTO = new PhoneDTO();
thisPhone.phoneNumber = "8885551212";
updateTagsResult.token = userService.updatePhone(thisPhone);

View 2 Replies

AS3.0 :: Java - Flex - ArrayList Of Custom Java Objects Over BlazeDS

Dec 7, 2010

Right away i just try to explain my problem: Using BlazeDS i got the following Javaclasses:

[Code]...

Then i got a Flex service class calling BlazeDS and executing the getCategories java method. Since Flash dosn't seem to understand typed arrays, the result from that method which i get back in flex is a simple array of untyped objects (the mapping dosn't seem to work here, even tought the class category exists in flex and has the same properties).
thats the first thing. but however, i'm converting the untyped objects manually into objects of the category.as class. the second thing is that categories have child-categories within the java object, which are also ArrayLists of the type category.java. the problem about that: my result event object only contains the first level of categories, looking into them the children are allways null. i dunno why they are empty, since they ARE part of the java object category.

and the third thing (the strangest by fast), you maybe noticed i named the properties of the category.java class strange, like idCat and nameTest instead of simply id and name. why that? because the property names of my flex result objects dont seem to change when i change the java objects properties names (result object properties are named "id" and "name" but the java class object properties are named "idCAT" and "nameTEST"). that it REALLY strange, since if i set the properties, like you see at nameTEST = "TESTNAME" it IS recogniced by flex, only the proertyNAMES dont seem to be recognized at all.

[Code]...

View 4 Replies

Flex - Session Handling - Flex BlazeDS Java?

Apr 16, 2011

Am facing issue with session timeout. Say for instance, the user logs into the application and he waits for 30 mins (session timeout time) and then tries to get a service through remote object.Ideally speaking, since the session has timeout the user shouldn't be able to hit the remote object, but this is happening the other way round.

[Code]...

View 1 Replies

Java :: Handle Custom Java Exception In Flex App?

Mar 18, 2010

we are using BlazeDS as a proxy between Flex and Java. The approach is the same as in

[Code]...

View 3 Replies

Flex :: Handling Events From Custom Header Renderer In AdvancedDataGrid

Jul 4, 2010

I have to create a custom header for the AdvancedDataGrid component. The custom header must have two buttons in it. The custom renderer must be applied to more than one column.

How I can fire, dispatch and handle events from the custom headers?

View 1 Replies

Custom Marshalling From Java To Flex Via BlazeDS?

Oct 29, 2010

My team are putting together a proof-of-concept Flex application sitting on top of a Spring-based server using BlazeDS.We do quite a lot of date calculations, so we use Joda Time extensively throughout the code and in our domain model.We're now trying to figure out how we can continue to use Joda Time in our DTOs that are sent back-and-forth with the Flex frontend via BlazeDS.

Our goal is to use the Actionscript 3 data type Date on the Flex side and have that map to our use of Joda time's DateTime, LocalDate and LocalTime types on the Java side.We can solve the problem of converting Actionscript 3's Date type when calling Java with a custom type marshaller plugged into BlazeDS, but this appears to only be invoked for the Flex->Java/BlazeDS direction and not for the Java/BlazeDS->Flex direction.

I'm now looking at custom PropertyProxy implementations for BlazeDS, but this doesn't look like the right thing either.The other idea was to implement Externalizable on our Java DTOs, but this seems like too much work, especially when I look at the BlazeDS rival GraniteDS and that shows plugging in Joda Time support in their documentation with a simple type converter!

View 3 Replies

Java :: Remote Object(flex) And ArrayList Of Custom Objects?

Jan 24, 2012

I have a custom java class which has an ArrayList and corresponding to it have a custom vo class which has ArrayCollection (in Flex).I want to return data from Java to flex.Every variable in java is getting mapped to vo perfectly except for ArrayList.When trying to retrive When trying to retrive exposureUSDList (which is an arrayList) in flex I am getting empty ArrayCollection. It is not getting mapped properlyPlease find my code below:

Flex Code:
package com.example.vo
{

[code].....

View 1 Replies

Actionscript 3 :: Catch PHP Exceptions In Flex Without AMFPHP?

Nov 10, 2011

I'm looking for a way to catch an Exception thrown by PHP in Flex using HTTPService. Is it possible to do it without using AMFPHP?

In my current implementation, if an Exception is thrown in PHP, a FaultEvent.FAULT is indeed dispatched on Flex side. The only problem is that the exception's message string is nowhere to be found in FaultEvent.[code]...

View 1 Replies

Flex :: BlazeDS Accessing HTTPRequest/HTTPSession In Custom Java MessageAdapter

Nov 4, 2009

In a custom MessageAdapter written for a BlazeDS Java server, is there any way to access HTTPSession and HTTPRequest in a custom MessageAdapter.I'm trying to adapt an existing COMET JSON long-poll messaging system to BlazeDS and we use HTTPRequest parameters to specify message sending/polling paramers (such as a unique ContextID for any given page for a user). Is there any type of HTTPSession information we can retrieve in MessageAdapter receiveMessage()?

If I can't access the HTTPRequest (I'm not sure we can even customize it if we're using the standard Producer, Consumer Actionscript classes anyways), is there a way to uniquely identify a given FlexClient long-poll from another long-poll from that client (e.g. if the same HTTPSession user has a tab open to the same Flex application is there any way to uniquely identify that user?).

View 1 Replies

Windows :: Flex Web - Warnings Or Exceptions Were Found While Compiling Null?

Jul 17, 2009

I did have the capability to compile my mxml files via the browser on my local machine. I've had to do a reinstall but now I'm having problems trying to compile.My current setup is:

WAMP 2.0i
- Apache 2.2.8
- PHP 5.2.8
- MySQL 5.1.36

FlashDevelop 3.0.0 RC1
Win XP

I've tried compiling in Firefox 3.5, IE8 & Chrome but all receive the same error:

Compilation results

Errors, warnings or exceptions were found while compiling null.Visit the online Flex documentation or API reference for further information. An error occured on the server.

Server error is: 'Error occurred in server thread; nested exception is: java.lang. NoSuchMethodError: flex.license.License.(Ljava/util/ Map;Ljava/lang/ String; Lflex/ license/Logger;)V'

I've followed the instructions from adobe:

http:[url]....I can compile without an issue via CMD but I prefer to use the browser as I find that much faster.

View 2 Replies

ActionScript 3.0 :: Custom Event Handling?

Aug 31, 2010

If you have a larger project, how do you manage your custom events, do you put all of them in a single class or make multiple classes?

View 2 Replies

Actionscript 3.0 :: Create A Throwable Movieclip?

Oct 1, 2009

I want to create a movieclip (or a button) that you can pick up using startDrag() and throw around when releasing the mouse button!

I know I have to calculate the difference between the old and new x and y values.

View 4 Replies

Java :: Flex - Max Upload File Size For Java Using Remote Object (BlazDS)?

Jul 16, 2010

I tried with flex and java in the backend. In this, I am able to upload files till 100 MB using remote object (blazeDs) where we will read the file as byte array and send it to the java method. If the file size exceeds after that, then I get the run time error in IE.

View 1 Replies

Java :: Flex - Unable To Send MIDI File Name To Java To Playback Music?

Oct 27, 2010

I could play MIDI file where "filename" is a String type with "asd.mid" value. However, I tried to sent AIR's nativeprocess command to Java, it shown "could not read" error.

[Code]...

View 1 Replies

Java :: Typical Development Workflow/process Developing With Weborb For Java With Flex?

Sep 15, 2011

Meaning specifically, what steps do you go through when creating a new application using these tools?

View 1 Replies

ActionScript :: Java - Flex ArrayCollection Of Number Objects To Java Collection<Long> Using BlazeDS

Mar 24, 2010

I am using Flex 3 and make a call through a RemoteObject to a Java 1.6 method and exposed with BlazeDS and Spring 2.5.5 Integration over a SecureAMFChannel. The ActionScript is as follows (this code is an example of the real thing which is on a separate dev network);

[Code]...

View 2 Replies

Java :: Web Multiplayer Game In FLEX And Java - Build The Server Clients Managing System?

Aug 4, 2011

I'm building a Facebook multiplayer game where the client side is in FLEX and the server side is in Java and I wanted to know if there is a guide on how to build the server clients managing system. When I say server clients managing system, I mean a server which many clients will connect to and will be able to choose between tables to join and play or to create their own table, same way as in texas holdem poker.

View 1 Replies

Java :: Performance - Code Doesnot(only Sometimes) Compiles In Java+flex (+ BlazeDS+Tomcat ) Combined Project.a

Aug 13, 2010

i am working on a flex+java combined project.My IDE and computer configuration is as follows:

[Code]...

When i make a small change in Flex code (eg, reposition of a button...anything), and run the project on server, it does make any change on output. Actually it depends on my luck... because it makes change in output randomly.what is is happening? tried rebuild, republish, clean , restart server, restarting the IDE, restarting the computer all available feature i could think. Also, i created a simple flex project on IDE and compiled it..... everything is compiled and displayed on output.

View 2 Replies

Java :: Flex - Create .swf In Java By Using 'ant' File & .mxml?

Apr 11, 2012

I am newer with flex technology.I am creating a chart using ant file & .mxml in eclipse my 'ant' file executes properly but it gives following error when i opens a .swf file which is created auomatically:

Flex Error #1002: Flash Player 9.0.115 and above is required to support signed RSLs. Problem occurred when trying to load the RSL

[Code]...

View 1 Replies

Java :: Implement A Web App With Blazeds+java+flex+tomcat?

Mar 23, 2010

I'm coding a web app in flex blazeds and Java. I installed the Eclipse plugins for using WTP mixed project. I'm using flex's server that uses an emulate of tomcat when i ran my flex service the web app got the datas, everythings is ok. the problem is when i copy the project with all files generated by flex in my tomcat or the blazeds's tomcat, it doesn't work, this is becasue i want to implement my app on a server the error is:[code]
i don't know why tomcat doesn't find the class of flex.messaging.endpoints.AMFEndpoint that is used for my-amf 'URL...'. all works well in the emulated server that flex has.

View 4 Replies

Java :: Adding Two Num Flex 3.0 As Front End And Java As Back End?

May 24, 2010

i hava two text boxs in flex.have to add two txt boxs values in back end java and have to return back to third text box in flex.

View 1 Replies

Java :: Accessing A Java Method In A Flex Object?

Jul 16, 2010

Assume I have the following java class public class Square {

[Code]...

Inside an actionscript class, using RemoteObject, I invoke the java method SquareDAO.findById(Long id) an I get an Object with the following: But I don't get the area. How can I invoke the method getArea() ?

View 1 Replies

Actionscript 3 :: Flex 4 Disptaching Custom Event From Custom Component (why Flex Converting Custom Event To Mouseevent)?

Mar 2, 2012

This is NOT duplicate of my earlier post (its is slightly different)But this is similar issue with similar error but its not the same error The error I am getting now is below while dispatching the custom event from my custom component

TypeError: Error #1034: Type Coercion failed: cannot convert events::MapEvent@a74ab51 to flash.events.MouseEvent.
dispatchEvent(new MapEvent(MapEvent.CLICKED_ON_MAP));

Note: The error in my earlier post is giving below error message

Type Coercion failed: cannot convert flash.events::Event@81ecb79 to com.events.ShopEvent

The difference here are two things, the earlier error is while converting flash event to custom event and now this one is while converting custom event to flash event and secondly, I have no clue why it is trying to convert to the mouseevent where I am just dispatching my custom event with proper listeners.

This is my custome event

package events
{
import flash.events.Event;
import ui.map.MapElement;

[code]...

View 1 Replies

Java :: Use Blazeds With A Custom Classloader?

Mar 18, 2010

has anybody tried using a custom classloader with BlazeDS? We have a web application using BlazeDS and we can convert Java objects in to ActionScript object and back without problems in the main application. However, we also have a plug-in mechanism based on a custom classloader.BlazeDS cannot map the types contained in jar files of that custom classloader since I don't know how to tell it to BlazeDS.The livedocs of TypeMarshallingcontext show a setClassloader() method, but since the context seems to be a singleton, I assume this will not work if you have multiple custom classloaders (we have 1 for each plugin that is deployed

View 1 Replies

Flex :: Something To Allow "Writing Flex Without ActionScript", Or "Java To AVM2 Compiler", Or "Write Flex Using Java" Exists?

Dec 27, 2009

There are many dynamic languages that target Sun's JVM (Groovy, Scala, Jython, Jruby etc) and I was sure there are many that target Adobe's AVM as well. But I was surprised to find only haXe do something similiar. related question on this site

I think the eclipse e4 SWT project doesn't compile to ABC (ActionScript Byte Code) directly, but first converts Java to AS3 and then the Flex compilter does the rest.Could it be that no one yet wrote a simple Java / Python / Scala AVM2 compiler that can be used as an alternative to the proprietary Adobe Flash Builder (formerly Flex Builder)?I don't mind paying Adobe for a fine producy, but writing Java in eclipse is so much faster and convinent than the half baked adobe plugin suite. are there really no efforts other than haXe?

View 3 Replies

Javascript :: Catching Uncaught Exceptions?

Apr 20, 2010

In my workplace we are mantaining a lot of ecommerce websites,some coded better than others. On some of those, sometimes uncaught exceptions are thrown, and showed by the alertbox from the flash player debug (If you have it installed).To rise the average user experience I'd like to report all those exceptions throught a in house tool we already have.Is there a way to catch those exceptions?Maybe the flash player debug exposes them to javascript, or in some other way.

View 2 Replies

Actionscript 3 :: Catch ALL Exceptions At Some Top-level?

Aug 24, 2010

Is it possible to catch ALL exceptions at some top-level in Actionscript 3?

View 1 Replies

Flash :: Swfloader: Catch All The Exceptions From The Loaded Swf?

Feb 9, 2010

I am loading a swf into another swf using swfloader, I want to catch all the exceptions thrown by the inner swf, is it doable?

View 2 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved