You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Dan Adams <da...@ifactory.com> on 2007/01/10 16:08:16 UTC

Parameter has already been declared

Someone here has an application where he's getting the following
exception:

Caused by: org.apache.hivemind.ApplicationRuntimeException: Parameter
onLoad has already been declared (at Annotation
@org.apache.tapestry.annotations.Parameter(cache=true, defaultValue=,
required=false, name=, aliases=) of public abstract java.lang.String
com.ifactory.sageeref.component.HeadContents.getOnLoad()). [Annotation
@org.apache.tapestry.annotations.Parameter(cache=true, defaultValue=,
required=false, name=, aliases=) of public abstract java.lang.String
com.ifactory.sageeref.component.HeadContents.getOnLoad()]

      at
org.apache.tapestry.spec.ComponentSpecification.addParameterByName(ComponentSpecification.java:245)

      at
org.apache.tapestry.spec.ComponentSpecification.addParameter(ComponentSpecification.java:227)

      at
org.apache.tapestry.annotations.ParameterAnnotationWorker.performEnhancement(ParameterAnnotationWorker.java:68)

      at
org.apache.tapestry.annotations.AnnotationEnhancementWorker.performMethodEnhancement(AnnotationEnhancementWorker.java:142)

      ... 93 more

He says that he only gets this when it runs in jetty and not when it
runs in tomcat although I haven verified that. Here's the page class
that it's complaining about:

public abstract class HeadContents extends BaseERefComponent {

  public abstract String getStylesheet();
  
  @Parameter
  public abstract String getPageName();

  // SEEMS TO BE COMPLAINING ABOUT THIS
  @Parameter
  public abstract String getOnLoad();
   
  @Parameter
  public abstract String[] getScriptFiles();
  
  @Parameter
  public abstract String[] getStylesheetFiles();
  
  public String getPageTitle(){
    ...
  }
}

Anyone have any suggestions as to what the problem could be? Thanks!

-- 
Dan Adams
Senior Software Engineer
Interactive Factory
617.235.5857


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


Re: Parameter has already been declared

Posted by Jesse Kuhnert <jk...@gmail.com>.
This also sounds like an old bug that hit people only when caching was
disabled. It's been fixed starting with 4.1.1.

On 1/10/07, Ron Piterman <rp...@gmx.net> wrote:
> try changing string[] to Collection<String> and see if this changes
> anything, tapestry is probably able to coerce these values, isn't it?
> Cheers,
> Ron
>
>
> Dan Adams wrote:
> > Someone here has an application where he's getting the following
> > exception:
> >
> > Caused by: org.apache.hivemind.ApplicationRuntimeException: Parameter
> > onLoad has already been declared (at Annotation
> > @org.apache.tapestry.annotations.Parameter(cache=true, defaultValue=,
> > required=false, name=, aliases=) of public abstract java.lang.String
> > com.ifactory.sageeref.component.HeadContents.getOnLoad()). [Annotation
> > @org.apache.tapestry.annotations.Parameter(cache=true, defaultValue=,
> > required=false, name=, aliases=) of public abstract java.lang.String
> > com.ifactory.sageeref.component.HeadContents.getOnLoad()]
> >
> >       at
> > org.apache.tapestry.spec.ComponentSpecification.addParameterByName(ComponentSpecification.java:245)
> >
> >       at
> > org.apache.tapestry.spec.ComponentSpecification.addParameter(ComponentSpecification.java:227)
> >
> >       at
> > org.apache.tapestry.annotations.ParameterAnnotationWorker.performEnhancement(ParameterAnnotationWorker.java:68)
> >
> >       at
> > org.apache.tapestry.annotations.AnnotationEnhancementWorker.performMethodEnhancement(AnnotationEnhancementWorker.java:142)
> >
> >       ... 93 more
> >
> > He says that he only gets this when it runs in jetty and not when it
> > runs in tomcat although I haven verified that. Here's the page class
> > that it's complaining about:
> >
> > public abstract class HeadContents extends BaseERefComponent {
> >
> >   public abstract String getStylesheet();
> >
> >   @Parameter
> >   public abstract String getPageName();
> >
> >   // SEEMS TO BE COMPLAINING ABOUT THIS
> >   @Parameter
> >   public abstract String getOnLoad();
> >
> >   @Parameter
> >   public abstract String[] getScriptFiles();
> >
> >   @Parameter
> >   public abstract String[] getStylesheetFiles();
> >
> >   public String getPageTitle(){
> >     ...
> >   }
> > }
> >
> > Anyone have any suggestions as to what the problem could be? Thanks!
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>


-- 
Jesse Kuhnert
Tapestry/Dojo team member/developer

Open source based consulting work centered around
dojo/tapestry/tacos/hivemind. http://blog.opencomponentry.com

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


Re: Parameter has already been declared

Posted by Ron Piterman <rp...@gmx.net>.
try changing string[] to Collection<String> and see if this changes
anything, tapestry is probably able to coerce these values, isn't it?
Cheers,
Ron


Dan Adams wrote:
> Someone here has an application where he's getting the following
> exception:
> 
> Caused by: org.apache.hivemind.ApplicationRuntimeException: Parameter
> onLoad has already been declared (at Annotation
> @org.apache.tapestry.annotations.Parameter(cache=true, defaultValue=,
> required=false, name=, aliases=) of public abstract java.lang.String
> com.ifactory.sageeref.component.HeadContents.getOnLoad()). [Annotation
> @org.apache.tapestry.annotations.Parameter(cache=true, defaultValue=,
> required=false, name=, aliases=) of public abstract java.lang.String
> com.ifactory.sageeref.component.HeadContents.getOnLoad()]
> 
>       at
> org.apache.tapestry.spec.ComponentSpecification.addParameterByName(ComponentSpecification.java:245)
> 
>       at
> org.apache.tapestry.spec.ComponentSpecification.addParameter(ComponentSpecification.java:227)
> 
>       at
> org.apache.tapestry.annotations.ParameterAnnotationWorker.performEnhancement(ParameterAnnotationWorker.java:68)
> 
>       at
> org.apache.tapestry.annotations.AnnotationEnhancementWorker.performMethodEnhancement(AnnotationEnhancementWorker.java:142)
> 
>       ... 93 more
> 
> He says that he only gets this when it runs in jetty and not when it
> runs in tomcat although I haven verified that. Here's the page class
> that it's complaining about:
> 
> public abstract class HeadContents extends BaseERefComponent {
> 
>   public abstract String getStylesheet();
>   
>   @Parameter
>   public abstract String getPageName();
> 
>   // SEEMS TO BE COMPLAINING ABOUT THIS
>   @Parameter
>   public abstract String getOnLoad();
>    
>   @Parameter
>   public abstract String[] getScriptFiles();
>   
>   @Parameter
>   public abstract String[] getStylesheetFiles();
>   
>   public String getPageTitle(){
>     ...
>   }
> }
> 
> Anyone have any suggestions as to what the problem could be? Thanks!
> 


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