Tuesday, March 24, 2015

fixed! java.net.UnknownHostException: tiles.apache.org

Reason why I get java.net.UnknownHostException: tiles.apache.org when I'm off-line is a silly mistake in my tiles definition xml at WEB-INF/layouts/layouts.xml :

I have version mis-match at DOCTYPE : 2.0 at DTD Tiles Configuration and 3.0 at file name tiles-config_3_0.dtd.
<!DOCTYPE tiles-definitions PUBLIC "-//Apache Software Foundation//DTD Tiles Configuration 2.0//EN" "http://tiles.apache.org/dtds/tiles-config_3_0.dtd">
So even though I have dtd file in my local lib
org/apache/tiles/resources/tiles-config_3_0.dtd at WEB-INF/lib/tiles-core-3.0.1.jar
the server is looking for the dtd from internet. The fix is simple : place same version 3.0 in both point
<!DOCTYPE tiles-definitions PUBLIC "-//Apache Software Foundation//DTD Tiles Configuration 3.0//EN" "http://tiles.apache.org/dtds/tiles-config_3_0.dtd">

1 comment:

Janaka said...

Thanks Nahid, I had the same and fixed