Sunday, November 21, 2010

Create Web Service Client on Eclipse with Tomcat, problem anyone ?

Hi, just a quick note, perhaps there's some bug, with eclipse and tomcat configuration all together, all I know, I've been banging my head all day, just because eclipse freeze everytime I try to generate a web service client.

After waiting several minutes I only got a not responding window, by then I had no other options than to kill the tomcat process from my task manager.
When tomcat was killed, the eclipse webservice client wizzard will then continue to the next step, without finding any services, well ofcourse.

So here's the trick, make sure the server option(double click the tomcat server to launch configuration editor) "Serve modules without publishing" is checked. Then the wizzard will find the services in a blink of an eye.

btw, I'm using Eclipse Helios Service Release 1, Tomcat 6, and Axis2-1.4


Sent from my BlackBerry® smartphone from Sinyal Bagus XL, Nyambung Teruuusss...!

Monday, August 30, 2010

DVD playing stuttered on windows XP

Just wanna share,

After I bought a dvd, and trying to play it on my laptop (Dell Inspiron 1420, core2duo T7250, vga onboard x3100) I get this problem where playing it cause the player to stutter mainly with the audio, already tried with windows media player, media player classic, and even VLC, yet still producing the same symptoms. And took me almost 2 hours to experiments with all the available configuration for each player with no luck, so I gave up being a smart *ss, and start googling(should have done this the first place, but I'm so lazy to plug in my modem), and finally found the answers(less than 3 minutes, zzz...).

I don't really get the answers but (I think) basically it has something to do with the IDE drivers in windows. The driver stop using the latest operation mode available called DMA(Direct Memory Access) for my DVD drive, and failing back to somewhat old operation mode called PIO(couldn't remember what it was), there are some reason why windows acting this way, none the less the solution actually lurking around in my device manager, and that's why messing with the player's configuration won't solve the problem, stupid me.

The site which I get the solution for is (can't put linked text from my blackberry) :
http://winhlp.com/node/10.?page=3

There's an easy solution there, where you can download the script and run it, or the not-so-easy solution where it trying to explain the causes and pretty much step-by-step solution. Well, I snag the first solution :p, download, run the script, reboot!

Watch hachiko for the next 2 hour without a single hick-up (with some tissue of course :p ).

Hope it helps somebody!

Regards,
- Zeft.

Friday, August 27, 2010

Oracle Query: Composite WHERE clause.

It's been a long night here at the office, me and my partner tryin to fix some trouble and do some testing, there are condition where I need to query records from transaction table, based on combination of fields from other table.

There are several ways to achive this kind of results:

1. Using a subquery
select * from table_trx a where a.subscriber_no in (select subscriber_no from table_reference b where b.offers = a.offers);

2. Using join
select * from table_trx a join table_reference b on a. subscriber_no = b.subscriber_no and a.offer = b.offer;

3. Using composite where clause
Select * from table_trx a where (a.subscriber_no, a.offer) in (select b.subscriber_no, b.offer from table_reference);

And #3 I just figured out last night (yes, shame on me), I'm using the third query just to verify that the results I'm getting from first or second query is correct, because I'm not quite sure whether the second query would have been accurate. While the first and second query will returns the same results, the second one might a little bit different, because if we using different kind of join, this will mostly returns different set of results.


Keywords: composite where clause query

Regards,
- Zeft.

Wednesday, August 25, 2010

Blogging from BlackBerry... Fyuhh..

Ok this is not meant to be a testing, but my first real post to my blog, been searching a lot on ways to post a blog from blackberry (other than using email or mms) but it seems there's no easy way to do so. The only thing that came close is cellspin (from blackberry app world) and they didn't give a trial for that, I've no intention to buy something I can't try yet.

So ok, no spesific application for posting to blogspot from blackberry, email it is then, but we can't write a html email from this handheld??? O cmon!!! I started to think to write my own simple blogspot client, yet I have no idea where to start ...

*doh..
Sent from my BlackBerry® smartphone from Sinyal Bagus XL, Nyambung Teruuusss...!

Still testing..

Try to test with <b>html formatted text</b>
Sent from my BlackBerry® smartphone from Sinyal Bagus XL, Nyambung Teruuusss...!

IMG00011-20100825-1234.jpg

Test publishing from blackberry with a picture maybe ?
Sent from my BlackBerry® smartphone from Sinyal Bagus XL, Nyambung Teruuusss...!
Test from my handheld

Sent from my BlackBerry® smartphone from Sinyal Bagus XL, Nyambung Teruuusss...!

Sunday, June 27, 2010

Exhausted ResultSet

Hi, if you ever encounter this kind of error

java.sql.SQLException: Exhausted Resultset
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:134)
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:179)
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:269)
at oracle.jdbc.driver.OracleStatement.prepare_for_new_get(OracleStatement.java:3195)
at oracle.jdbc.driver.OracleStatement.getIntValue(OracleStatement.java:4264)
at oracle.jdbc.driver.OracleResultSetImpl.getInt(OracleResultSetImpl.java:510)
at oracle.jdbc.driver.OracleResultSet.getInt(OracleResultSet.java:1528)



