jakarta-cactus-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andrew Boyd <andrew.b...@mindspring.com>
Subject Re: IllegalAccessError calling package private methods
Date Wed, 19 Nov 2003 19:44:38 GMT
Some suggested that the problem might have been caused by different
class loaders.  So I put some debug statements in to find out.

At the same time I upgraded from jboss 3.2.1 to 3.2.2.

Low and behold no more error! Hurray!  I guess I could go back to the old version
and check but time is a wasting.

Thanks for all the advice,

Andrew

-----Original Message-----
From: Andrew Boyd <andrew.boyd@mindspring.com>
Sent: Nov 13, 2003 4:06 PM
To: cactus-user@jakarta.apache.org
Subject: IllegalAccessError calling package private methods

Hi All,
  I'm getting the following error when running my cactus tests:
java.lang.IllegalAccessError: tried to access method 
com.digitalreasoning.kafe.host.Host.getKafeMBeanServer() from class
com.digitalreasoning.kafe.host.HostObjectFactoryTest at com.digitalreasoning.kafe.host.HostObjectFactoryTest.testDomainName(HostObjectFactoryTest.java:44)

The method getKafeMBeanServer() is a package private method in Host.
    /**
     * Returns the MBeanServer created by this Host.
     * Keeping this package private for testing since the Host should provide
     * any fuctionality that my be derived from the MBeanServer
     * @return
     */
    MBeanServer getKafeMBeanServer(){
        return kafeMbeanServer_;
    }

HostObjectFactoryTest is in the same package as you can tell.  The method  testDomainName()
is:
    /**
     * Make sure that the MBeanServer is created with the expected
     * DomainName.
     */
    public void testDomainName(){
        Host host = HostObjectFactory.createHost();
        MBeanServer server = host.getKafeMBeanServer();
        assertTrue("Asserting True that "+Host.DOMAIN + " == "+ server.getDefaultDomain(),
                          server.getDefaultDomain().equals(Host.DOMAIN));
    }

Any ideas why I'm getting the IllegalAccessError?

Thanks


Andrew Boyd
Software Architect
Sun Certified J2EE Architect
B&B Technical Services Inc.
205.422.2557

Mime
View raw message