Re: java.lang.NoSuchFieldError: ROLE

Max <maxxam-cuDQgYkrLFxfAa1EqD/[email protected]>
Newsgroups gmane.comp.java.keel.devel
Message-ID <[email protected]>
Hi,

Help please! I'm getting the java.lang.NoSuchFieldError: ROLE error 
again and can't seem to get rid of it. I've tried a completly fresh 
install of everything and still no luck. The problem does not occur if I 
build and deploy the default example but does so with my app.

I don't know where to find the source code for excalibur that generated 
the jars we are using but I found this code whilst checking the web SVN 
interface at 
http://cvs.apache.org/viewcvs.cgi/excalibur/trunk/fortress/container-impl/src/java/org/apache/avalon/fortress/util/?root=Apache-SVN 
:

<snippet from ContextManager.java>
...
    import org.apache.excalibur.mpool.PoolManager;
...
    protected void initializePoolManager() throws Exception
    {
        try
        {
line 545:            m_poolManager = (PoolManager) m_rootContext.get( 
PoolManager.ROLE ); 
        }
        catch ( ContextException ce )
        {
            final PoolManager pm = new DefaultPoolManager( m_sink );
            assumeOwnership( pm );
            m_poolManager = pm;
        }
    }
...
</snippet>

The line numbers do not match (543 in exception vs 545 in source) so I'm 
not looking at the exact same source, however the code implies that 
PoolManager.ROLE is not defined. I could not find where the 
PoolManager.java source was on the apache SVN server so I extracted out 
the PoolManager.class from the excalibur-mpool-1.0.jar and decompiled 
it. It gives:

    // JBuilder API Decompiler stub source generated from class file
    // 2005/04/23
    // -- implementation of methods is not available

    package org.apache.excalibur.mpool;

    public abstract interface PoolManager {

      // Methods
      Pool getManagedPool(ObjectFactory objectFactory, int _int) throws 
Exception;
    }

This code shows no definition of ROLE just as my error exception shows. 
I've downloaded a fresh copy of excalibur-mpool-1.0.jar from ibiblio and 
it has the same code so my jar file is not corrupt.

I'm not sure where to go from here as I don't know where to find the 
sources for excalibur/avalon that we are using. I can only find an 
excalibur-pool on apache.org (pool not mpool!). Any ideas anyone?

Thanks,
Max

> Max,
>
> "Jyotish" should be able to predict everything and know everything :-)
>
> Just kidding.  The error below is strange.  The PoolManager interface, 
> like any other Avalon service interface, defines the "ROLE" for that 
> service.  It almost seems like your PoolManager class/JAR is corrupt 
> (or, maybe the uber JAR is corrupt somehow), taking a wild guess.  If 
> you have ever killed a Maven build while it is downloading 
> dependencies, you can end up with a partial JAR, but the timestamp is 
> newer, so Maven will not download it again.  Try deleting the 
> excalibur-pool directory in your local Maven repo and building again.  
> But, if it works sometimes and not other times, it may be a completely 
> different problem (maybe synchronization problems/race conditions, etc.)
>
> Shash
>
>> I've been getitng this error after making incremental changes to my 
>> project.xml file. I have not yet identified the pattern, but after 
>> several iterations of development I always seem to end up with this 
>> error. First on plugin 12 and now also on plugin 13. I've also 
>> deleted project.bak before performing keel:maven and war.
>>
>> [KeelMetaInfoManager] Initializing
>> java.lang.NoSuchFieldError: ROLE
>>        at 
>> org.apache.avalon.fortress.util.ContextManager.initializePoolManager(
>> ContextManager.java:543)
>>        at 
>> org.apache.avalon.fortress.util.ContextManager.initialize(ContextMana
>> ger.java:245)
>>        at 
>> org.apache.avalon.fortress.impl.DefaultContainerManager.getInitialize
>> dContextManager(DefaultContainerManager.java:87)
>>        at 
>> org.apache.avalon.fortress.impl.DefaultContainerManager.<init>(Defaul
>> tContainerManager.java:74)
>>        at 
>> org.apache.avalon.fortress.impl.DefaultContainerManager.<init>(Defaul
>> tContainerManager.java:68)
>>        at 
>> org.keel.core.container.KeelContainerFactory.getContainerManager(Keel
>> ContainerFactory.java:229)
>>        at 
>> org.keel.core.container.KeelContainerFactory.createContainer(KeelCont
>> ainerFactory.java:624)
>>        at 
>> org.keel.core.container.KeelContainerFactory.createContainer(KeelCont
>> ainerFactory.java:607)
>>        at 
>> org.keel.servers.KeelAbstractServer.initialize(KeelAbstractServer.jav
>> a:126)
>>        at 
>> org.keel.servers.KeelAbstractServer.getContainer(KeelAbstractServer.j
>> ava:106)
>>        at 
>> org.keel.servers.direct.KeelDirectServer.run(KeelDirectServer.java:61
>> )
>>
>> I am also getting these warnings during build (not sure if they are 
>> related):
>>
>>    [copy] Warning: Could not find file 
>> D:\Proj\JyotishApplications\AstroMatch\AstroMatchServer-3.0\logkit.properties 
>> to
>> copy.
>>    [copy] Warning: Could not find file 
>> D:\Proj\JyotishApplications\AstroMatch\AstroMatchServer-3.0\roles.properties 
>> to
>> copy.
>>    [copy] Warning: Could not find file 
>> D:\Proj\JyotishApplications\AstroMatch\AstroMatchServer-3.0\instrument.propertie 
>>
>> s to copy.
>>    [copy] Copying 1 file to 
>> D:\Proj\JyotishApplications\AstroMatch\AstroMatchServer-3.0\target\axis\WEB-INF\lib 
>>
>>
>> I have not found an easy way of getting back to a working build.
>> Thanks for the help,
>> Max
>> http://keelframework.org/documentation.shtml
>> Keelgroup mailing list
>> [email protected]
>> http://lists.keelframework.com/listinfo.cgi/keelgroup-keelframework.com
>
>
>
>
> http://keelframework.org/documentation.shtml
> Keelgroup mailing list
> [email protected]
> http://lists.keelframework.com/listinfo.cgi/keelgroup-keelframework.com
>
>
>

http://keelframework.org/documentation.shtml
Keelgroup mailing list
[email protected]
http://lists.keelframework.com/listinfo.cgi/keelgroup-keelframework.com
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.