you might guessed that this error happen when you trying to access a resultset which already being closed or never been advanced to the first record, but you very certain that the statement is never been closed or always advanced to the first record and still these kind of error spitting out in your log or console, you might wanna check if the same statement object had been re-executed. In my case another thread executing the same statement object, thus the previous resultset is reset.
  1. thread A is executing the statement and get the resultset X
  2. thread A advance the resultset X by calling X.next()
  3. thread B is executing the statement and get the resultset Y
  4. thread A try to call X.getString("some_field") => spit the error
  5. thread B advance the resultset Y by calling Y.next()
  6. thread B try to call Y.getString("some_field") => working fine

took me whole night figure this one out, should have read the spec earlier, stupid me...

Friday, November 27, 2009

Install Subversion on SunOS 5.10 (Solaris 10)

Hi there,

So this is the story, although I already have a running svn server using VisualSvn on my office station (a wind*z machine), still I couldn't help worried bout something bad might happen to my precious. So I asked my boss whether or not I could use any *nix compliant machine in our network to serve as a Versioning server and get rid of the paranoia. And he gave me one, great !

One little problem, how would I do that ? Did a lot on Linux, few on windows, but on Solaris this would be the first time, hurraaay!!

I'm not sure whether direct linking from my post to sunfreeware packages is allowed or not, so download all the required package from here (all package from step 1 - 14). Most of the text below were retrieved from sunfreeware, wrap it, and added some comment. The idea is when you already download all the software required below, you only need to look at this post till you finish installing svn(hopefully).

to install a .gz package file do the following (assume the .gz file is in /tmp and you are root)

~# cd /tmp
~# gunzip <downloaded_package>.gz
~# pkgadd -d <downloaded_package>

Now I've been spending all night figuring how to install a working subversion (server) to a solaris system, and this is what I've got.

machine :

SunOS 5.10 Generic_125100-09 sun4u sparc SUNW,Sun-Fire-V890.


steps :

