Patch for FileDirContext
New to contributing to Tomcat so and not sure of the protocol for patches. Details follow… I ran into an issue using starting Tomcat (7.0.29) from inside Eclipse with the "Serve modules without publishing" option enabled for a project that uses CDI (Weld 1.1.8). Basically Weld would cause a StackOverflow on startup because it's TomcatListener class would end up recursively trying to locate app class files using a NamingContext received from Tomcat. I traced the problem to what I believe to be an issue in org.apache.naming.resources.FileDirContext. It seems it is creating a child directory object (FileDirContext) with the wrong path; it's using the current directory's path instead of the child directory's path. I edited FileDirContext.java, it was a one line change, and it has fixed my issues with starting Tomcat in my environment. My build seems to pass the unit tests ran from "ant test" properly as well. So I made a patch and attached it to this email. Let me know if I should submit the patch in some other manner. Kevin Wooten - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
Re: Patch for FileDirContext
I see now you don't seem to be able to attach patch files on this mailing list. The patch is so small… here it is… Index: java/org/apache/naming/resources/FileDirContext.java === --- java/org/apache/naming/resources/FileDirContext.java(revision 1378768) +++ java/org/apache/naming/resources/FileDirContext.java(working copy) @@ -872,7 +872,7 @@ Object object = null; if (currentFile.isDirectory()) { FileDirContext tempContext = new FileDirContext(env); -tempContext.setDocBase(file.getPath()); +tempContext.setDocBase(currentFile.getPath()); tempContext.setAllowLinking(getAllowLinking()); object = tempContext; } else { On Aug 29, 2012, at 8:27 PM, Kevin Wooten wrote: > New to contributing to Tomcat so and not sure of the protocol for patches. > Details follow… > > I ran into an issue using starting Tomcat (7.0.29) from inside Eclipse with > the "Serve modules without publishing" option enabled for a project that uses > CDI (Weld 1.1.8). > > Basically Weld would cause a StackOverflow on startup because it's > TomcatListener class would end up recursively trying to locate app class > files using a NamingContext received from Tomcat. > > I traced the problem to what I believe to be an issue in > org.apache.naming.resources.FileDirContext. It seems it is creating a child > directory object (FileDirContext) with the wrong path; it's using the current > directory's path instead of the child directory's path. > > I edited FileDirContext.java, it was a one line change, and it has fixed my > issues with starting Tomcat in my environment. My build seems to pass the > unit tests ran from "ant test" properly as well. So I made a patch and > attached it to this email. > > Let me know if I should submit the patch in some other manner. > > Kevin Wooten > > > > - > To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org > For additional commands, e-mail: dev-h...@tomcat.apache.org - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
Re: Patch for FileDirContext
I created Bug 53800 and attached the patch file. Is that all that is necessary to get this patch considered? On Aug 29, 2012, at 8:43 PM, Konstantin Kolinko wrote: > 2012/8/30 Kevin Wooten : >> New to contributing to Tomcat so and not sure of the protocol for patches. >> Details follow… >> >> I ran into an issue using starting Tomcat (7.0.29) from inside Eclipse with >> the "Serve modules without publishing" option enabled for a project that >> uses CDI (Weld 1.1.8). >> >> Basically Weld would cause a StackOverflow on startup because it's >> TomcatListener class would end up recursively trying to locate app class >> files using a NamingContext received from Tomcat. >> >> I traced the problem to what I believe to be an issue in >> org.apache.naming.resources.FileDirContext. It seems it is creating a child >> directory object (FileDirContext) with the wrong path; it's using the >> current directory's path instead of the child directory's path. >> >> I edited FileDirContext.java, it was a one line change, and it has fixed my >> issues with starting Tomcat in my environment. My build seems to pass the >> unit tests ran from "ant test" properly as well. So I made a patch and >> attached it to this email. >> >> Let me know if I should submit the patch in some other manner. >> > > Can you please open an issue in Bugzilla? > So it would be better to keep track of things. > > The patch looks good. > > Best regards, > Konstantin Kolinko > > - > To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org > For additional commands, e-mail: dev-h...@tomcat.apache.org >