ODP: Login Servlet?

2001-03-25 Thread Herchel Wojciech

there you go, it's taken from O'Reilly website.

vVolf


 -Oryginalna wiadomooe-
 Od: Mick Sullivan [mailto:[EMAIL PROTECTED]]
 Wysano: 23 marca 2001 21:12
 Do: [EMAIL PROTECTED]
 Temat: Login Servlet?
 
 
 Does anyone know where I could find code for a login servlet 
 using JDBC.
 I have a login tested, it checks the database and it outputs 
 whether the 
 username and password are correct to the jsp page, but I need 
 to use a 
 servlet for redirecting the user.
 Here is the code i have for the login procedure
 
 public void applyChanges() throws Exception
 {
   Statement statement = connection.createStatement();
try{
   ResultSet rs = 
 statement.executeQuery("SELECT * from Registration 
 WHERE (Username ='"
 + theUsername
 + "' AND Password = '"
 + thePassword + "');");
 
   boolean found = rs.next();
   System.out.println(found);
   rs.close();
   statement.close();
 
   if(found == true)
   {
 
   
 System.out.println("THAT IS THE CORRECT USERNAME AN PASSWORD!!");
   //request.setAttribute 
 ("servletName", "servletToJsp");
   rs.close();
   statement.close();
   //response.sendRedirect 
 ("/login.jsp");
   }
   else
   {
   System.out.println("YOU 
 ARE NOT IN OUR DB :-(");
   rs.close();
   statement.close();
   }
   }
   catch (Exception e)
   {
 
   }
 
 }
 }
 
 ANY help at all would be much appreciated. Thanks in advance, Mick
 __
 ___
 Get Your Private, Free E-mail from MSN Hotmail at 
 http://www.hotmail.com.
 


 LoginHandler.java


testing unsub - DELETE it

2001-03-25 Thread Herchel Wojciech

i should never get it back...

vVolf



ODP: Question on import javax.servlet.*;???

2001-03-23 Thread Herchel Wojciech

 I know Ive been at this for bout 6 months now, but what do 
 you mean when you 
 say "'servlet.jar' should be located in the classpath"?
that means that you should compile it with

javac -classpath .;PATH_TO_SERVLET_API YourClass.java

regards,
vVolf



ODP: Question on import javax.servlet.*;???

2001-03-22 Thread Herchel Wojciech

the package is not in your classpath

vVolf


 -Oryginalna wiadomooe-
 Od: Mick Sullivan [mailto:[EMAIL PROTECTED]]
 Wysano: 22 marca 2001 22:37
 Do: [EMAIL PROTECTED]
 Temat: Question on import javax.servlet.*;???
 
 
 Hi
 Does anyone know why I get the following error when I try to import
 "import javax.servlet.*;  AND
 import javax.servlet.http.*;"
 I need them for my loginHandler to use sendRedirect etc.
 This is the error:
 
 C:\JBuilder35\jdk1.2.2\binjavac 
 c:\tomcat\webapps\projectuser\web-inf\classes\l
 oginHandler.java
 c:\tomcat\webapps\projectuser\web-inf\classes\loginHandler.jav
 a:7: Package 
 java.
 servlet not found in import.
 import java.servlet.*;
^
 c:\tomcat\webapps\projectuser\web-inf\classes\loginHandler.jav
 a:8: Package 
 java.
 servlet.http not found in import.
 import java.servlet.http.*;
 
 Anyone have any ideas? The answer is probably straight 
 forward (as usual)
 Thanks in advance,
 Mick
 
 
 
 __
 ___
 Get Your Private, Free E-mail from MSN Hotmail at 
http://www.hotmail.com.



ODP: Does JDK1.3 works with Tomcat?

2001-03-22 Thread Herchel Wojciech

i think you compiled Counter as a part of homepages.jack package. there the
correct dir structure is:
web/WEB-INF/classes/homepages/jack/Counter.class

should work.

vVolf


 -Oryginalna wiadomooe-
 Od: Jack Li [mailto:[EMAIL PROTECTED]]
 Wysano: 22 marca 2001 17:09
 Do: [EMAIL PROTECTED]
 Temat: RE: Does JDK1.3 works with Tomcat?
 
 
 I didn't use special methods. the java codes are very simple 
 and listed
 below:
 
 import java.io.Serializable;
 public class Counter implements Serializable{
 int count = 0;
 
 public Counter(){}
 
 public int getCount(){
 count++;
 return this.count;
 }
 
 public void setCount(int count){
 this.count = count;
 }
 }
 ---
 
 Here is the directory structure:
 
 web -- homepages -- jack -- counter.jsp
 web -- web-inf   -- classes -- counter.class
 
 The error message is:
 Class homepages.jack.Counter not found in type declaration.
 
 Please help
 Thanks,
 Jack Li
 
 
 
 
 
 -Original Message-
 From: Ying Ho [mailto:[EMAIL PROTECTED]]
 Sent: Thursday, March 22, 2001 11:03 AM
 To: [EMAIL PROTECTED]
 Subject: Re: Does JDK1.3 works with Tomcat?
 
 
 JDK 1.3 does work with tomcat. Your bean must be using some 
 specific jdk
 1.1.*
 methods that is not supported in jdk 1.3 (and most likely 
 also jdk 1.2).
 
 - Original Message -
 From: "Jack Li" [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 Sent: Thursday, March 22, 2001 4:52 PM
 Subject: Does JDK1.3 works with Tomcat?
 
 
  Hello,
  Does JDK1.3 works with tomcat. My beans do not work with 
 JDK1.3. Error
  message says can't find the class. But all these beans 
 works fine with
  JDK1.1.8. Any ideas?
 
  Thanks,
  Jack Li
 
 



ODP: Security Policy problem

2001-03-21 Thread Herchel Wojciech

i think applets are only allowed to connect back to the server they
originate from. this might be the problem, or better, consult JDBC faq from
www.jguru.com

vVolf


 -Oryginalna wiadomooe-
 Od: Sunny SJ [mailto:[EMAIL PROTECTED]]
 Wysano: 21 marca 2001 04:19
 Do: [EMAIL PROTECTED]
 Temat: Security Policy problem
 
 
 I am creating a Java Applet (running on Internet Explorer web 
 browser) that
 can access a database located in a remote machine (server).  
 The connection to
 the remote database is established using JDBC-ODBC bridge.  However, I
 encounter java security problem that restricted me to access 
 the database
 across the network.  Is there anyway I can overcome this problem?
 
 Thanks for your help
 SSJ
 
 
 Get free email and a permanent address at 
http://www.netaddress.com/?N=1



ODP: Help: form-based auth in Tomcat 3.2.1

2001-03-21 Thread Herchel Wojciech

i have exactly the same symptoms - posted it here and never solved it...
anybody?
 

vVolf


 

-Oryginalna wiadomosc-
Od: Valeriy Molyakov [mailto:[EMAIL PROTECTED]]
Wyslano: 21 marca 2001 13:54
Do: [EMAIL PROTECTED]
Temat: Help: form-based auth in Tomcat 3.2.1






ODP: JDBCRealm reconnect problems?

2001-03-19 Thread Herchel Wojciech

i had a similar problem and solved it by changing connectionURL to:
connectionURL="jdbc:mysql://localhost/dbase?user=somebodyamp;password=secre
t"
and commenting connectionName and Password.

vVolf


 -Oryginalna wiadomooe-
 Od: Vladimir Grishchenko [mailto:[EMAIL PROTECTED]]
 Wysano: 16 marca 2001 20:45
 Do: [EMAIL PROTECTED]
 Temat: JDBCRealm reconnect problems?
 
 
 Has anyone experienced JDBCReconnect problems???
 Looks like mysql db connection times out and JDBCRealm cannot
 reopen it for some reason. 
 Actually it tries to reopen it and somehow is able to authenticate
 a user, but then dies completely...
 Any ideas what can be wrong?
 
 This is the error/exceptions from tomcat log file:
 
 
 2001-03-16 11:20:33 - ContextManager: JDBCRealm: The database 
 connection is null or was
 found to be closed. Trying to re-open it.
 2001-03-16 11:20:33 - ContextManager: JDBCRealm: There was an 
 SQLException while in
 authenticate: null
 2001-03-16 11:20:33 - ContextManager: JDBCRealm: 
 SQLException: java.sql.SQLException:
 Error during query: Unexpected Exception: 
 java.sql.SQLException message given:
 Communication link failure: java.io.IOException
 2001-03-16 11:20:38 - ContextManager: JDBCRealm: The database 
 connection is null or was
 found to be closed. Trying to re-open it.
 2001-03-16 11:20:38 - ContextManager: JDBCRealm: 
 JDBCRealm.authenticate: SELECT password
 FROM profiles WHERE username = ?
 2001-03-16 11:20:38 - ContextManager: JDBCRealm: 
 Authentication unsuccessful for user null
 2001-03-16 11:20:47 - ContextManager: JDBCRealm: 
 Authentication successful for user Walter
 2001-03-16 11:20:47 - ContextManager: JDBCRealm: Auth ok, user=Walter
 2001-03-16 11:20:47 - ContextManager: JDBCRealm: Controled 
 access for Walter R( /ngs_web +
 /entering/buttons.jsp + null) Ct 
 (jsp(org.apache.jasper.servlet.JspServlet/null) )
 2001-03-16 11:20:47 - ContextManager: JDBCRealm: There was an 
 SQLException while in
 getUserRoles: Walter
 2001-03-16 11:20:47 - ContextManager: JDBCRealm: 
 SQLException: java.sql.SQLException:
 Error during query: Unexpected Exception: 
 java.sql.SQLException message given:
 Communication link failure: java.io.IOException
 2001-03-16 11:20:47 - ContextManager: JDBCRealm: Auth ok, 
 user has no roles
 2001-03-16 11:20:47 - ContextManager: JDBCRealm: UnAuthorized Y
 2001-03-16 11:20:55 - ContextManager: JDBCRealm: The database 
 connection is null or was
 found to be closed. Trying to re-open it.
 2001-03-16 11:20:55 - Ctx( /ngs_web ): Exception in: R( 
 /ngs_web + /entering/buttons.jsp +
 null) - java.lang.NullPointerException
 at 
 org.gjt.mm.mysql.PreparedStatement.executeQuery(PreparedStatem
 ent.java:198)
 at 
 org.apache.tomcat.request.JDBCRealm.authenticate(JDBCRealm.java:307)
 at 
 org.apache.tomcat.request.JDBCRealm.authenticate(JDBCRealm.java:482)
 at 
 org.apache.tomcat.core.ContextManager.doAuthenticate(ContextMa
 nager.java:837)
 at 
 org.apache.tomcat.core.RequestImpl.getRemoteUser(RequestImpl.java:341)
 at 
 org.apache.tomcat.request.JDBCRealm.authorize(JDBCRealm.java:503)
 at 
 org.apache.tomcat.core.ContextManager.doAuthorize(ContextManag
 er.java:855)
 at 
 org.apache.tomcat.core.ContextManager.internalService(ContextM
 anager.java:789)
 at 
 org.apache.tomcat.core.ContextManager.service(ContextManager.java:743)
 at
 org.apache.tomcat.service.http.HttpConnectionHandler.processCo
 nnection(HttpConnectionHandler.java:210)
 at 
 org.apache.tomcat.service.TcpWorkerThread.runIt(PoolTcpEndpoin
 t.java:416)
 at 
 org.apache.tomcat.util.ThreadPool$ControlRunnable.run(ThreadPo
 ol.java:498)
 at java.lang.Thread.run(Thread.java:498)
 
 2001-03-16 11:21:00 - Ctx( /ngs_web ): Exception in: R( 
 /ngs_web + /display/ngs_home.jsp +
 null) - javax.servlet.ServletException
 at java.lang.Throwable.init(Throwable.java:96)
 at java.lang.Exception.init(Exception.java:44)
 at 
 javax.servlet.ServletException.init(ServletException.java:161)
 at
 org.apache.jasper.runtime.PageContextImpl.handlePageException(
 PageContextImpl.java:459)
 at
 display._0002fdisplay_0002fngs_0005fhome_0002ejspngs_0005fhome
 _jsp_4._jspService(_0002fdisplay_0002fngs_0005fhome_0002ejspng
 s_0005fhome_jsp_4.java:2404)
 at 
 org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:119)
 at 
 javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
 at
 org.apache.jasper.servlet.JspServlet$JspServletWrapper.service
 (JspServlet.java:177)
 at 
 org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet
 .java:318)
 at 
 org.apache.jasper.servlet.JspServlet.service(JspServlet.java:391)
 at 
 javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
 at 
 org.apache.tomcat.core.ServletWrapper.doService(ServletWrapper
 .java:404)
 at 

ODP: security

2001-03-16 Thread Herchel Wojciech

please refer to a http://localhost:8080/examples/jsp/security
and examples context's web.xml file.

vVolf


 -Oryginalna wiadomooe-
 Od: Heijns, P.J.B. [mailto:[EMAIL PROTECTED]]
 Wysano: 16 marca 2001 09:43
 Do: [EMAIL PROTECTED]
 Temat: security
 
 
 Hi,
 
 Can anyone tell me how I set the security rights for tomcat? 
 I want that no
 users can download my JSP pages. Now all users can see en 
 download my jsp
 pages. If they type the url for example 
http://127.0.0.1/myweb/ they see al
the JSP pages and they can download them. Can you set the security that the
users can't see and download the pages? I thought that u can set the
security in de web.xml, but I don't know how.

Thank u,

Pieter Heijms



crash!!!

2001-03-14 Thread Herchel Wojciech

Hi all! i've got the following problem.
tomcat was running, and i meant to shut it down, but instead i exceuted
"tomcat start". 
then i shut it down, and tried to restart again. alas, it does not start
HttpConnectionHandler on 8080 nor Ajp12ConnectionHandler on 8007. 
why is that? how can i solve that? executing netstat -t -a shows that server
linstens to ports 8007 and 8009.
plus a file called javacore19565.txt was generated.
can anybody help me please?


vVolf

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]




