Developers, Developers, Developers! Maksim Sorokin IT Blog

1Mar/112

Reading XML File in Custom IzPack Panel

Sometimes it is needed to have some configuration file in your custom IzPack panels. It is easy to have one!

First, you have to reference your configuration file from resources section in install.xml file:

<resources>
  <res id="mySpec.xml" src="mySpec.xml" />
</resources>

Then you would need to

28Feb/111

Developing and debugging IzPack panels in Eclipse

Here I will describe how one can develop and debug own IzPack panels using Eclipse.

First go and download IzPack. We will use 4.3.3 vesion here.
After installation you will find source directory src\lib in installation location. Import it into Eclipse. Or create a Java project in Eclipse and copy sources afterwards. Obviously, project has some dependencies, so in Java Build Path add all external jars from IzPack installation folder lib. Now you should not have any errors. IzPack code is now browsable.

You can have a

23Feb/111

Axis2 + Guice + Maven + Servlets

In this post I will continue Axis2 + Maven + Servlets + Tomcat topic. I will refer to it as previous post, because some stuff will be repeated. I will show how to have Google Guice dependency injection in Axis2 webservices.

I will reuse technique from sagara's Blog. It works perfectly, but it can be improved a little.

The same Axis2 wsdl generation technique will be used, so I will not refer to it again.

Again, we start by our

20Jan/111

JAX-WS web services + Maven + Tomcat

There is an awesome article about Deploy JAX-WS web services on Tomcat. It describes how to have a web service running without much effort.
We will follow the article and do the same, but with three differences:

  • We will build it with Maven
  • We will omit interface in the web service
  • We will not copy jars to the Tomcat. All dependencies will be managed by Maven

Let's start by creating a fresh maven project jaxwsExample. pom.xml will contain single

11Nov/100

Tycho compiler version

You can specify Java version for target and source in your pom.xml in Tycho:

<plugin>
<groupId>org.sonatype.tycho</groupId>
<artifactId>maven-osgi-compiler-plugin</artifactId>
<version>${tycho-version}</version>
<configuration>
  <source>1.6</source>
  <target>1.6</target>
</configuration>
</plugin>

But this version can still be overriden in you MANIFEST.MF file. So when you find an error, such as:

The method selectionChanged(SelectionChangedEvent) of type MyProvider.MyListener must override a superclass method

Make sure, you have right version of Java in your MANIFEST.MF

This error is spottable through running maven with -X option:

[WARNING] Overriding compiler target level 1.6 from POM with target level 1.5 from MANIFEST.MF
[DEBUG] Using compiler source level: 1.5, target level: 1.5
Tagged as: , , No Comments
1Sep/100

Working with Windows Registry in Java 3

jRegistryKey library actually is under LGPL. So it is suitable to be used in commercial projects too! Very simple library, that just works!

29Aug/100

Google Will Not Participate in JavaOne

http://googlecode.blogspot.com/2010/08/update-on-javaone.html
By Joshua Bloch

Tagged as: , No Comments
27Aug/103

Working with Windows Registry in Java 2

Ok, so the way to read registry data, which I described in previous post may be not a good idea. It is safer to rely on Windows Reg command. I wrote a simple utility to query registry using that utility.

  • isExists finds whereas registry path exists
  • get gets the value for specific key on certain registry path
24Aug/100

Working with Windows Registry in Java

There are commercial and free libraries which enable a possibility to work with Windows registry from Java. For example, there is nice, simple, free, but old jRegistryKey library. The problem is that it is gpl and works with additional dll file. It is under LGPL.

However, we can read and write to Windows Registry without additional libraries and any sort of JNI. First, check out this:
http://dmi.ensica.fr/doc/Java/j2sdk-1_4_2-doc/docs/j2h/java/util/prefs/WindowsPreferences.java.html
And here are some examples how guys work with that:
http://www.davidc.net/programming/java/reading-windows-registry-java-without-jni
http://www.jroller.com/lenkite/entry/use_pure_java_to_access
A bit hacky and works only with REG_SZ. But often that is enough!

Tagged as: , No Comments
25May/100

Masoud Kalali and Java EE Security

Guess who wrote recent DZone Refcardz #99. It was the same guy, who wrote GlassFish Security> book. His name is Masoud Kalali and he has own blog about Java.

Tagged as: , No Comments