Uploaded image for project: 'Tapestry 5'
  1. Tapestry 5
  2. TAP5-1851

Cannot store interface used by page classes in pages package

    XMLWordPrintableJSON

Details

    Description

      I have 2 pages which must implement an interface in order to make them interoperable with another component. The interface is stored in the tapestry pages package.

      Moving the interface to a non-tapestry package avoids the exception (eg com.blah.helpers)

      package com.blah.pages;
      public interface MyPageInterface {
      void doSomething();
      }

      package com.blah.pages;
      public class MyPage1 implements MyPageInterface {
      public void doSomething()

      { ... }
      }

      package com.blah.pages;
      public class MyPage2 implements MyPageInterface {
      public void doSomething(){ ... }

      }

      2012-02-20 12:47:13,875 http-80-1 ERROR org.apache.tapestry5.ioc.Registry - Illegal field modifiers in class com/blah/pages/MyPageInterface: 0x12
      2012-02-20 12:47:13,875 http-80-1 ERROR org.apache.tapestry5.ioc.Registry - Operations trace:
      2012-02-20 12:47:13,875 http-80-1 ERROR org.apache.tapestry5.ioc.Registry - [ 1] Creating instantiator for component class com.blah.pages.MyPage1
      2012-02-20 12:47:13,890 http-80-1 ERROR org.apache.tapestry5.services.TapestryModule.RequestExceptionHandler - Processing of request failed with uncaught exception: Illegal field modifiers in class com/blah/pages/MyPageInterface: 0x12
      java.lang.ClassFormatError: Illegal field modifiers in class com/blah/pages/MyPageInterface: 0x12
      at java.lang.ClassLoader.defineClass1(Native Method)
      at java.lang.ClassLoader.defineClass(ClassLoader.java:791)
      at java.lang.ClassLoader.defineClass(ClassLoader.java:634)
      at org.apache.tapestry5.internal.plastic.PlasticClassLoader.defineClassWithBytecode(PlasticClassLoader.java:52)
      at org.apache.tapestry5.internal.plastic.PlasticClassPool.realize(PlasticClassPool.java:144)
      at org.apache.tapestry5.internal.plastic.PlasticClassPool.realizeTransformedClass(PlasticClassPool.java:122)
      at org.apache.tapestry5.internal.plastic.PlasticClassImpl.createInstantiator(PlasticClassImpl.java:356)
      at org.apache.tapestry5.internal.plastic.PlasticClassPool.loadAndTransformClass(PlasticClassPool.java:350)
      at org.apache.tapestry5.internal.plastic.PlasticClassLoader.loadClass(PlasticClassLoader.java:38)
      at java.lang.ClassLoader.loadClass(ClassLoader.java:356)
      at java.lang.ClassLoader.defineClass1(Native Method)
      at java.lang.ClassLoader.defineClass(ClassLoader.java:791)
      at java.lang.ClassLoader.defineClass(ClassLoader.java:634)
      at org.apache.tapestry5.internal.plastic.PlasticClassLoader.defineClassWithBytecode(PlasticClassLoader.java:52)
      at org.apache.tapestry5.internal.plastic.PlasticClassPool.realize(PlasticClassPool.java:144)
      at org.apache.tapestry5.internal.plastic.PlasticClassPool.realizeTransformedClass(PlasticClassPool.java:122)
      at org.apache.tapestry5.internal.plastic.PlasticClassImpl.createInstantiator(PlasticClassImpl.java:356)
      at org.apache.tapestry5.internal.plastic.PlasticClassPool.loadAndTransformClass(PlasticClassPool.java:350)
      at org.apache.tapestry5.internal.plastic.PlasticClassLoader.loadClass(PlasticClassLoader.java:38)
      at java.lang.ClassLoader.loadClass(ClassLoader.java:356)
      at org.apache.tapestry5.internal.plastic.PlasticClassPool.getClassInstantiator(PlasticClassPool.java:510)
      at org.apache.tapestry5.plastic.PlasticManager.getClassInstantiator(PlasticManager.java:189)
      at org.apache.tapestry5.internal.services.ComponentInstantiatorSourceImpl$2.invoke(ComponentInstantiatorSourceImpl.java:234)
      at org.apache.tapestry5.internal.services.ComponentInstantiatorSourceImpl$2.invoke(ComponentInstantiatorSourceImpl.java:228)
      at org.apache.tapestry5.ioc.internal.OperationTrackerImpl.invoke(OperationTrackerImpl.java:74)
      at org.apache.tapestry5.ioc.internal.PerThreadOperationTracker.invoke(PerThreadOperationTracker.java:87)
      at org.apache.tapestry5.ioc.internal.RegistryImpl.invoke(RegistryImpl.java:1121)
      at org.apache.tapestry5.internal.services.ComponentInstantiatorSourceImpl.createInstantiatorForClass(ComponentInstantiatorSourceImpl.java:226)
      at org.apache.tapestry5.internal.services.ComponentInstantiatorSourceImpl.getInstantiator(ComponentInstantiatorSourceImpl.java:216)
      at $ComponentInstantiatorSource_1300c5f171672.getInstantiator(Unknown Source)
      at org.apache.tapestry5.internal.services.ComponentModelSourceImpl.getModel(ComponentModelSourceImpl.java:34)
      at org.apache.tapestry5.internal.services.ComponentModelSourceImpl.getPageModel(ComponentModelSourceImpl.java:39)
      at $ComponentModelSource_1300c5f171671.getPageModel(Unknown Source)
      at org.apache.tapestry5.internal.services.MetaDataLocatorImpl$2.valueForKey(MetaDataLocatorImpl.java:104)
      at org.apache.tapestry5.internal.services.MetaDataLocatorImpl.getSymbolExpandedValueFromCache(MetaDataLocatorImpl.java:119)
      at org.apache.tapestry5.internal.services.MetaDataLocatorImpl.findMeta(MetaDataLocatorImpl.java:99)
      at $MetaDataLocator_1300c5f171668.findMeta(Unknown Source)
      at org.apache.tapestry5.internal.services.RequestSecurityManagerImpl.isSecure(RequestSecurityManagerImpl.java:104)
      at org.apache.tapestry5.internal.services.RequestSecurityManagerImpl.needsRedirect(RequestSecurityManagerImpl.java:94)
      at org.apache.tapestry5.internal.services.RequestSecurityManagerImpl.checkForInsecurePageRenderRequest(RequestSecurityManagerImpl.java:68)
      at $RequestSecurityManager_1300c5f171665.checkForInsecurePageRenderRequest(Unknown Source)
      at org.apache.tapestry5.services.TapestryModule$37.handle(TapestryModule.java:2204)
      at $PageRenderRequestHandler_1300c5f17168e.handle(Unknown Source)
      at $PageRenderRequestHandler_1300c5f171683.handle(Unknown Source)
      at org.apache.tapestry5.internal.services.ComponentRequestHandlerTerminator.handlePageRender(ComponentRequestHandlerTerminator.java:48)
      at $ComponentRequestFilter_1300c5f171681.handlePageRender(Unknown Source)
      at $ComponentRequestHandler_1300c5f171684.handlePageRender(Unknown Source)
      at org.apache.tapestry5.services.InitializeActivePageName.handlePageRender(InitializeActivePageName.java:47)
      at $ComponentRequestHandler_1300c5f171684.handlePageRender(Unknown Source)
      at $ComponentRequestHandler_1300c5f171656.handlePageRender(Unknown Source)
      at org.apache.tapestry5.internal.services.PageRenderDispatcher.dispatch(PageRenderDispatcher.java:45)
      ...

      IMHO, there is no logical reason why this should not work - I realise however there may be a technical reason but in this case the error message should be more descriptive.

      maybe related to TAP5-1737?

      Attachments

        Activity

          People

            hlship Howard Lewis Ship
            paul.stanton Paul Stanton
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: