Discussion:
Help Needed: Struts-Tiles Configuration and/or Definition Error
Hilton, Steve
2006-03-08 16:06:56 UTC
Permalink
Hello every. I am new to this e-mail forum, so hopefully I am posting
this question correctly. I have been pulling my hair out over this
problem. I have looked in many books and at many examples on websites
and cannot see where I am doing anything wrong. I have listed the tiles
and struts configuration files for a simple example below. I can pull
examples, verbatim, off off websites and they get the exact same error
as sample programs I set up myself.

First of all, I am using Websphere 5.1.0. The problem is this....
Any time I try to reference a definition name in the tiles-defs.xml
file, any reference to that definition in the struts-config file always
produces a warning which states "Target page.default cannot be resolved
in the context of the following modules: /"

I have tried everything and cannot figure out why this will not work.
This really doesn't seem like it should be that hard. It just seems
like the struts-config file can never find anything in the tiles-defs
file.

To make this even more frustrating, I can create a welcome page like the
index.jsp listed below and that works fine.
index.jsp
<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles" %>
<insert:tiles definition="page.default">

Any help would be greatly appreciated. Thanks! -- Steve


Here's the files for the sample application....

tiles-defs.xml
<tiles-definitions>
<definition name="page.default" path="/tiles/myLayout.jsp">
<put name="title" value ="My Title"/>
<put name="header" value="/tiles/header.jsp"/>
<put name="body" value="/tiles/body.jsp"/>
<put name="footer" value="/tiles/footer.jsp"/>
</definition>
</tiles-definitions>

struts-config.xml
<struts-config>
<!-- Data Sources -->
<data-sources>
</data-sources>

<!-- Form Beans -->
<form-beans>
</form-beans>

<!-- Global Exceptions -->
<global-exceptions>
</global-exceptions>

<!-- Global Forwards -->
<global-forwards>
</global-forwards>

<!-- Action Mappings -->
<action-mappings>
<action path="/testAction"

type="com.aegon.learntiles.actions.LearnTilesAction">
<forward name="success" path="page.default"/>
</action>

</action-mappings>

<!-- Message Resources -->
<message-resources
parameter="com.aegon.learntiles.resources.ApplicationResources"/>

<plug-in className="org.apache.struts.tiles.TilesPlugin" >
<set-property property="pathnames"
value="/WEB-INF/tiles-defs.xml" />
<set-property property="definitions-config"
value="/WEB-INF/tiles-defs.xml" />
<set-property property="moduleAware" value="true" />
</plug-in>

</struts-config>


---------------------------------------------------------------------
To unsubscribe, e-mail: user-***@struts.apache.org
For additional commands, e-mail: user-***@struts.apache.org
Greg Reddin
2006-03-08 16:33:29 UTC
Permalink
Post by Hilton, Steve
First of all, I am using Websphere 5.1.0. The problem is this....
Any time I try to reference a definition name in the tiles-defs.xml
file, any reference to that definition in the struts-config file always
produces a warning which states "Target page.default cannot be
resolved
in the context of the following modules: /"
....
Post by Hilton, Steve
To make this even more frustrating, I can create a welcome page like the
index.jsp listed below and that works fine.
Looks like you need to specify the TilesRequestProcessor in your
struts-config.xml.

Greg
Hilton, Steve
2006-03-08 16:36:38 UTC
Permalink
Sorry, I should have shown that. I just stripped down the struts-config
file that I pasted in the e-mail. I do have the following code in the
struts-config file...

<controller
processorClass="org.apache.struts.tiles.TilesRequestProcessor"
bufferSize="4096" debug="0"/>



