Posts

Showing posts from 2009

org.hibernate.MappingException Unknown entity: AFullyQualifiedClassName

I was struggling with this error after having generated the DAO classes using MyEclipse IDE. My hibernate configuration file was alright, the libs were in place (hibernate3.jar ,hibernate-annotations.jar) and so was the desired mapping path present... mapping resource="com/bmb/model/BlogFeed.hbm.xml" I was importing the proper classes for the annotations import javax.persistence.Entity; import javax.persistence.GeneratedValue; import javax.persistence.Id; But the compiler continued to shout : 15:13:48,959 DEBUG BlogFeedDAO:62 - getting BlogFeed instance with id: 1 Entity retrieval failed.15:13:48,961 ERROR BlogFeedDAO:68 - get failed org.hibernate.MappingException: Unknown entity: BlogFeed.class Finally after hours, I realized the mistake and changed the code from orange to green... public BlogFeed findById( java.lang.Integer id) { log.debug("getting BlogFeed instance with id: " + id); try { //error BlogFeed instance = (BlogFeed) getSession...

Investigating the tech behind an iPhone Accelerometer

Interesting ways of making technology make SENSE !!! The iPhone contains 2 accelerometers which is used to detect orientation change with relation to gravity and 3D space. Many of us am sure must have played around with rotation from potrait to landscape mode or back... Here are the many creative ways in which it is being used. Check it out here.

Its time - " Jack of all, master in MSc Mobile and Wireless Computing"

I have decided to start pursuing masters in MSc Mobile and Wireless Computing at the University of West Minister,London,UK. Check out this link. Its is a 2 to 5 years, part-time course. I plan to finish it off in 2 years.

OMG = SixthSense Technology by Pranav Mistry !!!!

Pranav Mistry - A true genious !!! Pranav Mistry demos several tools that help the physical world interact with the world of data -- including a deep look at his SixthSense device and a new, paradigm-shifting paper "laptop." In an onstage Q&A, Mistry says he'll open-source the software behind SixthSense, to open its possibilities to all PART 1: PART 2: Cant wait- The future is HERE !!!

Google Blog Search API

I am currently investigating how to implement Google Blog search using the Java API, in an attempt to architect & implement an aggregator. Check this link out.

Busy@BMB building an Aggregator

I have dived deep into the world of YouTube API, along with Twitter and Flickr in an attempt to build a prototype feeds "aggregator". Soon i will move onto the Blogger API. I must say - interesting stuff , playing around with feeds from the Java / j2EE , Hibernate platform. It is fun!

Interview with Tom Sugden !!!

OMG - I just had a 30 min conversation with "Tom Sugden" from Adobe Consulting!!!

All time favorite book !

Image
Design Pattern for Dummies by Stenven Holzner Click here to try it!

A new Discovery - Xenocode !

Today, after tireless attempts to install IE 7.0 on my 64-bit Windows Vista Home Premium Operating System that came pre-loaded with IE 8.0 - I have thanks to the technical guidance by the guru's at BazaarVoice discovered XENOCODE. Now XENOCODE is simply ingenious! As aptly stated " brings the world of software to the web". No installation, no hassles by amateurs like me. To date, whenever I play with the O.S it crashes. Hence I am overjoyed at this discovery and happy that my multiple IE browser installation and uninstallation days are over... Please visit ">XENOCODE for more information.

Working with Strategy in AS3/Flex

Image
Strategy tells us to • Define and encapsulate a family of algorithms. • Make encapsulated algorithms interchangeable. • Allow algorithms to change independently from the clients that use it. HRAgency For illustration purposes,in this sample application, a Strategy pattern is used to implement a solution for an HR employment agency. • The agency has a number of consultants it represents. Clients call for different consultant job types targeted at either- employer or jobseeker. They want either a particular consultant or particular support tasks or main tasks they can perform. • To create a flexible program for the HR agency, each of the specific support related and main tasks has been created in separate algorithms. The algorithms are encapsulated, and the consultants delegate their performance skills to the encapsulated algorithms—strategies. The base Consultant context class The first step is to create a context class and concrete contexts that will use the different tasks and support...

Creating Combobox within a DataGrid column in Flex

The compononet that needs to be attached might be a Combobox or a Checkbox. One of the techniques is to create a custom ComboBox and use the itemRenderer property of the DataGridColumn to display it inside the data grid as a Combobox which then, internally fetches its values from an XML. <mx:DataGrid id="portfolioGrid" width="100%" height="100%" dataProvider="{portfolioModel.security}" selectable="true"> <mx:columns><mx:Array> <mx:DataGridColumn dataField="Symbol"/> <mx:DataGridColumn dataField="Quantity" textAlign="right"/> <mx:DataGridColumn dataField="Price" textAlign="right"/> <mx:DataGridColumn dataField="Value" textAlign="right"/> <mx:DataGridColumn dataField="portfolioType" width="175" textAlign="center" headerText="Type" sortable="false" editable="true...

"Protocols that RULE the FLEX world"

In the context of RIA, protocols that we need to get familiarized with are 1. REST - HTTP Object <mx:httpservice> 2. SOAP - WebServices Object WSDL <mx:webservices> 3. AMF - Remote Objects <mx:remoteobject> 4. XML Sockets (myXML = new XMLSocket;) RIA's essentially reside on the client and communicate with the servers only to request and process data unlike normal web apps which are page-centric. First is the widely used, REST(Responseful State Transfer) includes - HTTP(Hyper Text Transfer Protocol): HTTP Service Component typically consumes XML responses. They let you send HTTP GET, POST, HEAD, OPTIONS, PUT, TRACE, and DELETE requests and include data from HTTP responses in a Flex application. Flex does not support mulitpart form POSTs . The HTTPService's send() method makes the call to the JSP page. The resultFormat property of the HTTPService component is set to object , so the data is sent back to the Flex application as a graph of ActionScript object...

RSheYeah's System Reset & Restart

I have re-set and re-start 'ed, in London...and that explains the lapse in blogging, developing and pretty much everything...

Google Plugin for Eclipse 3.4 (Ganymede)

Instructions to jump start your Journey into the Google Development World. Read it here . -Thanks Google

Spice up your GWT components with GWT EXT - (read gwit extension)

GWText comes with some great components that spices up your otherwise plain GWT components. Place the 'gwtext.jar' file and include in your project classpath ie. compiler and shell script @java -Xmx256M -cp "%~dp0\src;%~dp0\bin;C:/gwt-windows-1.5.2/gwt-user.jar;C:/gwt-windows-1.5.2/gwt-dev-windows.jar;C:/gwt-windows-1.5.2/gwtext.jar" com.google.gwt.dev.GWTCompiler -out "%~dp0\www" %* com.rsheyeah.gwt.UITest Make sure you have these lines in UITest.gwt.xml file <inherits name='com.gwtext.GwtExt' /> <script src="js/ext/adapter/ext/ext-base.js" /> <script src="js/ext/ext-all.js" /> <stylesheet src="js/ext/resources/css/ext-all.css" /> Lastly, just have the appropriate resource files in their respective js folder Otherwise, the compiler screams "No source code is available for type com.gwtext.client.widgets.form.*****; did you forget to inherit a required module?"

Creating JUnit test cases for your GWT project

The importance of JUnit testing and benchmarking cannot be undermined for java projects, let alone GWT projects. Out-of-box JUnit test support is shipped with GWT for client and server side synchronous and asynchronous testing.Each GWT JUnit test extends GWTTestCase and implements getModuleName() method which defines the interest of GWT module. Hence, if you like to create a project "MyUITest" in eclipse: Go to your GWT_HOME (the place where your gwt related jars reside) directory and in the command prompt, promptly type in projectCreator -eclipse MyUITest and applicationCreator -eclipse MyUITest -out MyUITest com.rsheyeah.gwt.client.UITest and the result is as follows: Created directory MyUITest\src Created directory MyUITest\src\com\rsheyeah\gwt Created directory MyUITest\src\com\rsheyeah\gwt\client Created directory MyUITest\src\com\rsheyeah\gwt\public Created file MyUITest\src\com\rsheyeah\gwt\UITest.gwt.xml Created file MyUITest\src\com\rsheyeah\gwt\public\UITest.html C...

Feel like smoothening your GWT Development...

GWT Designer helps kick start your GWT development. GWT Designer™ is a GUI creator that supports GWT. Use GWT Designer's visual tools and wizards, and Java code will be generated for you. You don't need to write any lines of Java code, but you can fully edit the resulting Java if you wish. Below are the list of features cited - " GWT Designer™ from Instantiations is powerful, easy-to-use, and bi-directional. With its WYSIWYG tools, you can easily: - add controls using drag-and-drop. - add event handlers to your controls. - change various properties of controls using a property editor. - change and refactor its generated code and see it immediately in the visual designer. - reverse engineer code created by hand. " So, don't wait to try it out here . It comes with a 15 day trial period, which I believe is enough time frame to get you hooked. Yow will soon find out its worth the effort. Just download the 90 MB installer and point it to your favorite eclipse insta...

Wannabe iPhone App Developer...

Have fun exploring the following sites - The KamiCrazy development blog The official iPhone development site Idevgames  - a developers site Iphonedevsdk  - a community development forum Mobile Orchard  - information and useful blog posts  148apps  - an app review site

What is with GWT, AWT and SWING ?

So you have experienced Panels, Widgets and Event Listeners in AWT and Swing. And found the concept is pretty much similar in GWT as well. The differrence comes with the intent - Think of GWT and think of Javascript and HTML as Assembly language and GWT as a sort of High level language which generates Javascript and HTML. Moreover, AWT/Swing are used for desktop Java apps or applets and both require JVM to run as opposed to GWT that is targeted for building web apps that run on browsers and are look-alike of desktop apps

Ever wondered how to script "Closures" in JS ?

Anonymous / Inner Classes in Java are quite famous, with event handlers. Closures in JS are similar, not quite the same. Closures are expressions, usually functions, which can work with variables set within a certain context. Or, to try and make it easier, inner functions referring to local variables of its outer function create closures. Read it here as explained quite nicely by Morris Johns.

Classy JS => Prototypes

An excellent read about how to make an otherwise class-less java script emulate classes. Read it here . -Thanks Morris

Android - Cheezy name

Wow !!! this is truly a cheezy technological innovation by folks at Google and little known "Open Alliance" group. Read more about it here or Watch it here.

Ajax Men with TOOLS

GWT is headed by Bruce Johnson. JQuery by John Resig. Prototype by Sam Stephenson. Script.aculo.us by Thomas Fuchs Ajax by James Garret of Adaptive Path. Dojo by Alex Russel

GWT 101

What is GWT? A set of tools to write AJAX applications in JAVA. GWT is an open source, cross-browser framework that allows developers to write AJAX applications in Java and get the bytecode compiled into JavaScript. What makes GWT interesting is Java to JavaScript compiler? GWT is more than just a Java-JavaScript Compiler. Based on the code that you write in Java, it performs dead code elimination, code optimization etc straightening polymorphic calls, method call in lining and string interning. basically the features of what a "compiler" does. Well why Java ? Because Java is a strongly typed language unlike python and that is when you get benefit of the compiler optimizations. But then again Java is the chosen one, because of the availability of IDE's, debugging tools etc and not that its the only best language in the world. Google didn't choose Java because of a particular attachment to the language, but because of the abundance of tools out there available for Java...

Exceptions - To check or uncheck

Image
To decide whether to throw a checked exception or an unchecked runtime exception , you must look at the abnormal condition you are signalling. If you are throwing an exception to indicate an improper use of your class, you are signalling a software bug. The class of exception you throw probably should descend from RuntimeException, which will make it UNCHECKED . Otherwise, if you are throwing an exception to indicate not a software bug but an abnormal condition that client programmers should deal with every time they use your method, your exception should be CHECKED .

The Moody Thread States

Image
Understanding the moods of threads is critical to programming with threads. 1. New state – After the creations of Thread instance the thread is in this state but before the start() method invocation. At this point, the thread is considered not alive. 2. Runnable (Ready-to-run) state – A thread start its life from Runnable state. A thread first enters runnable state after the invoking of start() method but a thread can return to this state after either running, waiting, sleeping or coming back from blocked state also. On this state a thread is waiting for a turn on the processor. 3. Running state – A thread is in running state that means the thread is currently executing. There are several ways to enter in Runnable state but there is only one way to enter in Running state: the scheduler select a thread from runnable pool. 4. Dead state – A thread can be considered dead when its run() method completes. If any thread comes on this state that means it cannot ever run agai...

The Cache in Hibernate!

Image
Hibernate has two kinds of cache, which are the first-level cache and the second-level cache. The first-level cache aka "session cache", and the second-level cache aka "process-level cache". The first-level cache is mandatory and can’t be turned off; However, the second-level cache in Hibernate is optional. Because the process-level cache caches objects across sessions and has process or cluster scope, in some situation, turning on the process-level cache can improve the performance of the application. In fact, before accessing the database to load an object, Hibernate will first look in the Session cache and then in the process-level cache. The process-level cache is best used to store objects that change relatively infrequently, and it is set up in two steps. First, you have to decide which concurrency strategy to use. After that, you configure cache expiration and physical cache attribtes using the cache provider. Hibernate supports a variety of caching strategie...

iBATIS, Hibernate, and JPA - Which one ?

iBATIS, Hibernate, and JPA are three different mechanisms for persisting data in a relational database, each one with its own advantages and limitations. Before we delve into which one - lets think back on our criteria of choosing. Is it that you require complete control over SQL for your application, do you need to auto-generate SQL, or just want an easy-to-program complete ORM solution. iBATIS does not provide a complete ORM solution, and does not provide any direct mapping of objects and relational models. However, iBATIS provides you with complete control over queries. Hibernate provides a complete ORM solution, but offers you no control over the queries. Hibernate is very popular and a large and active community provides support for new users. JPA also provides a complete ORM solution, and provides support for object-oriented programming features like inheritance and polymorphism, but its performance depends on the persistence provider. A much more detailed analysis is always most...

Best Lyrics and Best Original Score

Truly, Not only A.R Rahman's moment to cherish - In a time when copy, paste has become the default tool, almost second habit, we have to remind ourselves that it is innovation which drives passion - to excel and always originality is lauded.

Remarkable Stories on Technologies I have experienced...

From the beginning of days I started delving into application development, I always felt there is always an alternative. An alternative to paths that ultimately leads to an end ie. "The End Product". What it means to be adopting Java or .NET, what it means to be adopting DOJO or YUI. I have a lot of experiences to share along the lines of "Why a certain technology has been adopted looking at the specifics for the project at hand"... So stay tuned...