ODP: help me out

2001-03-14 Thread Herchel Wojciech

 you don't need the .newInstance() on the end of your driver...
on the other hand it doesn't harm you at all. i read somewhere that i'd be
better off with .newInstance(), due to some bug in browser's (either IE or
Netscape) jvm. or i might be just wrong. anybody can back me up on this?

vVolf

 
 i.e.
  try { 
  Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); 
  }
   catch (java.lang.ClassNotFoundException ex) 
  { } 
 
 hth
 
 Alan
 
  
  I am having some problem in jsp. When i try to connect my jsp 
  application to database it gives me error "No suitable 
  driver".I am using Tomcat server and Access 97.
  I am giving u the code here.
  %@ page  import="java.sql.*" % 
  try { 
  Class.forName("sun.jdbc.odbc.JdbcOdbcDriver").newInstance();  
  }
   catch (java.lang.ClassNotFoundException ex) 
  { } 
  
  
  try
  {
  % Connection connection =  
  DriverManager.getConnection("jdbc:odbc:project"); % 
  }
  catch (SQLException ex)
  {}
  % Statement statement = connection.createStatement(); 
  ResultSet resultSet = statement.executeQuery("select * from 
  registration"); % 
  P The results are: 
  /P 
  UL 
  % while (resultSet.next()) { % 
  LI%= resultSet.getString(1) %/LI 
  % } % 
  /UL 
  
  
  Please Note :My java application runs fine and gives no 
  problem even while using Database.
  I am using WindowsMe.and Access97 database.
  My autoexec.bat is as follows.
  SET 
  CLASSPATH=C:\jdk1.2.2\bin;C:\jdk1.2.2\lib;C:\WINDOWS;C:\WINDOW
  S\COMMAND;C:\jdk1.2.2\jre\bin;
  SET windir=C:\WINDOWS
  SET winbootdir=C:\WINDOWS
  SET COMSPEC=C:\WINDOWS\COMMAND.COM
  SET PROMPT=$p$g
  SET TEMP=C:\WINDOWS\TEMP
  SET TMP=C:\WINDOWS\TEMP
  SET BLASTER=A220 I5 D1 T4
  SET JAVA_HOME=C:\jdk1.2.2
  SET TOMCAT_HOME=c:\tomcat
  
  
 waiting for your response
  bye
  gautam
  
  [EMAIL PROTECTED]
  __
  123India.com - India's Premier Portal 
  Get your Free Email Account at http://www.123india.com
  
  
  
 



ODP: Format of log files - Again

2001-03-13 Thread Herchel Wojciech

from server.xml:

"
 Timestamps:

 By default, logs print a timestamp in the form "-MM-dd
 hh:mm:ss" in front of each message.  To disable timestamps
 completely, set 'timestamp="no"'. To use the raw
 msec-since-epoch, which is more efficient, set
 'timestampFormat="msec"'.  If you want a custom format, you
 can use 'timestampFormat="hh:mm:ss"' following the syntax of
 java.text.SimpleDateFormat (see Javadoc API).  For a
 production environment, we recommend turning timestamps off,
 or setting the format to "msec".
"
hope it helps.

vVolf


 I asked it yesterday, but nobody could answer it. (anyway, I 
 got a letter
 back, but it was unreadable...)
 
 I'd like to ask if there is any possibilities to change the 
 format of the
 log entries. Now it is set to log the event, but not the 
 datetime event. I
 need all of imformations (I mean what happened and when 
 happened). Any idea
 how to change it?
 

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]




