Recently in framework Category

NEW NGELEPEN, JAVA, INDONESIA - MAY 31:  A gir...

Image by Getty Images via Daylife

After learning about gwt plugin for eclipse, i decided to give it a try. Unfortunately, running hello world in itself became a learning curve.

Eclipse provides nice interface to install the plugins. It did not complain in installing gwt and app engine SDK's and other binaries. Hello world project was created with no issues. Till here was cake walk. Moment i started compiling, jvm threw up lots of backtraces.

Compiling module com.jatspeak.gwt.first.Firstcut
Locking assertion failure.  Backtrace:
#0 /usr/lib/libxcb-xlib.so.0 [0xb73ad7c7]
#1 /usr/lib/libxcb-xlib.so.0(xcb_xlib_unlock+0x31) [0xb73ad891]
#2 /usr/lib/libX11.so.6(_XReply+0x254) [0x8a653494]
#3 /usr/lib/jvm/java-1.5.0-sun-1.5.0.16/jre/lib/i386/xawt/libmawt.so [0x8b76edce]
#4 /usr/lib/jvm/java-1.5.0-sun-1.5.0.16/jre/lib/i386/xawt/libmawt.so [0x8b758d77]
#5 /usr/lib/jvm/java-1.5.0-sun-1.5.0.16/jre/lib/i386/xawt/libmawt.so [0x8b758ef3]
#6 /usr/lib/jvm/java-1.5.0-sun-1.5.0.16/jre/lib/i386/xawt/libmawt.so(Java_sun_awt_X11GraphicsEnvironment_initDisplay+0x26) [0x8b759136]
#7 [0xb13bf008]
#8 [0xb13b8b6b]
#9 [0xb13b8b6b]
#10 [0xb13b6236]
#11 /usr/lib/jvm/java-1.5.0-sun-1.5.0.16/jre/lib/i386/server/libjvm.so [0xb764beec]
#12 /usr/lib/jvm/java-1.5.0-sun-1.5.0.16/jre/lib/i386/server/libjvm.so [0xb781bae8]
#13 /usr/lib/jvm/java-1.5.0-sun-1.5.0.16/jre/lib/i386/server/libjvm.so [0xb764bd1f]
#14 /usr/lib/jvm/java-1.5.0-sun-1.5.0.16/jre/lib/i386/server/libjvm.so(JVM_DoPrivileged+0x32d) [0xb76a982d]
#15 /usr/lib/jvm/java-1.5.0-sun-1.5.0.16/jre/lib/i386/libjava.so(Java_java_security_AccessController_doPrivileged__Ljava_security_PrivilegedAction_2+0x3d) [0xb735530d]
#16 [0xb13be898]
#17 [0xb13b8a94]
#18 [0xb13b6236]
#19 /usr/lib/jvm/java-1.5.0-sun-1.5.0.16/jre/lib/i386/server/libjvm.so [0xb764beec]
Locking assertion failure.  Backtrace:
#0 /usr/lib/libxcb-xlib.so.0 [0xb73ad7c7]
#1 /usr/lib/libxcb-xlib.so.0(xcb_xlib_lock+0x2e) [0xb73ad96e]
#2 /usr/lib/libX11.so.6 [0x8a652619]
#3 /usr/lib/libX11.so.6(XGetVisualInfo+0x26) [0x8a648666]
#4 /usr/lib/jvm/java-1.5.0-sun-1.5.0.16/jre/lib/i386/xawt/libmawt.so [0x8b7580b9]
#5 /usr/lib/jvm/java-1.5.0-sun-1.5.0.16/jre/lib/i386/xawt/libmawt.so [0x8b758303]
#6 /usr/lib/jvm/java-1.5.0-sun-1.5.0.16/jre/lib/i386/xawt/libmawt.so [0x8b758fa1]
#7 /usr/lib/jvm/java-1.5.0-sun-1.5.0.16/jre/lib/i386/xawt/libmawt.so(Java_sun_awt_X11GraphicsEnvironment_initDisplay+0x26) [0x8b759136]
#8 [0xb13bf008]
#9 [0xb13b8b6b]
#10 [0xb13b8b6b]
#11 [0xb13b6236]
#12 /usr/lib/jvm/java-1.5.0-sun-1.5.0.16/jre/lib/i386/server/libjvm.so [0xb764beec]
#13 /usr/lib/jvm/java-1.5.0-sun-1.5.0.16/jre/lib/i386/server/libjvm.so [0xb781bae8]
#14 /usr/lib/jvm/java-1.5.0-sun-1.5.0.16/jre/lib/i386/server/libjvm.so [0xb764bd1f]
#15 /usr/lib/jvm/java-1.5.0-sun-1.5.0.16/jre/lib/i386/server/libjvm.so(JVM_DoPrivileged+0x32d) [0xb76a982d]
#16 /usr/lib/jvm/java-1.5.0-sun-1.5.0.16/jre/lib/i386/libjava.so(Java_java_security_AccessController_doPrivileged__Ljava_security_PrivilegedAction_2+0x3d) [0xb735530d]
#17 [0xb13be898]
#18 [0xb13b8a94]
#19 [0xb13b6236]
Solution :- You need to run awt in headless mode. Upon googling some folks prescribed that you better "sed" the .so file, but that is not required. Putting a VM argument -Djava.awt.headless=true will serve the purpose as well. Many times the programs like servlets etc may not know how to connect to a DISPLAY in windowing system. Thus headless will enable them to connect without a display

Thus, headless compiles the gwt project.

Movin forward, while running the project, again lots of linkages were found absent. Fortunately, the error mentions that that listdc++5.so cannot be opened.

Solution :-
Ubuntu(8.10) ships with a mroe recent version of this library, so you will need to install the 5th version by sudo apt-get install libstdc++5

Conclusion :- In case your configuration has these two attributes
  1. Java 1.5
  2. Ubuntu Intrepid (8.10)
You may need to perform above two step in order to say Hello!
Reblog this post [with Zemanta]

Playing around with android

| No Comments | No TrackBacks
For testing out space suits and whatnot.

Image via Wikipedia

I have been androiding since last 2 days. I started from scratch, understood the documentation, went through tutorials, read sample code here and there, and did some exercises. Finally, after a whole day, i was able to build something productive on top of it. Blame my creativity, whatever i wished to build for it, was coincidently turning out to be enhancement of already present feature. Contacts, Calls, messaging etc. All this lead to some more efforts towards building the android operatng system from scratch. Following were the steps
  1. Get repo scripts from google
  2. Get checkout of the trunk
  3. Copy buildspec.mk to root. It ususally resides in one of the internal folders.
After this, i decided to compile the simulator. I launched make, and after 15-20 odd minutes, make returned some errors. These errors were due to INT_MAX being used in some of the cpp files. I am on Ubuntu interpid (8.10). This has gcc version 4.3.x. For optimization purposes, headers have been cleaned out. Thus, android folks forgot to put #include into one of the files where they were using INT_MAX. I fired make again.

 After some time, it compained giving double definition of template swap. This came in one of the stl files. I had to comment to move further.

All was built peacefully, and finally the simulator started building. At this point linker errors related to wxheaders-2.6 appeared. Somehow, the program was unable to link to gtk headers properly.I spent good 1 hour trying to fix it by installing different versions. After pondering upon variouos options, i thought it would be best to drop the simulator and instead compile an arm image for the emulator. I did changes in buildspec.mk by specifying correct target, and fired make again.

This time it complained not finding the definition of swap (the same template that i had commented earlier due to double definition). I uncommented it, and put make again.

After around 45 mins of screen scrolls, it had put system, ramdisk, kernel, and userdata images in proper folders.

I ran following command  

ashish@zeus:~ out/host/linux-x86/bin/emulator -system out/target/product/generic/ -kernel prebuilt/android-arm/kernel/kernel-qemu -data out/target/product/generic/userdata.img

This brought up the emulator on screen running the bundled apps. I changed a couple of strings in Contacts application, and build the images again by make. This time it was very fast and after firing up the emulator again, i could see the change s being reflected there.

Next few days would be building some core features and perhaps building some more apis.



android_screen.jpg.



Reblog this post [with Zemanta]

About this Archive

This page is an archive of recent entries in the framework category.

android is the previous category.

installation is the next category.

Find recent content on the main index or look in the archives to find all content.

Pages

Powered by Movable Type 4.23-en