Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

The file cannot be validated as the host"tiles.apache.org" is currently unreachable.

 
Bhawna Gupta
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,

I make a simple application using struts2 tiles.But when I was trying to deploy, nothing was coming on browser.I made this application on RAD7 with websphere6. I got the warning i.e 'The file cannot be validated as the host"tiles.apache.org" is currently unreachable ' in tiles.xml file.

Jar files which i have used:
1. commons-beannutils-1.8.0.jar
2. commons-digester-1.8.1.jar
3. commons-fileupload-1.2.1.jar
4. commons-io-1.3.2.jar
5. commons-loggig-1.1.jar
6. freemarker-2.3.13.jar
7. junit-3.8.1.jar
8. ognl-2.6.11.jar
9. struts2-convention-plugin-2.1.6.jar
10. struts2-core-2.1.6.jar
11. struts2-tiles-plugi-2.1.6.jar
12. tiles-api-2.1.2.jar
13.tiles-compat-2.1.2.jar
14.tiles-core-2.1.2.jar
15.tiles-jsp-2.1.2.jar
16.tiles-servlet-2.1.2.jar
17.xwork-2.1.2.jar


Web.xml file:

<?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>loan_validationWeb</display-name>
<welcome-file-list>
<welcome-file>Login.jsp</welcome-file>
</welcome-file-list>

<context-param>
<param-name>
org.apache.tiles.impl.BasicTilesContainer.DEFINITIONS_CONFIG
</param-name>
<param-value>/WEB-INF/tiles.xml</param-value>
</context-param>


<listener>
<listener-class>
org.apache.struts2.tiles.StrutsTilesListener
</listener-class>
</listener>




<filter>
<filter-name>struts2</filter-name>
<filter-class>
org.apache.struts2.dispatcher.FilterDispatcher
</filter-class>
</filter>

<filter-mapping>
<filter-name>struts2</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<resource-ref id="ResourceRef_1369224779673">
<description></description>
<res-ref-name>eis/XUConnectionFactory</res-ref-name>
<res-type>javax.resource.cci.ConnectionFactory</res-type>
<res-auth>Application</res-auth>
<res-sharing-scope>Unshareable</res-sharing-scope>
</resource-ref>

</web-app>



struts.xml:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE struts PUBLIC
"-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"
"http://struts.apache.org/dtds/struts-2.0.dtd">
<struts>

<constant name="struts.enable.DynamicMethodInvocation"
value="false" />
<constant name="struts.devMode" value="false" />
<constant name="struts.custom.i18n.resources"
value="ApplicationResources" />


<package name="default" extends="struts-default">


<result-types>
<result-type name="tiles"
class="org.apache.struts2.views.tiles.TilesResult" />
</result-types>

<action name="hello" class="com.struts2.action.Action1"
method="execute">
<result name="success">/HelloWorld.jsp</result>
</action>

<action name="login" class="com.struts2.action.LoginAction"
method="execute">
<result name="success" type="tiles">/Welcome.tiles</result>
<result name="error">/Login.jsp</result>
</action>

<action name="customer-form">
<result name="success" type="tiles">/customer.tiles</result>
</action>

<action name="customer"
class="com.struts2.action.Customer">
<result name="success" type="tiles">/customer.success.tiles</result>
<result name="input" type="tiles">/customer.tiles</result>
</action>


</package>
</struts>


tiles.xml file:

<?xml version="1.0" encoding="UTF-8" ?>

<!DOCTYPE tiles-definitions PUBLIC
"-//Apache Software Foundation//DTD Tiles Configuration 2.0//EN"
"http://tiles.apache.org/dtds/tiles-config_2_0.dtd">

<tiles-definitions>

<definition name="baseLayout" template="/BaseLayout.jsp">
<put-attribute name="title" value="" />
<put-attribute name="header" value="/Header.jsp" />
<put-attribute name="menu" value="/Menu.jsp" />
<put-attribute name="body" value="" />
<put-attribute name="footer" value="/Footer.jsp" />
</definition>

<definition name="/customer.tiles" extends="baseLayout">
<put-attribute name="title" value="Customer Form" />
<put-attribute name="body" value="/Customer.jsp" />
</definition>