-----Original Message-----
From: Greg Reddin [mailto:***@apache.org]
Sent: Wednesday, March 08, 2006 10:33 AM
To: Struts Users Mailing List
Subject: Re: Help Needed: Struts-Tiles Configuration and/or Definition
Error
Post by Hilton, Steve
First of all, I am using Websphere 5.1.0. The problem is this....
Any time I try to reference a definition name in the tiles-defs.xml
file, any reference to that definition in the struts-config file
always
produces a warning which states "Target page.default cannot be
resolved
in the context of the following modules: /"
....
Post by Hilton, Steve
To make this even more frustrating, I can create a welcome page
like the
index.jsp listed below and that works fine.
Looks like you need to specify the TilesRequestProcessor in your
struts-config.xml.

Greg


---------------------------------------------------------------------
To unsubscribe, e-mail: user-***@struts.apache.org
For additional commands, e-mail: user-***@struts.apache.org
Greg Reddin
2006-03-08 16:49:06 UTC
Permalink
Ok, I noticed that you have moduleAware="true" in your plugin
configuration. Are you using modules? I'm not very familiar with
them myself, but will it work if you take the moduleAware attribute out?

Greg
Post by Hilton, Steve
Sorry, I should have shown that. I just stripped down the struts-
config
file that I pasted in the e-mail. I do have the following code in the
struts-config file...
<controller
processorClass="org.apache.struts.tiles.TilesRequestProcessor"
bufferSize="4096" debug="0"/>
-----Original Message-----
Sent: Wednesday, March 08, 2006 10:33 AM
To: Struts Users Mailing List
Subject: Re: Help Needed: Struts-Tiles Configuration and/or Definition
Error
Post by Hilton, Steve
First of all, I am using Websphere 5.1.0. The problem is this....
Any time I try to reference a definition name in the tiles-defs.xml
file, any reference to that definition in the struts-config file
always
produces a warning which states "Target page.default cannot be
resolved
in the context of the following modules: /"
....
Post by Hilton, Steve
To make this even more frustrating, I can create a welcome page
like the
index.jsp listed below and that works fine.
Looks like you need to specify the TilesRequestProcessor in your
struts-config.xml.
Greg
---------------------------------------------------------------------
---------------------------------------------------------------------
Hilton, Steve
2006-03-08 16:59:38 UTC
Permalink
I think maybe we are getting warm here. Look at the last 3 lines below
(at the very bottom of this e-mail)...
It says it can't find file '/WEB-INF/tiles-defs.xml'

I don't understand because the struts-config file has (by the way, same
error with or without the pathname property being set below)-

<plug-in className="org.apache.struts.tiles.TilesPlugin" >
<set-property property="pathnames"
value="/WEB-INF/tiles-defs.xml" />
<set-property property="definitions-config"
value="/WEB-INF/tiles-defs.xml" />
<set-property property="moduleAware" value="true" />
</plug-in>

