@PostConstruct annotation supported?

Hi,

at the moment I am trying to load an instance of a java class which uses
the @PostConstruct annotation.
I am getting a NullPointerException when I try to call a method where an
object is referenced which is called in the annotated (@PostConstruct)
method.

Short example:

##java##

public class MyJavaClass {

MyType mt;

@PostConstruct
void init() {
    mt = new MyType("aString");
}

public String getAllDescriptions() {
    return mt.findAllOfAnything();
}

}

##jruby##
…(jar loading etc.)
obj = MyJavaClass.new
obj.get_all_descriptions

–> NativeException: java.lang.NullPointerException: null
from … class name:line:in ‘getAllDescriptions’

Do I have to treat these classes in a special way?

thanks & kind regards,
marco


To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs