*
The moose likes JSP and the fly likes c.tld: (line 2, col -1): Element type Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "c.tld: (line 2, col -1): Element type "taglib" is not declared?" Watch "c.tld: (line 2, col -1): Element type "taglib" is not declared?" New topic
Author

c.tld: (line 2, col -1): Element type "taglib" is not declared?

Garrett Smith
Ranch Hand

Joined: Jun 27, 2002
Posts: 401
Just got Tomcat 6 was on tomcat 4.

I get this weird error with c.tld. It looks like the error itself is wrong.

How could an error occur in column -1?

Lets have look at c.tld.

I am stupefied.

[ May 02, 2007: Message edited by: Garrett Smith ]

[ May 02, 2007: Message edited by: Bear Bibeault ]

[ May 02, 2007: Message edited by: Garrett Smith ]
[ May 02, 2007: Message edited by: Garrett Smith ]

comp.lang.javascript FAQ: http://jibbering.com/faq/
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60759
    
  65

Why is c.tld outside of its jar file?


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60759
    
  65

Does "TC6" mean Tomcat 6? Please avoid using such abbreviations... escpecially when you use "tomcat 4" in the same sentence. All it creates is confusion -- it took me a few reads to realize that you weren't using tomcat 4.

Read this.
[ May 02, 2007: Message edited by: Bear Bibeault ]
Garrett Smith
Ranch Hand

Joined: Jun 27, 2002
Posts: 401
Ok, I just edited my post. Tomcat 6. I hope that clears up any confusion.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60759
    
  65

I don't know what's up with the -1, but I ask again, what's c.tld doing outside of its jar? Did you extract it for some reason?
Garrett Smith
Ranch Hand

Joined: Jun 27, 2002
Posts: 401
should I just plop this in my WEB-INF/lib

jakarta-taglibs-standard-1.1.2.zip


?
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60759
    
  65

Yes, you should only need to include the jar files in WEB-INF/lib.

Do not extract the TLD files, do not put any goo in web.xml.

Usually there are two files for the JSTL: jstl.jar and standard.jar. Be sure that you have both if the distributon is such.
Garrett Smith
Ranch Hand

Joined: Jun 27, 2002
Posts: 401
so now I have:

Removed the taglib entries from web.xml.

restat tomcat 6 and:




Did I put the zip file in the right place? jakarta-taglibs-standard-1.1.2.zip contains both: jstl.jar standard.jar

Please advise.

Thank you,

Garrett
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60759
    
  65

It's the jar files that need to go into WEB-INF/lib, not the zip distribution file.
Garrett Smith
Ranch Hand

Joined: Jun 27, 2002
Posts: 401
standard.jar and jstl.jar in WEB-INF/lib


So I opened up my localhost[date].log and found this INFO before the error stack:

I don't know what's up with that col -1 or the error. It looks wrong. And web.xml looks fine to me.


So I try examples:
http://localhost/examples

JSTL examples all have an error:
org.apache.jasper.compiler.ParseException: /jsp/jsp2/tagfiles/panel.jsp(16,0) Taglib directive: Mandatory attribute uri missing

JSPX examples are not server-parsed:
http://localhost/examples/jsp/jsp2/jspx/basic.jspx



I am using mac 10.4.9 and java 5 (1.5.0_05-48)

What could I have done wrong?
[ May 03, 2007: Message edited by: Garrett Smith ]
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60759
    
  65

I've never had any of these types of problems, but I haven't tried out Tomcat 6 and have no reason to at this point.

Is there any reason you're using Tomcat 6 rather than 5.5 other than "it's the latest"?
Garrett Smith
Ranch Hand

Joined: Jun 27, 2002
Posts: 401
I downloaded Tomcat 6 again. The JSTL examples work.

But I cannot get JSTL to work in my own app.

I get the same -1 errors.

I am going to try and troubleshoot this additively by startin with something I know works and add to it.

I think I'll stick with Tomcat 6. It might be it easier to upgrade from Tomcat 6 to Tomcat 6.5 when 6.5 is released; potentially avoiding having to do more work to upgrade in the future.

The improved memory allocation might help. If I find any bugs, I can report them back to the development team (progress). Although the real reason is I don't want to get behind. My site is already so old and out of date. It is amazing how quickly things change.

http://tomcat.apache.org/whichversion.html

Thanks for the help.

Garrett
[ May 03, 2007: Message edited by: Garrett Smith ]
 
 
subject: c.tld: (line 2, col -1): Element type "taglib" is not declared?
 
Similar Threads
problem in displaying dropdown menu items in jsp with jstl
Error : Mandatory TLD element jsp-version missing
why these exception please see
web.xml couldn't detect taglib tag anymore?
EL Configuration Problem