This week's book giveaway is in the Java 8 forum.
We're giving away four copies of Java 8 in Action and have Raoul-Gabriel Urma, Mario Fusco, and Alan Mycroft on-line!
See this thread for details.
The moose likes JBoss/WildFly and the fly likes Tag Library validation failing for Choose tag Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Products » JBoss/WildFly
Bookmark "Tag Library validation failing for Choose tag" Watch "Tag Library validation failing for Choose tag" New topic
Author

Tag Library validation failing for Choose tag

Ragavendran Baskaran
Greenhorn

Joined: Dec 12, 2011
Posts: 15
Hi All,

My web application is getting migrated to Jboss 5.1 from weblogic 8.1.

There are many JSP pages where we have some HTML tags directly under choose tag(see the sample JSP below) and it used to get evaluated with weblogic 8.1. However if the same app is deployed in jboss and accessed i'm getting the below error

[java] 14:33:02,187 ERROR [[jsp]] Servlet.service() for servlet jsp threw exception
[java] org.apache.jasper.JasperException: <h3>Validation error messages from TagLibraryValidator for c in /test8.jsp</h3><p>14: Illegal text inside "c:choose" tag: "<b>A
ler...".</p><p>14: Illegal text inside "c:choose" tag: "</b>...".</p>
[java] at org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:51)
[java] at org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:409)
[java] at org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:74)
[java] at org.apache.jasper.compiler.Validator.validateXmlView(Validator.java:1795)
[java] at org.apache.jasper.compiler.Validator.validateExDirectives(Validator.java:1741)

JBoss version used - 5.1



When i moved the HTML tags outside the choose tag then it is working.



Is there any mandate not to keep html tags inside choose tag. Please help.

Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60072
    
  65

Ragavendran Baskaran wrote:Is there any mandate not to keep html tags inside choose tag.

No. HTML markup is invisible to the JSP processor.

Did you by any chance put either of servlet-api.jar or jsp-api.jar into WEB-INF/lib? Doing so is wrong, and frequently manifests itself as befuddling errors in tag libraries.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Ragavendran Baskaran
Greenhorn

Joined: Dec 12, 2011
Posts: 15
Thanks Bear for responding.

I cross checked my ear file and there is no servlet-api or jsp-api jars in it, however i found that standard.jar was packaged in it. I removed it and retested the application. But no luck.

Is there anything else i can check ?
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60072
    
  65

standard is necessary for the JSTL.
Ragavendran Baskaran
Greenhorn

Joined: Dec 12, 2011
Posts: 15
Removing standard.jar didn't made any difference to my application. I was still able to access the JSP's which uses JSTL.

Is there anything else which can affect this ?
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60072
    
  65

Not sure. As this is in the JBoss environment, I'm going to move this to the JBoss forum for those that know more about JBoss to look at.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60072
    
  65

Ragavendran Baskaran wrote:Removing standard.jar didn't made any difference to my application. I was still able to access the JSP's which uses JSTL.

That's suspicious. It means you might have conflicting jars. I'd go through the jars in your app and make sure you know what each one is doing there.
Peter Johnson
author
Bartender

Joined: May 14, 2008
Posts: 5779
    
    7

I responding from memory (I don't have my example apps with me) but from what I recall, you need to package standard.jar in your WAR but you should not install the jstl.jar (JBoss AS supplies it).

It does sound like you are picking up a stray standard.jar from somewhere. Check you CLASSPATH env var (by the way, I recommend not setting that env var, doing so often causes surprises). If that doesn't help, add the "-verbose:class" option to the java command line (in run.conf.bat on windows). This option tells you each class loaded and the JAR it came from. When you run your app you should see the JAR the standard classes are being loaded from.


JBoss In Action
Ragavendran Baskaran
Greenhorn

Joined: Dec 12, 2011
Posts: 15
Bear/Peter, Thanks for your time. To rule out the possibility of conflicting jar's i have created a tiny web application and deployed it.

I have 2 test pages in it

test.jsp below (When this page is accessed it fails with the same error what i posted earlier)


test1.jsp below (If this page is accessed it works fine)

I also tried enabling the verbose logging, i have enclosed the output.

[Loaded org.apache.taglibs.standard.tag.common.core.ChooseTag from jar:file:/C:/jboss_eap/jboss-eap-5.1/jboss-as/server/web/deploy/jbossweb.sar/jstl.jar!/]

Note: I tested by creating a war file which contains 2 JSP files, web.xml and no jar files in it.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Tag Library validation failing for Choose tag
 
Similar Threads
HFJS (V2) Final Mock Question 26 is wrong?
Comparing values using JSTL
Conditional alerts (was 'c:otherwise tag')
Final Mock Test Question 26 Head First and Servlets