0

I had to overwrite a tag from a custom Tag library due to a bug inside. I copy-pasted the complete code of the class (cannot subclass, bug located in private method) in my own custom class, I created my own .tld file with a new shortname property and added the reference in my web.xml file. Then I updated my jsp-pages using the new prefix.

Now I get the following error:

Error failed to locate setter method for attribute class in tag class my.package.MyTableTag

The field it is complaining about is explicitly defined in my custom class, so I don't understand why I get this error.

Any help would be greatly appreciated, if more information is required ask away!

Edit

I examined somewhat further and I think it should have something to do with the tei-class which is defined for the original tag (and my custom copy). But inside this class I cannot find anything that directly references a wrong class or something similar.
The application is deployed on a WAS 6.1 server and the error stacktrace starts with:

at com.ibm.ws.jsp.taglib.TagClassInfo.getParameterClassName(TagClassInfo.java:167)
at com.ibm.ws.jsp.translator.visitor.generator.BaseTagGenerator.evaluateAttribute(BaseTagGenerator.java:367)
at com.ibm.ws.jsp.translator.visitor.generator.BaseTagGenerator.generateSetters(BaseTagGenerator.java:256)
at com.ibm.ws.jsp.translator.visitor.generator.CustomTagGenerator.startGeneration(CustomTagGenerator.java:359)
at com.ibm.ws.jsp.translator.visitor.generator.GenerateVisitor.startGeneration(GenerateVisitor.java:699)
at com.ibm.ws.jsp.translator.visitor.generator.GenerateVisitor.visitCustomTagStart(GenerateVisitor.java:399)
at com.ibm.ws.jsp.translator.visitor.JspVisitor.processJspElement(JspVisitor.java:267)
at com.ibm.ws.jsp.translator.visitor.JspVisitor.processChildren(JspVisitor.java:309)
at com.ibm.ws.jsp.translator.visitor.JspVisitor.processJspElement(JspVisitor.java:268)
at com.ibm.ws.jsp.translator.visitor.JspVisitor.processChildren(JspVisitor.java:309)
at com.ibm.ws.jsp.translator.visitor.JspVisitor.processJspElement(JspVisitor.java:139)
at com.ibm.ws.jsp.translator.visitor.JspVisitor.visit(JspVisitor.java:121)
at com.ibm.ws.jsp.translator.visitor.generator.GenerateJspVisitor.visit(GenerateJspVisitor.java:137)
...
jb10210
  • 1,158
  • 5
  • 15
  • 1
    Where did you put the class file for your custom and same-name class? Looks like your class takes 2nd place against the original one, which probably comes from some JAR? – mgaert Mar 21 '12 at 11:09
  • @mgaert I also thought something like this but still don't know why, my class is deployed in `WEB-INF/classes` and the original is inside a JAR in `WEB-INF/lib`. also I use a different name for the class, which is displayed in the error, so it looks for the correct class it seems – jb10210 Mar 21 '12 at 11:14
  • @mgaert I updated my question with some extra info, if you could have another look ? Thanks – jb10210 Mar 21 '12 at 13:00

1 Answers1

0

Found another workaround using a subclass instead of the copy-paste class!

jb10210
  • 1,158
  • 5
  • 15