понедельник, 14 февраля 2011 г.

SVN on Mac OS X in 10 steps.

1. Download Subversion DMG from
2. Setup Subversion
3. $ sudo mkdir /usr/local/svn
$ sudo svnadmin create /usr/local/svn/[PROJECT_NAME]
$ sudo chown -R www /usr/local/svn
4. Create httpd.conf on the base of content of /etc/apache2/httpd.conf
5. Add to LoadModule section
LoadModule dav_svn_module libexec/apache2/mod_dav_svn.so
At end of the file, add this include
Include /private/etc/apache2/extra/httpd-svn.conf
Copy edited file to /etc/apache2/httpd.conf, overwrite
6. Create /etc/apache2/extra/httpd-svn.conf with following content:
<Location /svn>

DAV svn
SVNParentPath /usr/local/svn

# how to authenticate a user
AuthType Basic
AuthName "Subversion repository"
AuthUserFile /etc/apache2/subversion.auth
# only authenticated users may access the repository
Require valid-user
</Location>

7. $ sudo htpasswd -cm /etc/apache2/subversion.auth [USER_NAME] and create password for the user
8. Stop and start Apache server using apachectl or by un-checking and checking the Web Sharing checkbox in System Preferences > Sharing.
9. To access SVN, the URL is http://localhost/svn/[PROJECT_NAME]. The configuration is using SVN ParentPath configuration which means that you can have multiple repositories in /usr/local/svn (e.g. project1, project2, etc)
10. Setup SVN in Eclipse/STS, type following path: http://localhost/svn/[PROJECT_NAME], enter [USER_NAME] credentials.

четверг, 3 февраля 2011 г.

GWT + Roo + MySQL: Special & Cyrillic characters in UTF8

Defaut app generated by Roo persisting special & Cyrillic characters not correctly, as '???'. To fix that, update generated database.properties file:

database.url=jdbc\:mysql\://localhost\:3306/[YOUR_DB_NAME]?autoReconnect\=true&useUnicode\=true&characterEncoding\=UTF-8

GWT. Collection fields

For example, you have something like:

@Entity
public class Contact {
...
@OneToMany(mappedBy="contact", targetEntity=Tag.class, fetch=FetchType.EAGER)
private List tags;
...
}

On first look, when you fetching contacts, their 'tags' fields should be already prepopulated... as they annotated as eager... But then you'll try to execute something like:

requestFactory.contactRequest().findAllContacts().fire(lastDataReceiver);

all 'tags' will be NULL.

To fetch collection fields together with parent entity you have to use:
requestFactory.contactRequest().findAllContacts().with("tags").fire(lastDataReceiver);

Spring ROO + GWT. Back-end.

Playing with Spring Roo and GWT 2.1.1 plugin... Sometimes like it, sometimes - not. It's a long story, I'll concentrate on some tricky points...

It was not clear for me, how they implementing back-end stuff, as there are no any code in entity classes, as it usually appears in GWT examples. I found what Roo generates all back-end as AspectJ classes paced into same package as an entity. They are Roo-managed and not intended to be modified... If you need some special methods, you may create them in the entity class, Roo will not overwrite your code.

The tricky point - STS hide such files, .aj, by default. To show them, go to drop-down menu in Package Explorer in STS -> Filters... -> uncheck "Hide generated Spring Roo ITDs".

суббота, 18 декабря 2010 г.

Ice, ice baby....

Once a year, usually before New Year Holidays, Khanty-Mansiysk hosting Ice Sculpture Festival. I made some photos, enjoy :)







воскресенье, 12 декабря 2010 г.

Khanty Mansiysk

Do you know what I'm talking about? :) Do you know where it is? :) Don't lie to yourself :)


View Larger Map

It's now about 4.26 am local time... I've been traveling for last 10 hours with a connection at "Vnukovo" airport, Moscow...

Oh my... I could write a book about this trip... will start tomorrow :)

For now I could say just one thing: I've NEVER EVER EVER spent a 130 roubles (~$4) for a trip from an airport to a city center :)

суббота, 30 октября 2010 г.

Setup Tomcat on Mac OS X

How to develop Java EE applications on MacOS X? Eclipse + Tomcat is a good setup. You may download Eclipse from eclipse.org, just extract it to the folder you want. Tomcat setup a bit complicated...

1. Download latest binaries: Tomcat 7.0
2. Extract it to /Library/Tomcat
3. Lunch Terminal
4. cd /Library/Tomcat/bin
5. chmod 777 *.sh
6. Start it via ./startup.sh and kill it by ./shutdown.sh
7. Setup server configuration in Eclipse.

Enjoy! :)