Hi folks,

Trying out 5.3.0.  I was running into this exception:

12:44:23.062 ERROR  org.apache.tapestry5.ioc.Registry  - Illegal field 
modifiers in class lxyz/web2/components/codebook/controls/Button: 0x12
12:44:23.062 ERROR  org.apache.tapestry5.ioc.Registry  - Operations trace:
12:44:23.062 ERROR  org.apache.tapestry5.ioc.Registry  - [ 1] Constructing 
instance of page class lxyz.web2.pages.errors.Error404Page
12:44:23.062 ERROR  org.apache.tapestry5.ioc.Registry  - [ 2] Assembling root 
component for page errors/Error404Page
12:44:23.062 ERROR  org.apache.tapestry5.ioc.Registry  - [ 3] Assembling 
component errors/Error404Page:liabase (lxyz.web2.components.desktop.LiaBase)
12:44:23.062 ERROR  org.apache.tapestry5.ioc.Registry  - [ 4] Assembling 
component errors/Error404Page:liabase.base (lxyz.web2.components.head.BaseHead)
12:44:23.063 ERROR  org.apache.tapestry5.ioc.Registry  - [ 5] Creating 
ComponentAssembler for lxyz.web2.components.forums.LiveLinks
12:44:23.063 ERROR  org.apache.tapestry5.ioc.Registry  - [ 6] Creating 
instantiator for component class lxyz.web2.components.codebook.controls.Link
12:44:23.087 ERROR  stryModule.RequestExceptionHandler - Processing of request 
failed with uncaught exception: Illegal field modifiers in class 
lxyz/web2/components/codebook/controls/Button: 0x12  [1BE517AD] 
java.lang.ClassFormatError: Illegal field modifiers in class 
lxyz/web2/components/codebook/controls/Button: 0x12
        at java.lang.ClassLoader.defineClass1(Native Method)
        at java.lang.ClassLoader.defineClassCond(ClassLoader.java:632)
        at java.lang.ClassLoader.defineClass(ClassLoader.java:616)
        at java.lang.ClassLoader.defineClass(ClassLoader.java:466)
        at 
org.apache.tapestry5.internal.plastic.PlasticClassLoader.defineClassWithBytecode(PlasticClassLoader.java:53)
        at 
org.apache.tapestry5.internal.plastic.PlasticClassPool.realize(PlasticClassPool.java:140)
        at 
org.apache.tapestry5.internal.plastic.PlasticClassPool.realizeTransformedClass(PlasticClassPool.java:122)
        at 
org.apache.tapestry5.internal.plastic.PlasticClassImpl.createInstantiator(PlasticClassImpl.java:1722)
        at 
org.apache.tapestry5.internal.plastic.PlasticClassPool.loadAndTransformClass(PlasticClassPool.java:322)
        at 
org.apache.tapestry5.internal.plastic.PlasticClassLoader.loadClass(PlasticClassLoader.java:38)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
        at java.lang.ClassLoader.defineClass1(Native Method)
        at java.lang.ClassLoader.defineClassCond(ClassLoader.java:632)
        at java.lang.ClassLoader.defineClass(ClassLoader.java:616)
        at java.lang.ClassLoader.defineClass(ClassLoader.java:466)
        at 
org.apache.tapestry5.internal.plastic.PlasticClassLoader.defineClassWithBytecode(PlasticClassLoader.java:53)
        at 
org.apache.tapestry5.internal.plastic.PlasticClassPool.realize(PlasticClassPool.java:140)
        at 
org.apache.tapestry5.internal.plastic.PlasticClassPool.realizeTransformedClass(PlasticClassPool.java:122)
        at 
org.apache.tapestry5.internal.plastic.PlasticClassImpl.createInstantiator(PlasticClassImpl.java:1722)
        at 
org.apache.tapestry5.internal.plastic.PlasticClassPool.loadAndTransformClass(PlasticClassPool.java:322)
        at 
org.apache.tapestry5.internal.plastic.PlasticClassLoader.loadClass(PlasticClassLoader.java:38)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
        at 
org.apache.tapestry5.internal.plastic.PlasticClassPool.getClassInstantiator(PlasticClassPool.java:421)
        at 
org.apache.tapestry5.plastic.PlasticManager.getClassInstantiator(PlasticManager.java:189)
        at 
org.apache.tapestry5.internal.services.ComponentInstantiatorSourceImpl$1.invoke(ComponentInstantiatorSourceImpl.java:232)
        at 
org.apache.tapestry5.internal.services.ComponentInstantiatorSourceImpl$1.invoke(ComponentInstantiatorSourceImpl.java:226)

The Button class is:
public interface Button {
        public ButtonType getButtonType();
        public String getActionId();
        public boolean isDisabled();
}

After a lot of fiddling around, someone pointed out that an interface like this 
should not be in the components.xyz package to begin with.  This has been like 
this for 2 years and always worked with the javassist in 2.5.2 and older 
tapestry5 code. 

Modifier.java in the jdk defines constants that seem to indicate the offending 
combination is FINAL PRIVATE (assuming the native code that is generating the 
exception is using the same constants):
    public static final int PRIVATE        = 0x00000002;
    public static final int FINAL             = 0x00000010;

The only google results I found that seemed like a remotely-close match were on 
this un-accepted and unanswered tapestry user list question from June:
http://tapestry.1045711.n5.nabble.com/v5-3-and-Scala-Trait-Illegal-field-modifiers-0x12-td4534667.html
  
Maybe Scala happens to be doing something similar.

Moving the interface to a different package fixed the issue.  Just posting this 
here on the chance someone else might run into this puzzling error message, to 
save them the troubleshooting time.

    Steve

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org

Reply via email to