Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JSTL c:import issue

 
dkumar kizhakkel
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi

I import an external page to one of my webpage using jstl <%c:import%>
It works with windows,But when i run the page in Linux it shows

"org.apache.jasper.JasperException: javax.servlet.jsp.JspException: Problem accessing the absolute URL "+urlname


versions
Red Hat Enterprise Linux WS release 3 (Taroon)
Java 1.5
Apache Tomcat 5.5.26

Process I did
Copy standard.jar and jstl.jar to WEB-INF/lib dir
create tlds dir and copy c.tld
web.xml
<!DOCTYPE web-app
PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
"http://java.sun.com/dtd/web-app_2_3.dtd">

<taglib>
<taglib-uri>http://java.sun.com/jsp/jstl/core</taglib-uri>
<taglib-location>/WEB-INF/tlds/c.tld</taglib-location>
</taglib>

The webpage includes

<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
...
<c:import url="<%=urlpage%>" />

urlpage is dynamic

Can anyone help me to clear the issue.

Thanks
Dinesh
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64970
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There are a few errors in your setup. I'm not sure if they're causing your problem or not, but it's best to get everything squared away before diagnosing any further.

Originally posted by dkumar kizhakkel:
Process I did ...

create tlds dir and copy c.tld

Why? The tld files are already in the jar files in the classpath. Extracting them to the file system is not only unnecessary, it can cause issues with versions mismatches going forward. Remove these files.


web.xml

....

<taglib>
<taglib-uri>http://java.sun.com/jsp/jstl/core</taglib-uri>
<taglib-location>/WEB-INF/tlds/c.tld</taglib-location>
</taglib>

Also remove these entries for the same reason.

As I said, this may not solve your issue, but it will get those potential problems out of the way.
 
dkumar kizhakkel
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I remove the tlds directory.Also change web.xml. But still the issue remaining..What change i want to do in configurations?
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64970
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"org.apache.jasper.JasperException: javax.servlet.jsp.JspException: Problem accessing the absolute URL "+urlname

Is this the actual wording of the error message? It doesn't seen to match anything in your source.
 
dkumar kizhakkel
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
type Exception report

message

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

exception

org.apache.jasper.JasperException: javax.servlet.jsp.JspException: Problem accessing the absolute URL "http://micro.shoretel.com/www?p=overview&s=2&l=us&v=all". java.net.UnknownHostException: micro.shoretel.com
org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:460)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:355)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:329)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)


root cause

javax.servlet.ServletException: javax.servlet.jsp.JspException: Problem accessing the absolute URL "http://micro.shoretel.com/www?p=overview&s=2&l=us&v=all". java.net.UnknownHostException: micro.shoretel.com
org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:837)
org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:774)
org.apache.jsp.shoretelpage_jsp._jspService(shoretelpage_jsp.java:200)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:98)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:331)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:329)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)


root cause

java.net.UnknownHostException: micro.shoretel.com
java.net.PlainSocketImpl.connect(PlainSocketImpl.java:177)
java.net.Socket.connect(Socket.java:520)
java.net.Socket.connect(Socket.java:470)
sun.net.NetworkClient.doConnect(NetworkClient.java:157)
sun.net.www.http.HttpClient.openServer(HttpClient.java:388)
sun.net.www.http.HttpClient.openServer(HttpClient.java:523)
sun.net.www.http.HttpClient.<init>(HttpClient.java:231)
sun.net.www.http.HttpClient.New(HttpClient.java:304)
sun.net.www.http.HttpClient.New(HttpClient.java:321)
sun.net.www.protocol.http.HttpURLConnection.getNewHttpClient(HttpURLConnection.java:813)
sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:765)
sun.net.www.protocol.http.HttpURLConnection.connect(HttpURLConnection.java:690)
sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:934)
org.apache.taglibs.standard.tag.common.core.ImportSupport.acquireReader(ImportSupport.java:331)
org.apache.taglibs.standard.tag.common.core.ImportSupport.acquireString(ImportSupport.java:241)
org.apache.taglibs.standard.tag.common.core.ImportSupport.doEndTag(ImportSupport.java:161)
org.apache.jsp.shoretelpage_jsp._jspService(shoretelpage_jsp.java:176)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:98)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:331)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:329)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Your server can not find micro.shoretel.com.

Does your server have access to the internet?
If so, does it have a working DNS entry?

Try pinging that url from the command line.
I just did from my machine and it found that URL.



If ping can't find it, you'll need to talk with your system administrator or network administrator to find out why that machine can't find that URL.
 
dkumar kizhakkel
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks. Now it works.

It was a problem with DNS setting.
Thanks for your valuable suggestions!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic