BlazeMonster

AIR based Tool to generate Flex code for consuming/exposing Java classes as BlazeDS/LCDS Remoting services

This application helps developers to generate Flex code to consume BlazeDS/LCDS Remoting services and also generate configuration file to expose Java classes as Remoting services. Developers can view response from a Remoting service, generate Flex code to invoke a Remoting service and also generate AS3 VO code for the Java classes.

Content in this page was earlier hosted at http://sujitreddyg.wordpress.com/2009/05/07/blazemonster/ You can find more comments there.

Update: BlazeMonster V2 is published. Please find details on version 2 features at this URL http://sujitreddyg.wordpress.com/2009/08/26/blazemonster-v2-with-support-for-spring-blazeds/

What can this application do?

Existing Remoting services

1) View existing Remoting destinations

2) Invoke them and view the response in the application.

3) Generate Flex code to invoke a operation on a destination. Complete code including required AS3 VO classes will be generated.

Create new Remoting service

1) View public methods of Java classes

2) Generate configuration files to expose a Java class as Remoting service

3) Generate Flex code to invoke methods on the Java class exposed as Remoting destination. Complete code including required AS3 VO classes and configuration files will be generated.

AS3 VO Generation

1) Generate Action Script 3 VO classes for a Java class

2) All public properties of a Java class will be used to create the AS3 class

Remote BlazeDS

1) Useful when you cannot deploy the server code bundled with this application on the server

2) Invoke Remoting services exposed by third party BlazeDS server

3) Generate Flex code to invoke the exposed Remoting service

Screen shots of the application

Exposing Java classes as Remoting services

Exposing Java classes as Remoting services

Generated code

Generated code

AS3 VO class generated

AS3 VO class generated

