Re: Issue with JspTaglibs user-directive

Attila Szegedi <[email protected]>
Newsgroups gmane.comp.web.freemarker.user
Message-ID <[email protected]>
My first hunch is that BaseAjaxBodyTag is not a public class - in that  
case, any public methods declared on it that are not part of a public  
superclass or interface are unfortunately not accessible, even if the  
method itself is declared public.

FreeMarker is not defeating Java access control (i.e. not calling  
"setAccessible(true)" on java.lang.reflect.Method objects), so it  
can't access public methods of package private classes (unless those  
methods are part of a public superclass or interface).

Attila.

On 2009.03.04., at 14:16, Max wrote:

> Freemarker is returning an error when I try to call a user-directive
> (AjaxTags: http://ajaxtags.sourceforge.net/):
>
> <#assign ajax=JspTaglibs["/WEB-INF/tld/ajaxtags.tld"]/>
> <@ajax.select ... />
>
> 2009-03-04 13:34:42,966 ERROR []: freemarker.runtime
>                        -
> java.lang.IllegalAccessException: Class
> freemarker.ext.jsp.JspTagModelBase can not access a member of class
> net.sourceforge.ajaxtags.tags.BaseAjaxBodyTag with modifiers "public
> final"
> The problematic instruction:
> ----------
> ==> user-directive ajax.select
>
> Java backtrace for programmers:
> ----------
> freemarker.template.TemplateModelException:
> java.lang.IllegalAccessException: Class
> freemarker.ext.jsp.JspTagModelBase can not access a member of class
> net.sourceforge.ajaxtags.tags.BaseAjaxBodyTag with modifiers "public
> final"
> 	at  
> freemarker 
> .ext.jsp.TagTransformModel.getWriter(TagTransformModel.java:136)
> 	at freemarker.core.Environment.visit(Environment.java:285)
> 	at freemarker.core.UnifiedCall.accept(UnifiedCall.java:130)
> 	at freemarker.core.Environment.visit(Environment.java:209)
> 	at freemarker.core.MixedContent.accept(MixedContent.java:92)
> 	at freemarker.core.Environment.visit(Environment.java:209)
> 	at freemarker.core.Environment.process(Environment.java:189)
> 	at freemarker.template.Template.process(Template.java:237)
> 	at  
> org 
> .apache 
> .struts2 
> .views.freemarker.FreemarkerResult.doExecute(FreemarkerResult.java: 
> 187)
> 	at  
> org 
> .apache 
> .struts2 
> .dispatcher.StrutsResultSupport.execute(StrutsResultSupport.java:186)
> ...
>
> In JSP works normally, even when importing JSP via Freemarker:
>
> <@s.include value="/localidades.jsp" />
>
> Any idea what could be causing the error? I'm using Freemarker 2.3.15
>
> -- 
> Max

------------------------------------------------------------------------------
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.