Posts Tagged ‘java’

JBoss migration 4.2.2-GA to 5.1.0-GA

In my stupidity innocence I just hoped that deploying the application on the new JBoss (from 4.2.2-GA to 5.1.0-GA) should be just a simple matter of changing paths in ant. Here are some problems I encountered and was able to fix. (more…)

JBoss and LDAP

Target: create a test environment for JBoss JAAS authentication using LDAP.

Platform: Linux Ubuntu 9.10, JBoss 4.2.2.GA, java 1.6.0_15

Install and configure openldap

Installing ldap proved to be the most complicated part as apparently Karmic stripped all ldap configuration from the install so all tutorials found on ubuntu site are useless. Finally I’ve found a thread which described the process. Here are the steps I followed: (more…)

Eclipse crashes in Ubuntu Karmic

Trying to run Apache Directory Studio I’ve found that eclupse crashes in ubuntu karmic 9.10 with the following error:

#
# An unexpected error has been detected by HotSpot Virtual Machine:
#
#  SIGSEGV (0xb) at pc=0x00d64856, pid=8870, tid=3077867296
#
# Java VM: Java HotSpot(TM) Client VM (1.5.0_11-b03 mixed mode)
# Problematic frame:
# C  [libpango-1.0.so.0+0x23856]  pango_layout_new+0x36
#

I’ve tried running it with different java version and with the GDK_NATIVE_WINDOWS=1 with no luck and found the problem unanswered on lot of sites. Finally the solution required to disable the Assistive Technologies (System -> Preferences -> Assistive Technologies). After that everything works ok.

Hibernate localized data

Here are some reflections and solutions on how to localize strings in hibernate objects.

The model

I am assuming the localized strings will be stored in the database in a structure similar to:

Table MY_OBJECT:

  • LOCALIZED_FIELD

Table LOCALIZED_DATA:

  • CATEGORY (object type)
  • LOCALE
  • LOCALIZED_FK (stores the id of the localized object but without foreign key restrictions)
  • FIELD (field of the object)
  • DATA (the actual localization)

(more…)

Tapestry, hibernate application (no.5)

A few years ago I was writting some simple tutorials about using hibernate with tapestry to build a simple application. I’ve used Tapestry 3, 4 and I found it reliable to build applications which are still in production. I could consider myself a Tapestry fan and as such I am disappointed a bit to write this article since I was expecting to find no need for it. My goal was to build a simple example of Tapestry – Hibernate application using Tapestry 5. (more…)

A bit of hibernate optimization

The context

Assume you are dealing with a hibernate operation which requires to copy a lot of objects in the database. For instance you are having 2 objects as described in the diagram bellow: budget and entries and you want to duplicate the budget and all it’s entries for some operation. There are several way to do this.

Budget - entries

Budget - entries

First approach

In hibernate usual approach this is done most of the time as something similar to: (more…)

The conflicting ssleay32 and libeay32

Since everybody seemed to be stuck with using the library on windows and yet on linux it worked from the start I’ve decided to dive into the wonderful world of windoze. (more…)

Remote java debug

This is something which should be know be every java developer: how to enable remote debugging of your java application. The solution is remarcable simple:

export JAVA_OPTS="-Xdebug -Xrunjdwp:transport=dt_socket,address=8000,server=y,suspend=n"

and the start your application normally. You can use your IDE of choice for the debugging. Here is a screenshot of the eclipse configuration:

Remote java debug

Remote java debug

Locale files

When using flex and java in parallel the localization mechanism might be clear. One aspect which is not clear is the encoding of the properties files:

  • Flex locale files encoding: UTF-8
  • Java locale files encoding: ISO-8859-1

Convertor script:

..$ cat fixUTF.sh #!/bin/bash

TMP=iconv.tmp

if [ "!$2" == "!rev" ]; then	iconv -t ISO_8859-1 -f UTF-8 -o $TMP $1else	iconv -f ISO_8859-1 -t UTF-8 -o $TMP $1fimv $TMP $1

Graph web representation (conclusions)

Updated 18-oct-2008: There is a great solution in Flex which I have used for this and this projects.

Conclusion

The problem of representing a graph on the web is not a solved one. On the desktop application side there are lots of tools which can handle large graphs with nice visualization but on a web page the choices are limited. For the given problem of representing a set of nodes connected through lines in order to illustrate the elements of an application I have tried the following:

  • html representation using ul and li’s. This approach is very simple to realize but can be used for very simple representations only. It will probably look ok in most browsers if the CSS is done ok.
  • plain image representation. This approach can offer the best visual results and will also look ok on all browsers which support images but it’s completely static.
  • java applet representation. This approach was the most flexible but required a specialized applet. It also is plugin dependent and the applet technology is rather questioned at the moment in terms of viability. The technology is the same as 3-4 years ago on this subject.
  • dojo.gfx representation. This surely the newest and trendy choice but it’s not yet mature enough and also requires specialized coding. It will surely advance a lot in the future as the demand will grow more and more as applications leave the desktop to the browser.

What I left out:

  • flash. I know nothing of flash. All I know is that is proprietary and you need a windows environment to code it so this is why I avoided it. Feel free to tell me if there is a flash solution which could have solved my problem instantly.
Related Posts with Thumbnails