Apr 18, 2010

TPT 1.1

My TPT project finally has been released to version 1.1 Main changes are pdf document viewer which allow to stream and view very large pdf files in a manner of google book reader and without downloading any contents to the client computer. Also, it has been aligned with recently released Vaadin 6.3.

Browse and download from google code - http://code.google.com/p/tpt or from Vaadin Directory

Feb 14, 2010

Debugging on usb-connected Android phone on Linux

Since my nvidia-broken mybook exchange process got extended by some unclear reasons - maybe russian customs sends us a nice "hello" or local Deep Apple screwed up, but I did not yet got my working machine back and still sitting on rented terrible asus u6v laptop and Ubuntu.

By the way, I need to work regardless the status of my macbook, so I installed Android sdk on Ubuntu this weekend. While sdk installation and development process went nice, I stuck on running my app on a real, usb connected device - IDEA / NetBeans were hanging on a device selection dialog and "adb devices" commands says "no permissions".

The answer was simple, so Im posting it here, basically for my own records and if this would be useful for anyone else. The problems is in permissions. To fix this, just become root and restart your adb server by invoking the following commands (as root !) from Android sdk:

adb kill-server
adb start-server 

Now try to reinvoke your IDE Android devices list or just call "adb devices" - you should see your phone now ok.

In some cases, you'll need to add permissions to asb devices manager, in such case plase consult the source topic I found information in - it contains some more details on this question: http://androidboss.com/using-android-debug-bridge-adb-in-linux/

Jan 10, 2010

Lack of JEE runtime configurability thoughts

What I still do not like in complete JEE stack is a lack of runtime configurability. Assume you created an EAR application and want to distribute it to your customers. Each customer has its own database. Yes, you do hardcode the JNDI name to your persistence units and may require customer to pre-create such JDBC resource in its appserver before deploying your EAR. But you CAN'T let your customer simply deploy your EAR, go to web app from it and let to choose the database, login and password in your own configuration web UI. And that's what most customers want, as they do not like (even tech guys) to dig with JDBC pools, etc.

At the moment I realized that the only solution is to merge the app server with your enterprise application installer as well. This way you could silently install the app server, run the series of DB (and other resources) configuration screens and finally tweak the app server xml files.

But what if your enterprise application uses JAP and needs to change, say, database at runtime ? The workaround paragraph above will not help in this case. And there could be a lot of similar use-cases collected.

Well, something needs to be enhanced in this area, I think...

Nov 9, 2009

Problems running Android SDK on a Mac

You might encounter a problem when trying to install and run the Android SDK on your Mac like me yesterday. The symptom is like when you're trying to run the "android" command line tool, it says the following text and then does nothing:


dll-book:~ dll$ android Developer/android-sdk-mac/tools/android 
Starting Android SDK and AVD Manager
No command line parameters provided, launching UI.
See 'android --help' for operations from the command line.

The solution is simple - "android" is a shell script which contains a hardcoded path to a Java 1.5 executable. However, due to bug in SWT, it does not run under OS X 64 bit JDK 1.5 and since android's UI is SWT based, it does not run either.

To solve the problem, simply open the "android" executable in any text editor (it is a simple shell script), then find and replace the path to 1.5 JDK to a path to 1.6 one. It is easy to perform a search for the phrase "java_cmd" in your text editor and you'll find it. Once 1.5 changed to 1.6, everything works just fine.

Oct 20, 2009

SVN file rollback

This is quite often operation, however, this is also a most asked question - "I just broke a build by my commit, how can I rollback my changes ?" The answer is simple, but you just need to use command line svn client instead of your favorite IDE-embedded one.  Let's say, you just comitted an updated version of Bullshit.java and it broke the build. How to rollback quickly ?

1. Navigate to bullshit.java package folder:

cd com/myapp/bullshit

2. Check current revision of broken file (let's assume, the current broken revision is 500):

svn info Bullshit.java

3. If required, ensure that previous revision is the correct working file:

svn diff -r 499:500 Bullshit.java

4. Get back the previous revision of the file:

svn merge -r 500:499 Bullshit.java

5. Commit file and fix the build:

svn ci -m "I fixed the build"

And in some cases, you'd want to rollback entire trunk or folder - in this case, it it easier to do the following actions:

1. Delete current folder or trunk:
svn delete svn://svn.host.net/some/project

2. Restore deleted folder by copying appropriate revision from history:

svn copy svn://svn.host.net/some/project@24 protocol://svnserver/some/


where 24 - is a proper revision number you want to make current.

Oct 16, 2009

public static void main ( String args[] );

Finally decided to start putting some technical on-the-go thoughts, testcases and ideas to the web, just in order not the get them lost and in case this will be helpful for anyone else. So, here is the main method invoked :)