This is the bug from http://marc.theaimsgroup.com/?l=tomcat-dev&m=113264006531391&w=2 the user group can't contain a attachment,so I fire this bug to attach the patch.Bellow is the bug description I pasted here. >>>>>>>>>>>> Regarding this mail, http://marc.theaimsgroup.com/?l=tomcat-user&m=113035775420898&w=2 I have tested both tomcat admin app and MBean createJNDIRealm can't create a realm successfully with Tomcat5.5.12. I have checked some code and found a bug in creating an JNDIRealm. The signature of createJNDIRealm in MBeanFactory.java is not enough, it only has one parameter called parent, if we want to create an JNDIRealm through JMX, we need another three parameters, they are ConnectionURL,ConnectionName,ConnectionPassword.If we provide this information, the JNDIRealm can be initialized correctly,so you can set other attribute to the realm. Attachments are the patches for admin webapp and the MBeanFactory modification with tc5.5.x, I have tested it, and it can work now, Another improvement is I add createJAASRealm in MBeanFactory for tomcat source code didn't contain creating JAASRealm JMX API,so I add it, it can work too. The above problem I haven't fire a bug in bugzilla, if it's necessary, I can do it. Thanks. Terry Zhou
Created attachment 17011 [details] Modify CreateJNDIRealm signature of MBeanFactory and related admin webapp This patch also include the admin webapp patch and new improvement of CreateJAASRealm method.
build-main: [javac] Compiling 150 source files to C:\development\tomcat\tc5build\tc5.5.x\build\build\server\webapps\admin\WEB-IN F\classes [javac] C:\development\tomcat\tc5build\tc5.5.x\container\webapps\admin\WEB-INF\classes\org\apache\webapp\admin\realm \SaveJNDIRealmAction.java:173: cannot find symbol [javac] symbol : method getConnectionUserName() [javac] location: class org.apache.webapp.admin.realm.JNDIRealmForm [javac] values[2] = rform.getConnectionUserName(); [javac] ^ [javac] Note: Some input files use or override a deprecated API. [javac] Note: Recompile with -Xlint:deprecation for details. [javac] Note: Some input files use unchecked or unsafe operations. [javac] Note: Recompile with -Xlint:unchecked for details. [javac] 1 error BUILD FAILED C:\development\tomcat\tc5build\tc5.5.x\build\build.xml:799: The following error occurred while executing this line: C:\development\tomcat\tc5build\tc5.5.x\build\build.xml:384: The following error occurred while executing this line: C:\development\tomcat\tc5build\tc5.5.x\container\webapps\admin\build.xml:198: Compile failed; see the compiler error out
Created attachment 18781 [details] Revised patch. Sorry for the build error of this patch, I have revised it and attached a new patch. When I wanted to write unit test for this patch, I couldn't find any jmx related test cases, at the same time I failed to run testcases in container/tester directory, is there any instruction for that?
Many thanks for the patch. It has been applied to SVN and will be included in 5.5.21 onwards.