I have been working on this for a couple of days now. I think I am close, but still missing something basic. If you know how to set up a JDBCRealm, please look over my files and error logs and tell me where I have made my mistake.
Thanks in advance for your help. ___________________________________________________________________
I have several applications on this server and I want to start using JDBCRealm for authentication.
Of the several applications running on this server, I am only trying to apply a JDBCRealm to the /hd application initially. Once I get it working on one application, then I want to apply JDBCRealm to all of my apps.
I think my problem is related to this error message: "No Realm has been configured to authenticate against"
___________________________ From hd_log.2003-07-09.txt: ___________________________ 2003-07-09 11:39:25 WebappLoader[/hd]: Deploying class repositories to work directory /var/tomcat4/work/Standalone/localhost/hd 2003-07-09 11:39:25 WebappLoader[/hd]: Deploy class files /WEB-INF/classes to /var/tomcat4/webapps/hd/WEB-INF/classes 2003-07-09 11:39:25 WebappLoader[/hd]: Reloading checks are enabled for this Context 2003-07-09 11:39:25 ContextConfig[/hd]: No Realm has been configured to authenticate against 2003-07-09 11:39:25 ContextConfig[/hd]: Marking this application unavailable due to previous error(s) 2003-07-09 11:39:25 StandardManager[/hd]: Seeding random number generator class java.security.SecureRandom 2003-07-09 11:39:25 StandardManager[/hd]: Seeding of random number generator has been completed 2003-07-09 11:39:25 StandardContext[/hd]: Context startup failed due to previous errors
__________________ From catalina.out: __________________ Jul 9, 2003 11:39:20 AM org.apache.commons.modeler.Registry loadRegistry INFO: Loading registry information Jul 9, 2003 11:39:20 AM org.apache.commons.modeler.Registry getRegistry INFO: Creating new Registry instance Jul 9, 2003 11:39:21 AM org.apache.commons.modeler.Registry getServer INFO: Creating MBeanServer Jul 9, 2003 11:39:22 AM org.apache.coyote.http11.Http11Protocol init INFO: Initializing Coyote HTTP/1.1 on port 8080 Starting service Tomcat-Standalone Apache Tomcat/4.1 Jul 9, 2003 11:39:26 AM org.apache.coyote.http11.Http11Protocol start INFO: Starting Coyote HTTP/1.1 on port 8080 Jul 9, 2003 11:39:26 AM org.apache.jk.common.ChannelSocket init INFO: JK2: ajp13 listening on /127.0.0.1:8009 Jul 9, 2003 11:39:26 AM org.apache.jk.server.JkMain start INFO: Jk running ID=0 time=6/120 config=/var/tomcat4/conf/jk2.properties
__________________________________
From localhost_log.2003-07-09.txt:
__________________________________
2003-07-09 11:39:13 StandardHost[localhost]: Removing web application at context path
/sqledit
2003-07-09 11:39:13 StandardHost[localhost]: Removing web application at context path
/ai
2003-07-09 11:39:13 StandardHost[localhost]: Removing web application at context path
2003-07-09 11:39:13 StandardHost[localhost]: Removing web application at context path
/hd
2003-07-09 11:39:13 StandardHost[localhost]: ContainerBase.removeChild: stop:
LifecycleException: Container StandardContext[/hd] has not been started
at org.apache.catalina.core.StandardContext.stop(Unknown Source)
at org.apache.catalina.core.ContainerBase.removeChild(Unknown Source)
at org.apache.catalina.core.StandardHostDeployer.remove(Unknown Source)
at org.apache.catalina.core.StandardHost.remove(Unknown Source)
at org.apache.catalina.startup.HostConfig.undeployApps(Unknown Source)
at org.apache.catalina.startup.HostConfig.stop(Unknown Source)
at org.apache.catalina.startup.HostConfig.lifecycleEvent(Unknown Source)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(Unknown Source)
at org.apache.catalina.core.ContainerBase.stop(Unknown Source)
at org.apache.catalina.core.ContainerBase.stop(Unknown Source)
at org.apache.catalina.core.StandardService.stop(Unknown Source)
at org.apache.catalina.core.StandardServer.stop(Unknown Source)
at org.apache.catalina.startup.Catalina.start(Unknown Source)
at org.apache.catalina.startup.Catalina.execute(Unknown Source)
at org.apache.catalina.startup.Catalina.process(Unknown Source)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at org.apache.catalina.startup.Bootstrap.main(Unknown Source)2003-07-09 11:39:13 StandardHost[localhost]: Removing web application at context path /nsfs 2003-07-09 11:39:25 HostConfig[localhost]: Deploying web application directory ROOT 2003-07-09 11:39:25 StandardHost[localhost]: Installing web application at context path from URL file:/var/tomcat4/webapps/ROOT 2003-07-09 11:39:25 WebappLoader[]: Deploying class repositories to work directory /var/tomcat4/work/Standalone/localhost/_ 2003-07-09 11:39:26 StandardManager[]: Seeding random number generator class java.security.SecureRandom 2003-07-09 11:39:26 StandardManager[]: Seeding of random number generator has been completed 2003-07-09 11:39:26 StandardWrapper[:default]: Loading container servlet default 2003-07-09 11:39:26 default: init 2003-07-09 11:39:26 StandardWrapper[:invoker]: Loading container servlet invoker 2003-07-09 11:39:26 invoker: init 2003-07-09 11:39:26 jsp: init
_______________________________ Here is my /hd/WEB-INF/web.xml: _______________________________ <?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE web-app
PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
"http://java.sun.com/dtd/web-app_2_3.dtd"><web-app>
<security-constraint>
<web-resource-collection>
<web-resource-name>Protected Area</web-resource-name>
<!-- Define the context-relative URL(s) to be protected -->
<url-pattern>/*</url-pattern>
<!-- Only methods listed will be protected -->
<http-method>DELETE</http-method>
<http-method>GET</http-method>
<http-method>POST</http-method>
<http-method>PUT</http-method>
</web-resource-collection>
<auth-constraint>
<!-- Anyone with one of the listed roles may access this area -->
<role-name>tomcat</role-name>
</auth-constraint>
</security-constraint>
<login-config>
<auth-method>FORM</auth-method>
<realm-name>Form-Based Authentication Area</realm-name>
<form-login-config>
<form-login-page>/login.jsp</form-login-page>
<form-error-page>/login_error.jsp</form-error-page>
</form-login-config>
</login-config>
<security-role>
<description>
tomcat test role
</description>
<role-name>tomcat</role-name>
</security-role>
</web-app>_____________________________________________ Here is my $TOMCAT_HOME/conf/server.xml file: _____________________________________________ <Server port="8005" shutdown="SHUTDOWN" debug="0">
<Listener className="org.apache.catalina.mbeans.ServerLifecycleListener" debug="0"/> <Listener className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener" debug="0"/>
<!-- Define the Tomcat Stand-Alone Service --> <Service name="Tomcat-Standalone">
<!-- Define a non-SSL Coyote HTTP/1.1 Connector on port 8080 -->
<Connector className="org.apache.coyote.tomcat4.CoyoteConnector"
port="8080" minProcessors="5" maxProcessors="75"
enableLookups="true" redirectPort="8443"
acceptCount="100" debug="0" connectionTimeout="20000"
useURIValidationHack="false" disableUploadTimeout="true" />
<!-- Note: To disable connection timeouts, set connectionTimeout value to -1 --> <!-- Define a Coyote/JK2 AJP 1.3 Connector on port 8009 -->
<Connector className="org.apache.coyote.tomcat4.CoyoteConnector"
port="8009" minProcessors="5" maxProcessors="75"
enableLookups="true" redirectPort="8443"
acceptCount="10" debug="0" connectionTimeout="0"
useURIValidationHack="false"
protocolHandlerClassName="org.apache.jk.server.JkCoyoteHandler"/> <!-- Define the top level container in our container hierarchy -->
<Engine name="Standalone" defaultHost="localhost" debug="0"> <!-- Global logger unless overridden at lower levels -->
<Logger className="org.apache.catalina.logger.FileLogger"
prefix="catalina_log." suffix=".txt"
timestamp="true"/> Realm className="org.apache.catalina.realm.JDBCRealm"
connectionName="AI_DBA"
connectionPassword="SUKHOI"
connectionURL="jdbc:oracle:thin:@sukoi:1521:orcl"
driverName="oracle.jdbc.driver.OracleDriver"
userTable="REALM_USER"
userNameCol="LOGIN"
userCredCol="PASSWORD"
userRoleTable="REALM_ROLE"
roleNameCol="ROLE"
/> <!-- Define the default virtual host -->
<Host name="localhost" debug="0" appBase="webapps"
unpackWARs="true" autoDeploy="true"> <!-- Logger shared by all Contexts related to this virtual host. By
default (when using FileLogger), log files are created in the "logs"
directory relative to $CATALINA_HOME. If you wish, you can specify
a different directory with the "directory" attribute. Specify either a
relative (to $CATALINA_HOME) or absolute path to the desired
directory.-->
<Logger className="org.apache.catalina.logger.FileLogger"
directory="logs" prefix="localhost_log." suffix=".txt"
timestamp="true"/> <!-- NSFS Context -->
<Context path="/nsfs" docBase="nsfs" debug="0" reloadable="true"
crossContext="true">
<Logger className="org.apache.catalina.logger.FileLogger"
prefix="nsfs_log." suffix=".txt" timestamp="true"/>
</Context> <!-- HelpDesk Context -->
<Context path="/hd" docBase="hd" debug="0" reloadable="true"
crossContext="true">
<Logger className="org.apache.catalina.logger.FileLogger"
prefix="hd_log." suffix=".txt" timestamp="true"/>
</Context> <!-- SQLEdit Context -->
<Context path="/sqledit" docBase="sqledit" debug="0" reloadable="true"
crossContext="true">
<Logger className="org.apache.catalina.logger.FileLogger"
prefix="sqledit_log." suffix=".txt" timestamp="true"/>
</Context> <!-- ActionItems Context -->
<Context path="/ai" docBase="ai" debug="0" reloadable="true"
crossContext="true">
<Logger className="org.apache.catalina.logger.FileLogger"
prefix="ai_log." suffix=".txt" timestamp="true"/>
</Context></Host>
</Engine>
</Service>
</Server>
_____________________________________________________ Here is my /etc/httpd2/conf/workers2.properties file: _____________________________________________________ [logger] level=DEBUG
[config:] file=/etc/httpd2/conf/workers2.properties debug=0 debugEnv=0
[uriMap:] info=Maps the requests. Options: debug debug=0
# Alternate file logger [logger.file:0] level=DEBUG file=/var/log/httpd2/jk2.log
[shm:] info=Scoreboard. Required for reconfiguration and status with multiprocess servers file=/var/run/jk2.shm size=1000000 debug=0 disabled=0
[workerEnv:] info=Global server options timing=1 debug=0 # Default Native Logger (apache2 or win32 ) # can be overriden to a file logger, useful # when tracing win32 related issues #logger=logger.file:0
[lb:lb] info=Default load balancer. debug=0
[lb:lb_1] info=A second load balancer. debug=0
[channel.socket:localhost:8009] info=Ajp13 forwarding over socket debug=0 tomcatId=localhost:8009
[status:] info=Status worker, displays runtime informations
[vm:]
info=Parameters used to load a JVM in the server process
#JVM=C:\jdk\jre\bin\hotspot\jvm.dll
OPT=-Djava.class.path=${TOMCAT_HOME}/lib/tomcat-jni.jar;${TOMCAT_HOME}/server/lib/commons-logging.jar
OPT=-Dtomcat.home=${TOMCAT_HOME}
OPT=-Dcatalina.home=${TOMCAT_HOME}
OPT=-Xmx128M
#OPT=-Djava.compiler=NONE
disabled=1[uri:/jkstatus/*] info=Display status information and checks the config file for changes. group=status:
# --<< CONTEXTS >>
# # /nsfs # [uri:/nsfs] info=NSFS WBS Web Application context=/nsfs debug=0
[uri:/nsfs/servlet/*] info=Prefix mapping
[uri:/nsfs/*.jsp] info=Extension mapping
[uri:/nsfs/*] info=Map the whole webapp
# # /sqledit # [uri:/sqledit] info=SQL Web Application context=/sqledit debug=0
[uri:/sqledit/servlet/*] info=Prefix mapping
[uri:/sqledit/*.jsp] info=Extension mapping
[uri:/sqledit/*] info=Map the whole webapp
# # /ai # [uri:/ai] info=Action Item Web Application context=/ai debug=0
[uri:/ai/servlet/*] info=Prefix mapping
[uri:/ai/*.jsp] info=Extension mapping
[uri:/ai/*] info=Map the whole webapp
# # /hd # [uri:/hd] info=Help Desk Web Application context=/hd debug=0
[uri:/hd/servlet/*] info=Prefix mapping
[uri:/hd/*.jsp] info=Extension mapping
[uri:/hd/*] info=Map the whole webapp
-- ******************************************* * Rick Roberts * * Advanced Information Technologies, Inc. * *******************************************
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
