amiry2

Member
Sep 4, 2011
16
0
51
cPanel Access Level
Website Owner
hi
i have a tomcat server in my cpanel . i used a simple tag file in jsp file and taglib tag is

<%@taglib uri="http://jakarta.apache.org/tomcat/debug-taglib" prefix="as" %>

and setting in web.xml is
<taglib>
<taglib-uri>http://jakarta.apache.org/tomcat/debug-taglib</taglib-uri>
<taglib-location>/WEB-INF/as1.tld</taglib-location>
</taglib>

structure of my project is :
puplic_html
|------------ index.jsp
|------------ admin
|------------ index.jsp
....
when i requested index.jsp it run correct . but when i requested admin/index.jsp i get is error :

[h=1]HTTP Status 500 - [/h][HR][/HR]type Exception report

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

org.apache.jasper.JasperException: The absolute uri: http://jakarta.apache.org/tomcat/debug-taglib cannot be resolved in either web.xml or the jar files deployed with this application org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:51) org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:409) org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:116) org.apache.jasper.compiler.TagLibraryInfoImpl.generateTLDLocation(TagLibraryInfoImpl.java:317) org.apache.jasper.compiler.TagLibraryInfoImpl.<init>(TagLibraryInfoImpl.java:148) org.apache.jasper.compiler.Parser.parseTaglibDirective(Parser.java:430) org.apache.jasper.compiler.Parser.parseDirective(Parser.java:499) org.apache.jasper.compiler.Parser.parseElements(Parser.java:1558) org.apache.jasper.compiler.Parser.parse(Parser.java:130) org.apache.jasper.compiler.ParserController.doParse(ParserController.java:245) org.apache.jasper.compiler.ParserController.parse(ParserController.java:101) org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:161) org.apache.jasper.compiler.Compiler.compile(Compiler.java:326) org.apache.jasper.compiler.Compiler.compile(Compiler.java:307) org.apache.jasper.compiler.Compiler.compile(Compiler.java:295) org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:565) org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:309) org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:308) org.apache.jasper.servlet.JspServlet.service(JspServlet.java:259) javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
please help me !!!!!!!!!!!!!!!!
 

cPanelTristan

Quality Assurance Analyst
Staff member
Oct 2, 2010
7,607
40
248
somewhere over the rainbow
cPanel Access Level
Root Administrator
So you are basically saying you cannot get scripts to run inside a subfolder in public_html but only in public_html directly for applications?
 

amiry2

Member
Sep 4, 2011
16
0
51
cPanel Access Level
Website Owner
hi cPanelTristan
yes , jsp tags in public_html directly run correctly but jsp tags in inside a subfolder in public_html get above error .
i tested <%@taglib uri="/WEB-INF/as1.tld" prefix="as" %> in a subfolders , i get this error :
org.apache.jasper.JasperException: File "/WEB-INF/jsp2/jsp2-example-taglib.tld" not found
org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:51)
org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:409)
org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:116)
org.apache.jasper.compiler.TagLibraryInfoImpl.<init>(TagLibraryInfoImpl.java:160)
org.apache.jasper.compiler.Parser.parseTaglibDirective(Parser.java:430)
org.apache.jasper.compiler.Parser.parseDirective(Parser.java:499)
........
please help me .
 

amiry2

Member
Sep 4, 2011
16
0
51
cPanel Access Level
Website Owner
i guess tld files not loading for subfolders in tomcat cpanel . i tested this project on other host , tomcat7 is correct but in cpanel with tomcat 5.32 , i get error .
 

cPanelTristan

Quality Assurance Analyst
Staff member
Oct 2, 2010
7,607
40
248
somewhere over the rainbow
cPanel Access Level
Root Administrator
Based on this wiki post:

Metawerx Wiki: Org.apache.jasper.JasperException

Those errors are typically when making changes on an application without the service being restarted when no uri is mentioned, while the uri in the first post normally means the path isn't being found. Either try the absolute url or the full path here:

Code:
<taglib>
<taglib-uri>http://jakarta.apache.org/tomcat/debug-taglib</taglib-uri>
<taglib-location>/WEB-INF/as1.tld</taglib-location>
</taglib>
The wiki example is:

Code:
<uri>http://metawerx.net/taglibs/mytags</uri>
 

cPanelTristan

Quality Assurance Analyst
Staff member
Oct 2, 2010
7,607
40
248
somewhere over the rainbow
cPanel Access Level
Root Administrator
Hello amiry2,

As I mentioned:

while the uri in the first post normally means the path isn't being found. Either try the absolute url or the full path here:
Your post is the first one and shows a uri failure error. You'd need to revise your tags.

Thanks!
 

amiry2

Member
Sep 4, 2011
16
0
51
cPanel Access Level
Website Owner
hi cPanelTristan
i tested full path for

<taglib-location>/WEB-INF/as1.tld</taglib-location>

but this error happened too.
please help me .
 

cPanelTristan

Quality Assurance Analyst
Staff member
Oct 2, 2010
7,607
40
248
somewhere over the rainbow
cPanel Access Level
Root Administrator
Have you tried posting on a JSP and servlet forum instead? The examples provided were found online by searching, you might want to review your code further. Given the error message, it appears to indicate your code is the issue with the uri it is trying to use.
 

amiry2

Member
Sep 4, 2011
16
0
51
cPanel Access Level
Website Owner
hi
the real path of /WEB-INF/as1.tld is /home/domainname/public_html/WEB-INF/as1.tld but when requested admin/index.jsp the return real path is /home/domainname/public_html/admin/WEB-INF/as1.tld That admin is Additional So tomcat throw file notFound exception .

when i get application.getContextPath() return error .

please help me .
 

cPanelTristan

Quality Assurance Analyst
Staff member
Oct 2, 2010
7,607
40
248
somewhere over the rainbow
cPanel Access Level
Root Administrator
I've tried to assist you thus far. I've given points of what to check. Please post on a forum dedicated to JSP and servlets for faster assistance, since we do not have a large population of developers who post on this forum.
 

amini

Registered
Sep 14, 2011
3
0
51
cPanel Access Level
DataCenter Provider
my jsp page can not write to as.txt

hi
i use tomcat5.32 + cpanel . the php code can write to as1.txt while jsp code can not write to as1.txt .
the as1.txt perms is 644 .


my code is :
<%

String path = application.getRealPath("")+"/as.txt";
FileOutputStream fos = new FileOutputStream(path);
fos.write("this is test ?".getBytes());
fos.close();
%>
When requested get this error : java.io.FileNotFoundException: /home/domainname/public_html/ROOT/as.txt (Permission denied)

java.io.FileInputStream.open(Native Method) java.io.FileInputStream.<init>(FileInputStream.java:106) java.io.FileInputStream.<init>(FileInputStream.java:66) org.apache.jsp.newjsp_jsp._jspService(newjsp_jsp.java:66) org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:98

why tomcat user can not write user even change permission to 664 tomcat user can not write to file .