TC on Suse 8.1, urgent, please

2003-03-06 Thread Uros Kotnik
Hi I know this is for tomcat-user but maybe I can get faster answer
here.

I'm using TC 4.1.18

I developed app in W2K environment, but  have problems to configure TC
on Suse 8.1 Linux.

I have my base classes with my realm implementation and other stuff in
framework.jar,  framework.jar is in TChome/server/lib

On windows everything is working OK but when I try to start TC on Linux
I first get :

- java.lang.ClassNotFoundException: org.asterius.servlet.InitListener
InitListener is my class in framework.jar
OK, then I put framework.jar in classpath

Afther that I get this :

- java.lang.NoClassDefFoundError: org/apache/catalina/realm/RealmBase
because I'm using RealmBase in framework.jar to make my own realm
Than, when I put RealmBase in classpath I get
java.lang.NoClassDefFoundError for other classes and so on...

It seems that I have to put all TC classes(jar) in classpath ?
Any solution to that ?

Thanx


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



TC on Suse 8.1, urgent, please

2003-03-06 Thread Uros Kotnik
Hi I know this is for tomcat-user but maybe I can get faster answer
here.

I'm using TC 4.1.18

I developed app in W2K environment, but  have problems to configure TC
on Suse 8.1 Linux.

I have my base classes with my realm implementation and other stuff in
framework.jar,  framework.jar is in TChome/server/lib

On windows everything is working OK but when I try to start TC on Linux
I first get :

- java.lang.ClassNotFoundException: org.asterius.servlet.InitListener
InitListener is my class in framework.jar
OK, then I put framework.jar in classpath

Afther that I get this :

- java.lang.NoClassDefFoundError: org/apache/catalina/realm/RealmBase
because I'm using RealmBase in framework.jar to make my own realm Than,
when I put RealmBase in classpath I get java.lang.NoClassDefFoundError
for other classes and so on...

It seems that I have to put all TC classes(jar) in classpath ? Any
solution to that ?

Thanx



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



RE: TC on Suse 8.1, urgent, please

2003-03-06 Thread Uros Kotnik
Yes, obviously my colleague didn't follow my instructions where to put
realm implementation .jar, we lost 3 hours and on the end he told me
..but I didn't put it tchome\server\lib..  (where it should be)
Now everything is working... 

Sorry.



