CarbonRider

BlazeDS – SSL – IBM Websphere

Saturday, August 28th, 2010 - Flex

No it’s not one more hate post against IBM websphere, but this time the target is BlazeDS. Few days back, we were facing problem while deploying Flex application on SSL. The environment used for the deployment was IBM websphere 6.1 with IBM JDK and windows 2008. As per BlazeDS documentation, there are very minimal configuration changes required to be done in services-config.xml and other XXX-config.xml files to use secure-amf channel.

continue reading

Flex DataGrid – Data updates not reflected

Tuesday, August 24th, 2010 - Flex

Flex datagrid is nice option to display data in tabular format and with built-in features like sort, rearrange column position and customize each columns with renderers/editors, it makes developers life easy to built user friendly application in quick time.  But most of the time, those who have coded in Flex, must have noticed that the datagrid just doesnt work properly when row information is updated. Consider following scenario.

1. Datagrid uses ItemEditor to update Collection bound as dataprovider.
2. A change in value of one of the column, involves updates to values displayed in other columns.

In 2nd step, user may change value in one of the column, which will internally result in change in value displayed in other columns. One can easily achieve that using itemEditEnd event but most of the time the updates are not reflected. Consider following code


		
			
			
			
			
			
			
		
	

	
		
			
			
			
			
				
				
				
				
			
		
	

continue reading

Back to Basics – Fresh new start

Saturday, August 14th, 2010 - Articles

I remember almost 5-6 years back when I started learning many programming languages, .Net (1.1) was one of my favourite framework and C# was the language of choice. The event based programming model, readymade suite of components with ASP.Net was definitely an interesting way to develop web applications. The ease of development and powerful Visual Studio IDE had really impressed me. In fact, I was quite comfortable with Visual Studio much before .Net came into market, the reason was – Visual Basic. No one could have ever imagined that the language like Basic can become so powerful and provide so many functionalities.

continue reading

I am not addicted to Coffee

Sunday, July 11th, 2010 - Articles

Almost 7 years back when, I joined first organisation, inspite the fact of knowing languages like Visual Basic 6.0, ASP, Java 1.2, PHP 4, C, Shell Script, Oracle PL/SQL, MySQL [and little bit .Net] etc., I started working on HTML and JavaScript. The goal was to understand how online shopping sitess actually work [and the most important getting breakthrough in IT industry :) ]. The things were quite simple as apart from Web page designing there was no much responsibility and there was less headache in terms of banging head on fixing bugs. After few days, there was one of the Perl programmer working on some implementation got stuck in one of the implementation and was not able to resolve it. Being curious to know, what was the problem, I just thought of having a look at the Perl code. Well having a little bit idea of shell scripting and knowledge of PHP proved bit of help here. The Perl code look somewhat familiar to me and the problem (generation of some JavaScript logic using Perl Script) was resolved within few minutes.

continue reading

Codemodel – Java Code generation library

Thursday, July 8th, 2010 - Articles

I was looking out for a utility/library which can be used to generate Java Source code. Initially I thought of using source code templates and generate Java Files from it. But fortunately I came across an interesting library CodeModel.

This library is used by most of the popular code generators including JAXB. The library provides set of API classes which can be used to generate Java Source code (supports Java 5 generics, annotations etc.). The only downside of this library is that, it is not well documented. Worst part is, there are no tutorials available. So If you want to find out more details about how this library works, you better fold your sleeves and start writing some code which uses API. Good Luck.

continue reading

IBM Websphere – Address Already in use : NET_Bind

Monday, July 5th, 2010 - Articles

I was recently trying to fix one error and after installing patch 31 on IBM websphere 6.1.0.25, I came across a weird problem – My application was trying to connect to database using DBCP common pool and it suddenly stopped working after applying patch. The error message logged in file was “Network adapter could not establish connection”.

continue reading

IBM Websphere – Worst NiGhTmArE (NoClassDefFoundError – com.sun.org.apache.xerces.internal.dom.DocumentImpl)

Sunday, July 4th, 2010 - Articles

Last week, I was trying to deploy CXF 2.X webservice application on Websphere 6.1.0.X. Everything worked well and no error at the time of deployment. But while invoking webservices, we were getting an error

java.lang.NoClassDefFoundError: com.sun.org.apache.xerces.internal.dom.DocumentImpl

After googling, we found that this class is integral to JDK 1.5 and ships along with it. We were bit confused as the application was working fine on development machines with no errors. After googling more, the same problem was reported on most of the forums by Websphere users.

continue reading

Sun Certified Enterprise Architect

Wednesday, June 23rd, 2010 - personal

Finally, completed Sun Certified Enterprise Architect certification.

SCEA

continue reading

Enterprise Application – What it demands?

Sunday, May 30th, 2010 - Articles

Scalability, performance etc are all required to good build softwares. Before starting development, majority of the firms do come up with well designed Software Architecture and address customer needs in efficient way. Selecting right technology, infrastructure and placing frameworks at right place are all required to build robust applications.
While we can see there are new frameworks/languages coming in the market with the capability to address modern day problems, the customers are also concertrating more on how the application can help them to quickly address business problems and tap market opportunities.

continue reading

Extending Flex Builder 3 – Building eclipse plugin

Sunday, May 2nd, 2010 - Eclipse, Flex

As mentioned in earlier post, I have been playing with FLEX builder and understand its extensibility APIs. After spending almost day crawling through various search engines and websites I couldn’t find a single site giving me details about how to work with MXML design editor APIs, I thought of giving up. But fortunately I could able to figure out how things actually work in FLEX Builder, and then I thought of publishing some of the details through the blog.

The next few paragraphs will talk about various APIs and options available in FLEX builder which can be used by anyone to build their own plugin in Flex Builder. While the title of the post says that “Building eclipse plugin”, it surely doesn’t describe basic steps required to build eclipse plugin. To learn basics of building eclipse plugin, you should visit other sites like java2s and yeah offcourse eclipse itself has plethora of information on building plugin.

The aim of this article is to give details about the editor used to design Flex layouts. You must have used plugins which can generate AS code, ident XML code etc in Flex builder but there are very few plugins which actually work on design editor.
Before writing any plugin code you need to make sure that you have the required environment set for plugin development. Though Eclipse comes with built in feature of plugin development, Flex builder doesn’t have built-in support for Java and plugin development project. So to get started with plugin development you need to first install plugin development and Java development feature into Flex builder. Keep it in mind that we need to build plugin inside Flex Builder, the simple reason behind this is to test your plugin code we will require sample workspace of Flex builder and that can be easily started through Flex builder. The installation of Java and Plugin development feature is only required if Flex Builder is installed as Standalone version. If you have installed Flex Builder in Eclipse you can skip this installation.

The next step is to add required Extensions and Jar files in plugin project. Make sure that you have added extensions listed in following image.

Flex builder extensions

Apart from adding above extensions you will need 3 additional Jar files which contain useful APIs. The filenames are derived.jar, mxml.jar and mxmlmodel.jar. You need to search these files in Flex plugins. Now create a default “view” using Plugin wizard available in Eclipse.
The wizard should create all the files required to build plugin.

Lets directly jump into java code and see how you can get the reference of MXML editor itself

MXMLEditor a = (MXMLEditor)getSite().getPage().getActiveEditor();

Above statement will give you the reference of current MXML editor. You need to be bit careful while using this statement as user may not always work with MXML editor (There is action script editor or user may switch from one MXML file to another or may even switch from design view to source code). So you need to logically place this code to get reference of MXML editor.
(Hint: Try to find out details about IPartListener.)

The editor object is pretty much useful to listen to the events raised in editor. An editor instance has a method called getMXMLModel which represents an MXML instance for the editor. You can use the IMXMLModel instance returned by getMXMLModel method to manipulate MXML code. The reference also provides a convenient method to listen to the user selection in design view.
Just place below code after getting IMXMLModel reference

mm.getSelectionProvider().addSelectionChangedListener(new SelectionChangeListener())

Note that the SelectionChangeListener is custom class implementing an interface ISelectionChangedListener. A method “selectionChanged” will be invoked on the above instance whenever user select control in MXML design editor. The method has one argument of “SelectionChangedEvent” which can be used to get the reference of the component selected. I leave the part of getting reference of control using instance of “SelectionChangedEvent” to you.
For demonstration, I have created a sample plugin which displays component selected in “Sample View”, check below images.
Flex Builder - Button selected

Flex Builder - checkbox selected

The story doesnt end here, I would be revealing more details about API – watch this space.

continue reading