ODP: Set application's working path?

2001-03-13 Thread Herchel Wojciech

i had the same problem - all i did was i fed FileOutputStream with a real
path, where i wanted files to be stored. ie.
FileOutputStream  output = new
FileOutputStream("/and/directories/follow/file.name");

if anybody has more elegant solution, i'll be grateful.

regards,
vVolf


 -Oryginalna wiadomooe-
 Od: Alexander Batzios [mailto:[EMAIL PROTECTED]]
 Wysano: 14 marca 2001 06:12
 Do: [EMAIL PROTECTED]
 Temat: Set application's working path?
 
 
 Hello.
 
 I am using a JSP file to call a class, say myClass, which is 
 a pure java 
 application. From that class, I then need to call a method, 
 say myMethod. The 
 part of the JSP file that does the above is like:
 
 myClass mc = new myClass(parameters);
 mc.myMethod();
 
 Part of myMethod() functionality is reading/writting files. 
 Well, the thing is 
 that it only works in the /bin directory of tomcat (where the 
 startup,shutdown 
 scripts are). That is, it expects to find files there, and it 
 creates files 
 there. How can I change it's working path to a virtual path 
 of the webserver? 
 Or to where the JSP file that calls it lives?
 
 Any help will be greatly appreciated.
 
 Thanks,
 alex
 
 
  Get your FREE web-based e-mail and newsgroup access at:
 http://MailAndNews.com
 
  Create a new mailbox, or access your existing IMAP4 or
  POP3 mailbox from anywhere with just a web browser.
 
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, email: [EMAIL PROTECTED]
 

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]




ODP: JDBC Realm Problems; Probably server.xml related...

2001-03-12 Thread Herchel Wojciech

and does not work for bunch of others...

vVolf


 -Oryginalna wiadomooe-
 Od: Ignacio J. Ortega [mailto:[EMAIL PROTECTED]]
 Wysano: 12 marca 2001 09:53
 Do: '[EMAIL PROTECTED]'
 Temat: RE: JDBC Realm Problems; Probably server.xml related...
 
 
  looks like jdbcrealm is not tip-top finished - it's 
  malfunctioning all the
  time. 
 
 Thanks for you help... 
 
 but JDBCRealm works for a bunch of other people ( me too ).. 
 
 Your help will be highly appreciatted to help out in "tip-top" finish
 it..
 
 TIA
 
 Saludos ,
 Ignacio J. Ortega
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, email: [EMAIL PROTECTED]
 

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]




ODP: JDBC Realm Problems; Probably server.xml related...

2001-03-12 Thread Herchel Wojciech

i'm sorry - i did not mean to offend you - my point was only that it is not
perfect.
i still have a problem with jdbcrealm and it wasn't me who first said that "
looks
like some of the code [jdbcRealm] in 3.2.1 is never called." 
anyways, keep up with the good work! :)

vVolf


 -Oryginalna wiadomooe-
 Od: Ignacio J. Ortega [mailto:[EMAIL PROTECTED]]
 Wysano: 12 marca 2001 10:12
 Do: '[EMAIL PROTECTED]'
 Temat: RE: JDBC Realm Problems; Probably server.xml related...
 
 
 Well you can:
 
 * report a bug in http://nagoya.apache.org/bugzilla 
 
 * study JDBCRealm and related and send a patch ( trought a bug report
 I.e. ) to help us solve your problems.
 
 * Buy some other container... that resolves your problems.. :)
 
 Whichever way you elect to help yourself, will help us too... but only
 words can not help anybody
 
 TIA
 
 Saludos ,
 Ignacio J. Ortega
 
 
  -Mensaje original-----
  De: Herchel Wojciech [mailto:[EMAIL PROTECTED]]
  Enviado el: lunes 12 de marzo de 2001 10:00
  Para: '[EMAIL PROTECTED]'
  Asunto: ODP: JDBC Realm Problems; Probably server.xml related...
  
  
  and does not work for bunch of others...
  
  vVolf
  
  
   -Oryginalna wiadomooec-
   Od: Ignacio J. Ortega [mailto:[EMAIL PROTECTED]]
   Wyslano: 12 marca 2001 09:53
   Do: '[EMAIL PROTECTED]'
   Temat: RE: JDBC Realm Problems; Probably server.xml related...
   
   
looks like jdbcrealm is not tip-top finished - it's 
malfunctioning all the
time. 
   
   Thanks for you help... 
   
   but JDBCRealm works for a bunch of other people ( me too ).. 
   
   Your help will be highly appreciatted to help out in 
  "tip-top" finish
   it..
   
   TIA
   
   Saludos ,
   Ignacio J. Ortega
   
   
   
  
 -
   To unsubscribe, e-mail: [EMAIL PROTECTED]
   For additional commands, email: 
 [EMAIL PROTECTED]
   
  
  
 -
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, email: [EMAIL PROTECTED]
  
  
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, email: [EMAIL PROTECTED]
 

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]




ODP: JDBC Realm Problems; Probably server.xml related...

2001-03-11 Thread Herchel Wojciech

looks like jdbcrealm is not tip-top finished - it's malfunctioning all the
time. 
my idea is that tomcat tries to tell you that a connetionName is missing -
on the other hand docs say it's optional... anybody any ideas?

