Skip to main content

not working in v2.1(9.1.1) (build b60e-fcs)

3 replies [Last post]
dbsquared
Offline
Joined: 2009-08-03

My web application is using the JavaServer Pages Standard Tag Library (jstl) defined in standard.jar found in my applications WEB-INF/lib. The problem is its clear the Glassfish server is not loading the correct version of these classes since I'm getting errors that indicate the calling signature is wrong:
java.lang.NoSuchMethodError: org.apache.taglibs.standard.tag.rt.core.ForTokensTag.setItems(Ljava/lang/String)

After some digging I discovered that the class is being loaded from GLASSFISH_HOME/lib/appserv-jstl.jar which is an older implementation. Some research indicates that I can have MY_APPLICATION/WEB-INF/lib/standard.jar take precedence with sun-web.xml entries like . The problem is it does not work? I was able to make it work by following these steps:
1. modified the Application Server->JVM Settings-> JVM Options -Dcom.sun.enterprise.taglibs=appserv-jstl.jar,jsf-impl.jar to remove the appserv-jstl.jar
2. added my WEB-INF/lib/standard.jar to the Classpath Prefix
The problem is I have no idea what the impact of #1 might be on the glassfish server or admin gui so I would prefer not having to override things in this manner.

Do I misunderstand how is suppose to work? Why is this not the default? Is there a known bug in my version?

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Sahoo

JSTL is part of GlassFish, so when JSP container encounters the JSTL
URI, it does not have to search the tag libraries using application
classloader. I suspect that's the reason for delegate flag to not come
into picture.

I will let web container folks tell you the implication of what you have
done. It is not necessary for an appserver to allow user to override
parts of implementation which is what you are trying to do.

BTW, any particular reason you want to use a different JSTL
implementation? GF v2 comes with JSTL 1.2 implementation and I don't
think there is a newer spec out there, is there? Are you finding bugs in
GlassFish JSTL implementation?

Thanks,
Sahoo

glassfish@javadesktop.org wrote:
> My web application is using the JavaServer Pages Standard Tag Library (jstl) defined in standard.jar found in my applications WEB-INF/lib. The problem is its clear the Glassfish server is not loading the correct version of these classes since I'm getting errors that indicate the calling signature is wrong:
> java.lang.NoSuchMethodError: org.apache.taglibs.standard.tag.rt.core.ForTokensTag.setItems(Ljava/lang/String)
>
> After some digging I discovered that the class is being loaded from GLASSFISH_HOME/lib/appserv-jstl.jar which is an older implementation. Some research indicates that I can have MY_APPLICATION/WEB-INF/lib/standard.jar take precedence with sun-web.xml entries like . The problem is it does not work? I was able to make it work by following these steps:
> 1. modified the Application Server->JVM Settings-> JVM Options -Dcom.sun.enterprise.taglibs=appserv-jstl.jar,jsf-impl.jar to remove the appserv-jstl.jar
> 2. added my WEB-INF/lib/standard.jar to the Classpath Prefix
> The problem is I have no idea what the impact of #1 might be on the glassfish server or admin gui so I would prefer not having to override things in this manner.
>
> Do I misunderstand how is suppose to work? Why is this not the default? Is there a known bug in my version?
> [Message sent by forum member 'dbsquared' (dbsquared)]
>
> http://forums.java.net/jive/thread.jspa?messageID=358827
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@glassfish.dev.java.net
> For additional commands, e-mail: users-help@glassfish.dev.java.net
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@glassfish.dev.java.net
For additional commands, e-mail: users-help@glassfish.dev.java.net

Jan Luehe

On 08/04/09 22:33, Sahoo wrote:
> JSTL is part of GlassFish, so when JSP container encounters the JSTL
> URI, it does not have to search the tag libraries using application
> classloader. I suspect that's the reason for delegate flag to not come
> into picture.
>
> I will let web container folks tell you the implication of what you
> have done. It is not necessary for an appserver to allow user to
> override parts of implementation which is what you are trying to do.

Yes, Sahoo got it right: The webapp classloader ignores the delegate
flag for a number of
packages, including any packages starting with javax.* and
org.apache.taglibs.standard.*,
and will unconditionally delegate resolution of any symbols in these
packages to the parent
classloader.

Like Sahoo, I would like to understand your motivation for replacing the
JSTL impl in
GlassFish, which implements the latest JSTL spec, so I'm not sure what
you mean by
it is an "older implementation". From where did you get your "standard.jar"?

Thanks!

Jan

>
> BTW, any particular reason you want to use a different JSTL
> implementation? GF v2 comes with JSTL 1.2 implementation and I don't
> think there is a newer spec out there, is there? Are you finding bugs
> in GlassFish JSTL implementation?
>
> Thanks,
> Sahoo
>
> glassfish@javadesktop.org wrote:
>> My web application is using the JavaServer Pages Standard Tag Library
>> (jstl) defined in standard.jar found in my applications WEB-INF/lib.
>> The problem is its clear the Glassfish server is not loading the
>> correct version of these classes since I'm getting errors that
>> indicate the calling signature is wrong:
>> java.lang.NoSuchMethodError:
>> org.apache.taglibs.standard.tag.rt.core.ForTokensTag.setItems(Ljava/lang/String)
>>
>>
>> After some digging I discovered that the class is being loaded from
>> GLASSFISH_HOME/lib/appserv-jstl.jar which is an older implementation.
>> Some research indicates that I can have
>> MY_APPLICATION/WEB-INF/lib/standard.jar take precedence with
>> sun-web.xml entries like . The problem
>> is it does not work? I was able to make it work by following these
>> steps:
>> 1. modified the Application Server->JVM Settings-> JVM Options
>> -Dcom.sun.enterprise.taglibs=appserv-jstl.jar,jsf-impl.jar to remove
>> the appserv-jstl.jar
>> 2. added my WEB-INF/lib/standard.jar to the Classpath Prefix The
>> problem is I have no idea what the impact of #1 might be on the
>> glassfish server or admin gui so I would prefer not having to
>> override things in this manner.
>>
>> Do I misunderstand how is suppose to
>> work? Why is this not the default? Is there a known bug in my version?
>> [Message sent by forum member 'dbsquared' (dbsquared)]
>>
>> http://forums.java.net/jive/thread.jspa?messageID=358827
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@glassfish.dev.java.net
>> For additional commands, e-mail: users-help@glassfish.dev.java.net
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@glassfish.dev.java.net
> For additional commands, e-mail: users-help@glassfish.dev.java.net
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@glassfish.dev.java.net
For additional commands, e-mail: users-help@glassfish.dev.java.net

dbsquared
Offline
Joined: 2009-08-03

Jan, Sahoo thanks for all the information it's good to understand the special case around certain packages that clears things up. As for my motivation it was really my error turns out I was including the JSTL 1.1 jar's and Sahoo thanks for clearing that up I've removed those jar's from my web application and that cleared up my issue straight away. Thanks again for both of your replies.