I have a public static 0 argument function in Java that I am trying to call through XSLT in a webapp. When I run it in tomcat (5.5.34), it works fine, but when I run it in JBoss (6.1 final) I get the error
TransformerException: Instance method call to method getScoreXMLTagClass requires an
Object instance as first argument
I'm wondering if JBoss is using a different XSLT parser - I believe I want to use Xalan, and I've heard that Saxon (which is used in some parts of this webapp) can have compatibility issues with this kind of thing. Is there a way to tell which it's using/force it to use a different one? Apologies if I've missed some vital information here, this is not my area of expertise - let me know if some other info is needed.
edit: To show how this is being used, here's the code
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"
...
xmlns:resources="java:com.example.MyResources"
<xmlns:rclass="java:com.example.MyClass">
<xsl:template name="scoreString">
<xsl:param name="string" />
<xsl:value-of select="resources:getString(rclass:getData(),$string,null)"/>
</xsl:template>
<xsl:template match="/">
<xsl:if test="normalize-space(.)">
<div>
<xsl:for-each select="s:scores/s:score">
<xsl:for-each select="s:net">
<dl>
<dt>
<xsl:call-template name="scoreString">
<xsl:with-param name="string">network</xsl:with-param>
</xsl:call-template>
<xsl:value-of select="@id"/>
</dt>
...
I've shortened the class names to simplify it. The equivalent error would be
TransformerException: Instance method call to method getData requires an
Object instance as first argument
edit 2
the method is
public static final Class getData()
{
return MyClass.class;
}