Return-Path: Delivered-To: apmail-jakarta-tomcat-user-archive@jakarta.apache.org Received: (qmail 49906 invoked by uid 500); 29 Aug 2001 21:51:23 -0000 Mailing-List: contact tomcat-user-help@jakarta.apache.org; run by ezmlm Precedence: bulk Reply-To: tomcat-user@jakarta.apache.org list-help: list-unsubscribe: list-post: Delivered-To: mailing list tomcat-user@jakarta.apache.org Received: (qmail 49890 invoked from network); 29 Aug 2001 21:51:22 -0000 Received: from tomts6.bellnexxia.net (HELO tomts6-srv.bellnexxia.net) (209.226.175.26) by daedalus.apache.org with SMTP; 29 Aug 2001 21:51:22 -0000 Received: from sympatico.ca ([64.231.78.150]) by tomts6-srv.bellnexxia.net (InterMail vM.4.01.03.16 201-229-121-116-20010115) with ESMTP id <20010829215057.YYVT3759.tomts6-srv.bellnexxia.net@sympatico.ca> for ; Wed, 29 Aug 2001 17:50:57 -0400 Message-ID: <3B8D63DC.DDD3AB0C@sympatico.ca> Date: Wed, 29 Aug 2001 17:51:25 -0400 From: Raimee X-Mailer: Mozilla 4.76 [en] (Windows NT 5.0; U) X-Accept-Language: en MIME-Version: 1.0 To: tomcat-user@jakarta.apache.org Subject: Re: JDBCRealm with Catalina + Apache References: Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N I have modified the application web.xml as suggested but still no success. I have also tried replacing the jdbc realm with a memory realm but that yields the same results. The Entire Web Application /* GET POST admin BASIC cntx1 Realm the suggested admin Christoph Rooms wrote: > Hi, > > Try to change this in your web.xml : > > > > cntx1 WEB.XML RESOURCE NAME > /* > --> GET > --> POST > > > admin > > ... > > --> admin > > -----Original Message----- > From: Raimee [mailto:raimee@sympatico.ca] > Sent: woensdag 29 augustus 2001 22:20 > To: tomcat-user@jakarta.apache.org > Subject: JDBCRealm with Catalina + Apache > > I am having trouble setting up the following > > JDBCRealm with Tomcat-4.0-b7 and Apache 1.3 on Windows 2000. I have not > defined a Stand-Alone service, I am > only interested in the Apache Connector. > > The problem: the logon credentials are not being accepted even though > they are correct. > (I am using the suggested database configuration - table names,columns > etc... and I am able to establish > connections and perform queries outside of Tomcat. Tomcat is also able > to make the connection and appropriate queries, > although the prepared statement issued to retrieve the password is > missing the userName info - ie.still ? ) > > I have also seen a problem releasing db connections when running the > shutdown script - see below. > > server.xml > ======= > > > > className="org.apache.catalina.connector.warp.WarpConnector" > port="8008" minProcessors="5" maxProcessors="75" > enableLookups="true" > acceptCount="10" debug="0"/> > > name="Apache" defaultHost="elderlyone" debug="0" appBase="webapps"> > > > driverName="COM.ibm.db2.jdbc.app.DB2Driver" > connectionURL="jdbc:db2:WEBAPPDB" > userTable="users" userNameCol="user_name" > userCredCol="user_pass" > userRoleTable="user_roles" roleNameCol="role_name" /> > > > prefix="catalina_log." suffix=".txt" > timestamp="true"/> > > unpackWARs="true"> > className="org.apache.catalina.valves.RequestDumperValve"/> > className="org.apache.catalina.authenticator.SingleSignOn" > debug="0"/> > directory="logs" prefix="elderlyone_access_log." > suffix=".txt" > pattern="common"/> > directory="logs" prefix="elderlyone_cmn_context_log." > suffix=".txt" > timestamp="true"/> > > > reloadable="true"> > className="org.apache.catalina.valves.RequestDumperValve"/> > prefix="context_cntx1_log." suffix=".txt" > timestamp="true"/> > > > > > > > My apache httpd.conf: > =============== > WebAppConnection conn warp elderlyone:8008 > WebAppDeploy cntx1 conn /cntx1 > > cntx1 web.xml > ======== > > > PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" > "http://java.sun.com/dtd/web-app_2_3.dtd"> > > > > > > > cntx1 WEB.XML RESOURCE NAME > > /* > > > admin > > > > > > BASIC > cntx1 REALM > > > > > ---------------------------------------------------------------------- > log output: > context_wtc_log.txt > ============= > 2001-08-29 15:55:42 WebappLoader[/wtc]: Deploying class repositories to > work directory G:\Tomcat\jakarta-tomcat-4.0-b7\work\elderlyone\wtc > 2001-08-29 15:55:42 WebappLoader[/wtc]: Reloading checks are enabled for > this Context > 2001-08-29 15:55:42 StandardManager[/wtc]: Seeding random number > generator class java.security.SecureRandom > 2001-08-29 15:55:42 StandardManager[/wtc]: Seeding of random number > generator has been completed > 2001-08-29 15:55:42 ContextConfig[/wtc]: Configured an authenticator for > method BASIC > 2001-08-29 15:55:42 StandardWrapper[/wtc:default]: Loading container > servlet default > 2001-08-29 15:55:42 default: init > 2001-08-29 15:55:42 StandardWrapper[/wtc:invoker]: Loading container > servlet invoker > 2001-08-29 15:55:42 invoker: init > 2001-08-29 15:55:42 StandardWrapper[/wtc:jsp]: Using Jasper classloader > for servlet jsp > 2001-08-29 15:55:42 jsp: init > 2001-08-29 15:55:43 StandardWrapper[/wtc:ssi]: Loading container servlet > ssi > 2001-08-29 15:55:43 ssi: init > 2001-08-29 15:55:43 StandardWrapper[/wtc:cgi]: Loading container servlet > cgi > 2001-08-29 15:55:43 cgi: init > 2001-08-29 15:55:43 cgi: init: loglevel set to 6 > 2001-08-29 15:56:20 RequestDumperValve[/wtc]: REQUEST URI =/wtc/ > 2001-08-29 15:56:20 RequestDumperValve[/wtc]: authType=null > 2001-08-29 15:56:20 RequestDumperValve[/wtc]: characterEncoding=null > 2001-08-29 15:56:20 RequestDumperValve[/wtc]: contentLength=-1 > 2001-08-29 15:56:20 RequestDumperValve[/wtc]: contentType=null > 2001-08-29 15:56:20 RequestDumperValve[/wtc]: contextPath=/wtc > 2001-08-29 15:56:20 RequestDumperValve[/wtc]: > header=accept-language=en > 2001-08-29 15:56:20 RequestDumperValve[/wtc]: > header=connection=Keep-Alive > 2001-08-29 15:56:20 RequestDumperValve[/wtc]: > header=accept=image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, > image/png, */* > 2001-08-29 15:56:20 RequestDumperValve[/wtc]: > header=host=elderlyone > 2001-08-29 15:56:20 RequestDumperValve[/wtc]: > header=accept-charset=iso-8859-1,*,utf-8 > 2001-08-29 15:56:20 RequestDumperValve[/wtc]: > header=accept-encoding=gzip > 2001-08-29 15:56:20 RequestDumperValve[/wtc]: > header=user-agent=Mozilla/4.76 [en] (Windows NT 5.0; U) > 2001-08-29 15:56:20 RequestDumperValve[/wtc]: locale=en > 2001-08-29 15:56:20 RequestDumperValve[/wtc]: method=GET > 2001-08-29 15:56:20 RequestDumperValve[/wtc]: pathInfo=null > 2001-08-29 15:56:20 RequestDumperValve[/wtc]: > protocol=HTTP/1.0 > 2001-08-29 15:56:20 RequestDumperValve[/wtc]: queryString=null > 2001-08-29 15:56:20 RequestDumperValve[/wtc]: > remoteAddr=64.231.78.150 > 2001-08-29 15:56:20 RequestDumperValve[/wtc]: > remoteHost=64.231.78.150 > 2001-08-29 15:56:20 RequestDumperValve[/wtc]: remoteUser=null > 2001-08-29 15:56:20 RequestDumperValve[/wtc]: requestedSessionId=null > 2001-08-29 15:56:20 RequestDumperValve[/wtc]: scheme=http > 2001-08-29 15:56:20 RequestDumperValve[/wtc]: > serverName=elderlyone > 2001-08-29 15:56:20 RequestDumperValve[/wtc]: serverPort=80 > 2001-08-29 15:56:20 RequestDumperValve[/wtc]: servletPath=null > 2001-08-29 15:56:20 RequestDumperValve[/wtc]: isSecure=false > 2001-08-29 15:56:20 RequestDumperValve[/wtc]: > --------------------------------------------------------------- > 2001-08-29 15:56:20 RequestDumperValve[/wtc]: > --------------------------------------------------------------- > 2001-08-29 15:56:20 RequestDumperValve[/wtc]: authType=null > 2001-08-29 15:56:20 RequestDumperValve[/wtc]: contentLength=-1 > 2001-08-29 15:56:20 RequestDumperValve[/wtc]: contentType=null > 2001-08-29 15:56:20 RequestDumperValve[/wtc]: > header=WWW-Authenticate=Basic realm="WTC WEB.XML REALM NAME" > 2001-08-29 15:56:20 RequestDumperValve[/wtc]: > message=Unauthorized > 2001-08-29 15:56:20 RequestDumperValve[/wtc]: remoteUser=null > 2001-08-29 15:56:20 RequestDumperValve[/wtc]: status=401 > 2001-08-29 15:56:20 RequestDumperValve[/wtc]: > =============================================================== > 2001-08-29 15:56:23 RequestDumperValve[/wtc]: REQUEST URI =/wtc/ > 2001-08-29 15:56:23 RequestDumperValve[/wtc]: authType=null > 2001-08-29 15:56:23 RequestDumperValve[/wtc]: characterEncoding=null > 2001-08-29 15:56:23 RequestDumperValve[/wtc]: contentLength=-1 > 2001-08-29 15:56:23 RequestDumperValve[/wtc]: contentType=null > 2001-08-29 15:56:23 RequestDumperValve[/wtc]: contextPath=/wtc > 2001-08-29 15:56:23 RequestDumperValve[/wtc]: > header=accept-language=en > 2001-08-29 15:56:23 RequestDumperValve[/wtc]: > header=connection=Keep-Alive > 2001-08-29 15:56:23 RequestDumperValve[/wtc]: > header=accept=image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, > image/png, */* > 2001-08-29 15:56:23 RequestDumperValve[/wtc]: > header=authorization=Basic cmFpbWVlOnJhaW1lZQ== > 2001-08-29 15:56:23 RequestDumperValve[/wtc]: > header=host=elderlyone > 2001-08-29 15:56:23 RequestDumperValve[/wtc]: > header=accept-charset=iso-8859-1,*,utf-8 > 2001-08-29 15:56:23 RequestDumperValve[/wtc]: > header=accept-encoding=gzip > 2001-08-29 15:56:23 RequestDumperValve[/wtc]: > header=user-agent=Mozilla/4.76 [en] (Windows NT 5.0; U) > 2001-08-29 15:56:23 RequestDumperValve[/wtc]: locale=en > 2001-08-29 15:56:23 RequestDumperValve[/wtc]: method=GET > 2001-08-29 15:56:23 RequestDumperValve[/wtc]: pathInfo=null > 2001-08-29 15:56:23 RequestDumperValve[/wtc]: > protocol=HTTP/1.0 > 2001-08-29 15:56:23 RequestDumperValve[/wtc]: queryString=null > 2001-08-29 15:56:23 RequestDumperValve[/wtc]: > remoteAddr=64.231.78.150 > 2001-08-29 15:56:23 RequestDumperValve[/wtc]: > remoteHost=64.231.78.150 > 2001-08-29 15:56:23 RequestDumperValve[/wtc]: remoteUser=null > 2001-08-29 15:56:23 RequestDumperValve[/wtc]: requestedSessionId=null > 2001-08-29 15:56:23 RequestDumperValve[/wtc]: scheme=http > 2001-08-29 15:56:23 RequestDumperValve[/wtc]: > serverName=elderlyone > 2001-08-29 15:56:23 RequestDumperValve[/wtc]: serverPort=80 > 2001-08-29 15:56:23 RequestDumperValve[/wtc]: servletPath=null > 2001-08-29 15:56:23 RequestDumperValve[/wtc]: isSecure=false > 2001-08-29 15:56:23 RequestDumperValve[/wtc]: > --------------------------------------------------------------- > 2001-08-29 15:56:23 RequestDumperValve[/wtc]: > --------------------------------------------------------------- > 2001-08-29 15:56:23 RequestDumperValve[/wtc]: authType=null > 2001-08-29 15:56:23 RequestDumperValve[/wtc]: contentLength=-1 > 2001-08-29 15:56:23 RequestDumperValve[/wtc]: contentType=null > 2001-08-29 15:56:23 RequestDumperValve[/wtc]: > header=WWW-Authenticate=Basic realm="WTC WEB.XML REALM NAME" > 2001-08-29 15:56:23 RequestDumperValve[/wtc]: > message=Unauthorized > 2001-08-29 15:56:23 RequestDumperValve[/wtc]: remoteUser=null > 2001-08-29 15:56:23 RequestDumperValve[/wtc]: status=401 > 2001-08-29 15:56:23 RequestDumperValve[/wtc]: > =============================================================== > > -------------- > > The RequestDumperValve reveals that the remoteUser field is null both > during the first request for the restricted URL > and during the second request after I submitted the credentials through > the browser. > > Can the Apache Connector run without defing an http stand-alone > connector? > > There also appears to be a problem releasing database connections when > exiting Tomcat > using the shutdown.bat script: > > Here is the catalina_log.txt > 2001-08-29 16:08:59 [org.apache.catalina.connector.warp.WarpConnector] > Connection from elderlyone/64.231.78.150:3773 to > elderlyone/64.231.78.150:8008 > 2001-08-29 16:08:59 > [org.apache.catalina.connector.warp.WarpConfigurationHandler] Filter > mappings (0) > 2001-08-29 16:09:16 WarpEngine[Apache]: Mapping request > 2001-08-29 16:09:20 WarpEngine[Apache]: Mapping request > > reflect simple requests > > > > 2001-08-29 16:09:43 [org.apache.catalina.connector.warp.WarpConnection] > Exception on socket > java.io.IOException: Premature packet header end > at > org.apache.catalina.connector.warp.WarpConnection.recv(WarpConnection.java:2 > 36) > > at > org.apache.catalina.connector.warp.WarpRequestHandler.handle(WarpRequestHand > ler.java:110) > > at > org.apache.catalina.connector.warp.WarpConnection.run(WarpConnection.java:19 > 4) > > at java.lang.Thread.run(Thread.java:484) > > 2001-08-29 16:09:56 [org.apache.catalina.connector.warp.WarpConnector] > Error accepting requests > java.net.SocketException: socket closed > at java.net.PlainSocketImpl.socketAccept(Native Method) > at java.net.PlainSocketImpl.accept(PlainSocketImpl.java:421) > at java.net.ServerSocket.implAccept(ServerSocket.java:243) > at java.net.ServerSocket.accept(ServerSocket.java:222) > at > org.apache.catalina.connector.warp.WarpConnector.run(WarpConnector.java:554) > > at java.lang.Thread.run(Thread.java:484) > > > 2001-08-29 16:09:56 JDBCRealm[Apache]: Exception closing database > connection > COM.ibm.db2.jdbc.DB2Exception: [IBM][CLI Driver] CLI0116E Invalid > transaction state. SQLSTATE=25000 > at > COM.ibm.db2.jdbc.app.SQLExceptionGenerator.throw_SQLException(SQLExceptionGe > nerator.java:174) > > at > COM.ibm.db2.jdbc.app.SQLExceptionGenerator.check_return_code(SQLExceptionGen > erator.java:419) > > at COM.ibm.db2.jdbc.app.DB2Connection.close2(DB2Connection.java:694) > at COM.ibm.db2.jdbc.app.DB2Connection.close(DB2Connection.java:667) > at org.apache.catalina.realm.JDBCRealm.close(JDBCRealm.java:439) > at org.apache.catalina.realm.JDBCRealm.stop(JDBCRealm.java:633) > at org.apache.catalina.core.ContainerBase.stop(ContainerBase.java:1178) > > at > org.apache.catalina.core.StandardService.stop(StandardService.java:415) > at > org.apache.catalina.core.StandardServer.stop(StandardServer.java:502) > at org.apache.catalina.startup.Catalina.start(Catalina.java:756) > at org.apache.catalina.startup.Catalina.execute(Catalina.java:657) > at org.apache.catalina.startup.Catalina.process(Catalina.java:178) > at java.lang.reflect.Method.invoke(Native Method) > at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:202) > > I don't believe that my first problem is related to this, but it should > be of interest. > > Any suggestions welcome...Thanks.