my dog learned polymorphism*
The moose likes JSP and the fly likes problem with TLD files Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "problem with TLD files" Watch "problem with TLD files" New topic
Author

problem with TLD files

Sanjay Izardar
Greenhorn

Joined: Apr 18, 2011
Posts: 19
i have three files

1)DiceRoller.class in foo package



2)DiceFunctions.tld in WEB-INF folder


3)result.jsp


after running result.jsp from the browser i am getting this error.

HTTP Status 500 -

type Exception report

message

description The server encountered an internal error () that prevented it from fulfilling this request.

exception

org.apache.jasper.JasperException: File "/DiceFunctions" not found
org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:510)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:375)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)

root cause

org.apache.jasper.JasperException: File "/DiceFunctions" not found
org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:50)
org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:407)
org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:114)
org.apache.jasper.compiler.TagLibraryInfoImpl.<init>(TagLibraryInfoImpl.java:159)
org.apache.jasper.compiler.Parser.parseTaglibDirective(Parser.java:423)
org.apache.jasper.compiler.Parser.parseDirective(Parser.java:492)
org.apache.jasper.compiler.Parser.parseElements(Parser.java:1552)
org.apache.jasper.compiler.Parser.parse(Parser.java:126)
org.apache.jasper.compiler.ParserController.doParse(ParserController.java:211)
org.apache.jasper.compiler.ParserController.parse(ParserController.java:100)
org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:155)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:295)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:276)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:264)
org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:563)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:303)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)

note The full stack trace of the root cause is available in the Apache Tomcat/5.5.17 logs.

can someone please help me.
Stefan Evans
Bartender

Joined: Jul 06, 2005
Posts: 1016
Works fine for me on Tomcat 7.
What server are you using? Try restarting the server?

Where have you put these files?
The DiceRoller class needs to be WEB-INF/classes/foo/DiceRoller.class
The tld needs to be WEB-INF/Dicefunctions.tld (you say it is. Please double check)

Also, I might suggest an alternative to use the java.util.Random nextInt method to generate a dice roll rather than Math.random().
But thats a matter of personal taste :-).


EDIT: Fixed stoopid mistake. Thanks Bear.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60782
    
  65

Stefan Evans wrote:The DiceRoller class needs to be WEB-INF/classes/foo.DiceRoller.class

Correction: WEB-INF/classes/foo/DiceRoller.class


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: problem with TLD files
 
Similar Threads
problem with EL functions
Exception - EL Funtion Example page 389
how to get .tld file working
Regarding TLD
.tld error