11 Interesting Java-related links. September 30 – October 6, 2013
http://www.ibm.com/developerworks/views/java/libraryview.jsp?search_by=java+next – the whole series of interesting articles about the future of Java which is already there. http://java.dzone.com/articles/testing-stages-maven – a short article about maven-failsafe-plugin maven plugin. http://java.dzone.com/articles/encryption-mysql-vs-postgresql – comparison of the two most popular open-source RDBMS in the field on data encryption. http://persism.sourceforge.net/main.php – a small but still pretty useful ORM library for the cases when you don’t need huge Hibernate/EclipseLink with myriads of dependencies. http://www.infoq.com/articles/Introduction-to-HotSpot – introduction into JVM internals from the source code point of view http://www.javacodegeeks.com/2013/09/testing-java-ee-6-with-arquillian-incl-jpa-ejb-bean-validation-and-cdi.html –…
Interesting Java-related links. September 16 – September 29 2013
http://www.adam-bien.com/roller/abien/entry/the_hidden_javaee_7_gem – sweet stuff. Lambdas in JDK7. Still pretty much unusable because of the lack of static type validation during compilation. I’d rather move to Groovy for something like this. http://www.javapractices.com/home/HomeAction.do – collection of established practices for Java with code snippets and explanations on why these are good. http://cr.openjdk.java.net/~mr/se/8/java-se-8-edr-spec.02.html – the latest early draft spec for Java SE 8. http://www.infoq.com/articles/tuning-tips-G1-GC – article on tuning G1 garbage collector http://mrhaki.blogspot.com/2013/09/grails-goodness-render-binary-output.html – a small tip for Groovy 2.x users http://habrahabr.ru/post/190876/ (Russian) – how…
Interesting Java-related links for July 14 – July 28
http://www.javacodegeeks.com/2013/07/javas-reflection-api.html – reflection basics. A pretty good description of what you can do. Unfortunately it lacks information about MethodHandle introduced in JDK 1.7 http://www.infoq.com/articles/G1-One-Garbage-Collector-To-Rule-Them-All – G1 GC description. http://java.dzone.com/articles/gradle-deprecations – worth reading if you’re using Gradle on your projects. http://www.javacodegeeks.com/2013/07/5-coding-hacks-to-reduce-gc-overhead.html – five useful tips http://subversion.apache.org/docs/release-notes/1.8.html#moves – new goodies in SVN 1.8 http://elwood.su/?p=544 (Russian) – article about using JBoss Remoting bisocket transport to organize server-client communication. http://habrahabr.ru/post/185492/ (Russian) – Really cool article about UEFI and Secure Boot http://habrahabr.ru/post/184412/ (Russian) – Scala…
Presentations and Education. May 20 – May 26
https://blogs.oracle.com/arungupta/entry/java_ee_7_launch_webcast. Usually you see some simple demos like this and might even say Wow. The devil is usually in the details when you start implementation of something more difficult. You often get various behaviour with a bunch of nuances for different appserver vendors. Or just simple appserver bugs which might force you to investigate server code rather than writing your own. In any case it ‘s useful to see the directions of J2EE platform movement. http://www.codeschool.com/courses. My main problem with…
Weird TopLink exception message
Got a strange exception today during executing a dynamic JPA query via TopLink.It looks like: Caused by: line 1:25: unexpected token: nullat oracle.toplink.essentials.internal.parsing.ejbql.antlr273.EJBQLParser.rangeVariableDeclaration(EJBQLParser.java:1727)… 136 more Initially the query looks like “select o from Test”. It’s definitely not correct because it should be “select o from Test o”. But in any case the message is not useful at all.
Integrating JAX-WS into Magnolia CMS

Got a task today to add support of JAX-WS into our Magnolia based project. Hell. I took me 30 minutes to add support for JAX-RS(Jersey). But it took about four hours to do this for JAX-WS. The first step is quite trivial we need to create web service itself:package com.softteco.ws; import javax.jws.WebMethod;import javax.jws.WebParam;import javax.jws.WebService; @WebService(serviceName=”PingService”)public class PingService { @WebMethod(operationName=”ping”) public String ping(@WebParam(name=”s”) String data) { return data; }}The second step is also quite trivial. You’ll need to add one more listener into your web.xml….
PostgreSQL 8.4 two-phase commit j2ee5 Glassfish
Recently we moved our server from Postgresql 8.3 to Postgresql 8.4, and I faced with a problem with some functionality mulfunction. In glassfish domain log I found errors that transaction could not be rolled back during postinvoke on bean. The problem was found out when I went to the logs of PostgreSQL: 2010-09-09 17:19:09 EEST ERROR: prepared transactions are disabled2010-09-09 17:19:09 EEST HINT: Set max_prepared_transactions to a nonzero value. And really, in Postgresql 8.4 the max_prepared_transactions parameter became 0, meanwhile…
Integrating Magnolia CMS and custom application security
We have an application integrated into Magnolia CMS. and it’s quite natural to have a single way of handling security. Both Magnolia and our application use JAAS for authentication. However magnolia uses JCR repository to store security data, while our application uses database. Since we didn’t want to cause some possible side effects in Magnolia – the following model was applied: users and a limited set of roles is synchronized between application and Magnolia. Let’s look at how it looks…
Dissapearing IE window
Sometimes we can have the situation when the download window disappears because of the IE security settings. This problem occurred in our GWT application. We have several places which return different kind of reports. The behaviour was really different in different places, while all of the reports are using the same method to write data and to open a new browser window. Some of the reports functioned properly, while IE window was closed immediately on others. I’ve spent hours trying…
Downloading generated RTF/XLS file in IE6/7

Today we had to do some changes in the way the reports are generated. Previously a new page has been opened and the content was sent to the browser. We used the following headers:1. Content-Type – mime type of the content2. Content-Length – length of the contents data3. Content-Disposition – this helped us to control the name of the file which browser uses during saving.This approach worked fine for IE and Firefox. Now we decided to store the generated reports…