Bug 37588 - Creating JNDIRealm through JMX is not correct.
Creating JNDIRealm through JMX is not correct.
Status: RESOLVED FIXED
Product: Tomcat 5
Classification: Unclassified
Component: Catalina
5.5.12
Other other
: P2 major (vote)
: ---
Assigned To: Tomcat Developers Mailing List
:
Depends on:
Blocks:
  Show dependency tree
 
Reported: 2005-11-22 07:55 UTC by TerryZhou
Modified: 2006-11-08 20:15 UTC (History)
0 users



Attachments
Modify CreateJNDIRealm signature of MBeanFactory and related admin webapp (5.69 KB, patch)
2005-11-22 07:57 UTC, TerryZhou
Details | Diff
Revised patch. (5.81 KB, patch)
2006-09-01 05:27 UTC, TerryZhou
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description TerryZhou 2005-11-22 07:55:03 UTC
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
Comment 1 TerryZhou 2005-11-22 07:57:21 UTC
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.
Comment 2 Filip Hanik 2006-08-31 13:29:30 UTC
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
Comment 3 TerryZhou 2006-09-01 05:27:40 UTC
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?
Comment 4 Mark Thomas 2006-11-08 20:15:03 UTC
Many thanks for the patch. It has been applied to SVN and will be included in
5.5.21 onwards.