File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JSP and the fly likes why these exception? 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 "why these exception?" Watch "why these exception?" New topic
Author

why these exception?

Arun Maalik
Ranch Hand

Joined: Oct 25, 2005
Posts: 216
Dear sir i am using sunmicrosystem deploye tool. I am making a tag for jdbc but when i am calling the jsp i am getting following type of exception as. i want to know here that why i am getting these types of exception?In which situation these types of exception may occure.


org.apache.jasper.JasperException: Unable to initialize TldLocationsCache: XML parsing error on file /WEB-INF/connect.tld: (line 4, col 23)
org.apache.jasper.compiler.TldLocationsCache.init(TldLocationsCache.java:252)
org.apache.jasper.compiler.TldLocationsCache.getLocation(TldLocationsCache.java:223)
org.apache.jasper.JspCompilationContext.getTldLocation(JspCompilationContext.java:480)
org.apache.jasper.compiler.Parser.parseTaglibDirective(Parser.java:422)
org.apache.jasper.compiler.Parser.parseDirective(Parser.java:488)
org.apache.jasper.compiler.Parser.parseElements(Parser.java:1544)
org.apache.jasper.compiler.Parser.parse(Parser.java:131)
org.apache.jasper.compiler.ParserController.doParse(ParserController.java:216)
org.apache.jasper.compiler.ParserController.parse(ParserController.java:105)
org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:214)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:500)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:481)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:469)
org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:516)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:307)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:297)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:247)
javax.servlet.http.HttpServlet.service(HttpServlet.java:860)
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
java.lang.reflect.Method.invoke(Method.java:585)
org.apache.catalina.security.SecurityUtil$1.run(SecurityUtil.java:249)
java.security.AccessController.doPrivileged(Native Method)
javax.security.auth.Subject.doAsPrivileged(Subject.java:517)
org.apache.catalina.security.SecurityUtil.execute(SecurityUtil.java:282)
org.apache.catalina.security.SecurityUtil.doAsPrivilege(SecurityUtil.java:165)

with regard

Arun kumar maalik
[ September 01, 2006: Message edited by: Bear Bibeault ]
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

org.apache.jasper.JasperException: Unable to initialize TldLocationsCache: XML parsing error on file /WEB-INF/connect.tld: (line 4, col 23)


The file connect.tld is not well formed.


Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
Arun Maalik
Ranch Hand

Joined: Oct 25, 2005
Posts: 216
sorry sir but the coding of all 3 file that is tag handler,tld file and jsp file are well if you want to see the coding then coding are as below

[code ]//for jsp file

<html>
<body>
<%@ taglib uri="/connect.tld" prefix="chrt" %>

<chrt:connect />
</body>
</html>
[/code]
------------------------------------------------------------------------


----------------------------------------------------------------------



and at the time of deployment i have give in file refrence for tag as below

/connect.tld /web-inf/connect.tld

sir here i would like to know that why above exception
is server not serching tld file?
server reached at tld file but not reaching to harbanse.connect?

what problem sir

with regard

Arun kumar maalik
Richard Green
Ranch Hand

Joined: Aug 25, 2005
Posts: 536
here is your problem.
<short-name>connect</connect>


it needs to be
<short-name>connect</short-name>


pay close attention to the error messages - it tells you exactly what was wrong.

org.apache.jasper.JasperException: Unable to initialize TldLocationsCache: XML parsing error on file /WEB-INF/connect.tld: (line 4, col 23)

ie., Line number 4, column number 23 in connect.tld has a problem.


MCSD, SCJP, SCWCD, SCBCD, SCJD (in progress - URLybird 1.2.1)
Christophe Verré
Sheriff

Joined: Nov 24, 2005
Posts: 14687
    
  16

Could you please stop posting the same question in different threads, and ignoring those answering you. Thank you.

http://www.coderanch.com/t/172927/java-Web-Component-SCWCD/certification/which-we-these-exception


[My Blog]
All roads lead to JavaRanch
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60766
    
  65

Yes, please do not cross-post the same question in multiple forums. It wastes people's time when multiple redundant conversations take place.

I have closed the redundant posts.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Richard Green
Ranch Hand

Joined: Aug 25, 2005
Posts: 536

String st="insert into user_login (user_id,user_password) values (name,pass1);";
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection con=DriverManager.getConnection("Jdbc:Odbc:MyDataSource","scott","tiger");
Statement stmt=con.createStatement();
int n=stmt.executeUpdate(st);

Guys,

Correct me if I am wrong. My understanding is that custom tags (or actions) should be used only for display logic (like printing out a menu / header / footer notes etc). For the same reason, I wasn't really a fan of the JSTL SQL Tag Library. Putting SQL logic in JSP defeats the whole purpose of MVC, in my humble opinion.
Christophe Verré
Sheriff

Joined: Nov 24, 2005
Posts: 14687
    
  16

Yes, I also think that JSTL's sql support is evil
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60766
    
  65

Yes, even the JSTL specification essentailly says that the SQL tags should only be used for protoyping and not production code.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: why these exception?
 
Similar Threads
Problem using Custom tag in JSP
JasperException
JasperException: Unable to initialize TldLocationsCache:
java.lang.NoSuchMethodError: javax.servlet.ServletContext.getResourcePaths(Ljava/lang/String;)Ljava
issues in taglib usage