I unfortunately have to work with computers with default language set to German.
Until now I was always able to change the language, but Windows does really support this. Which means I have part of my computer in English and many application remain in German.
It is very annoying for stack trace for instance.
Thus you can set the language of apache tomcat via a system property.
In eclipse you can set
-Duser.language=en
as VM argument to the launch configuration of tomcat.
Wednesday, May 4, 2011
Tuesday, April 19, 2011
VerifyError in Websphere
When deploying my application in Websphere 7.0 I got the following error. It is somehow related to class loading.
I could resolved the comflict by removeing the jta.jar file from the dependencies of my war file.
Thanks to Erik-Berndt Scheper
The basic problem is that you should not provide classes that are already provided by Websphere.
The basically remove all "javax" package classes from you war.
I could resolved the comflict by removeing the jta.jar file from the dependencies of my war file.
Caused by: java.lang.VerifyError: com/ibm/websphere/uow/UOWSynchronizationRegistry.registerInterposedSynchronization(Ljavax/tranhttp://www.blogger.com/img/blank.gifsaction/Synchronization;)V at org.springframework.transaction.jta.WebSphereUowTransactionManager$UOWActionAdapter.run(WebSphereUowTransactionManager.java:356) at com.ibm.ws.uow.UOWManagerImpl.runUnderNewUOW(UOWManagerImpl.java:1067) ... 38 more
Thanks to Erik-Berndt Scheper
The basic problem is that you should not provide classes that are already provided by Websphere.
The basically remove all "javax" package classes from you war.
Thursday, December 16, 2010
Accessing spring beans from liferay templates
I had an interesting task, display the version of the portal.
The question which immediately arises is: how do I get from my velocity template to my spring beans?
1. The first stop is the VelocityVariable class from Liferay.
there your fine "serviceLocator" variable which sound just as the right variable to use.
2. In your tpl file add the following
3. You may think now that you only have to configure a Spring bean named "versionBean". Wrong!
The bean name must be augmented with ".velocity" and the bean you are talking to is not yours, but the "ProxyFactoryBean" in which you inject your bean!
4. The Java bean class is up to you then.
Thanks you Martin for your help with this one.
The question which immediately arises is: how do I get from my velocity template to my spring beans?
1. The first stop is the VelocityVariable class from Liferay.
there your fine "serviceLocator" variable which sound just as the right variable to use.
2. In your tpl file add the following
- $serviceLocator.findService("versionBean").getVersion()
3. You may think now that you only have to configure a Spring bean named "versionBean". Wrong!
The bean name must be augmented with ".velocity" and the bean you are talking to is not yours, but the "ProxyFactoryBean" in which you inject your bean!
4. The Java bean class is up to you then.
Thanks you Martin for your help with this one.
Wednesday, December 1, 2010
Choose default java version in Ubuntu
I got annoyed today, as I needed the sun jdk on my Ubuntu machine.
I had to goodle a while before finding how to change the default from open jdk to sun jdk
The how to is located here.
But I reproduce the text here:
I had to goodle a while before finding how to change the default from open jdk to sun jdk
The how to is located here.
But I reproduce the text here:
Choosing the default Java to use
- Open a Terminal window
- Run sudo update-java-alternatives -l to see the current configuration and possibilities.
- Run sudo update-java-alternatives -s XXXX to set the XXX java version as default. For Sun Java 6 this would be sudo update-java-alternatives -s java-6-sun
- Run java -version to ensure that the correct version is being called.
- Open a Terminal window
- Run sudo update-alternatives --config java
- Follow the onscreen prompt
Monday, November 29, 2010
Caching in Firefox
I was checking if my static content was effectively cached by my browser, but was stuck. Nothing got cached !
Until I found a very informative forum contribution from Aso
Until I found a very informative forum contribution from Aso
Type about:config in FF and search for 'cache'.
Check
browser.cache.disk.enable
browser.cache.memory.enable and
network.http.use-cache
are set to true.
Also try cranking up the size of browser.cache.disk.capacity (50000).
Lastly, make sure browser.cache.check_doc_frequency is integer 3.
Another thing I should mention - when you say you 'reload' the page, are you hitting refresh? Because this effectively reloads the page (and all it's objects) from the server, so you will not experience the effect of cache. Only when browsing a site will cache make a difference.
Monday, August 16, 2010
Property files encoding
Java resource bundle are saved in ascii. This can lead to problems and the special character must therefore be converted. There is a utility which comes with Java which allows to to exactly this.
The file is then awful, but everything is displayed correctly afterwards.
The file is then awful, but everything is displayed correctly afterwards.
jdk1.6.0_18\bin\native2ascii.exe translations.properties translations_converted.properties
Friday, July 9, 2010
Java Quiz
I found a dirty peace of code and made a small quiz out of it.
What is the result of the following code?
I encountered twice the construction of a inner class
but only in books. I never had any use of such a construct.
If you don't find out just try it :)
What is the result of the following code?
I encountered twice the construction of a inner class
Outter.Inner in = out.new Inner();
but only in books. I never had any use of such a construct.
If you don't find out just try it :)
class Outter {
private int value;
private Inner in = new Inner();
Outter() {
value = 41;
}
void print() {
in.print();
}
class Inner {
Inner() {
print();
}
void print() {
System.out.println(value++);
}
}
}
public class Main {
public static void main(String[] args) {
Outter out = new Outter();
out.print();
Outter.Inner in = out.new Inner();
in.print();
}
}
Subscribe to:
Posts (Atom)