How do I use this application?

  1. Set up BlazeDS for your web application as explained at this URL http://sujitreddyg.wordpress.com/2009/04/07/setting-up-blazeds/
  2. You need to have Adobe AIR installed. Most of the computers have it, if you forgot to install, please download form this URL http://get.adobe.com/air/
  3. Download BlazeMonster AIR application (.air file: 670 KB) from this URL http://www.sujitreddyg.com/applicationinstallers/blazemonster/BlazeMonster.air (Incase of IE, if the file is saved as BlazeMonster.zip, please rename to BlazeMonster.air and install)
  4. Download required Java files (zip file: 6 KB) from this URL http://www.sujitreddyg.com/applicationinstallers/blazemonster/BlazeMonsterServerSetup.zip
  5. Extract the downloaded zip file on your system
  6. Assuming “mywebapplication” is the name of your J2EE application
  7. Copy the invokeremotingservicebrowser.jsp from the extracted folder in to the root folder of your web application (mywebapplication/invokeremotingservicebrowser.jsp)
  8. Copy the folder named com from the extracted folder in to the WEB-INF/classes folder of your web application (mywebapplication/WEB-INF/classes/com/*)
  9. Install the BlazeMonster application by invoking the BlazeMonster.air file

Set up for BlazeMonster to work with Spring BlazeDS

Spring BlazeDS instantiates MessageBroker with “_messageBroker” as ID and so you need to modify invokeremotingservicebrowser.jsp to get destinations from MessageBroker used by Spring BlazeDS. This can be applied to any case where the MessageBroker has a different ID than the default.

Follow the following steps to get BlazeMonster work with Spring BlazeDS:

  1. Download one of the nightly builds of 1.0.1 version of Spring BlazeDS from this URL http://static.springsource.org/downloads/nightly/snapshot-download.php?project=FLEX
  2. In invokeremotingservicebrowser.jsp change code in line number 13 to out.println(browser.getDestinations(“_messageBroker“));
  3. Restart your server and you can see Spring BlazeDS destinations in BlazeMonster
  4. In case you run into issues with Spring BlazeDS or want to discuss with other developers you can do in the forum at this URL http://forum.springframework.org/forumdisplay.php?f=61

Troubleshooting

If you have problems with BlazeMonster try the following:

  1. Check if the application root URL in the application is correct
  2. Send a request to this URL http://<server-root>:<server-port>/<app-context>/invokeremotingservicebrowser.jsp?operationName=getDestinations from your browser
  3. Check if there are any errors in your server log files
  4. Make sure your server is configured to use at least JRE 1.5 and above. I am working on class file for older versions of JRE :)

Any suggestions/bug reports/enhancement feed backs are most welcome :)

Adobe Rocks :)

26 Responses to BlazeMonster

  1. nsdevaraj says:

    Hi,
    The tool is nice, but how to login(authenticate) in case of using the java-security for spring-blazeds?

  2. nsdevaraj says:

    Hi Sujit,
    The tool rocks, i got the place where to provide authentication information. I am using Spring-Blaze DS with
    http://www.ibm.com/developerworks/java/library/j-genericdao.html

    In my case, my methods and arguments were not exposed to the destinations.

    Do you have any idea, how to get them exposed to your tool..?
    Regards,
    Devaraj

  3. nsdevaraj says:

    Hi Sujit,
    In my case using,
    http://www.ibm.com/developerworks/java/library/j-genericdao.html

    was not an issue..

    For Spring-BlazeDS,
    The id of Bean required to be in this way to get the list of methods available..

    Can you check that..
    Thanks,
    Devaraj

  4. Sriram Vasantha says:

    Hi Sujit,
    Excellent tool.
    I was introspecting one of my services which returned a VO. When I tried to invoke that service, the tool told me to generate VOs and I am able to do that from the other link inside the tool. Is there a way I can make that newly created VO available for the tool so that it can now invoke my method.
    Also can it be added to the list of operationarguments in the RemoteBlazeDS >> Add Argument Screen?

  5. Sriram Vasantha says:

    Hi Sujit,
    I read the message carefully and it appears that you did add the capability to add dynamically created VOs, not that I know that it is possible to with Flex.

    Additionally another nice to have feature is to use dynamic objects for Custom VOs in the absence of specific ones.

  6. Nargis says:

    I tried this tool and i am trying to generate vo and i found following error

    org.apache.catalina.core.StandardWrapperValve invoke
    SEVERE: Servlet.service() for servlet jsp threw exception
    org.apache.jasper.JasperException: Unable to compile class for JSP:

    An error occurred at line: 6 in the generated java file
    Only a type can be imported. com.adobe.services.RemotingServiceBrowser resolves to a package

    An error occurred at line: 9 in the jsp file: /invokeremotingservicebrowser.jsp
    RemotingServiceBrowser cannot be resolved to a type
    6:
    7: if(operationName != null)
    8: {
    9: RemotingServiceBrowser browser = new RemotingServiceBrowser();
    10:
    11: if(operationName.equalsIgnoreCase(“getdestinations”))
    12: {

    An error occurred at line: 9 in the jsp file: /invokeremotingservicebrowser.jsp
    RemotingServiceBrowser cannot be resolved to a type
    6:
    7: if(operationName != null)
    8: {
    9: RemotingServiceBrowser browser = new RemotingServiceBrowser();
    10:
    11: if(operationName.equalsIgnoreCase(“getdestinations”))
    12: {

    Stacktrace:
    at org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:92)
    at org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:330)
    at org.apache.jasper.compiler.JDTCompiler.generateClass(JDTCompiler.java:439)
    at org.apache.jasper.compiler.Compiler.compile(Compiler.java:334)
    at org.apache.jasper.compiler.Compiler.compile(Compiler.java:312)
    at org.apache.jasper.compiler.Compiler.compile(Compiler.java:299)
    at org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:586)
    at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:317)
    at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:342)
    at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:267)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)
    at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:849)
    at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
    at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:454)
    at java.lang.Thread.run(Thread.java:595)

    can you help me to generate vo

  7. Stu Thompson says:

    Is there a license associated with this project?

  8. Victor Muguerza says:

    Awesome tool, thanks Sujit.

    BlazeMonster Rocks!!!
    Greetings from Peru

  9. Tyler says:

    Hi Sujit,
    BlazeMonster will be a great tool, it looks like theres a couple of small bugs. When generating multiple VOs, the generator seems to be aggregating the properties. Each VO gets its properties and all of the properties from the VOs before it. An ArrayCollection import isn’t being added when ArrayCollection is used and there doesn’t seem to be a way to close generated VO tabs when you’re dome with them.

    Thanks for you great work,
    Tyler

  10. Hi Tyler,

    Thanks, will work on this soon :)

  11. Pedro B Morales says:

    Hi Sujit,

    This tool is fantastic, but I have two suggestions:

    1. java.util collections are not mapped to ArrayCollection in AS3. (If a Java model object has a Set then the AS3 has a Set, where it should have an ArrayCollection). Also, add the import mx.collections.ArrayCollection and mx.collections.IListView.

    2. All the fields of the AS3 VO are public but if you could have them be private and then have get/set fields that would be cool.
    (Maybe that could be an option in the Generate VO action).

    Thanks!
    Pedro

  12. Rajendra says:

    how to implements image pagination in flex.please provide any approach

  13. kalai says:

    Excellent Tool, Thanks to Sujith!

  14. kenton says:

    First of all, I love this tool. This should be shipped with every distribution of BlazeDS.

    Second of all, any chance of releasing the source? I have a few customizations I’d like to make.

  15. Matthew Morrissette says:

    I discovered a defect related to back references in data objects. For instance, if I have the java data object:

    package com.company.domain.dto;
    public class Parent {
    private List children = new ArrayList();

    public List getChildren() {
    return children;
    }

    public void setChildren(List children) {
    this.children = children;
    }
    }

    package com.company.domain.dto;
    public class Child {
    private Parent parent;

    public Parent getParent() {
    return parent;
    }

    public void setParent(Parent parent) {
    this.parent = parent;
    }
    }

    If you use Soap UI to make the AMF calls, you can see that everything returns from Blaze correctly. See the response below:

    0.75
    12

    16
    1
    children

    0.75
    12

    16
    1
    parent

    false
    false
    com.company.domain.dto.Child

    0.75
    12

    16
    1
    parent

    false
    false
    com.company.domain.dto.Child

    false
    false
    com.company.domain.dto.Parent

    However, if I use BlazeMonster, the “Server Response in Tree” and “Server Response in Text” are all completely empty and no error is displayed. It just doesn’t work.

  16. CK says:

    Hi all,

    Can BlazeMonster generate AS3 Value Object/Data Transfer Object from complex Java classes without issue, like enum, generic, collection/set/list/map than contain other collection/set/list/map (few levels)?

    Thanks.

  17. [...] BlazeMonster generate AS3 Value Object/Data Transfer Object from complex Java classes without issue, like enum, [...]

  18. What does this mean?…
    HTTP request error
    Additional data:
    Error: [IOErrorEvent type="ioError" bubbles=false cancelable=false eventPhase=2 text="Error #2032" errorID=2032]. URL: http://localhost/simpleapp/invokeremotingservicebrowser.jsp

  19. Hi Cesar,

    Looks like the server and application context entered are wrong. Can you please make sure values are right.

    Hope this helps.

  20. Thanks Sujit, i all ready fixed and u are right it was about configuration, thanks

  21. Michael Neil says:

    Honestly I just downloaded this but already it reminds me of the amfphp service browser and I feel right at home with it. I don’t know if other service browsers for JAVA exist out there but coming from AS3 and MXML this is a lifesaver on a guy who’s a little rusty with JAVA! Thank you, thank you, thank you.

  22. Hi Michael,

    Thanks :) Glad you found it useful. Also please try the DCD features in Flash Builder 4, integrating Flex with Java is very very easy with that. Please find more details here http://sujitreddyg.wordpress.com/flash-builder-4/

  23. Rajiv says:

    Hi Sujith,
    I am getting the following error.

    HTTP request error
    Additional data:
    Error: [IOErrorEvent type="ioError" bubbles=false cancelable=false eventPhase=2 text="Error #2032" errorID=2032]. URL: http://demo.mylife.biz/invokeremotingservicebrowser.jsp

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

Join 111 other followers

%d bloggers like this: