Re: [Shale] Using standalone tiles?
I am using Tiles in a Struts (v.1.2.7) app, and also experienced an error when the Apache site was temporarily down. So to prevent this from happening in the future, what is the suggested solution? Removing the DOCTYPE element from the tiles-def.xml file does not seem appropriate - or is it? Any suggestions would be appreciated... thanks! Regards, Chris [EMAIL PROTECTED] 11/28/2005 3:14:31 PM On Nov 28, 2005, at 1:57 PM, Craig McClanahan wrote: On 11/28/05, Greg Reddin [EMAIL PROTECTED] wrote: protected String registrations[] = { -//Apache Software Foundation//DTD Tiles Configuration 1.1// EN, /org/apache/tiles/resources/tiles-config_1_1.dtd, -//Apache Software Foundation//DTD Tiles Configuration 1.2// EN, /org/apache/tiles/resources/tiles-config_1_2.dtd, }; Hmm ... Shale uses exactly this style for its own config resources, including the leading slash on the URLs, and it seems to work fine when I disconnect from the Internet. I suspect there might be version specific issues with URL resolution between JVMs in this area. I think the issue is this: Standalone Tiles uses the ClassLoader directly, while Struts-Tiles goes through the Class (which delegates to the ClassLoader according to the Javadoc). Compare Standalone Tiles: URL url = this.getClass().getClassLoader().getResource( to Struts-Tiles: URL url = this.getClass().getResource( The effect is that if you use the ClassLoader you cannot have a leading / on the name. Now I'm not sure which is more correct... Greg - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [Shale] Using standalone tiles?
On Nov 29, 2005, at 7:31 AM, Christopher Becker wrote: I am using Tiles in a Struts (v.1.2.7) app, and also experienced an error when the Apache site was temporarily down. So to prevent this from happening in the future, what is the suggested solution? Removing the DOCTYPE element from the tiles-def.xml file does not seem appropriate - or is it? No, that doesn't seem like an adequate solution to me. The *right* thing to do is make sure your DTD public identifiers are pointing to the right place and your URLs are pointing to the right place. Then we have to figure out how to make sure they resolve to the jar file instead of the URL. I'm not sure we know the right thing to do in the framework yet to make that happen. Greg - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [Shale] Using standalone tiles?
I am getting a similar error with totally different configuration(struts 1.2, no shale of jsf). Apache web site seems down (or I can not reach it) so tomcat could not fetch the dtd files. I think the problem is related to that. Bjørn T Johansen wrote: I am using JSF, Shale and tiles (tiles-nightly) and this has been working great... But now suddenly, I get the following error when I try to start Tomcat..: Nov 28, 2005 3:07:31 PM org.apache.tiles.servlets.TilesServlet init INFO: Initializing TilesServlet Nov 28, 2005 3:07:31 PM org.apache.tiles.servlets.TilesServlet readFactoryConfig INFO: CONFIG FILES DEFINED IN WEB.XML Nov 28, 2005 3:07:31 PM org.apache.tiles.servlets.TilesServlet initDefinitionsFactory INFO: initializing definitions factory... Nov 28, 2005 3:10:40 PM org.apache.tiles.servlets.TilesServlet saveExceptionMessage WARNING: Caught exception when initializing definitions factory Nov 28, 2005 3:10:40 PM org.apache.tiles.servlets.TilesServlet saveExceptionMessage WARNING: I/O Error reading definitions. Nov 28, 2005 3:10:40 PM org.apache.tiles.servlets.TilesServlet saveExceptionMessage WARNING: org.apache.tiles.DefinitionsFactoryException: I/O Error reading definitions. Nov 28, 2005 3:10:40 PM org.apache.tiles.servlets.TilesServlet saveExceptionMessage WARNING: Caught exception when initializing definitions factory Nov 28, 2005 3:10:40 PM org.apache.tiles.servlets.TilesServlet saveExceptionMessage WARNING: I/O Error reading definitions. Nov 28, 2005 3:10:40 PM org.apache.tiles.servlets.TilesServlet saveExceptionMessage WARNING: javax.servlet.ServletException: I/O Error reading definitions. This was working yesterday and I haven't changed anything... (well, the only thing I have done, is to rebuild my application, but I can't see why that should result in this...) Any suggestions why this is happening? (I did one more thing, I upgraded to Shale rc1 and also tiles-nightly to 27. so I was thinking this was the reason, but after downgrading to my previous lib versions, I still get the samme error...) Regards, BTJ -- Bahadir Yagan MHT Elektronik +90 312 265 02 10 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [Shale] Using standalone tiles?
Yes, I think you are right... But I think it's kind of stupid that my webapplication is dependent on an external site to be up and running for my webapplication to work! Or is there a workaround that I don't know about? BTJ Bahadır Yağan wrote: I am getting a similar error with totally different configuration(struts 1.2, no shale of jsf). Apache web site seems down (or I can not reach it) so tomcat could not fetch the dtd files. I think the problem is related to that. Bjørn T Johansen wrote: I am using JSF, Shale and tiles (tiles-nightly) and this has been working great... But now suddenly, I get the following error when I try to start Tomcat..: Nov 28, 2005 3:07:31 PM org.apache.tiles.servlets.TilesServlet init INFO: Initializing TilesServlet Nov 28, 2005 3:07:31 PM org.apache.tiles.servlets.TilesServlet readFactoryConfig INFO: CONFIG FILES DEFINED IN WEB.XML Nov 28, 2005 3:07:31 PM org.apache.tiles.servlets.TilesServlet initDefinitionsFactory INFO: initializing definitions factory... Nov 28, 2005 3:10:40 PM org.apache.tiles.servlets.TilesServlet saveExceptionMessage WARNING: Caught exception when initializing definitions factory Nov 28, 2005 3:10:40 PM org.apache.tiles.servlets.TilesServlet saveExceptionMessage WARNING: I/O Error reading definitions. Nov 28, 2005 3:10:40 PM org.apache.tiles.servlets.TilesServlet saveExceptionMessage WARNING: org.apache.tiles.DefinitionsFactoryException: I/O Error reading definitions. Nov 28, 2005 3:10:40 PM org.apache.tiles.servlets.TilesServlet saveExceptionMessage WARNING: Caught exception when initializing definitions factory Nov 28, 2005 3:10:40 PM org.apache.tiles.servlets.TilesServlet saveExceptionMessage WARNING: I/O Error reading definitions. Nov 28, 2005 3:10:40 PM org.apache.tiles.servlets.TilesServlet saveExceptionMessage WARNING: javax.servlet.ServletException: I/O Error reading definitions. This was working yesterday and I haven't changed anything... (well, the only thing I have done, is to rebuild my application, but I can't see why that should result in this...) Any suggestions why this is happening? (I did one more thing, I upgraded to Shale rc1 and also tiles-nightly to 27. so I was thinking this was the reason, but after downgrading to my previous lib versions, I still get the samme error...) Regards, BTJ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [Shale] Using standalone tiles?
Bjørn T Johansen [EMAIL PROTECTED] wrote on 11/28/2005 10:04:38 AM: Yes, I think you are right... But I think it's kind of stupid that my webapplication is dependent on an external site to be up and running for my webapplication to work! Or is there a workaround that I don't know about? hi there, I got this same exception. What I did was remove the: !DOCTYPE tiles-definitions PUBLIC -//Apache Software Foundation//DTD Tiles Configuration//EN http://jakarta.apache.org/struts/dtds/tiles-config.dtd; from the top of tiles.xml and that got rid of the error.. BTJ Geeta
Re: [Shale] Using standalone tiles?
On 11/28/05, Bjørn T Johansen [EMAIL PROTECTED] wrote: Yes, I think you are right... But I think it's kind of stupid that my webapplication is dependent on an external site to be up and running for my webapplication to work! It shouldn't be... provided you give it the right public identifier. For Stand-alone Tiles, use either: !DOCTYPE tiles-definitions PUBLIC -//Apache Software Foundation//DTD Tiles Configuration 1.1//EN http://struts.apache.org/dtds/tiles-config_1_1.dtd; or !DOCTYPE tiles-definitions PUBLIC -//Apache Software Foundation//DTD Tiles Configuration 1.2//EN http://struts.apache.org/dtds/tiles-config_1_2.dtd; Those public identifiers (the part that starts with --/Apache...) are registered to copies of the DTD inside the tiles-core.jar file, you can see them in there under /org/apache/tiles/resources. -- Wendy - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [Shale] Using standalone tiles?
Well, that's the one I am using and it is not working when the apache site is down! BTJ Wendy Smoak wrote: On 11/28/05, Bjørn T Johansen [EMAIL PROTECTED] wrote: Yes, I think you are right... But I think it's kind of stupid that my webapplication is dependent on an external site to be up and running for my webapplication to work! It shouldn't be... provided you give it the right public identifier. For Stand-alone Tiles, use either: !DOCTYPE tiles-definitions PUBLIC -//Apache Software Foundation//DTD Tiles Configuration 1.1//EN http://struts.apache.org/dtds/tiles-config_1_1.dtd; or !DOCTYPE tiles-definitions PUBLIC -//Apache Software Foundation//DTD Tiles Configuration 1.2//EN http://struts.apache.org/dtds/tiles-config_1_2.dtd; Those public identifiers (the part that starts with --/Apache...) are registered to copies of the DTD inside the tiles-core.jar file, you can see them in there under /org/apache/tiles/resources. -- Wendy - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [Shale] Using standalone tiles?
Wendy Smoak [EMAIL PROTECTED] wrote on 11/28/2005 10:55:29 AM: Those public identifiers (the part that starts with --/Apache...) are registered to copies of the DTD inside the tiles-core.jar file, you can see them in there under /org/apache/tiles/resources. Wendy, I remember you saying this was so a while back (and a few times since!) and so i rechecked my tiles-cores.jar and found (in tiles-core.tld within META-INF) the following: urihttp://jakarta.apache.org/tiles/uri I had thought this was what my !DOCTYPE tiles-definitions should point to..? (-so i did think it funny that my solution of removing that top bit worked!) After your current message I checked within my resources as you have suggested and did find what you have below.. But I'm wondering why the META-INF has a different notation..? -- Wendy Many thanks for your time, Geeta
Re: [Shale] Using standalone tiles?
Actually I changed my !DOCTYPE defintion to what is in my /org/apache/tiles/resources as Wendy states below and now it does work.. Maybe you can recheck and make sure your dtd says exactly what you think it does..? Geeta Bjørn T Johansen [EMAIL PROTECTED] wrote on 11/28/2005 11:03:23 AM: Well, that's the one I am using and it is not working when the apache site is down! BTJ
Re: [Shale] Using standalone tiles?
On Nov 28, 2005, at 10:08 AM, [EMAIL PROTECTED] wrote: Those public identifiers (the part that starts with --/Apache...) are registered to copies of the DTD inside the tiles-core.jar file, you can see them in there under /org/apache/tiles/resources. Wendy, I remember you saying this was so a while back (and a few times since!) and so i rechecked my tiles-cores.jar and found (in tiles- core.tld within META-INF) the following: urihttp://jakarta.apache.org/tiles/uri We changed the location of the DTDs a while back. I wonder if the change did not happen in the standalone TIles repo. I'll check on it. Greg - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [Shale] Using standalone tiles?
Now it works, because the site is up again BTJ [EMAIL PROTECTED] wrote: Actually I changed my !DOCTYPE defintion to what is in my /org/apache/tiles/resources as Wendy states below and now it does work.. Maybe you can recheck and make sure your dtd says exactly what you think it does..? Geeta Bjørn T Johansen [EMAIL PROTECTED] wrote on 11/28/2005 11:03:23 AM: Well, that's the one I am using and it is not working when the apache site is down! BTJ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [Shale] Using standalone tiles?
Greg Reddin [EMAIL PROTECTED] wrote on 11/28/2005 11:15:29 AM: On Nov 28, 2005, at 10:08 AM, [EMAIL PROTECTED] wrote: Those public identifiers (the part that starts with --/Apache...) are registered to copies of the DTD inside the tiles-core.jar file, you can see them in there under /org/apache/tiles/resources. Wendy, I remember you saying this was so a while back (and a few times since!) and so i rechecked my tiles-cores.jar and found (in tiles- core.tld within META-INF) the following: urihttp://jakarta.apache.org/tiles/uri We changed the location of the DTDs a while back. I wonder if the change did not happen in the standalone TIles repo. I'll check on it. I never fail to be amazed with this list's responsiveness! Thanks :) Greg Geeta
Re: [Shale] Using standalone tiles?
On 11/28/05, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Wendy, I remember you saying this was so a while back (and a few times since!) and so i rechecked my tiles-cores.jar and found (in tiles-core.tld within META-INF) the following: urihttp://jakarta.apache.org/tiles/uri I had thought this was what my !DOCTYPE tiles-definitions should point to..? (-so i did think it funny that my solution of removing that top bit worked!) After your current message I checked within my resources as you have suggested and did find what you have below.. But I'm wondering why the META-INF has a different notation..? Hmmm... maybe we should wait for Greg to sort this all out. :) It should _not_ be going out to retrieve the dtd, that much I know. -- Wendy - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [Shale] Using standalone tiles?
On Nov 28, 2005, at 10:22 AM, Wendy Smoak wrote: Hmmm... maybe we should wait for Greg to sort this all out. :) It should _not_ be going out to retrieve the dtd, that much I know. Ok, here's what's happening. The DigesterDefinitionsReader class is the class that reads Tiles defs using Digester in Standalone Tiles. In part, it contains the following code: protected String registrations[] = { -//Apache Software Foundation//DTD Tiles Configuration 1.1// EN, /org/apache/tiles/resources/tiles-config_1_1.dtd, -//Apache Software Foundation//DTD Tiles Configuration 1.2// EN, /org/apache/tiles/resources/tiles-config_1_2.dtd, }; ... public DigesterDefinitionsReader() { digester = new Digester(); digester.setValidating(validating); digester.setNamespaceAware(true); digester.setUseContextClassLoader(true); // Register our local copy of the DTDs that we can find for (int i = 0; i registrations.length; i += 2) { URL url = this.getClass().getClassLoader().getResource( registrations[i+1]); if (url != null) { digester.register(registrations[i], url.toString()); } } } The registrations array definition creates a set of Strings to pass to digester. The constructor then gets the Resource for each registration string and calls the Digester register() method to point to the DTD in the JAR instead of on the web. The problem is that the ClassLoader cannot resolve the URL if it begins with /. So if I change this: protected String registrations[] = { -//Apache Software Foundation//DTD Tiles Configuration 1.1// EN, /org/apache/tiles/resources/tiles-config_1_1.dtd, -//Apache Software Foundation//DTD Tiles Configuration 1.2// EN, /org/apache/tiles/resources/tiles-config_1_2.dtd, }; to this: protected String registrations[] = { -//Apache Software Foundation//DTD Tiles Configuration 1.1// EN, org/apache/tiles/resources/tiles-config_1_1.dtd, -//Apache Software Foundation//DTD Tiles Configuration 1.2// EN, org/apache/tiles/resources/tiles-config_1_2.dtd, }; it works. I can completely disconnect from any network and still resolve the DTDs. Interestingly, the problem seems to only occur when running with a JAR. If I run the original code against an exploded directory instead of a JAR it works fine. But if I JAR the code up I have to remove the leading / or the URL won't resolve. Any idea why that is? Greg - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [Shale] Using standalone tiles?
On Nov 28, 2005, at 1:11 PM, Greg Reddin wrote: public DigesterDefinitionsReader() { digester = new Digester(); digester.setValidating(validating); digester.setNamespaceAware(true); digester.setUseContextClassLoader(true); // Register our local copy of the DTDs that we can find for (int i = 0; i registrations.length; i += 2) { URL url = this.getClass().getClassLoader().getResource( registrations[i+1]); if (url != null) { digester.register(registrations[i], url.toString()); } } } The problem is that the ClassLoader cannot resolve the URL if it begins with /. BTW, the Struts version of Tiles does something similar. I remember seeing something a while back about Apache complaining about too many requests to the website for the Tiles DTD. The struts-tiles digester parser class has the following: digester = new Digester(); digester.setValidating(validating); digester.setNamespaceAware(true); digester.setUseContextClassLoader(true); // Register our local copy of the DTDs that we can find for (int i = 0; i registrations.length; i += 2) { URL url = this.getClass().getResource(registrations[i+1]); if (url != null) { digester.register(registrations[i], url.toString()); } No error is logged if url is null. It just doesn't register it and gets the DTD from the web instead. Could it be that we are always getting it from the web b/c Tiles never resolves the URL in a web application? Greg - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [Shale] Using standalone tiles?
On 11/28/05, Greg Reddin [EMAIL PROTECTED] wrote: protected String registrations[] = { -//Apache Software Foundation//DTD Tiles Configuration 1.1// EN, /org/apache/tiles/resources/tiles-config_1_1.dtd, -//Apache Software Foundation//DTD Tiles Configuration 1.2// EN, /org/apache/tiles/resources/tiles-config_1_2.dtd, }; Hmm ... Shale uses exactly this style for its own config resources, including the leading slash on the URLs, and it seems to work fine when I disconnect from the Internet. I suspect there might be version specific issues with URL resolution between JVMs in this area. If taking away the leading slash leaves it still working in both jar'd and unjar'd formats, I'd say go for it. Craig
Re: [Shale] Using standalone tiles?
On Nov 28, 2005, at 1:57 PM, Craig McClanahan wrote: On 11/28/05, Greg Reddin [EMAIL PROTECTED] wrote: protected String registrations[] = { -//Apache Software Foundation//DTD Tiles Configuration 1.1// EN, /org/apache/tiles/resources/tiles-config_1_1.dtd, -//Apache Software Foundation//DTD Tiles Configuration 1.2// EN, /org/apache/tiles/resources/tiles-config_1_2.dtd, }; Hmm ... Shale uses exactly this style for its own config resources, including the leading slash on the URLs, and it seems to work fine when I disconnect from the Internet. I suspect there might be version specific issues with URL resolution between JVMs in this area. I think the issue is this: Standalone Tiles uses the ClassLoader directly, while Struts-Tiles goes through the Class (which delegates to the ClassLoader according to the Javadoc). Compare Standalone Tiles: URL url = this.getClass().getClassLoader().getResource( to Struts-Tiles: URL url = this.getClass().getResource( The effect is that if you use the ClassLoader you cannot have a leading / on the name. Now I'm not sure which is more correct... Greg - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [Shale] Using standalone tiles?
On my first post to this thread I mentioned that I am having a *similar* exception, which I have related to the down time of ASF website. The similarity is, if I understand it correctly, my long list of exceptions are coming from both tiles and sql-maps dtd's. So if this issue turns out to be a bug, sqlmaps may have the same problem. Bahadir Greg Reddin wrote: On Nov 28, 2005, at 1:57 PM, Craig McClanahan wrote: On 11/28/05, Greg Reddin [EMAIL PROTECTED] wrote: protected String registrations[] = { -//Apache Software Foundation//DTD Tiles Configuration 1.1// EN, /org/apache/tiles/resources/tiles-config_1_1.dtd, -//Apache Software Foundation//DTD Tiles Configuration 1.2// EN, /org/apache/tiles/resources/tiles-config_1_2.dtd, }; Hmm ... Shale uses exactly this style for its own config resources, including the leading slash on the URLs, and it seems to work fine when I disconnect from the Internet. I suspect there might be version specific issues with URL resolution between JVMs in this area. I think the issue is this: Standalone Tiles uses the ClassLoader directly, while Struts-Tiles goes through the Class (which delegates to the ClassLoader according to the Javadoc). Compare Standalone Tiles: URL url = this.getClass().getClassLoader().getResource( to Struts-Tiles: URL url = this.getClass().getResource( The effect is that if you use the ClassLoader you cannot have a leading / on the name. Now I'm not sure which is more correct... Greg - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]