<definition name="/Welcome.tiles" extends="baseLayout">
<put-attribute name="title" value="Welcome" />
<put-attribute name="body" value="/Successful.jsp" />
</definition>

<definition name="/customer.success.tiles" extends="baseLayout">
<put-attribute name="title" value="Customer Added" />
<put-attribute name="body" value="/SuccessCustomer.jsp" />
</definition>


</tiles-definitions>

I have no idea how to resolve this problem.please help me.
Thanks in advance.
 
Jaames Smith
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I did not tested your codes but try re-arranging your web.xmlbased on this sample.

 
Bhawna Gupta
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
HI James,

I changed my web.xml according to the series which was given in solution. Now,this problem is not coming.Instead of this problem, a new problem is coming ie

[5/30/13 10:42:20:812 IST] 00000025 Dispatcher W com.opensymphony.xwork2.util.logging.commons.CommonsLogger warn Could not find action or result
There is no Action mapped for namespace / and action name . - [unknown location]
at com.opensymphony.xwork2.DefaultActionProxy.prepare(DefaultActionProxy.java:177)
at org.apache.struts2.impl.StrutsActionProxy.prepare(StrutsActionProxy.java:61)
at org.apache.struts2.impl.StrutsActionProxyFactory.createActionProxy(StrutsActionProxyFactory.java:39)
at com.opensymphony.xwork2.DefaultActionProxyFactory.createActionProxy(DefaultActionProxyFactory.java:47)
at org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:458)
at org.apache.struts2.dispatcher.FilterDispatcher.doFilter(FilterDispatcher.java:395)
at com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.doFilter(FilterInstanceWrapper.java:190)
at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:130)
at com.ibm.ws.webcontainer.filter.WebAppFilterChain._doFilter(WebAppFilterChain.java:87)
at com.ibm.ws.webcontainer.filter.WebAppFilterManager.doFilter(WebAppFilterManager.java:761)
at com.ibm.ws.webcontainer.filter.WebAppFilterManager.doFilter(WebAppFilterManager.java:673)
at com.ibm.ws.webcontainer.filter.WebAppFilterManager.invokeFilters(WebAppFilterManager.java:688)
at com.ibm.ws.wswebcontainer.filter.WebAppFilterManager.invokeFilters(WebAppFilterManager.java:96)
at com.ibm.ws.webcontainer.extension.DefaultExtensionProcessor.invokeFilters(DefaultExtensionProcessor.java:737)
at com.ibm.ws.webcontainer.extension.DefaultExtensionProcessor.handleRequest(DefaultExtensionProcessor.java:531)
at com.ibm.ws.wswebcontainer.extension.DefaultExtensionProcessor.handleRequest(DefaultExtensionProcessor.java:113)
at com.ibm.ws.webcontainer.webapp.WebApp.handleRequest(WebApp.java:3184)
at com.ibm.ws.webcontainer.webapp.WebGroup.handleRequest(WebGroup.java:254)
at com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:811)
at com.ibm.ws.wswebcontainer.WebContainer.handleRequest(WebContainer.java:1433)
at com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java:111)
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:454)
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewInformation(HttpInboundLink.java:383)
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.ready(HttpInboundLink.java:263)
at com.ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.sendToDiscriminators(NewConnectionInitialReadCallback.java:214)
at com.ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.complete(NewConnectionInitialReadCallback.java:113)
at com.ibm.ws.tcp.channel.impl.AioReadCompletionListener.futureCompleted(AioReadCompletionListener.java:165)
at com.ibm.io.async.AbstractAsyncFuture.invokeCallback(AbstractAsyncFuture.java:217)
at com.ibm.io.async.AsyncChannelFuture.fireCompletionActions(AsyncChannelFuture.java:161)
at com.ibm.io.async.AsyncFuture.completed(AsyncFuture.java:136)
at com.ibm.io.async.ResultHandler.complete(ResultHandler.java:195)
at com.ibm.io.async.ResultHandler.runEventProcessingLoop(ResultHandler.java:743)
at com.ibm.io.async.ResultHandler$2.run(ResultHandler.java:873)
at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1469)


