Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

SEVERE: null : Can't find file '/WEB-INF/tiles-defs.xml'

843838Jul 7 2006 — edited Jul 10 2006
I'm trying to get Tiles to work with Struts on my server. I'm running a local instance of Tomcat v5.5. Development environment is Eclipse. I"ve looked everywhere on the web and can't find any solutions that work. I've been working on this for several days now. It shouldn't be this hard...

I appreciate any help or suggestions people might have. I would really like to get beyond the configuration $#!^ and start coding.

Thanks in advance!!!

Jim

Here are snippets from the pertinent files:

web.xml:
<?xml version="1.0" encoding="UTF-8"?>
<web-app id="WebApp_ID" version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">

<display-name>
admin</display-name>
<welcome-file-list>
<welcome-file>index.html</welcome-file>
<welcome-file>index.htm</welcome-file>
<welcome-file>index.jsp</welcome-file>
<welcome-file>default.html</welcome-file>
<welcome-file>default.htm</welcome-file>
<welcome-file>default.jsp</welcome-file>
</welcome-file-list>


<servlet>
<servlet-name>action</servlet-name>
<servlet-class>
org.apache.struts.action.ActionServlet
</servlet-class>
<init-param>
<param-name>config</param-name>
<param-value>/WEB-INF/struts-config.xml</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>


<servlet-mapping>
<servlet-name>action</servlet-name>
<url-pattern>*.do</url-pattern>
</servlet-mapping>


<jsp-config>
<taglib>
<taglib-uri>struts-bean</taglib-uri>
<taglib-location>/WEB-INF/tlds/struts-bean.tld</taglib-location>
</taglib>

<taglib>
<taglib-uri>struts-logic</taglib-uri>
<taglib-location>/WEB-INF/tlds/struts-logic.tld</taglib-location>
</taglib>

<taglib>
<taglib-uri>struts-html</taglib-uri>
<taglib-location>/WEB-INF/tlds/struts-html.tld</taglib-location>
</taglib>

<taglib>
<taglib-uri>struts-tiles</taglib-uri>
<taglib-location>/WEB-INF/tlds/struts-tiles.tld</taglib-location>
</taglib>

<!-- The following tag library info was added for JSTL libraries. -->
<taglib>
<taglib-uri>http://java.sun.com/jstl/fmt</taglib-uri>
<taglib-location>/WEB-INF/tlds/fmt.tld</taglib-location>
</taglib>

<taglib>
<taglib-uri>http://java.sun.com/jstl/fmt-rt</taglib-uri>
<taglib-location>/WEB-INF/tlds/fmt-rt.tld</taglib-location>
</taglib>

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

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

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

<taglib>
<taglib-uri>http://java.sun.com/jstl/sql-rt</taglib-uri>
<taglib-location>/WEB-INF/tlds/sql-rt.tld</taglib-location>
</taglib>

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

<taglib>
<taglib-uri>http://java.sun.com/jstl/x-rt</taglib-uri>
<taglib-location>/WEB-INF/tlds/x-rt.tld</taglib-location>
</taglib>

</jsp-config>

</web-app>

struts-config.xml:
<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE struts-config PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 1.2//EN"
"/WEB-INF/dtds/struts-config_1_2.dtd">
<struts-config>

<!-- ============================================ Data Source Configuration -->
<data-sources />

<!-- ================================================ Form Bean Definitions -->
<form-beans>

</form-beans>

<!-- ========================================= Global Exception Definitions -->
<global-exceptions />

<!-- =========================================== Global Forward Definitions -->
<global-forwards />

<!-- =========================================== Action Mapping Definitions -->
<action-mappings>
<action path="/foobar" forward="/createAccount.jsp" />
</action-mappings>

<!--
============================================= Controller Configuration
<controller contentType="text/html; charset=UTF-8" />

======================================== Message Resources Definitions
<message-resources
parameter="com.xilinx.web.registration.struts.res.ApplicationResources" />

=============================================== Plug Ins Configuration -->


<!--======================================================= Tiles plugin -->
<!--
This plugin initialize Tiles definition factory. This later can takes some
parameters explained here after. The plugin first read parameters from
web.xml, thenoverload them with parameters defined here. All parameters
are optional.
The plugin should be declared in each struts-config file.
- definitions-config: (optional)
Specify configuration file names. There can be several comma
separated file names (default: ?? )
- moduleAware: (optional - struts1.1)
Specify if the Tiles definition factory is module aware. If true
(default), there will be one factory for each Struts module.
If false, there will be one common factory for all module. In this
later case, it is still needed to declare one plugin per module.
The factory will be initialized with parameters found in the first
initialized plugin (generally the one associated with the default
module).
true : One factory per module. (default)
false : one single shared factory for all modules
- definitions-parser-validate: (optional)
Specify if xml parser should validate the Tiles configuration file.
true : validate. DTD should be specified in file header (default)
false : no validation