-Original Message-
From: Tom Anderson [mailto:[EMAIL PROTECTED] 
Sent: Thursday, March 06, 2003 19:19 
To: Tomcat Developers List
Subject: Re: TC on Suse 8.1, urgent, please

Have you read this document?

http://jakarta.apache.org/tomcat/tomcat-4.1-doc/class-loader-howto.html


On Thursday, March 6, 2003, at 09:58 AM, Uros Kotnik wrote:

 Hi I know this is for tomcat-user but maybe I can get faster answer
 here.

 I'm using TC 4.1.18

 I developed app in W2K environment, but  have problems to configure TC
 on Suse 8.1 Linux.

 I have my base classes with my realm implementation and other stuff in
 framework.jar,  framework.jar is in TChome/server/lib

 On windows everything is working OK but when I try to start TC on
Linux
 I first get :

 - java.lang.ClassNotFoundException: org.asterius.servlet.InitListener
   InitListener is my class in framework.jar
 OK, then I put framework.jar in classpath

 Afther that I get this :

 - java.lang.NoClassDefFoundError: org/apache/catalina/realm/RealmBase
 because I'm using RealmBase in framework.jar to make my own realm
Than,
 when I put RealmBase in classpath I get java.lang.NoClassDefFoundError
 for other classes and so on...

 It seems that I have to put all TC classes(jar) in classpath ? Any
 solution to that ?

 Thanx



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



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


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



RE: DataSource realm, apply fix for 16316 bug, still not working ?

2003-03-03 Thread Uros Kotnik
Basicaly my own Realm implementation is copy/paste DataSourceRealm, I
just changed preparedRoles and preparedCredentials in start() and also
modified hasRole(Principal principal, String role) for my needs, but
exception that I get is when opening DataSource which is defined in
Context, it seemes that Context is not started yet when opening DB
connection from Realm ?


-Original Message-
From: Glenn Nielsen [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, February 25, 2003 17:18 
To: Tomcat Developers List
Subject: Re: DataSource realm, apply fix for 16316 bug, still not
working ?

So the problem isn't in the DataSourceRealm that comes with Tomcat?
It is in your own Realm implementation?  If so, debugging the problem
is up to you.

 From your config you might try using the fully qualified JNDI name
in your Realm config java:env/jdbc/hsqldb.

Regards,

Glenn
Uros Kotnik wrote:
 OK, I'm doing this:
 
 
 I made class 
 -
 
 public class UserManager
 extends RealmBase
 
 It's almost same like DataSourceRealm just little changed to suit my
DB.
 
 I deleted code parts from start() that validates that we can open our
 connection and also put this code part  to 
 
 public Principal authenticate(String username, String credentials)
 
 if (dbConnection == null) {
 return null;
 }
 
 
 
 
 This is where I get exception
 -
 
 private Connection open() {
 try {
 StandardServer server = (StandardServer)
 ServerFactory.getServer();
 Context context = server.getGlobalNamingContext();
 DataSource dataSource =
 (DataSource)context.lookup(dataSourceName); //exception here
 
 return dataSource.getConnection();
 } catch (Exception e) {
 // Log the problem for posterity
 log(sm.getString(dataSourceRealm.exception), e);
 }
 return null;
 }
 
 This is from the log:
 -
 
 003-02-25 15:09:16 DataSourceRealm[]: Exception performing
 authentication
 javax.naming.NameNotFoundException: Name jdbc is not bound in this
 Context
 at org.apache.naming.NamingContext.lookup(NamingContext.java:811)
 at org.apache.naming.NamingContext.lookup(NamingContext.java:194)
 at org.asterius.tomcat.security.UserManager.open(UserManager.java:647)
 at

org.asterius.tomcat.security.UserManager.authenticate(UserManager.java:4
 80)
 at

org.apache.catalina.authenticator.FormAuthenticator.authenticate(FormAut
 henticator.java:263) at

org.apache.catalina.authenticator.AuthenticatorBase.invoke(Authenticator
 Base.java:480)
 
 
 
 This is Server.xml
 --
 
 Context debug=0 docBase=C:\Projects\ipcs\ipcs path=
 workDir=C:\Projects\ipcs\ipcs
 
 
   Resource name=jdbc/hsqldb
   auth=Container
   type=javax.sql.DataSource/
 
   ResourceParams name=jdbc/hsqldb
 parameter
   namefactory/name
   valueorg.apache.commons.dbcp.BasicDataSourceFactory/value
 /parameter
 
 parameter
   namemaxActive/name
   value100/value
 /parameter
 
 parameter
   namemaxIdle/name
   value30/value
 /parameter
 

 parameter
   namemaxWait/name
   value1/value
 /parameter
 
 !-- dB username and password for dB connections  --
 parameter
  nameusername/name
  valueiuser/value
 /parameter
 parameter
  namepassword/name
  valueiuser/value
 /parameter
 
 !-- Class name for JDBC driver --
 parameter
namedriverClassName/name
valueorg.hsqldb.jdbcDriver/value   
 /parameter
 
 parameter
   nameurl/name
   valuejdbc:hsqldb:hsql://asterix/value  
 /parameter
   /ResourceParams
   
   
 
 Realm className=org.asterius.tomcat.security.UserManager debug=99

dataSourceName=jdbc/hsqldb
userTable=ic_users userNameCol=login_name
userCredCol=password
userRoleTable=ic_groups roleNameCol=group_name 
linkUserRoleTable=ic_users_groups groupIDcol=id_group
 userIDcol=id_user
userIDlang = id_language userRealName=real_name
/ 
 
 

--
Glenn Nielsen [EMAIL PROTECTED] | /* Spelin donut madder|
MOREnet System Programming   |  * if iz ina coment.  |
Missouri Research and Education Network  |  */   |
--


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


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



RE: DataSource realm, apply fix for 16316 bug, still not working ?

2003-02-26 Thread Uros Kotnik
Basicaly my own Realm implementation is copy/paste DataSourceRealm, I
just changed preparedRoles and preparedCredentials in start() and also
modified hasRole(Principal principal, String role) for my needs, but
exception that I get is when opening DataSource which is defined in
Context, it seemes that Context is not started yet when opening DB
connection from Realm ?


-Original Message-
From: Glenn Nielsen [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, February 25, 2003 17:18 
To: Tomcat Developers List
Subject: Re: DataSource realm, apply fix for 16316 bug, still not
working ?

So the problem isn't in the DataSourceRealm that comes with Tomcat?
It is in your own Realm implementation?  If so, debugging the problem
is up to you.

 From your config you might try using the fully qualified JNDI name
in your Realm config java:env/jdbc/hsqldb.

Regards,

Glenn
Uros Kotnik wrote:
 OK, I'm doing this:
 
 
 I made class 
 -
 
 public class UserManager
 extends RealmBase
 
 It's almost same like DataSourceRealm just little changed to suit my
DB.
 
 I deleted code parts from start() that validates that we can open our
 connection and also put this code part  to 
 
 public Principal authenticate(String username, String credentials)
 
 if (dbConnection == null) {
 return null;
 }
 
 
 
 
 This is where I get exception
 -
 
 private Connection open() {
 try {
 StandardServer server = (StandardServer)
 ServerFactory.getServer();
 Context context = server.getGlobalNamingContext();
 DataSource dataSource =
 (DataSource)context.lookup(dataSourceName); //exception here
 
 return dataSource.getConnection();
 } catch (Exception e) {
 // Log the problem for posterity
 log(sm.getString(dataSourceRealm.exception), e);
 }
 return null;
 }
 
 This is from the log:
 -
 
 003-02-25 15:09:16 DataSourceRealm[]: Exception performing
 authentication
 javax.naming.NameNotFoundException: Name jdbc is not bound in this
 Context
 at org.apache.naming.NamingContext.lookup(NamingContext.java:811)
 at org.apache.naming.NamingContext.lookup(NamingContext.java:194)
 at org.asterius.tomcat.security.UserManager.open(UserManager.java:647)
 at

org.asterius.tomcat.security.UserManager.authenticate(UserManager.java:4
 80)
 at

org.apache.catalina.authenticator.FormAuthenticator.authenticate(FormAut
 henticator.java:263) at

org.apache.catalina.authenticator.AuthenticatorBase.invoke(Authenticator
 Base.java:480)
 
 
 
 This is Server.xml
 --
 
 Context debug=0 docBase=C:\Projects\ipcs\ipcs path=
 workDir=C:\Projects\ipcs\ipcs
 
 
   Resource name=jdbc/hsqldb
   auth=Container
   type=javax.sql.DataSource/
 
   ResourceParams name=jdbc/hsqldb
 parameter
   namefactory/name
   valueorg.apache.commons.dbcp.BasicDataSourceFactory/value
 /parameter
 
 parameter
   namemaxActive/name
   value100/value
 /parameter
 
 parameter
   namemaxIdle/name
   value30/value
 /parameter
 

 parameter
   namemaxWait/name
   value1/value
 /parameter
 
 !-- dB username and password for dB connections  --
 parameter
  nameusername/name
  valueiuser/value
 /parameter
 parameter
  namepassword/name
  valueiuser/value
 /parameter
 
 !-- Class name for JDBC driver --
 parameter
namedriverClassName/name
valueorg.hsqldb.jdbcDriver/value   
 /parameter
 
 parameter
   nameurl/name
   valuejdbc:hsqldb:hsql://asterix/value  
 /parameter
   /ResourceParams
   
   
 
 Realm className=org.asterius.tomcat.security.UserManager debug=99

dataSourceName=jdbc/hsqldb
userTable=ic_users userNameCol=login_name
userCredCol=password
userRoleTable=ic_groups roleNameCol=group_name 
linkUserRoleTable=ic_users_groups groupIDcol=id_group
 userIDcol=id_user
userIDlang = id_language userRealName=real_name
/ 
 
 

--
Glenn Nielsen [EMAIL PROTECTED] | /* Spelin donut madder|
MOREnet System Programming   |  * if iz ina coment.  |
Missouri Research and Education Network  |  */   |
--


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


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



DataSource realm, apply fix for 16316 bug, still not working ?

2003-02-25 Thread Uros Kotnik
Hi,

Applyed fix for bug 16316, DataSourceRealm can not find JNDI name in
context.
Before fix solution was to put JNDI Named DataSource which is used
by the DataSourceRealm in the GlobalNamingResources section of your
server.xml config and that worked.
I thought than now I can left JNDI Named DataSource from
GlobalNamingResources and put it in Context (or use JNDI Named
DataSource that I defined in context) but I still get  Name jdbc is not
bound in this Context.

Thanx.





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



RE: DataSource realm, apply fix for 16316 bug, still not working ?

2003-02-25 Thread Uros Kotnik
OK, I'm doing this:


I made class 
-

public class UserManager
extends RealmBase

It's almost same like DataSourceRealm just little changed to suit my DB.

I deleted code parts from start() that validates that we can open our
connection and also put this code part  to 

public Principal authenticate(String username, String credentials)

if (dbConnection == null) {
return null;
}




This is where I get exception
-

private Connection open() {
try {
StandardServer server = (StandardServer)
ServerFactory.getServer();
Context context = server.getGlobalNamingContext();
DataSource dataSource =
(DataSource)context.lookup(dataSourceName); //exception here

return dataSource.getConnection();
} catch (Exception e) {
// Log the problem for posterity
log(sm.getString(dataSourceRealm.exception), e);
}
return null;
}

This is from the log:
-

003-02-25 15:09:16 DataSourceRealm[]: Exception performing
authentication
javax.naming.NameNotFoundException: Name jdbc is not bound in this
Context
at org.apache.naming.NamingContext.lookup(NamingContext.java:811)
at org.apache.naming.NamingContext.lookup(NamingContext.java:194)
at org.asterius.tomcat.security.UserManager.open(UserManager.java:647)
at
org.asterius.tomcat.security.UserManager.authenticate(UserManager.java:4
80)
at
org.apache.catalina.authenticator.FormAuthenticator.authenticate(FormAut
henticator.java:263) at
org.apache.catalina.authenticator.AuthenticatorBase.invoke(Authenticator
Base.java:480)



This is Server.xml
--

Context debug=0 docBase=C:\Projects\ipcs\ipcs path=
workDir=C:\Projects\ipcs\ipcs


  Resource name=jdbc/hsqldb
auth=Container
type=javax.sql.DataSource/

  ResourceParams name=jdbc/hsqldb
parameter
  namefactory/name
  valueorg.apache.commons.dbcp.BasicDataSourceFactory/value
/parameter

parameter
  namemaxActive/name
  value100/value
/parameter

parameter
  namemaxIdle/name
  value30/value
/parameter

   
parameter
  namemaxWait/name
  value1/value
/parameter

!-- dB username and password for dB connections  --
parameter
 nameusername/name
 valueiuser/value
/parameter
parameter
 namepassword/name
 valueiuser/value
/parameter

!-- Class name for JDBC driver --
parameter
   namedriverClassName/name
   valueorg.hsqldb.jdbcDriver/value   
/parameter

parameter
  nameurl/name
  valuejdbc:hsqldb:hsql://asterix/value  
/parameter
  /ResourceParams



Realm className=org.asterius.tomcat.security.UserManager debug=99  
   dataSourceName=jdbc/hsqldb
   userTable=ic_users userNameCol=login_name userCredCol=password
   userRoleTable=ic_groups roleNameCol=group_name 
   linkUserRoleTable=ic_users_groups groupIDcol=id_group
userIDcol=id_user
   userIDlang = id_language userRealName=real_name
   /   









-Original Message-
From: Glenn Nielsen [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, February 25, 2003 14:52 
To: Tomcat Developers List
Subject: Re: DataSource realm, apply fix for 16316 bug, still not
working ?

The code for DataSourceRealm defers obtaining the db connection from
the JNDI named JDBC DataSource until it is used, after the context
is started.  What you are trying to do should work.

Please post more information about your configuration and any stack
traces or errors which get logged.

Glenn

Uros Kotnik wrote:
 Hi,
 
 Applyed fix for bug 16316, DataSourceRealm can not find JNDI name in
 context.
 Before fix solution was to put JNDI Named DataSource which is used
 by the DataSourceRealm in the GlobalNamingResources section of your
 server.xml config and that worked.
 I thought than now I can left JNDI Named DataSource from
 GlobalNamingResources and put it in Context (or use JNDI Named
 DataSource that I defined in context) but I still get  Name jdbc is
not
 bound in this Context.
 
 Thanx.
 
 
 
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]



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


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



Accessing DataSourceRealm from servlet

2003-02-11 Thread Uros Kotnik
Hi,

I implemented my own class for user authentication based on RealmBase
class, basicaly it's DataSourceRealm class just changed to my needs
(added some methods like getUserRealName() etc.)
So the class is

public class MyDataSourceRealm
extends RealmBase {.

I put jar with my class  in tc_home/server/lib, defined it in
server.xml. And everything is working OK.

Only problem that I have is that I can't access that class from servlet
and use some of my added methods, like this:

  try{
Context ctx = new InitialContext();
MyDataSourceRealm um =
(MyDataSourceRealm)ctx.lookup(java:comp/myDataSourceRealm);
String sFullName = um.getFullName(req.getRemoteUser());
  }
  catch(NamingException e){
System.out.println(e.toString());   
  }

I get :

javax.naming.NameNotFoundException: Name myDataSourceRealm is not bound
in this
Context

So, how I can gain access to myDataSourceRealm ?

Thanx


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




RE: Accessing DataSourceRealm from servlet

2003-02-11 Thread Uros Kotnik
So is there a way to access my own realm implementation from Servlet ?



-Original Message-
From: Glenn Nielsen [mailto:[EMAIL PROTECTED]] 
Sent: Tuesday, February 11, 2003 13:26 
To: Tomcat Developers List
Subject: Re: Accessing DataSourceRealm from servlet

The DataSourceRealm uses a JNDI named JDBC DataSource, it is not a
JNDI named resource itself.

Glenn

Uros Kotnik wrote:
 Hi,
 
 I implemented my own class for user authentication based on RealmBase
 class, basicaly it's DataSourceRealm class just changed to my needs
 (added some methods like getUserRealName() etc.)
 So the class is
 
 public class MyDataSourceRealm
 extends RealmBase {.
 
 I put jar with my class  in tc_home/server/lib, defined it in
 server.xml. And everything is working OK.
 
 Only problem that I have is that I can't access that class from
servlet
 and use some of my added methods, like this:
 
   try{
 Context ctx = new InitialContext();
 MyDataSourceRealm um =
 (MyDataSourceRealm)ctx.lookup(java:comp/myDataSourceRealm);
 String sFullName = um.getFullName(req.getRemoteUser());
   }
   catch(NamingException e){
 System.out.println(e.toString());   
   }
 
 I get :
 
 javax.naming.NameNotFoundException: Name myDataSourceRealm is not
bound
 in this
 Context
 
 So, how I can gain access to myDataSourceRealm ?
 
 Thanx
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]




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


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