vVolf


 -Oryginalna wiadomooe-
 Od: eric chacon [mailto:[EMAIL PROTECTED]]
 Wysano: 12 marca 2001 03:13
 Do: [EMAIL PROTECTED]
 Temat: JDBC Realm Problems; Probably server.xml related...
 
 
 I am trying to set up a JDBC Realm on tomcat 3.2.1. After 
 modifying the 
 server.xml file (shown below), tomcat will no longer start.
 
 I am quite new to tomcat and Linux, in genral.
 
 I have not modified any of the other xml files (the web.xml for my 
 application, for instance).
 
 I have set up my database (Postgresql) as described in the 
 JDBC Realms 
 How-To.
 I'm running on Linux (Corel, if it matters).
 I've added the mod_jk.so; Apache handles static HTML and 
 routes requests for 
 JSPs and Servlets to Tomcat. This appears to work fine.
 
 
 Here is my entry in the server.xml file
 
  RequestInterceptor
 className="org.apache.tomcat.request.JDBCRealm"
 debug="99"
 driverName="org.postgresql.Driver"
   
 connectionURL="jdbc:postgresql://localhost:5432/mysite_userdb"
 userTable="users"
 userNameCol="user_name"
 userCredCol="user_pass"
 userRoleTable="user_roles"
 roleNameCol="role_name" /
 
 Here is the error I get when I try to start Tomacat
 
 FATAL:java.lang.RuntimeException: JDBCRealm.start.readXml: 
 The user property 
 is missing. It is mandatory.
 java.lang.RuntimeException: JDBCRealm.start.readXml: The user 
 property is 
 missing. It is mandatory.
 at 
 org.apache.tomcat.request.JDBCRealm.contextInit(JDBCRealm.java,
 Compiled Code)
 at
 org.apache.tomcat.core.ContextManager.initContext(ContextManager.java,
 Compiled Code)
 at 
 org.apache.tomcat.core.ContextManager.init(ContextManager.java,
 Compiled Code)
 at 
 org.apache.tomcat.startup.Tomcat.execute(Tomcat.java, Compiled
 Code)
 at org.apache.tomcat.startup.Tomcat.main(Tomcat.java, 
 Compiled Code)
 
 I have all the necessary databases set up, I can connect to 
 postgres from 
 stand-alone programs. I have the JDBC drivers in the 
 classpath and in the 
 tomcat/lib directory.
 
 If I remove the connectionURL line or the driverName line, I 
 get appropriate 
 error messages telling me that these attributes are required.
 
 If I remove the RequestInterceptor entry for JDBC realms 
 entirely, tomcat 
 starts, and I can run servlets and JSPs.
 
 I'm not sure what a user property is... is this a simple 
 oversight that I'm 
 missing?
 
 Cheers, and thanks,
 
 Eric
 _
 Get your FREE download of MSN Explorer at http://explorer.msn.com
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, email: [EMAIL PROTECTED]
 

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]




ODP: j_security_check question

2001-03-11 Thread Herchel Wojciech

 -Oryginalna wiadomooe-
 Od: Thomas Riemer [mailto:[EMAIL PROTECTED]]
 Most likely you are missing a JkMount statement.
 You need to tell your web server that /j_security_check exists.
 
 JkMount /j_security_check ajp12

where do i put that? mod_jk.conf? do i have to restart apache?

vVolf

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]





ODP: Help - Tomcat configuration

2001-03-08 Thread Herchel Wojciech

althought your classpath points to servet package, apparently it is not
found by javac. try this
javac -cp .;PATH_TO_SERVLET_API HelloWorldExample.java

vVolf


 -Oryginalna wiadomooe-
 Od: Becky Wang [mailto:[EMAIL PROTECTED]]
 Wysano: 9 marca 2001 06:12
 Do: [EMAIL PROTECTED]
 Temat: Help - Tomcat configuration
 
 
 Hello,
 
 I installed Apache and Tomcat 3.2, with no problem running all the
 example jsp and servlets, but when I tried to compile the sample
 HelloWorldExample servlet(which come with Tomcat), I got the following
 error message:
 
 C:\tomcat\webapps\examples\WEB-INF\classesjavac 
 HelloWorldExample.java
 HelloWorldExample.java:8: package javax.servlet does not exist
 import javax.servlet.*;
 ^
 HelloWorldExample.java:9: package javax.servlet.http does not exist
 import javax.servlet.http.*;
 ^
 HelloWorldExample.java:17: cannot resolve symbol
 symbol  : class HttpServlet
 location: class HelloWorldExample
 public class HelloWorldExample extends HttpServlet {
^
 HelloWorldExample.java:20: cannot resolve symbol
 symbol  : class HttpServletRequest
 location: class HelloWorldExample
 public void doGet(HttpServletRequest request,
   ^
 HelloWorldExample.java:21: cannot resolve symbol
 symbol  : class HttpServletResponse
 location: class HelloWorldExample
   HttpServletResponse response)
   ^
 HelloWorldExample.java:22: cannot resolve symbol
 symbol  : class ServletException
 location: class HelloWorldExample
 throws IOException, ServletException
 ^
 6 errors
 
 my autoexec.bat is as follows:
 
 PATH C:\WINDOWS;C:\WINDOWS\COMMAND;C:\orawin95\bin
 SET PATH=%PATH%;C:\jdk1.3\bin
 IF EXIST C:\IMNNQ_95\IMNENV.BAT CALL C:\IMNNQ_95\IMNENV.BAT
 SET TOMCAT_HOME=C:\TOMCAT
 SET CLASSPATH=.;C:\TOMCAT\LIB\SERVLET.JAR
 SET JAVA_HOME=C:\jdk1.3
 SET IMNINSTSRV=C:\IMNNQ_95
 SET PATH=%PATH%;C:\IMNNQ_95
 
 Thanks for any suggestion.
 
 Becky Wang
 
 
 __
 Do You Yahoo!?
 Get email at your own domain with Yahoo! Mail. 
 http://personal.mail.yahoo.com/
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, email: [EMAIL PROTECTED]
 

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]




bug or wrong Apache+Tomcat configuration???

2001-03-07 Thread Herchel Wojciech

Hi all!
I've encountered following problem. i have a protected area defined in my
web.xml file:

