aspose file tools*
The moose likes JDBC and the fly likes JDBCRealm Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC
Bookmark "JDBCRealm" Watch "JDBCRealm" New topic
Author

JDBCRealm

Varun Nayudu
Ranch Hand

Joined: Jun 26, 2006
Posts: 157
i am trying to authorize my webapp to access the database to see if the user is authorized or no.I have created 'users'(user_name,user_pass) and 'user_roles'(user_roles,role_name) table in the Mysql database named 'login'.

i have also made changes in the server.xml and used the jdbcrealm ..which is as follows.
-----------------------------------------------------------------------------------------------------------------------------------------------------
<Realm className="org.apache.catalina.realm.JDBCRealm" debug="99"
driverName="com.mysql.jdbc.Driver"
connectionURL="jdbc:mysql://localhost:3306/login"
connectionName="root" connectionPassword="root"
userTable="users" userNameCol="user_name" userCredCol="user_pass"
userRoleTable="user_roles" roleNameCol="role_name" />
-----------------------------------------------------------------------------------------------------------------------------------------------------
here 'root' is the username and password of my database (named 'login').

i am using netbeans to run my application .In this when i run my application i get a dialog box 'Tomcat Manager Application' promptiing me to enter username and password.

when i enter the username and password that i have saved in the database i get a error in tomcat which is as follows.
-----------------------------------------------------------------------------------------------------------------------------------------------------
Deployment error:
Access to Tomcat server has not been authorized. Set the correct username and password with the "manager" role in the Tomcat customizer in the Server Manager.
See the server log for details.
at org.netbeans.modules.j2ee.deployment.devmodules.api.Deployment.deploy(Deployment.java:198)
at org.netbeans.modules.j2ee.ant.Deploy.execute(Deploy.java:103)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:288)
at sun.reflect.GeneratedMethodAccessor142.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
at org.apache.tools.ant.Task.perform(Task.java:348)
at org.apache.tools.ant.Target.execute(Target.java:357)
at org.apache.tools.ant.Target.performTasks(Target.java:385)
at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1337)
at org.apache.tools.ant.Project.executeTarget(Project.java:1306)
at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
at org.apache.tools.ant.Project.executeTargets(Project.java:1189)
at org.apache.tools.ant.module.bridge.impl.BridgeImpl.run(BridgeImpl.java:273)
at org.apache.tools.ant.module.run.TargetExecutor.run(TargetExecutor.java:499)
at org.netbeans.core.execution.RunClassThread.run(RunClassThread.java:151)
Caused by: java.lang.IllegalStateException: Access to Tomcat server has not been authorized. Set the correct username and password with the "manager" role in the Tomcat customizer in the Server Manager.
at org.netbeans.modules.tomcat5.TomcatManagerImpl.list(TomcatManagerImpl.java:389)
at org.netbeans.modules.tomcat5.TomcatManager.modules(TomcatManager.java:622)
at org.netbeans.modules.tomcat5.TomcatManager.getAvailableModules(TomcatManager.java:433)
at org.netbeans.modules.j2ee.deployment.impl.TargetServer.getAvailableTMIDsMap(TargetServer.java:392)
at org.netbeans.modules.j2ee.deployment.impl.TargetServer.checkUndeployForSharedReferences(TargetServer.java:348)
at org.netbeans.modules.j2ee.deployment.impl.TargetServer.checkUndeployForSharedReferences(TargetServer.java:297)
at org.netbeans.modules.j2ee.deployment.impl.TargetServer.checkUndeployForSharedReferences(TargetServer.java:294)
at org.netbeans.modules.j2ee.deployment.impl.TargetServer.processLastTargetModules(TargetServer.java:416)
at org.netbeans.modules.j2ee.deployment.impl.TargetServer.init(TargetServer.java:162)
at org.netbeans.modules.j2ee.deployment.impl.TargetServer.deploy(TargetServer.java:540)
at org.netbeans.modules.j2ee.deployment.devmodules.api.Deployment.deploy(Deployment.java:163)
... 16 more
Caused by: org.netbeans.modules.tomcat5.AuthorizationException
at org.netbeans.modules.tomcat5.TomcatManagerImpl.list(TomcatManagerImpl.java:390)
... 26 more
BUILD FAILED (total time: 2 minutes 9 seconds)
-----------------------------------------------------------------------------------------------------------------------------------------------------

but when i check the log i see this.
-----------------------------------------------------------------------------------------------------------------------------------------------------
2009-01-15 09:47:52 JDBCRealm[Catalina]: Username varun successfully authenticated
-----------------------------------------------------------------------------------------------------------------------------------------------------
what does this mean

and please tell me what is going wrong.





SCJP 1.5, SCWCD 1.5
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41509
    
  53
Does the user account you're using have the "manager" role?


Ping & DNS - my free Android networking tools app
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: JDBCRealm