You need a root privilege to install packages below, make sure you follow below steps in order, I've arrange these steps based on subversion dependency tree. You might wanna backup the whole /usr/local directory just in case. Now let's begin the journey...
  1. install libgcc-3.4.6-sol10-sparc-local.gz

  2. This package includes the files and links
    libgcc_s.so
    libgcc_s.so.1
    libstdc++.so
    libstdc++.so.6
    libstdc++.so.6.0.3

    in my case my target system already have this library installed, so I skipped the first step.

  3. install openssl-0.9.8l-sol10-sparc-local.gz

  4. openssl is an open source toolkit implementing the Secure Sockets Layer (SSL v2/v3) and Transport Layer Security (TLS v1) protocols as well as a full-strength general purpose cryptography library - installs in /usr/local/ssl.

  5. install expat-2.0.1-sol10-sparc-local.gz

  6. Expat is a fast, non-validating, stream-oriented XML parsing library - installs in /usr/local.

  7. install zlib-1.2.3-sol10-sparc-local.gz

  8. zlib compression libraries - installs in /usr/local. This package has both libz.a and libz.so libraries.

  9. install libiconv-1.11-sol10-sparc-local.gz

  10. GNU libiconv provides an iconv() implementation for use on systems which do not have one - installs in /usr/local.

  11. install db-4.2.52.NC-sol10-sparc-local.gz

  12. db is the Berkeley open source embedded database system - installs in /usr/local/BerkeleyDB.4.2.

  13. install sasl-2.1.21-sol10-sparc-local.gz

  14. This is the Cyrus SASL (Simple Authentication and Security Layer) API implementation. It can be used on the client or server side to provide authentication and authorization services - installs in /usr/local.
    The installation of the sasl software indicates:
    ********************************************************
    * WARNING:
    * Plugins are being installed into /usr/local/lib/sasl2,
    * but the library will look for them in /usr/lib/sasl2.
    * You need to make sure that the plugins will eventually
    * be in /usr/lib/sasl2 -- the easiest way is to make a
    * symbolic link from /usr/lib/sasl2 to /usr/local/lib/sasl2,
    * but this may not be appropriate for your site, so this
    * installation procedure won't do it for you.
    *
    * If you don't want to do this for some reason, you can
    * set the location where the library will look for plugins
    * by setting the environment variable SASL_PATH to the path
    * the library should use.
    ********************************************************

    I did the easiest way, create a symbolic link in /usr/lib to /usr/local/lib/sasl2

  15. install neon-0.25.5-sol10-sparc-local.gz

  16. Neon is an HTTP and WebDAV client library - installs in /usr/local. Neon is used by subversion.

  17. install apache_noldap-2.2.11-sol10-sparc-local.gz

  18. Apache 2 - the popular web server - installs in /usr/local/apache2. Documentation can be found in /usr/local/apache2/doc/apache2. The configuration files in /usr/local/apache2/conf must be edited to fit your site's needs, including ssl support.

    I dont want to setup my svn server with apache, yet the subversion package from sunfreeware required this package to be installed, you might change this requirement if you compile the subversion source (also from sunfreeware) without apache support.

  19. install swig-1.3.36-sol10-sparc-local.gz

  20. SWIG is a software development tool that connects programs written in C and C++ with a variety of high-level programming languages. SWIG is used with different types of languages including common scripting languages such as Perl, PHP, Python, Tcl, Ruby and PHP - installs in /usr/local.

  21. install libxml2-2.6.31-sol10-sparc-local.gz

  22. Libxml2 is the XML C library developed for the Gnome project - installs in /usr/local.

  23. install libintl-3.4.0-sol10-sparc-local.gz

  24. Libintl is used with gettext and is needed by a few programs when libintl in not in /usr/lib - installs in /usr/local/lib.

  25. install openldap-2.4.16-sol10-sparc-local.gz

  26. OpenLDAP is an open source implementation of the Lightweight Directory Access Protocol - installs in /usr/local.

    warning! this package giving me a hard time when I realized that one of my shared library wasnt update enough (libresolv.so.2), the workaround is at the end of this post.

  27. finally! subversion-1.6.5-sol10-sparc-local.gz

  28. Subversion is an alternative to the CVS version control system - installs in /usr/local.

ok when you're done, go to /usr/local/bin/ directory and type

~# ldd svn

you'll get something like
~# ldd svn
libsvn_client-1.so.0 => /usr/local/lib/libsvn_client-1.so.0
libsvn_wc-1.so.0 => /usr/local/lib/libsvn_wc-1.so.0
libsvn_ra-1.so.0 => /usr/local/lib/libsvn_ra-1.so.0
libsvn_diff-1.so.0 => /usr/local/lib/libsvn_diff-1.so.0
libsvn_ra_local-1.so.0 => /usr/local/lib/libsvn_ra_local-1.so.0
libsvn_repos-1.so.0 => /usr/local/lib/libsvn_repos-1.so.0
libsvn_fs-1.so.0 => /usr/local/lib/libsvn_fs-1.so.0
libsvn_fs_fs-1.so.0 => /usr/local/lib/libsvn_fs_fs-1.so.0
libsvn_fs_util-1.so.0 => /usr/local/lib/libsvn_fs_util-1.so.0
libsvn_ra_svn-1.so.0 => /usr/local/lib/libsvn_ra_svn-1.so.0
libsvn_ra_neon-1.so.0 => /usr/local/lib/libsvn_ra_neon-1.so.0
libsvn_ra_serf-1.so.0 => /usr/local/lib/libsvn_ra_serf-1.so.0
libserf-0.so.0 => /usr/local/lib/libserf-0.so.0
libm.so.2 => /usr/lib/libm.so.2
...
if theres a line that tells some file not found, that means there some package you've missed, check all the package in this post and makesure you've install them in order.
when everything is done, try to type