security-constraint
  web-resource-collection
 web-resource-nameProtected Area/web-resource-name
  url-pattern/protected/*/url-pattern
  http-methodDELETE/http-method
  http-methodGET/http-method
  http-methodPOST/http-method
http-methodPUT/http-method
 /web-resource-collection
 auth-constraint
   role-nametest/role-name
 role-namedevelope/role-name
 role-nameagent/role-name
 /auth-constraint
/security-constraint

under /protected I have serveral jsp files and they cannot be accessed
without authorization. however html and js files can be easily accessed
without authorization, simply by requesting a proper URL
(http://mydomain/protected/somefile.html) !! why is that?


vVolf

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]




ODP: JDBC Realm not triggering

2001-03-05 Thread Herchel Wojciech

form auth does work, only j_security_check is not found.

vVolf


 -Oryginalna wiadomooe-
 Od: Ignacio J. Ortega [mailto:[EMAIL PROTECTED]]
 Wysano: 5 marca 2001 09:52
 Do: '[EMAIL PROTECTED]'
 Temat: RE: JDBC Realm not triggering
 
 
 Please revise http://localhost:8080/examples/jsp/security/protected ..
 
 The problem is that you need to access a protected resource for FORM
 auth to work.., not directly the Login formin the config below ..
 you need to acess a url with the form
 http://localhost:8080/context/pwAdmin/ i.e ( i dont know the 
 exact name
 of the context .. try substitute "context" with the right one 
 ).. after
 that Tomcat tries to authenticate the user prior to access 
 the resource
 ..  showing the login form.. when you make a correct 
 authentication.. it
 redirect the form the login page to the original protected resource ..
 does not have sense to try to access directly the login form..
 
 
 Saludos ,
 Ignacio J. Ortega
 
 
  -Mensaje original-----
  De: Herchel Wojciech [mailto:[EMAIL PROTECTED]]
  Enviado el: lunes 5 de marzo de 2001 8:14
  Para: '[EMAIL PROTECTED]'
  Asunto: ODP: JDBC Realm not triggering
  
  
  same problem here - still don't know how to solve it :(
  
  vVolf
  
  
   -Oryginalna wiadomooec-
   Od: Mike Slinn [mailto:[EMAIL PROTECTED]]
   Wyslano: 2 marca 2001 18:59
   Do: [EMAIL PROTECTED]
   Temat: JDBC Realm not triggering
   
   
   I feel like I sailed off the edge of the known universe, 
   because there isn't
   much documentation for form-based authentication using JDBC 
  realms (at
   least, none that I could find, beyond the short 
   JDBCRealm.howto included in
   the TomCat docs).
   
   I am using Windows NT Server 4sp6 with JDK1.3 and Tomcat 3.2.1.
   
   I made the following changes to server.xml:
   
   !-- RequestInterceptor 
   className="org.apache.tomcat.request.SimpleRealm"
   debug="0" / --
   RequestInterceptor 
 className="org.apache.tomcat.request.JDBCRealm"
debug="99"
driverName="org.gjt.mm.mysql.Driver"
connectionURL="jdbc:mysql://blahblah.com:3306/database"
connectionName="secret"
connectionPassword="secret"
userTable="Users" userNameCol="userId" 
  userCredCol="userPassword"
userRoleTable="UserPriv" roleNameCol="privLevel" /
   
   The database tables exist, exactly as shown in 
   RequestInterceptor, since
   mySql is case-sensitive w.r.t. table names.
   
   Here is a piece of my web.xml:
   
 security-constraint
   web-resource-collection
 web-resource-namedeveloper/web-resource-name
 url-pattern/pwAdmin/*/url-pattern
 url-pattern/pwModerator/*/url-pattern
 url-pattern/pwNormal/*/url-pattern
 url-pattern/pwPortal/*/url-pattern
 url-pattern/pwTest/*/url-pattern
 http-methodget/http-method
 http-methodpost/http-method
   /web-resource-collection
   
   auth-constraint
 role-namedeveloper/role-name
   /auth-constraint
   
   user-data-constraint
 transport-guaranteeNONE/transport-guarantee
   /user-data-constraint
 /security-constraint
   
 login-config
   auth-methodFORM/auth-method
   realm-nameJDBC/realm-name
   form-login-config
 form-login-page/index.html/form-login-page
 form-error-page/register.jsp/form-error-page
   /form-login-config
 /login-config
   
 security-role
   role-namedeveloper/role-name
 /security-role
   
   
   Here is the authentication form:
   form method="POST" action="j_security_check"
  Login id: input type="text" name="j_username" size="8"
   class=formStylebr
  Password: input type="password" name="j_password" size="8"
   class=formStylebr
input type="submit" value="  Log In  " name="LogIn"
   class=formStyle
   /form
   
   
   When I press the submit button, I get the following error:
   HTTP 404 - File not found
   The url reported is http://localhost:8080/j_security_check
   
   Somehow the form action is not being picked up by the 
  TomCat security
   mechanism.  What have I missed?
   
   A few more questions:
- If I omit transport-guarantee, does it default to NONE?
- Is it possible to use * for http-method to specify 
  that all HTTP
   methods are to be subject to security?
- I would like to use a numeric column in the database to 
   store the user
   authentication level, rather than a text string.  Can the 
   JDBC realm be set
   up to work this way?
- I found very little documentation regarding form-based 
   authentication
   using JDBC realms. Can you point me to some more?
   
   ... thanks
   Mike
   
   
   
  
 ---

ODP: JDBC Realm not triggering

2001-03-05 Thread Herchel Wojciech


 JDBRealm  has *nothing* to do with FORM or BASIC or web.xml 
 settings..,
 it's ONLY a way to store user details inside a DB, .

very much so. but the problem is with the form, not with jdbc or anything
else. tomcat cannot exceute action j_security_check, thus throwing a 404
error. i did revised examples files though, and did exactly as told. 
still no luck.

regards,
vVolf

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]




ODP: Basic Authentication

2001-03-05 Thread Herchel Wojciech

see http://localhost/examples/jsp/security for guidelines and examine
examples web.xml file

vVolf


 -Oryginalna wiadomooe-
 Od: Cory Hubert [mailto:[EMAIL PROTECTED]]
 Wysano: 5 marca 2001 16:43
 Do: [EMAIL PROTECTED]
 Temat: Basic Authentication
 
 
   Can someone point me to the right direction.  I am 
 trying to setup Basic
 Authentication.  I realized that it wasn't as simple as creating an
 .htaccess file.   The documentation on this seems pretty 
 skimp.  Can anyone
 outline the process or point me to a good resource.
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, email: [EMAIL PROTECTED]
 

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]




ODP: JDBCRealm again

2001-03-04 Thread Herchel Wojciech

surely :) follow the steps described in the attached file. 


vVolf


 -Oryginalna wiadomo-
 Od: Chris Andreou [mailto:[EMAIL PROTECTED]]
 Wysano: 2 marca 2001 15:59
 Do: '[EMAIL PROTECTED]'
 Temat: RE: JDBCRealm again
 
 
 Wolf, 
 
 I am new tomcat user. Would you mind taking some time and write some
 quiedlines how to setup JDBCReal? 
 
 Thanks
 
 Chris
 
 
 -Original Message-
 From: Herchel Wojciech [mailto:[EMAIL PROTECTED]]
 Sent: Friday, March 02, 2001 1:29 AM
 To: 'Tomcat'
 Subject: JDBCRealm again
 
 
 I managed to force tomcat to reopen connection to auth data base and
 authorization works fine, there's only one "but" - it cannot 
 read roles
 therefore denies accessed to resource... here's tomcat log:
 
 log--
 2001-03-02 08:04:53 - ContextManager: JDBCRealm: The database 
 connection is
 null or was found to be closed. Trying to re-open it.
 2001-03-02 08:04:53 - ContextManager: JDBCRealm: 
 JDBCRealm.authenticate:
 SELECT user_pass FROM users WHERE user_name = ?
 2001-03-02 08:04:53 - ContextManager: JDBCRealm: 
 Authentication successful
 for user wojtek
 2001-03-02 08:04:53 - ContextManager: JDBCRealm: Auth ok, user=wojtek
 2001-03-02 08:04:53 - ContextManager: JDBCRealm: Controled 
 access for wojtek
 R(  + /protected/panel.jsp + null) Ct
 (jsp(org.apache.jasper.servlet.JspServlet/null) )
 2001-03-02 08:04:53 - ContextManager: JDBCRealm: There was an 
 SQLException
 while in getUserRoles: wojtek
 2001-03-02 08:04:53 - ContextManager: JDBCRealm: SQLException:
 java.sql.SQLException: Communication link failure: java.io.IOException
 2001-03-02 08:04:53 - ContextManager: JDBCRealm: Auth ok, 
 user has no roles
 2001-03-02 08:04:53 - ContextManager: JDBCRealm: UnAuthorized test
 
 how can i fix it?
 
 vVolf
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, email: [EMAIL PROTECTED]
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, email: [EMAIL PROTECTED]
 


 JDBCRealm.howto

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]


ODP: JDBC Realm not triggering

2001-03-04 Thread Herchel Wojciech

