For help with installation, bugs reports or feature requests, please head over to our new forums.
Genuitec Community on GitHub
- This topic has 13 replies, 6 voices, and was last updated 20 years, 1 month ago by
Renen.
-
AuthorPosts
-
ronen malkaMemberHi
I am using
eclipse version : 3.0.1
MyEclipse Version : 3.8.4I am developing tag libraries.
I keep getting the following error message: “Unable to find setter method for attribute”Although I have all setters and the code run and debug fine and the intelisense recognize the attribute.
It seams that MyEclipse does not get updated properly.April 17, 2005 at 1:05 pm #228224
Riyad KallaMemberI keep getting the following error message: “Unable to find setter method for attribute”
Where does this error come from? Is it in the JSP editor? If so, is it an error in the LEFT or RIGHT margin? What does the line of code look like that is causing the error? What does that <tag> def look like in the TLD file? What is the property code for that taglib class file?
It seams that MyEclipse does not get updated properly.
Correct, we currently are aware of stale cached taglib information in MyEclipse and hope to get it fixed during the 4.x series. Sometimes closing and reopening the project and rebuilding it will fix this, other times you may need to restart Eclipse.
April 21, 2005 at 2:30 am #228459
tiscMemberI’ve got a similar problem here.
It looks like MyEclipse cannot cope with inherited methods. We have an AbstractQueryTag which defines setName() and getName(). A ContentQueryTag ist derived from it and defines the name attribute.
MyEclipse complains
Unable to find setter method for attribute: name
I suppose this should be easy to fix.
April 21, 2005 at 8:32 am #228470
Riyad KallaMembertisc,
I’m going to direct the *exact* same questions at you that I did to the original poster.Please keep in mind that JSTL and JSF tags are almost entirely inherited from base tag classes and they function fine in MyEclipse, so I am not entirely convinced of your conclusion.
July 7, 2005 at 10:12 am #232497
fpecherMemberI’m having the same problem.
(Eclipse 3.1.0, MyEclipseIDE 4.0M2, JDK 5.0)“Unable to find setter method for attribute: name”.
In my tag “navigationItem”, there are two attributes defined: “name” and “link”. Eclipse only complains about the name attribute. This is also true when I rename the attributes to something else, eclipse keeps complaining about a missing setter for the first attribute defined in the tld.
The code works correctly on Tomcat 5, however, so this must be some parsing problem.
To answer some questions you asked the original poster:
– The error appears in the jsp editor. It is marked on the left editor margin (white x, red background) , as well as in the problems view.
– The jsp line showing the error: <ps:navigationItem name=”List Books” link=”/listBooks.faces”> </ps:navigationItem>
(btw, the error is shown only in the line of the first navigationItem.– The tag definition in the tld file:
<tag>
<name>navigationItem</name>
<tagclass>de.pechersys.tags.NavigationItemTag</tagclass>
<bodycontent>JSP</bodycontent>
<info>Navigation item element</info>
<attribute>
<name>name</name>
<required>true</required>
<rtexprvalue>false</rtexprvalue>
</attribute>
<attribute>
<name>link</name>
<required>true</required>
<rtexprvalue>false</rtexprvalue>
</attribute>
</tag>I think all my code is correct, or Tomcat would complain.
July 7, 2005 at 10:15 am #232499
Riyad KallaMemberplease post the source code for the NavigationItemTag class.
July 7, 2005 at 10:16 am #232500
fpecherMemberimport java.io.IOException;
import javax.servlet.jsp.JspTagException;
import javax.servlet.jsp.JspWriter;
import javax.servlet.jsp.tagext.BodyTagSupport;public class NavigationItemTag extends BodyTagSupport
{
//————————————————————————–
private static final long serialVersionUID = 1L;private Object parent = null;
private String name;
private String link;//————————————————————————–
public int doStartTag()
throws JspTagException
{
parent = findAncestorWithClass(this, NavigationItemTag.class);if (parent == null)
{
parent = findAncestorWithClass(this, NavigationTag.class);
}if (parent == null)
{
throw new JspTagException(
“navigationItem must be nested either”
+ ” within navigation or navigationItem”
);
}try
{
JspWriter out = pageContext.getOut();
out.println(
“(” + name
+ “, ” + link
+ “)<br>”
);
}
catch (IOException e)
{
e.printStackTrace();
}return EVAL_BODY_INCLUDE;
}//————————————————————————–
//————————————————————————–
//————————————————————————–
/**
* @return Returns the name.
*/
public String getName()
{
return name;
}/**
* @param name The name to set.
*/
public void setName(String name)
{
this.name = name;
}/**
* @return Returns the link.
*/
public String getLink()
{
return link;
}/**
* @param link The link to set.
*/
public void setLink(String link)
{
this.link = link;
}
}//——————————————————————————
July 7, 2005 at 10:22 am #232501
Riyad KallaMemberYour class does have a package statement correct? (I didn’t see one above). Also have you tried closing your project, restarting MyEclipse and rebuilding your project? There is a known bug where the cache of the taglibs is not revalidated correctly so if you are actively developing this taglib you can run into an issue where MyEclipse doesn’t recognize the most recent state of it.
July 8, 2005 at 8:51 am #232571
fpecherMemberYes, the class has a package statement, I just forgot to copy it, sorry.
I tried opening / closing eclipse, doing a full rebuild (clean / build automatically), but the problem still persists.Frank
July 25, 2005 at 5:59 pm #233604
vtattaMemberI have the same problem tried all the avenues but of no vail.
rebuilt project, removed the attribute from jsp and added again, changed the tld and added the attribute offending </attribute> and I still have the problem.
I use maven to build the war files and I did that, updated the project and yet again I have this problem. This kind of arrested by development. any more suggestions out there? I would be glad to try’em out.vas
July 25, 2005 at 6:12 pm #233606
Riyad KallaMemberVas,
Try and close all your editors and projects, then shutdown MyEclipse. Then add -clean to your command line and restart it, then reopen and rebuild your project.July 25, 2005 at 6:34 pm #233608
vtattaMemberthanks Riyad but unfortunately its not working for me.
July 25, 2005 at 8:16 pm #233610
Riyad KallaMemberVas,
Because no two problems are usually ever *exactly* the same, I would like to ask you can you please post all the information we request in the [URL=http://www.myeclipseide.com/PNphpBB2+file-viewtopic-t-393.html]Posting Guidelines[/URL] thread at the top of this forum? That will give us some context so that we can determine if this is an installation issue, a configuration problem, or a bug. Thanks.I would also like a lot more details about your project setup, how is it organized? What are the errors? What does your web.xml file look like for it’s <taglib> entries, what JARs are in your Buikld path, etc. etc.
August 27, 2005 at 5:32 pm #235837
RenenMemberHas there been any progress towards resolving this?
-
AuthorPosts