Please give me the solution of this problem.
Thanks in advance.
 
Bhawna Gupta
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
HI ,

When i refreshed my project.Then that problem came again ie.The file cannot be validated as the host "tiles.apache.org" is currently unreachable and the above problem still coming ie.
[5/30/13 10:42:20:812 IST] 00000025 Dispatcher W com.opensymphony.xwork2.util.logging.commons.CommonsLogger warn Could not find action or result
There is no Action mapped for namespace / and action name . - [unknown location]


I did some changes in XML file.Please check this.

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>loan_validationWeb</display-name>
<listener>
<listener-class>
org.apache.struts2.tiles.StrutsTilesListener
</listener-class>
</listener>

<context-param>
<param-name>
org.apache.tiles.impl.BasicTilesContainer.DEFINITIONS_CONFIG
</param-name>
<param-value>/WEB-INF/tiles.xml</param-value>
</context-param>

<filter>
<filter-name>struts2</filter-name>
<filter-class>
org.apache.struts2.dispatcher.FilterDispatcher
</filter-class>
</filter>
<filter-mapping>
<filter-name>struts2</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>

<welcome-file-list>
<welcome-file>Login.jsp</welcome-file>
</welcome-file-list>

<resource-ref id="ResourceRef_1369224779673">
<description></description>
<res-ref-name>eis/XUConnectionFactory</res-ref-name>
<res-type>javax.resource.cci.ConnectionFactory</res-type>
<res-auth>Application</res-auth>
<res-sharing-scope>Unshareable</res-sharing-scope>
</resource-ref>

</web-app>


struts.xml:


<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE struts PUBLIC
"-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"
"http://struts.apache.org/dtds/struts-2.0.dtd">
<struts>

<constant name="struts.enable.DynamicMethodInvocation"
value="false" />
<constant name="struts.devMode" value="false" />
<constant name="struts.custom.i18n.resources"
value="ApplicationResources" />


<package name="default" extends="struts-default" namespace="/">


<result-types>
<result-type name="tiles"
class="org.apache.struts2.views.tiles.TilesResult" />
</result-types>

<action name="hello" class="com.struts2.action.Action1"
method="execute">
<result name="success">helloWorld.jsp</result>
</action>

<action name="login" class="com.struts2.action.LoginAction"
method="execute">
<result name="success" type="tiles">Welcome</result>
<result name="error">Login.jsp</result>
</action>

<action name="customer-form">
<result name="success" type="tiles">customer</result>
</action>

<action name="customer"
class="com.struts2.action.Customer" method="execute">
<result name="success" type="tiles">customer.success</result>
<result name="input" type="tiles">customer</result>
</action>


</package>
</struts>


tiles.xml:

<?xml version="1.0" encoding="UTF-8" ?>

<!DOCTYPE tiles-definitions PUBLIC
"-//Apache Software Foundation//DTD Tiles Configuration 2.0//EN"
"http://tiles.apache.org/dtds/tiles-config_2_0.dtd ">

<tiles-definitions>

<definition name="baseLayout" template="/BaseLayout.jsp">
<put-attribute name="title" value="" />
<put-attribute name="header" value="/Header.jsp" />
<put-attribute name="menu" value="/Menu.jsp" />
<put-attribute name="body" value="" />
<put-attribute name="footer" value="/Footer.jsp" />
</definition>

<definition name="customer" extends="baseLayout">
<put-attribute name="title" value="Customer Form" />
<put-attribute name="body" value="/Customer.jsp" />
</definition>

<definition name="Welcome" extends="baseLayout">
<put-attribute name="title" value="Welcome" />
<put-attribute name="body" value="/Successful.jsp" />
</definition>

<definition name="customer.success" extends="baseLayout">
<put-attribute name="title" value="Customer Added" />
<put-attribute name="body" value="/SuccessCustomer.jsp" />
</definition>


</tiles-definitions>

Please give me some suggestions.Why this problem come again and again?Please help me.I stuck in this problem from last 4 days.
Thanks in advance.
 
Jaames Smith
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Try putting http://tiles.apache.org/dtds/tiles-config_2_0.dtd in your browser and see if you can access this address directly.
If not then you have to configure it locally.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic