tags:

views:

145

answers:

1

Hi, when using this method

public List<Field> getFieldWithoutId(List<Integer> idSections) throws Exception {
    try {
        Connection conn = this.getConnection();
        Array arraySections = conn.createArrayOf("int4", idSections.toArray());
        this.log.info("Recupero field");
        List<Field> fields = this.getJdbcTemplate().query(getFieldWithoutIdQuery, new Object[] {arraySections},ParameterizedBeanPropertyRowMapper.newInstance(Field.class));
        /*if (!conn.isClosed())
            conn.close();
        */
        releaseConnection(conn);
        return fields;
    } catch (Exception e) {
        e.printStackTrace();
        throw new Exception("Errore.");
    }
}

I have an exception at conn.createArrayOf("int4", idSections.toArray());.

The exception is:

javax.ejb.EJBException : Unexpected Error
java.lang.AbstractMethodError: org.jboss.resource.adapter.jdbc.jdk5.WrappedConnectionJDK5.createArrayOf(Ljava/lang/String;[Ljava/lang/Object;)Ljava/sql/Array;

postgresql-8.4-701.jdbc4.jar is in jboss/server/all/lib dir. Application is spring based with ejb3.

When working locally with the same setup everything is fine. This only happens on a preproduction environment. Only difference is locally I have jboss run in default mode, in the other case there are 2 jbosses in all configuration. I can't track down the cause of this error. Could someone help me please?

A: 

java.lang.AbstractMethodError

This means that an abstract method which is declared in some API in the current runtime classpath is missing in the concrete implementation in the current runtime classpath.

org.jboss.resource.adapter.jdbc.jdk5.WrappedConnectionJDK5.createArrayOf(Ljava/lang/String;[Ljava/lang/Object;)Ljava/sql/Array;

Given the fact that it works fine in local environment, but not in preproduction environment, it would mean that the environments are using a different JBoss server version and/or that the deployed webapplication unnecessarily contains JBoss-specific libraries in the /WEB-INF/lib. At least, the classpath is messed up. Cleanup it.

BalusC
JBoss version is the same, and EAR content is this :1) lib folder with ejbclient.jar with no libraries2) META-INF folder with Manifest3) backend.jar that contains : 1) META-INF folder with manifest and spring config files4) one webapp, currently almost empty, with no libraries anywayCould you point me to the right way of cleaning classpath?
Francesco
Just go through all paths covered by the webapp's classpath, check if you don't see version collisions in JAR files with same classes. Maybe those libraries are in the `/JRE/lib` or `/JRE/lib/ext`.
BalusC
I'll check this out, thanks!
Francesco