~# svn help

if it print the help page, then you're successfully install subversion on your Solaris 10, congratulations !!. But if you're like me and it didn't print the help page, instead showing this kind of error

ld.so.1: svn: fatal: libresolv.so.2: version `SUNW_2.2.2' not found (required by file /usr/local/lib/libldap-2.4.so.2)
ld.so.1: svn: fatal: libresolv.so.2: open failed: No such file or directory
Killed

that means the libldap-2.4.so.2 (from openldap package) require newer version of libresolv.so.2 which I couldn't get anywhere.

From sunfreeware :
you will need to update to a newer version of Solaris 10 or upgrade the SUNWcsl and SUNWcslr packages
Update system ? that's not an option for me, and I could'nt find any of the new packages. Googling whole night gives me some other options.
  1. recompile openldap from sources and create a mapfile to point to the existing libresolv.so.2 (or something like that)
  2. set the LD_NOVERSION environment variable to non null value, so that the linker will ignore any version check.

  3. ~# export LD_NOVERSION=1
I dont really get the first option, so I hit the second one, and it actually work flawless !. The problem is if we set the LD_NOVERSION environment variable, then the linker will ignore version checking of the existing shared library for all application which can break the whole system, so be careful! Everytime you have finished doing your svn thing, make sure to unset that variable again.

~# unset LD_NOVERSION

Ok, now lets setup the server, I'm not using Apache for that, instead I'm using svnserve (from subversion package), the advantage is, it's so easy to setup, the disadvantage is, you need an svn client to browse the repository, while for apache you could use plain web browser to browse a repository.
Create a new repository in /root directory with svnadmin

~# svnadmin create /root/repository

I've made a script called start_svnserver.sh to start the svn server as a daemon which consist following lines

#!/bin/bash
# ignore version check
export LD_NOVERSION=1
# start the server
svnserve -d -r /root/repository --pid-file svnserve.pid --log-file svnserve.log
# dont forget to unset this, we only need it to start svnserve
unset LD_NOVERSION

and stop_svnserver.sh to stop the svn_server, consist the following lines.

#!/bin/bash
cat svnserve.pid | xargs kill -15


make sure that stop_svnserver.sh is in the same directory of start_svnserver.sh, and command svnserve is accessible. After the server started, We can connect to the new server with any svn client for example using command-line svn, or an IDE (I'm using Eclipse+subclipse plugins).

the main repository url would be like

svn://<hostname_or_ip>


Good luck !

Keywords : subversion, Solaris10, libresolv.so.2, SUNW_2.2.2, mapfile openldap

Tuesday, November 17, 2009

VisualSVN basic Authentication.

8 months without anything, soooo lazy.., let's start with something small shall we :p.

Today I'm trying to setup a svn server using VisualSVN on my office work station (yes , its windows..), browsing works fine after (simple) installation. the problem is when I'm trying to commit changes from eclipse (using subversive plugin), it always throw me an error (click for larger image)


I have default authentication setup within my repository before I'm using visualsvn, but it seems VisualSVN don't actually use those setup. So I remove my auth setup in my repository, and use the one that come with VisualSVN. just right click on your repositories node, and choose All Tasks -> Manage Security. add a new user if you dont have one, and set the permissions. In my case I want my user can commit, so I choose Read/Write permissions.


After this I'm trying to commit, still failed, with new error message


Apparently, I need to repeat those steps for each repository node I'm trying to access (child of Repositories node), and dont forget to restart VisualSVN.

good day.


keywords: Commit failed, MKACTIVITY, 403 Forbidden, VisualSVN