*** Starting the server ***
************ Start Display Current Environment ************
WebSphere Platform 5.0 [BASE 5.0.2 ptf2M0325.01] running with process
name localhost\localhost\server1 and process id 2348
Host Operating System is Windows XP, version 5.1
Java version = J2RE 1.3.1 IBM Windows 32 build cn131-20030711a (JIT
enabled: jitc), Java Compiler = jitc, Java VM name = Classic VM
was.install.root = C:\WSAD51\runtimes\base_v5
user.install.root = C:\WSAD51\runtimes\base_v5
Java Home = C:\WSAD51\runtimes\base_v5\java\jre
ws.ext.dirs =
C:\WSAD51\runtimes\base_v5/java/lib;C:\WSAD51\runtimes\base_v5/classes;C
:\WSAD51\runtimes\base_v5/classes;C:\WSAD51\runtimes\base_v5/lib;C:\WSAD
51\runtimes\base_v5/lib/ext;C:\WSAD51\runtimes\base_v5/web/help;C:\WSAD5
1\runtimes\base_v5/deploytool/itp/plugins/com.ibm.etools.ejbdeploy/runti
me;C:/WSAD51/wstools/eclipse/plugins/com.ibm.etools.webservice_5.1.0/run
time/worf.jar
Classpath =
C:\WSAD51\runtimes\base_v5/properties;C:\WSAD51\runtimes\base_v5/propert
ies;C:\WSAD51\runtimes\base_v5/lib/bootstrap.jar;C:\WSAD51\runtimes\base
_v5/lib/j2ee.jar;C:\WSAD51\runtimes\base_v5/lib/lmproxy.jar;C:/WSAD51/ws
tools/eclipse/plugins/com.ibm.etools.websphere.tools.common_5.1.0/runtim
e/wteServers.jar;C:/WSAD51/wstools/eclipse/plugins/com.ibm.etools.websph
ere.tools.common_5.1.0/runtime/wasToolsCommon.jar
Java Library path =
C:\WSAD51\runtimes\base_v5/bin;C:\WSAD51\runtimes\base_v5/java/bin;C:\WS
AD51\runtimes\base_v5/java/jre/bin;C:\wsad51\eclipse\jre\bin;.;C:\j2sdk1
.4.2_03\bin;C:\j2sdk1.4.2_03\bin;C:\WSAD51\runtimes\base_v5\java;C:\PVSW
\BIN;C:\PVSW\Bin\;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbe
m;C:\Program Files\cvsnt;p:\lnrmmisc\lus\dll;C:\Program
Files\IBM\WebSphere MQ\bin;C:\Program Files\IBM\WebSphere
MQ\tools\c\samples\bin;C:\SNA\system;C:\Program
Files\Oracle\ora81\bin\;C:\Program Files\oracle\bin;C:\Program
Files\oracle\jre\1.1.7\bin;C:\Program Files\Microsoft SQL
Server\80\Tools\BINN;C:\Program Files\Microsoft Visual
Studio\Common\Tools\WinNT\;C:\Program Files\Microsoft Visual
Studio\Common\Tools\;C:\Program Files\Microsoft Visual
Studio\VC98\Bin\;C:\Program Files\Microsoft Visual
Studio\Common\MSDev98\Bin
************* End Display Current Environment *************
[3/8/06 10:51:45:657 CST] 4c8ff6a5 ManagerAdmin I TRAS0017I: The
startup trace state is *=all=disabled.
[3/8/06 10:51:46:157 CST] 4c8ff6a5 AdminInitiali A ADMN0015I:
AdminService initialized
[3/8/06 10:51:47:142 CST] 4c8ff6a5 Configuration A SECJ0215I:
Successfully set JAAS login provider configuration class to
com.ibm.ws.security.auth.login.Configuration.
[3/8/06 10:51:47:189 CST] 4c8ff6a5 SecurityDM I SECJ0231I: The
Security component's FFDC Diagnostic Module
com.ibm.ws.security.core.SecurityDM registered successfully: true.
[3/8/06 10:51:47:298 CST] 4c8ff6a5 SecurityCompo I SECJ0309I: Java 2
Security is disabled.
[3/8/06 10:51:47:298 CST] 4c8ff6a5 SecurityCompo I SECJ0212I: WCCM JAAS
configuration information successfully pushed to login provider class.
[3/8/06 10:51:47:314 CST] 4c8ff6a5 SecurityCompo I SECJ0240I: Security
service initialization completed successfully
[3/8/06 10:51:47:314 CST] 4c8ff6a5 JMSRegistrati A MSGS0602I: WebSphere
Embedded Messaging Client only has been installed
[3/8/06 10:51:50:282 CST] 4c8ff6a5 CacheServiceI I DYNA0048I: WebSphere
Dynamic Cache initialized successfully.
[3/8/06 10:51:52:142 CST] 4c8ff6a5 JMXSoapAdapte A ADMC0013I: SOAP
connector available at port 8880
[3/8/06 10:51:52:157 CST] 4c8ff6a5 SecurityCompo I SECJ0243I: Security
service started successfully
[3/8/06 10:51:52:157 CST] 4c8ff6a5 SecurityCompo I SECJ0210I: Security
enabled false
[3/8/06 10:51:53:126 CST] 4c8ff6a5 ApplicationMg A WSVR0200I: Starting
application: IBMUTC
[3/8/06 10:51:53:673 CST] 4c8ff6a5 WebContainer A SRVE0161I: IBM
WebSphere Application Server - Web Container. Copyright IBM Corp.
1998-2002
[3/8/06 10:51:53:704 CST] 4c8ff6a5 WebContainer A SRVE0162I: Servlet
Specification Level: 2.3
[3/8/06 10:51:53:704 CST] 4c8ff6a5 WebContainer A SRVE0163I: Supported
JSP Specification Level: 1.2
[3/8/06 10:51:53:767 CST] 4c8ff6a5 WebContainer A SRVE0169I: Loading
Web Module: IBM Universal Test Client.
[3/8/06 10:51:54:048 CST] 4c8ff6a5 WebGroup I SRVE0180I: [IBM
Universal Test Client] [/UTC] [Servlet.LOG]: JSP 1.2 Processor: init
[3/8/06 10:51:54:157 CST] 4c8ff6a5 WebGroup I SRVE0180I: [IBM
Universal Test Client] [/UTC] [Servlet.LOG]: SimpleFileServlet: init
[3/8/06 10:51:54:236 CST] 4c8ff6a5 ApplicationMg A WSVR0221I:
Application started: IBMUTC
[3/8/06 10:51:54:251 CST] 4c8ff6a5 ApplicationMg A WSVR0200I: Starting
application: DefaultEAR
[3/8/06 10:51:54:829 CST] 4c8ff6a5 WebContainer A SRVE0169I: Loading
Web Module: TilesTest.
[3/8/06 10:51:54:970 CST] 4c8ff6a5 WebGroup I SRVE0180I:
[TilesTest] [/TilesTest] [Servlet.LOG]: JSP 1.2 Processor: init
[3/8/06 10:51:56:111 CST] 4c8ff6a5 WebGroup I SRVE0180I:
[TilesTest] [/TilesTest] [Servlet.LOG]: SimpleFileServlet: init
[3/8/06 10:51:56:126 CST] 4c8ff6a5 WebGroup I SRVE0180I:
[TilesTest] [/TilesTest] [Servlet.LOG]: InvokerServlet: init
[3/8/06 10:51:56:173 CST] 4c8ff6a5 WebGroup I SRVE0180I:
[TilesTest] [/TilesTest] [Servlet.LOG]: action: init
[3/8/06 10:51:56:204 CST] 4c8ff6a5 PropertyMessa I
org.apache.struts.util.PropertyMessageResources Initializing,
config='org.apache.struts.util.LocalStrings', returnNull=true
[3/8/06 10:51:56:204 CST] 4c8ff6a5 PropertyMessa I
org.apache.struts.util.PropertyMessageResources Initializing,
config='org.apache.struts.action.ActionResources', returnNull=true
[3/8/06 10:51:56:564 CST] 4c8ff6a5 PropertyMessa I
org.apache.struts.util.PropertyMessageResources Initializing,
config='com.aegon.tilestest.resources.ApplicationResources',
returnNull=true
[3/8/06 10:51:56:673 CST] 4c8ff6a5 I18nFactorySe E
org.apache.struts.tiles.xmlDefinition.I18nFactorySet null : Can't find
file '/WEB-INF/tiles-defs.xml'
[3/8/06 10:51:56:673 CST] 4c8ff6a5 TilesPlugin E
org.apache.struts.tiles.TilesPlugin Can't create Tiles definition
factory for module ''.
[3/8/06 10:51:56:704 CST] 4c8ff6a5 ServletInstan E SRVE0100E: Did not
realize init() exception thrown by servlet action:
javax.servlet.ServletException: null : Can't find file
'/WEB-INF/tiles-defs.xml'

Loading...