Dear All,

I am new to Jython and decided to try the code supplied in the monthly Newsletters of September and October 2006 as I want to be able to write some object factories for Python classes.

I am coding and testing in Eclipse vsn 3.5.1 with PyDev plugin installed,  Jython 2.5.1 and JRE 6

I copied the code from the newsletters and changed the classes that differed between the two newsletters to have either Sep or Oct in them to distinguish where they came from. I have spent ages trying to find the problem and getting nowhere. One suggestion in an earlier post was to include into the python class

import sys
sys.add_package(' java package' ) - so I added this code as well for the java package 'jyinterface.interfaces'

but to no avail, same NullPointerException & ExceptionInInitializerError.

The only differences between my code and the code provided by Charlie Groves and Josh Juneau are java class name changes (, in package jyinterface.interfaces, and in the Jython project and I put not in package jyinterface as Josh had, but in the jyinterface.interfaces package). I also updated the references to these classes.

Here is the console output I get. Happy to supply the code if anyone feels kind enough to have a look!

Exception in thread "main" java.lang.ExceptionInInitializerError
    at org.python.core.PyObject.<clinit>(
    at org.python.util.PythonInterpreter.<init>(
    at org.python.util.PythonInterpreter.<init>(
    at jyinterface.factory.EmployeeFactory.<init>(
    at jyinterface.interfaces.MainOct.main(
Caused by: java.lang.NullPointerException
    at org.python.core.PyType.init(
    at org.python.core.PyType.createType(
    at org.python.core.PyType.addFromClass(
    at org.python.core.PyType.fromClass(
    at org.python.core.PyType.<clinit>(
    ... 5 more

The lines that are being referred to in the error log are
        EmployeeFactory factory = new EmployeeFactory();
        PythonInterpreter interpreter = new PythonInterpreter();

public PythonInterpreter() {    // line 59
        this(null, null);                   // line 60
            dict = new PyStringMap();
    public static final PyType TYPE = PyType.fromClass(PyObject.class);
            if (!Py.BOOTSTRAP_TYPES.contains(underlying_class)) {
        return createType(c, needsInners);
            addFromClass(PyType.class, null);
    public static PyType TYPE = fromClass(PyType.class);