Bug 4771

Summary: cannot use xtags- jar file conflict?
Product: Taglibs Reporter: rasand
Component: XTags TaglibAssignee: Tomcat Developers Mailing List <dev>
Status: CLOSED FIXED    
Severity: blocker    
Priority: P3    
Version: 1.0   
Target Milestone: ---   
Hardware: PC   
OS: All   

Description rasand 2001-11-09 08:34:09 UTC
I have two clean installations of tomcat, version 3.2.2 and version 3.3 with 
JDK1.2.2.  I have a JSP page that uses xtags, a recent nightly build (nov 6).  
I downloaded dom4j v1.1 and put dom4j-full.jar in my classpath, along with 
xtags.jar.  When using a <xtag:variable...> tag, I get the following exception:

java.lang.AbstractMethodError: 
org/apache/taglibs/xtags/util/JspVariableContext.getVariableValue
	at org.jaxen.ContextSupport.getVariableValue(ContextSupport.java:97)
	at org.jaxen.Context.getVariableValue(Context.java:57)
	at org.jaxen.expr.DefaultVariableReferenceExpr.evaluate
(DefaultVariableReferenceExpr.java:60)
	at org.jaxen.expr.DefaultXPath.asList(DefaultXPath.java:46)
	at org.jaxen.JaXPath.jaSelectNodes(JaXPath.java:35)
	at org.jaxen.JaXPath.jaSelectSingleNode(JaXPath.java:40)
	at org.jaxen.JaXPath.jaValueOf(JaXPath.java:52)
	at org.jaxen.BaseXPath.valueOf(BaseXPath.java:32)
	at org.dom4j.xpath.DefaultXPath.valueOf(DefaultXPath.java:169)
	at org.apache.taglibs.xtags.xpath.VariableTag.doStartTag
(VariableTag.java:99)
	at help._0002fhelp_0002fhelp_0002ejsphelp_jsp_47._jspService
(_0002fhelp_0002fhelp_0002ejsphelp_jsp_47.java, Compiled Code)
....

My jsp page is pretty simple:

<%@ taglib uri="/xtags" prefix="xtags" %>
<xtags:parse uri="help.xml"/>
<xtags:variable id="helptopic" select="$topic"/>

...and that's all i need to get this crash.

I have tried using the 1.0 dom4j, but one of the classes in that package 
required a method of java.util.Collections that only exists in jdk1.3.

Thanks!

Best regards,

Richard
Comment 1 rasand 2001-11-09 09:04:41 UTC
Hi again-

I can confirm that when I downgraded to dom4j v1.0 (and upgraded to jdk1.3, 
strange that dom4j 1.0 requires jdk1.3 yet dom4j v1.1 doesn't), that xtags 
works.  I tried dom4j 1.1 with jdk 1.3 and it produced the same failure, so I 
conclude that there is something in dom4j v1.1 that breaks xtags. 

FYI i tried even using the latest beta of jaxen, 1.0b7, separately, instead of 
the version that is packaged with dom4j, still to no avail.
Comment 2 rasand 2001-11-09 09:33:18 UTC
Hi again- my page compiles with dom4j v1.0, but the tags don't seem to work 
properly!  At least, my tag <xtags:forEach select="/help/topic[topic-key=$topic]
[1]"> seems to return the first topic, instead of the one indicated by the 
variable.  Looks like I'm stuck trying to get this thing to work with dom4j 
v1.1.  Help! :)
Comment 3 James Strachan 2001-11-09 10:19:58 UTC
I've just fixed it now in CVS.

The code has been patched to work with dom4j 1.1.

In addition proper support for JSP scopes has been added so you can use 
expressions like $header:agent or $cookie:foo or $param:bar in XPath 
expressions.

The nightly build should hopefully be updated soon - until then please try use 
the CVS image.