Paths found in Tiles definitions are relative to the main context.
-->

<plug-in className="org.apache.struts.tiles.TilesPlugin" >
<set-property property="definitions-config" value="/WEB-INF/tiles-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" />
</plug-in>


<!-- =================================================== Validator plugin
<plug-in className="org.apache.struts.validator.ValidatorPlugIn">
<set-property property="pathnames"
value="/WEB-INF/validator-rules.xml,/WEB-INF/validation.xml" />
</plug-in>
-->

</struts-config>

tiles-defs.xml (in the WEB-INF directory as are the other xml files...):
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE tiles-definitions PUBLIC "-//Apache Software Foundation//DTD Tiles Configuration 1.1//EN"
"http://jakarta.apache.org/struts/dtds/tiles-config_1_1.dtd">
<tiles-definitions>
<definition name="Tiles.register" page="/tiles/template.jsp">
<put name="header" value="/tiles/header.jsp" />
<put name="body" value="/register.jsp" />
<put name="footer" value="/tiles/footer.jsp" />
</definition>
</tiles-definitions>


Console output when starting the server:
....
INFO: Starting Servlet Engine: Apache Tomcat/5.5.17
Jul 7, 2006 11:36:41 AM org.apache.catalina.core.StandardHost start
INFO: XML validation disabled
Jul 7, 2006 11:36:43 AM org.apache.struts.tiles.xmlDefinition.I18nFactorySet initFactory
SEVERE: null : Can't find file '/WEB-INF/tiles-defs.xml'
Jul 7, 2006 11:36:43 AM org.apache.struts.tiles.TilesPlugin initDefinitionsFactory
SEVERE: Can't create Tiles definition factory for module ''.
Jul 7, 2006 11:36:43 AM org.apache.struts.action.ActionServlet init
SEVERE: Unable to initialize Struts ActionServlet due to an unexpected exception or error thrown, so marking the servlet as unavailable. Most likely, this is due to an incorrect or missing library dependency.
javax.servlet.ServletException: null : Can't find file '/WEB-INF/tiles-defs.xml'
at org.apache.struts.tiles.TilesPlugin.initDefinitionsFactory(TilesPlugin.java:233)
at org.apache.struts.tiles.TilesPlugin.init(TilesPlugin.java:137)
at org.apache.struts.action.ActionServlet.initModulePlugIns(ActionServlet.java:869)
at org.apache.struts.action.ActionServlet.init(ActionServlet.java:336)
at javax.servlet.GenericServlet.init(GenericServlet.java:211)
at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1105)
at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:932)
at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:3917)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4201)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1013)
at org.apache.catalina.core.StandardHost.start(StandardHost.java:718)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1013)
at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:442)
at org.apache.catalina.core.StandardService.start(StandardService.java:450)
at org.apache.catalina.core.StandardServer.start(StandardServer.java:709)
at org.apache.catalina.startup.Catalina.start(Catalina.java:551)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:294)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:432)
Jul 7, 2006 11:36:43 AM org.apache.catalina.core.ApplicationContext log
INFO: Marking servlet action as unavailable
Jul 7, 2006 11:36:43 AM org.apache.catalina.core.StandardContext loadOnStartup
SEVERE: Servlet /admin threw load() exception
javax.servlet.UnavailableException: null : Can't find file '/WEB-INF/tiles-defs.xml'
....

I have the following jars in my Web App Libraries (WEB-INF/lib):
standard.jar
commons-fileupload.jar
antlr.jar
struts.jar
commons-beanutils.jar
commons-logging.jar
commons-validator.jar
myswl-connector-java-3.1.12-bin.jar
struts-el.jar
jstl.jar
commons-digester.jar

Struts is version: 1.2.9.
JRE / JDK: 1.5.0_06 (Program files shows I have JRE 1.5.0_05 in the tree as well)

Note: Struts will work if I comment out the tiles plug-in in the struts-config.xml file.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Aug 7 2006
Added on Jul 7 2006
1 comment
2,022 views