users@glassfish.java.net

Booting GlassFish in TestNG

From: <glassfish_at_javadesktop.org>
Date: Thu, 11 Mar 2010 01:18:50 PST

I'm trying to boot GlassFish in my test class in order to test EJB3, following instructions here (http://blogs.sun.com/alexismp/entry/testing_ejb_3_1_s) and there (http://ctpjava.blogspot.com/2009/10/unit-testing-ejbs-and-jpa-with.html)

private static Context context;
    private static EJBContainer container;

    @BeforeSuite
    public static void createContainer() {
        Map<String, Object> properties = new HashMap<String, Object>();
        properties.put(EJBContainer.MODULES, new File("target/classes"));
        properties.put("org.glassfish.ejb.embedded.glassfish.installation.root", "./src/test/glassfish");
        container = EJBContainer.createEJBContainer(properties);
        context = container.getContext();
    }

Everything is in place but when Maven runs the test phase I get the following exception:

11 mars 2010 10:12:42 org.glassfish.ejb.embedded.EJBContainerProviderImpl createEJBContainer
GRAVE: ejb.embedded.exception_instantiating
java.lang.NoSuchMethodError: org.objectweb.asm.ClassReader.accept(Lorg/objectweb/asm/ClassVisitor;I)V

Does anyone have an idea of what's happening?
By the way, asm is part of my transitive dependencies since the module I'm trying to test uses hibernate for persistence.
[Message sent by forum member 'sarbogast' (sebastien.arbogast_at_gmail.com)]

http://forums.java.net/jive/thread.jspa?messageID=391183