same problem here - still don't know how to solve it :(

vVolf


 -Oryginalna wiadomooe-
 Od: Mike Slinn [mailto:[EMAIL PROTECTED]]
 Wysano: 2 marca 2001 18:59
 Do: [EMAIL PROTECTED]
 Temat: JDBC Realm not triggering
 
 
 I feel like I sailed off the edge of the known universe, 
 because there isn't
 much documentation for form-based authentication using JDBC realms (at
 least, none that I could find, beyond the short 
 JDBCRealm.howto included in
 the TomCat docs).
 
 I am using Windows NT Server 4sp6 with JDK1.3 and Tomcat 3.2.1.
 
 I made the following changes to server.xml:
 
 !-- RequestInterceptor 
 className="org.apache.tomcat.request.SimpleRealm"
 debug="0" / --
 RequestInterceptor className="org.apache.tomcat.request.JDBCRealm"
  debug="99"
  driverName="org.gjt.mm.mysql.Driver"
  connectionURL="jdbc:mysql://blahblah.com:3306/database"
  connectionName="secret"
  connectionPassword="secret"
  userTable="Users" userNameCol="userId" userCredCol="userPassword"
  userRoleTable="UserPriv" roleNameCol="privLevel" /
 
 The database tables exist, exactly as shown in 
 RequestInterceptor, since
 mySql is case-sensitive w.r.t. table names.
 
 Here is a piece of my web.xml:
 
   security-constraint
 web-resource-collection
   web-resource-namedeveloper/web-resource-name
   url-pattern/pwAdmin/*/url-pattern
   url-pattern/pwModerator/*/url-pattern
   url-pattern/pwNormal/*/url-pattern
   url-pattern/pwPortal/*/url-pattern
   url-pattern/pwTest/*/url-pattern
   http-methodget/http-method
   http-methodpost/http-method
 /web-resource-collection
 
 auth-constraint
   role-namedeveloper/role-name
 /auth-constraint
 
 user-data-constraint
   transport-guaranteeNONE/transport-guarantee
 /user-data-constraint
   /security-constraint
 
   login-config
 auth-methodFORM/auth-method
 realm-nameJDBC/realm-name
 form-login-config
   form-login-page/index.html/form-login-page
   form-error-page/register.jsp/form-error-page
 /form-login-config
   /login-config
 
   security-role
 role-namedeveloper/role-name
   /security-role
 
 
 Here is the authentication form:
 form method="POST" action="j_security_check"
Login id: input type="text" name="j_username" size="8"
 class=formStylebr
Password: input type="password" name="j_password" size="8"
 class=formStylebr
  input type="submit" value="  Log In  " name="LogIn"
 class=formStyle
 /form
 
 
 When I press the submit button, I get the following error:
 HTTP 404 - File not found
 The url reported is http://localhost:8080/j_security_check
 
 Somehow the form action is not being picked up by the TomCat security
 mechanism.  What have I missed?
 
 A few more questions:
  - If I omit transport-guarantee, does it default to NONE?
  - Is it possible to use * for http-method to specify that all HTTP
 methods are to be subject to security?
  - I would like to use a numeric column in the database to 
 store the user
 authentication level, rather than a text string.  Can the 
 JDBC realm be set
 up to work this way?
  - I found very little documentation regarding form-based 
 authentication
 using JDBC realms. Can you point me to some more?
 
 ... thanks
 Mike
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, email: [EMAIL PROTECTED]
 

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]




ODP: Form based auth

2001-03-04 Thread Herchel Wojciech

hey!

i did exactly as described and got 404 error. i know j_security_check is not
a class that i should provide. and i'm using tomcat 3.2.1. any ideas?

vVolf


 -Oryginalna wiadomooe-
 Od: Craig R. McClanahan [mailto:[EMAIL PROTECTED]]
 Wysano: 2 marca 2001 20:32
 Do: [EMAIL PROTECTED]
 DW: 'uthay '
 Temat: Re: Form based auth
 
 
 "McCay, Larry" wrote:
 
  vVolf,
 
  I have observed the same behavior on 3.1 and 3.2.1.
 
  I am going to dig in a little deeper to see what security 
 functionality is
  supported at all.
 
 
 Form based security was not supported in Tomcat 3.1, but is 
 supported in 3.2
 and 4.0.
 
 Note that you do ***not*** provide a "j_security_check" 
 class.  That URI is
 handled by Tomcat.  The only thing your webapp includes 
 related to security is
 a form login page and a form error page.
 
 See the "examples" application included with Tomcat.  It uses 
 form-based
 security to protect the following URL:
 
 http://localhost:8080/examples/jsp/security/protected
 
 
 
  thanks,
 
  -larry
 
 
 Craig McClanahan
 
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, email: [EMAIL PROTECTED]
 

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]




ODP: jdbc realm

2001-03-04 Thread Herchel Wojciech

basically it is used to authenticate users against data-base, it;s more
flexible that simplerealm, based on a file (tomcat-users.xml) stored in
memory.

vVolf


 -Oryginalna wiadomooe-
 Od: mikhail malamud [mailto:[EMAIL PROTECTED]]
 Wysano: 5 marca 2001 05:22
 Do: [EMAIL PROTECTED]
 Temat: jdbc realm
 
 
 Hello -
 What is the purpose of a jdbc realm. Configuring it into server.xml
 seems rather easy but what is the practical usage? Can anyone show how
 he/she uses jdbc realm. Thanks.
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, email: [EMAIL PROTECTED]
 

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]




ODP: jdbc realm

2001-03-04 Thread Herchel Wojciech

 JDBC Realm has a couple of problems, for those of you using it.
 
 1) It has to change pretty radically between 3.2.1 and 3.3.1. 
  It looks
 like some of the
 code in 3.2.1 is never called.
^^
most likely. i'm using tomcat 3.2.1 and after mySQL closes the connection,
tomcat tries to reconnect, but for no apparent reason is not providing any
password but changing connection String to 
"jdbc:mysql://localhost/database?user=meamp;password=secret" does the
trick. however, now after reconnection tomcat cannot get a role associated
with a user. anybody knows why?
this is what tomcat logs:
--
2001-03-02 08:04:53 - ContextManager: JDBCRealm: Auth ok, user=user1
2001-03-02 08:04:53 - ContextManager: JDBCRealm: Controled access for user1
R(  + /protected/panel.jsp + null) Ct
(jsp(org.apache.jasper.servlet.JspServlet/null) )
2001-03-02 08:04:53 - ContextManager: JDBCRealm: There was an SQLException
while in getUserRoles: user1
2001-03-02 08:04:53 - ContextManager: JDBCRealm: SQLException:
java.sql.SQLException: Communication link failure: java.io.IOException
2001-03-02 08:04:53 - ContextManager: JDBCRealm: Auth ok, user has no roles
2001-03-02 08:04:53 - ContextManager: JDBCRealm: UnAuthorized test
2001-03-02 08:06:26 - ContextManager: JDBCRealm: The database connection is
null 

would you recommend upgrading tomcat?


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]




ODP: Newbie-Error in compiling servlets

2001-03-02 Thread Herchel Wojciech

add servlet classes to your classpath
 

vVolf


 

-Oryginalna wiadomosc-
Od: RaviShankar K [mailto:[EMAIL PROTECTED]]
Wyslano: 2 marca 2001 14:02
Do: [EMAIL PROTECTED]
Temat: Newbie-Error in compiling servlets




-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]




mySQL again

2001-03-01 Thread Herchel Wojciech

Hi!
My connectionURL in server.xml now looks like this:
"jdbc:mysql://localhost/auth?user=rootpassword=somepassword"

and tomcat doesn't start up (although there is no error msg or anything) and
when i execute tomcat stop i get the following exception:
org.xml.sax.SAXParseException: Next character must be ";" terminating
reference to entity "password" and a stack trace follows...

why is that?


vVolf

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]




ODP: Generating a random alphanumeric string

2001-03-01 Thread Herchel Wojciech

see tomcat sources, org.apache.tomcat.util.SessionIdGenerator namely

vVolf


 -Oryginalna wiadomooe-
 Od: Cato, Christopher [mailto:[EMAIL PROTECTED]]
 Wysano: 1 marca 2001 15:05
 Do: '[EMAIL PROTECTED]'
 Temat: Generating a random alphanumeric string
 
 
 Hello, can anyone show me an example or give me a clue about how
 to generate a random alphanumeric string of lets say 16-32 chars?
 TomCat is obviously doing it for the session ids, but how would I
 do the same in a servlet?
 
 Regards,
 
 Christopher Cato
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, email: [EMAIL PROTECTED]
 

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]




JDBCRealm again

2001-03-01 Thread Herchel Wojciech

I managed to force tomcat to reopen connection to auth data base and
authorization works fine, there's only one "but" - it cannot read roles
therefore denies accessed to resource... here's tomcat log:

log--
2001-03-02 08:04:53 - ContextManager: JDBCRealm: The database connection is
null or was found to be closed. Trying to re-open it.
2001-03-02 08:04:53 - ContextManager: JDBCRealm: JDBCRealm.authenticate:
SELECT user_pass FROM users WHERE user_name = ?
2001-03-02 08:04:53 - ContextManager: JDBCRealm: Authentication successful
for user wojtek
2001-03-02 08:04:53 - ContextManager: JDBCRealm: Auth ok, user=wojtek
2001-03-02 08:04:53 - ContextManager: JDBCRealm: Controled access for wojtek
R(  + /protected/panel.jsp + null) Ct
(jsp(org.apache.jasper.servlet.JspServlet/null) )
2001-03-02 08:04:53 - ContextManager: JDBCRealm: There was an SQLException
while in getUserRoles: wojtek
2001-03-02 08:04:53 - ContextManager: JDBCRealm: SQLException:
java.sql.SQLException: Communication link failure: java.io.IOException
2001-03-02 08:04:53 - ContextManager: JDBCRealm: Auth ok, user has no roles
2001-03-02 08:04:53 - ContextManager: JDBCRealm: UnAuthorized test

how can i fix it?

vVolf

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]




ODP: TOMCAT: IOException

2001-02-28 Thread Herchel Wojciech

same problem here, but since it doesn't do any harm, i just ignore it :)

vVolf


 -Oryginalna wiadomooe-
 Od: Bartsch Axel [mailto:[EMAIL PROTECTED]]
 Wysano: 28 lutego 2001 12:01
 Do: [EMAIL PROTECTED]
 Temat: TOMCAT: IOException
 
 
 Hi,
 
 Does anybody know the following problem?
 
 I  use TOMCAT 3.2 and IE Explorer 5.
 I call a servlet URL.
 If I delete the 'temporary Internet files' (=cache) in IE 
 Explorer the following printout does not occurr.
 But if I call my servlet a second time without having deleted 
 the cache
 (the image files are found on the hard disk) the following 
 printout occurrs.
 But everything works fine.
 (Option in IE Explorer is 'check for newer versions of stored 
 pages=every visit to the page')
 
 
 2001-02-28 11:34:28 - Ctx( /swam ): IOException in: R( /swam 
 + /images/mn-bg.jpg
  + null) socket write error (code=10053)
 2001-02-28 11:34:29 - Ctx( /swam ): IOException in: R( /swam 
 + /images/mn-surpas
 s_hiq.gif + null) socket write error (code=10053)
 2001-02-28 11:34:29 - Ctx( /swam ): IOException in: R( /swam 
 + /images/mn-Drahtk
 ugel_80.gif + null) socket write error (code=10053)
 

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]




jsp plugin tag

2001-02-28 Thread Herchel Wojciech

Hi!

Can anybody tell me where can i find more info on that tag, except for an
example that came along with tomcat distribution?

vVolf

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]




Tomcat and mySQL

2001-02-28 Thread Herchel Wojciech

Hi!

I'm using JDBCRealm authorisation.
How can I force mySQL not to close the connection Tomcat opened upon startup
(to database where users, roles, user_roles tables are stored)?
i assume mySQL's variable wait_timeout is responsible for closing inactive
connections. the default is 28800 secs, will changing it to zero do the
trick? or else? anyone?

regards, 

vVolf

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]




ODP: simple servlet setup question

2001-02-28 Thread Herchel Wojciech

 found.  I specify which servlet the form is submitted to
 in the html file with this line:
 
 form name="LoginExtranet" method="POST" action="ExtranetServlet"

you should send an action to "servlet/ExtranetServlet.class"

 The html file is in the jakarta-tomcat\webapps\extranet
 directory, and the ExtranetServlet.class file is in the
 jakarta-tomcat\webapps\extranet\classes directory, but

and put class files under jakarta-tomcat\webapps\extranet\WEB-INF\classes

hope it helps.

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]




ODP: Tomcat and mySQL

2001-02-28 Thread Herchel Wojciech

ok, i've checked tomcat logs - it tries to reconnect, but then it reports:
There was a SQLException: Invalid authorization specification: Access denied
for user: '[EMAIL PROTECTED]' (Using password: NO)
why does tomcat log as 'nobody'? although in server.xml there is a different
connectionUser specified. how can i make it to use original connection user
and passwd?

vVolf


 -Oryginalna wiadomo-
 Od: Cato, Christopher [mailto:[EMAIL PROTECTED]]
 Wysano: 28 lutego 2001 17:56
 Do: '[EMAIL PROTECTED]'
 Temat: RE: Tomcat and mySQL
 
 
 Add ;autoreconnect=true to the db connect string.
 
  -Original Message-
  From: Herchel Wojciech [mailto:[EMAIL PROTECTED]]
  Sent: den 28 februari 2001 17:32
  To: 'Tomcat'
  Subject: Tomcat and mySQL
  
  
  Hi!
  
  I'm using JDBCRealm authorisation.
  How can I force mySQL not to close the connection Tomcat 
  opened upon startup
  (to database where users, roles, user_roles tables are stored)?
  i assume mySQL's variable wait_timeout is responsible for 
  closing inactive
  connections. the default is 28800 secs, will changing it to 
  zero do the
  trick? or else? anyone?
  
  regards, 
  
  vVolf
  
  
 -
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, email: [EMAIL PROTECTED]
  
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, email: [EMAIL PROTECTED]
 

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]




ODP: Tomcat and mySQL

2001-02-28 Thread Herchel Wojciech

ok, now i know what's happening, looking at the process list i can see that
upon startup tomcat logs as specified by connectionUser/Password strings
from server.xml files. but then for no apparent reason it tries to reconnect
as nobody without providing passwd. 
how can i fix that?

vVolf


 -Oryginalna wiadomo-
 Od: Cato, Christopher [mailto:[EMAIL PROTECTED]]
 Wysano: 28 lutego 2001 17:56
 Do: '[EMAIL PROTECTED]'
 Temat: RE: Tomcat and mySQL
 
 
 Add ;autoreconnect=true to the db connect string.
 
  -Original Message-
  From: Herchel Wojciech [mailto:[EMAIL PROTECTED]]
  Sent: den 28 februari 2001 17:32
  To: 'Tomcat'
  Subject: Tomcat and mySQL
  
  
  Hi!
  
  I'm using JDBCRealm authorisation.
  How can I force mySQL not to close the connection Tomcat 
  opened upon startup
  (to database where users, roles, user_roles tables are stored)?
  i assume mySQL's variable wait_timeout is responsible for 
  closing inactive
  connections. the default is 28800 secs, will changing it to 
  zero do the
  trick? or else? anyone?
  
  regards, 
  
  vVolf
  
  
 -
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, email: [EMAIL PROTECTED]
  
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, email: [EMAIL PROTECTED]
 

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]




Cookies in JSP

2001-02-27 Thread Herchel Wojciech

Hello!

I hava JDBCRealm auth, and want to store user's last_accessed time. i
thought cookies would be good for that. my code is as follows:

Locale l = new Locale("pl","PL","UNIX");
  String user = request.getRemoteUser();
String data="";
boolean found = false;
Cookie[] cookies = request.getCookies();
  for (int i = 0; i  cookies.length; i++) {
  Cookie c = cookies[i];
if (c.getName().equals(user)) {
found=true;
data = c.getValue();

c.setValue(DateFormat.getDateTimeInstanceDateFormat.LONG,DateFormat.LONG,l).
format(new Date()));
}   
}

if (!found) {
String bla =
DateFormat.getDateTimeInstance(DateFormat.LONG,DateFormat.LONG,l).format(new
Date());
Cookie newC = new Cookie(request.getRemoteUser(),bla);
newC.setMaxAge(10);
response.addCookie(newC);
}

then variable data would return last_accessed time. but it doesnt! that is a
call to setValue(DateFormat...) is not stored in a cookie for good, only
temporary. only for the new user a new cookie with a proper access time is
stored.

anybody?
thanks.

vVolf

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]




Form based auth

2001-02-27 Thread Herchel Wojciech

Hi all!

How come would Tomcat (Apache?) return 404 Error while trying to
authenticate via form? apparently it does not recognise "j_security_check".
anybody has got any idea? 
here's my code (login.jsp):

div align="center"
form method="POST" action="j_security_check" 
table cellspacing=4
tr
  td colspan=2 class="aaa"Please log in/td
/tr
tr
  td class="lewe"Username:/td
  tdinput type="text" name="j_username"/td
/tr
tr
  td class="lewe"Password:/td
  tdinput type="password" name="j_password"/td
/tr
tr
  td colspan=2 class="aaa"input type="submit" value="Log in"
name="j_security_check"/td
/tr
/table
/form
/div

and i'm getting 404 Error. 

vVolf

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]




ODP: Form based auth

2001-02-27 Thread Herchel Wojciech

hm, according to servlet specification v2.2:
"11.5.3.1 Login Form Notes
...the action of the login form must always be "j_security_check"..."
furthermore, according to tomcat docs, it (tomcat) complies with that!
and it works when i'm testing it on win95+tomcat. but when i moved it on my
company's server (linux) it does not, resulting in said error.
anybody?

vVolf


 
 Is your file "j_security_check" a jsp file or servlet
 If jsp where is the extension!
 If servlet you may want to make sure you are giving the 
 correct context
 path.
 
 
 
 
 
 - Original Message -
 From: "Herchel Wojciech" [EMAIL PROTECTED]
 To: "'Tomcat'" [EMAIL PROTECTED]
 Sent: Tuesday, February 27, 2001 3:14 PM
 Subject: Form based auth
 
 
  Hi all!
 
  How come would Tomcat (Apache?) return 404 Error while trying to
  authenticate via form? apparently it does not recognise
 "j_security_check".
  anybody has got any idea?
  here's my code (login.jsp):
 
  div align="center"
  form method="POST" action="j_security_check" 
  table cellspacing=4
  tr
td colspan=2 class="aaa"Please log in/td
  /tr
  tr
td class="lewe"Username:/td
tdinput type="text" name="j_username"/td
  /tr
  tr
td class="lewe"Password:/td
tdinput type="password" name="j_password"/td
  /tr
  tr
td colspan=2 class="aaa"input type="submit" value="Log in"
  name="j_security_check"/td
  /tr
  /table
  /form
  /div
 
  and i'm getting 404 Error.

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]




ODP: Form based auth

2001-02-27 Thread Herchel Wojciech

oops, i don't really have j_security_check class, i thought it is taken care
of by tomcat...

vVolf


 -Oryginalna wiadomo-
 Od: uthay [mailto:[EMAIL PROTECTED]]
 Wysano: 27 lutego 2001 17:48
 Do: [EMAIL PROTECTED]
 Temat: Re: Form based auth
 
 
 If you are using servlet then you dont need the extension.
 But if your context is say webapps/xxx/
 and you have j_security_check.class inside xxx/WEB-INF
 then you may want to try
 xxx/j_security_check
 
 
 Uthay
 
 
How come would Tomcat (Apache?) return 404 Error while trying to
authenticate via form? apparently it does not recognise
   "j_security_check".
anybody has got any idea?
here's my code (login.jsp):
   
div align="center"
form method="POST" action="j_security_check" 
table cellspacing=4
tr
  td colspan=2 class="aaa"Please log in/td
/tr
tr
  td class="lewe"Username:/td
  tdinput type="text" name="j_username"/td
/tr
tr
  td class="lewe"Password:/td
  tdinput type="password" name="j_password"/td
/tr
tr
  td colspan=2 class="aaa"input type="submit" 
 value="Log in"
name="j_security_check"/td
/tr
/table
/form
/div
   
and i'm getting 404 Error.
 
  

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]




ODP: MySQL question - No suitable driver

2001-02-27 Thread Herchel Wojciech

most likely the mm driver is not in your classpath

vVolf


 -Oryginalna wiadomooe-
 Od: Wong, Connie [mailto:[EMAIL PROTECTED]]
 Wysano: 27 lutego 2001 20:56
 Do: [EMAIL PROTECTED]
 Temat: MySQL question - No suitable driver
 
 
 Hi,
 
 I try to connect a servlet talk to the MySQL database.
  I set:
  
  drivername = "org.gjt.mm.mysql.Driver" and
  url = "jdbc:mysql:tbl_data"
 
 I downloaded MyODBC and fill in the ODBC setup and add the
 "mm_mysql-2_0_2-bin.jar" in the classpath.
 
 When I run my servlet on the browser, it display the 
 following Exception:
 
 
 java.sql.SQLException: No suitable driver at
 java.sql.DriverManager.getConnection(DriverManager.java:537) at
 java.sql.DriverManager.getConnection(DriverManager.java:146) at
 Benchmark_sql.query(Benchmark_sql.java:94) at
 Benchmark_sql.doGet(Benchmark_sql.java:47) at
 javax.servlet.http.HttpServlet.service(HttpServlet.java:740) at
 javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at
 org.apache.tomcat.core.ServletWrapper.handleRequest(ServletWra
 pper.java:503)
 at
 org.apache.tomcat.core.ServletWrapper.handleRequest(ServletWra
 pper.java:597)
 at
 org.apache.tomcat.servlets.InvokerServlet.service(InvokerServl
 et.java:257)
 at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at
 org.apache.tomcat.core.ServletWrapper.handleRequest(ServletWra
 pper.java:503)
 at 
 org.apache.tomcat.core.ContextManager.service(ContextManager.j
 ava:559) at
 org.apache.tomcat.service.http.HttpConnectionHandler.processCo
 nnection(HttpC
 onnectionHandler.java:160) at
 org.apache.tomcat.service.TcpConnectionThread.run(SimpleTcpEnd
 point.java:338
 ) at java.lang.Thread.run(Thread.java:484) n
 
 
 Can someon tell me what else I do miss?
 Thanks,
 Connie
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, email: [EMAIL PROTECTED]
 

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]