I've been working on this for a while, but haven't gotten anywhere. I
chopped it down to a minimum. index.jsp works fine unless there is a
tile reference, in which case it throws the exception.
I do have the tiles.jar file in my WEB-INF/lib folder. The taglib
location on the webpages is correct. The location of the
struts-tile-defs.xml file is correct in the plugin.
Here is what I have so far..
----> PLUGIN from struts-config.xml
<plug-in className="org.apache.struts.tiles.TilesPlugin" >
<set-property property="definitions-config"
value="/WEB-INF/configs/struts-tile-defs.xml" />
<set-property property="definitions-debug" value="2" />
<set-property property="definitions-parser-details" value="2" />
<set-property property="definitions-parser-validate" value="true"
/>
<set-property property="moduleAware" value="true" />
</plug-in>
----> JSP Page index.jsp...
<%@ page language="java"%>
<%@ taglib uri="/WEB-INF/tlds/struts-html.tld" prefix="html" %>
<%@ taglib uri="/WEB-INF/tlds/struts-tiles.tld" prefix="tiles" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html:html locale="true">
<head>
<html:base />
<tiles:insert definition="page.default" />
</html:html>
----> struts-tile-defs.xml file entry for page.default
<definition name="page.default"
path="/WEB-INF/pages/layouts/defaultlayout.jsp" />
----> defaultlayout.jsp
<%@ page language="java"%>
<%@ taglib uri="/WEB-INF/tlds/struts-html.tld" prefix="html" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html:html locale="true">
<table border="0" width="80%">
Start Page
</table>
</html:html>
----> The Exception..
javax.servlet.ServletException: Can't get definitions factory from
context.
org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:846)
org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:779)
org.apache.jsp.WEB_002dINF.pages.index_jsp._jspService(org.apache.jsp.WEB_002dINF.pages.index_jsp:86)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:99)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:325)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:295)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:245)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
root cause
javax.servlet.jsp.JspException: Can't get definitions factory from
context.
org.apache.struts.taglib.tiles.InsertTag.processDefinitionName(InsertTag.java:583)
org.apache.struts.taglib.tiles.InsertTag.createTagHandler(InsertTag.java:487)
org.apache.struts.taglib.tiles.InsertTag.doStartTag(InsertTag.java:451)
org.apache.jsp.WEB_002dINF.pages.index_jsp._jspx_meth_tiles_insert_0(org.apache.jsp.WEB_002dINF.pages.index_jsp:162)
org.apache.jsp.WEB_002dINF.pages.index_jsp._jspx_meth_html_html_0(org.apache.jsp.WEB_002dINF.pages.index_jsp:123)
org.apache.jsp.WEB_002dINF.pages.index_jsp._jspService(org.apache.jsp.WEB_002dINF.pages.index_jsp:77)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:99)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:325)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:295)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:245)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
What does the log file say when you start your webapp? Mine has:
12:35:42,050 - DEBUG org.apache.struts.tiles.xmlDefinition.I18nFactorySet -
Factory initialized from file '/WEB-INF/tiles-defs.xml'.
12:35:42,050 - INFO org.apache.struts.tiles.TilesPlugin - Tiles definition
factory loaded for module ''.
(Plus other lines listing all the tiles defs and their contents.)
--
Wendy
Mar 10, 2005 3:27:03 PM org.apache.catalina.core.ApplicationContext log
INFO: HTMLManager: restart: Reloading web application at '/registrar'
Mar 10, 2005 3:27:03 PM org.apache.catalina.core.StandardContext reload
INFO: Reloading this Context has started
Mar 10, 2005 3:27:04 PM org.apache.struts.util.PropertyMessageResources
<init>
INFO: Initializing, config='org.apache.struts.util.LocalStrings',
returnNull=true
Mar 10, 2005 3:27:04 PM org.apache.struts.util.PropertyMessageResources
<init>
INFO: Initializing, config='org.apache.struts.action.ActionResources',
returnNull=true
Mar 10, 2005 3:27:04 PM org.apache.struts.action.ActionServlet
handleConfigException
SEVERE: Parsing error processing resource path
java.net.UnknownHostException: struts.apache.org
at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:177)
at java.net.Socket.connect(Socket.java:507)
at java.net.Socket.connect(Socket.java:457)
at sun.net.NetworkClient.doConnect(NetworkClient.java:157)
at sun.net.www.http.HttpClient.openServer(HttpClient.java:365)
at sun.net.www.http.HttpClient.openServer(HttpClient.java:477)
at sun.net.www.http.HttpClient.<init>(HttpClient.java:214)
at sun.net.www.http.HttpClient.New(HttpClient.java:287)
at sun.net.www.http.HttpClient.New(HttpClient.java:299)
.....
Mar 10, 2005 3:27:04 PM org.apache.catalina.core.ApplicationContext log
INFO: Marking servlet action as unavailable
Mar 10, 2005 3:27:04 PM org.apache.catalina.core.ApplicationContext log
SEVERE: Servlet /registrar threw load() exception
javax.servlet.UnavailableException: Parsing error processing resource
path
at
org.apache.struts.action.ActionServlet.handleConfigException(ActionServlet.java:1035)
at
org.apache.struts.action.ActionServlet.parseModuleConfigFile(ActionServlet.java:1012)
at
org.apache.struts.action.ActionServlet.initModuleConfig(ActionServlet.java:955)
at org.apache.struts.action.ActionServlet.init(ActionServlet.java:470)
at javax.servlet.GenericServlet.init(GenericServlet.java:211)
.....
Mar 10, 2005 3:27:04 PM org.apache.catalina.core.ApplicationContext log
INFO: HTMLManager: list: Listing contexts for virtual host 'localhost'
When I hit the page, I get the error I posted in the first post.. This
error shows in the browser as well as in the logs...
> Mar 10, 2005 3:27:04 PM org.apache.struts.action.ActionServlet
> handleConfigException
> SEVERE: Parsing error processing resource path
> java.net.UnknownHostException: struts.apache.org
...
>
org.apache.struts.action.ActionServlet.parseModuleConfigFile(ActionServlet.j
ava:1012)
Are you using modules? Looks like there's a problem parsing that config
file.
--
Wendy
I am thinking that this has to do with the ActionServlet method trying
to parse down either the struts-config.xml file or the
struts-tiles-defs.xml file, but so far I haven't been able to find any
problems with them. I am using MyEclipse to code and it sees no
problems with either xml file.
Since you're already using eclipse, you can download the trial (get the
light version that doesn't include eclipse) have it point your eclipse
environment (or make a copy if it if you're worried) and see if NitroX
can automatically find the errors or provide some hints to the problem.
You can see some of the tiles support here:
http://www.m7.com/tiles.htm
You can download here: www.m7.com/free
I'd recommend the free JSP Editor since it includes trial capabilities
for the Struts IDE and JSP IDE. Remember to get the Express edition so
you don't download eclipse as well.
good luck.