问题
I tried to use an ObjectAutoCompleteBuilder to build ObjectAutoCompleteField as below:
ObjectAutoCompleteBuilder builder = new ObjectAutoCompleteBuilder(provider);
builder.autoCompleteRenderer(renderer);
final ObjectAutoCompleteField autocompleteField = builder.build("searchResource" , new Model());
final TextField searchResource = autocompleteField.getSearchTextField();
searchResource.setRequired(true);
but it has thrown this exception :
java.lang.NoSuchMethodError: org.apache.wicket.AttributeModifier.append(Ljava/lang/String;Ljava/io/Serializable;)Lorg/apache/wicket/behavior/AttributeAppender;
Does anyone have any idea why?
回答1:
You're using the wrong version of Wicket (1.4.17) for the WicketStuff project you're using (1.5.4).
From the WicketStuff wiki:
Our release process allows end users an easy way to track a project relative to the wicket release cycle.
For example, if a user sees a org.wicketstuff:someproject artifact with a version of 1.4.16.1 they can know immediately that it is based on wicket 1.4.16 and that it is the first point release (the 1.4.16 version would have been the original release).
So you need Wicket 1.5 - or find a version of autocomplete based on 1.4.17.
来源:https://stackoverflow.com/questions/9125704/exception-java-lang-nosuchmethoderror-org-apache-wicket-attributemodifier-appen