You are viewing a plain text version of this content. The canonical link for it is here.
Posted to server-dev@james.apache.org by Jason Webb <jw...@inovem.com> on 2002/08/15 12:30:07 UTC

NNTP auth issues

I'm trying to link our database into the NNTP auth mechanism as we
provide an MLM that has a lot of NNTP style features. However, when I
ask for a DataSource from the ComponentManager, I get an exception
thrown at me:

org.apache.avalon.framework.component.ComponentException: Unable to
provide implementation for
org.apache.avalon.cornerstone.services.datasource.DataSourceSelector
        at
org.apache.avalon.framework.component.DefaultComponentManager.lookup
DefaultComponentManager.java:70)
        at
org.apache.james.nntpserver.AuthServiceImpl.isAuthenticated(AuthServiceI
mpl.java:84)
        at
org.apache.james.nntpserver.AuthServiceImpl.isAuthorized(AuthServiceImpl
.java:53)


Etc....

It all works fine in the mailet we use for our MLM. Is NNTP special with
regards to DataSources?

Help!

-- Jason


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: NNTP auth issues

Posted by Harmeet Bedi <ha...@kodemuse.com>.
----- Original Message -----
From: "Jason Webb" <jw...@inovem.com>
To: "'James Developers List'" <ja...@jakarta.apache.org>
Sent: Thursday, August 15, 2002 3:30 AM
Subject: NNTP auth issues


> I'm trying to link our database into the NNTP auth mechanism as we
> provide an MLM that has a lot of NNTP style features. However, when I
> ask for a DataSource from the ComponentManager, I get an exception
> thrown at me:
>
> org.apache.avalon.framework.component.ComponentException: Unable to
> provide implementation for
> org.apache.avalon.cornerstone.services.datasource.DataSourceSelector
>         at
> org.apache.avalon.framework.component.DefaultComponentManager.lookup
> DefaultComponentManager.java:70)
>         at
>
Not sure what 'DataSourceSelector' requires. It may be that MailImpl etc.
are calling DataSourceSelector with some configuration and your
AuthServiceImpl is not.


Harmeet

org.apache.james.nntpserver.AuthServiceImpl.isAuthenticated(AuthServiceI
> mpl.java:84)
>         at
> org.apache.james.nntpserver.AuthServiceImpl.isAuthorized(AuthServiceImpl
> .java:53)
>
>
> Etc....
>
> It all works fine in the mailet we use for our MLM. Is NNTP special with
> regards to DataSources?
>
> Help!
>
> -- Jason
>
>
> --
> To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
> For additional commands, e-mail:
<ma...@jakarta.apache.org>


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


RE: NNTP auth issues

Posted by Jason Webb <jw...@inovem.com>.
Obvious if you think about it...

All you need to do is add the datasource selector lines as follows:
(I'm very sorry, but given my dev env., I can't provide diffs without
destroying lots of work, or giving you stuff you don't need)

In AuthServiceImpl.xinfo add:
    <dependency>
      <service
name="org.apache.avalon.cornerstone.services.datasource.DataSourceSelect
or" version="1.0"/>
    </dependency>

In james-assembly.xml:
(add the DataSourceSelector line)

  <!-- NNTP Authentication Service -->
  <block class="org.apache.james.nntpserver.AuthServiceImpl"
name="nntpauth" >
    <provide name="users-store"
role="org.apache.james.services.UsersStore"/>
        <provide name="database-connections"
	
role="org.apache.avalon.cornerstone.services.datasource.DataSourceSelect
or" />
  </block>

-- Jason


-----Original Message-----
From: Noel J. Bergman [mailto:noel@devtech.com] 
Sent: 19 August 2002 07:39
To: James Developers List
Subject: RE: NNTP auth issues


Paul,

FYI, the NNTP code is not a Mailet.  :-)  It is one of these:

public class AuthServiceImpl extends AbstractLogEnabled
    implements AuthService, Composable, Configurable

and acquired by the NNTPHandler like this:

  auth =
(AuthService)componentManager.lookup("org.apache.james.nntpserver.AuthSe
rvic
e");

so I presume that it is probably supposed to carry the Component
decoration until you show us how you want that replaced.

> anti-pattern of Mailets getting free reign of the ComponentManager

We'll get there.  There is no way to have a portable Mailet API if
Mailets have to keep getting at non-portable services.

	--- Noel

-----Original Message-----
From: Paul Hammant [mailto:Paul_Hammant@yahoo.com]
Sent: Monday, August 19, 2002 2:18
To: James Developers List
Subject: Re: NNTP auth issues


Noel,  Jason,

>Shouldn't be any different.  Did you make any progress on this?
>
>You might want to ask Paul Hammant to take a look at it.  For example, 
>I don't know what the relationship is between the .xinfo files and 
>things
like
>the assembly file, but the .xinfo for the nntp server doesn't have an 
>entry for the UsersStore, which is present in the .xinfo for other 
>services.
>
There is a strong relationship is Noel suspects.

You will have to fork the root NNTP block to declare its need for and
get DataSource from ComponentManager in its compose method.

At least until we find a way of eliminating the dar I suggest insecure
anti-pattern of Mailets getting free reign of the ComponentManager.

- Paul

>	--- Noel
>
>-----Original Message-----
>From: Jason Webb [mailto:jw@inovem.com]
>Sent: Thursday, August 15, 2002 6:30
>To: 'James Developers List'
>Subject: NNTP auth issues
>
>
>I'm trying to link our database into the NNTP auth mechanism as we 
>provide an MLM that has a lot of NNTP style features. However, when I 
>ask for a DataSource from the ComponentManager, I get an exception 
>thrown at me:
>
>org.apache.avalon.framework.component.ComponentException: Unable to 
>provide implementation for 
>org.apache.avalon.cornerstone.services.datasource.DataSourceSelector
>        at 
>org.apache.avalon.framework.component.DefaultComponentManager.lookup
>DefaultComponentManager.java:70)
>        at 
>org.apache.james.nntpserver.AuthServiceImpl.isAuthenticated(AuthService
>I
>mpl.java:84)
>        at
>org.apache.james.nntpserver.AuthServiceImpl.isAuthorized(AuthServiceImp
l
>.java:53)
>
>
>Etc....
>
>It all works fine in the mailet we use for our MLM. Is NNTP special 
>with regards to DataSources?
>
>Help!
>
>-- Jason
>
>
>--
>To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
>For additional commands, e-mail: 
><ma...@jakarta.apache.org>
>
>
>




--
To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
For additional commands, e-mail:
<ma...@jakarta.apache.org>


--
To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
For additional commands, e-mail:
<ma...@jakarta.apache.org>



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


RE: NNTP auth issues

Posted by "Noel J. Bergman" <no...@devtech.com>.
Paul,

FYI, the NNTP code is not a Mailet.  :-)  It is one of these:

public class AuthServiceImpl extends AbstractLogEnabled
    implements AuthService, Composable, Configurable

and acquired by the NNTPHandler like this:

  auth =
(AuthService)componentManager.lookup("org.apache.james.nntpserver.AuthServic
e");

so I presume that it is probably supposed to carry the Component decoration
until you show us how you want that replaced.

> anti-pattern of Mailets getting free reign of the ComponentManager

We'll get there.  There is no way to have a portable Mailet API if Mailets
have to keep getting at non-portable services.

	--- Noel

-----Original Message-----
From: Paul Hammant [mailto:Paul_Hammant@yahoo.com]
Sent: Monday, August 19, 2002 2:18
To: James Developers List
Subject: Re: NNTP auth issues


Noel,  Jason,

>Shouldn't be any different.  Did you make any progress on this?
>
>You might want to ask Paul Hammant to take a look at it.  For example, I
>don't know what the relationship is between the .xinfo files and things
like
>the assembly file, but the .xinfo for the nntp server doesn't have an entry
>for the UsersStore, which is present in the .xinfo for other services.
>
There is a strong relationship is Noel suspects.

You will have to fork the root NNTP block to declare its need for and
get DataSource from ComponentManager in its compose method.

At least until we find a way of eliminating the dar I suggest insecure
anti-pattern of Mailets getting free reign of the ComponentManager.

- Paul

>	--- Noel
>
>-----Original Message-----
>From: Jason Webb [mailto:jw@inovem.com]
>Sent: Thursday, August 15, 2002 6:30
>To: 'James Developers List'
>Subject: NNTP auth issues
>
>
>I'm trying to link our database into the NNTP auth mechanism as we
>provide an MLM that has a lot of NNTP style features. However, when I
>ask for a DataSource from the ComponentManager, I get an exception
>thrown at me:
>
>org.apache.avalon.framework.component.ComponentException: Unable to
>provide implementation for
>org.apache.avalon.cornerstone.services.datasource.DataSourceSelector
>        at
>org.apache.avalon.framework.component.DefaultComponentManager.lookup
>DefaultComponentManager.java:70)
>        at
>org.apache.james.nntpserver.AuthServiceImpl.isAuthenticated(AuthServiceI
>mpl.java:84)
>        at
>org.apache.james.nntpserver.AuthServiceImpl.isAuthorized(AuthServiceImpl
>.java:53)
>
>
>Etc....
>
>It all works fine in the mailet we use for our MLM. Is NNTP special with
>regards to DataSources?
>
>Help!
>
>-- Jason
>
>
>--
>To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
>For additional commands, e-mail: <ma...@jakarta.apache.org>
>
>
>




--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: NNTP auth issues

Posted by Paul Hammant <Pa...@yahoo.com>.
Noel,  Jason,

>Shouldn't be any different.  Did you make any progress on this?
>
>You might want to ask Paul Hammant to take a look at it.  For example, I
>don't know what the relationship is between the .xinfo files and things like
>the assembly file, but the .xinfo for the nntp server doesn't have an entry
>for the UsersStore, which is present in the .xinfo for other services.
>
There is a strong relationship is Noel suspects.

You will have to fork the root NNTP block to declare its need for and 
get DataSource from ComponentManager in its compose method.

At least until we find a way of eliminating the dar I suggest insecure 
anti-pattern of Mailets getting free reign of the ComponentManager.

- Paul

>	--- Noel
>
>-----Original Message-----
>From: Jason Webb [mailto:jw@inovem.com]
>Sent: Thursday, August 15, 2002 6:30
>To: 'James Developers List'
>Subject: NNTP auth issues
>
>
>I'm trying to link our database into the NNTP auth mechanism as we
>provide an MLM that has a lot of NNTP style features. However, when I
>ask for a DataSource from the ComponentManager, I get an exception
>thrown at me:
>
>org.apache.avalon.framework.component.ComponentException: Unable to
>provide implementation for
>org.apache.avalon.cornerstone.services.datasource.DataSourceSelector
>        at
>org.apache.avalon.framework.component.DefaultComponentManager.lookup
>DefaultComponentManager.java:70)
>        at
>org.apache.james.nntpserver.AuthServiceImpl.isAuthenticated(AuthServiceI
>mpl.java:84)
>        at
>org.apache.james.nntpserver.AuthServiceImpl.isAuthorized(AuthServiceImpl
>.java:53)
>
>
>Etc....
>
>It all works fine in the mailet we use for our MLM. Is NNTP special with
>regards to DataSources?
>
>Help!
>
>-- Jason
>
>
>--
>To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
>For additional commands, e-mail: <ma...@jakarta.apache.org>
>
>  
>




--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: NNTP auth issues

Posted by Stephen McConnell <mc...@apache.org>.

Noel J. Bergman wrote:

>Shouldn't be any different.  Did you make any progress on this?
>
>You might want to ask Paul Hammant to take a look at it.  For example, I
>don't know what the relationship is between the .xinfo files and things like
>the assembly file, but the .xinfo for the nntp server doesn't have an entry
>for the UsersStore, which is present in the .xinfo for other services.
>
>	--- Noel
>
>-----Original Message-----
>From: Jason Webb [mailto:jw@inovem.com]
>Sent: Thursday, August 15, 2002 6:30
>To: 'James Developers List'
>Subject: NNTP auth issues
>
>
>I'm trying to link our database into the NNTP auth mechanism as we
>provide an MLM that has a lot of NNTP style features. However, when I
>ask for a DataSource from the ComponentManager, I get an exception
>thrown at me:
>
>org.apache.avalon.framework.component.ComponentException: Unable to
>provide implementation for
>org.apache.avalon.cornerstone.services.datasource.DataSourceSelector
>        at
>org.apache.avalon.framework.component.DefaultComponentManager.lookup
>DefaultComponentManager.java:70)
>        at
>org.apache.james.nntpserver.AuthServiceImpl.isAuthenticated(AuthServiceI
>mpl.java:84)
>        at
>org.apache.james.nntpserver.AuthServiceImpl.isAuthorized(AuthServiceImpl
>.java:53)
>
>
>Etc....
>  
>

Could you post the Etc.
It as just getting interesting ;-)
Steve.

>It all works fine in the mailet we use for our MLM. Is NNTP special with
>regards to DataSources?
>
>Help!
>
>-- Jason
>
>
>--
>To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
>For additional commands, e-mail: <ma...@jakarta.apache.org>
>
>  
>

-- 

Stephen J. McConnell

OSM SARL
digital products for a global economy
mailto:mcconnell@osm.net
http://www.osm.net




--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


RE: NNTP auth issues

Posted by "Noel J. Bergman" <no...@devtech.com>.
Shouldn't be any different.  Did you make any progress on this?

You might want to ask Paul Hammant to take a look at it.  For example, I
don't know what the relationship is between the .xinfo files and things like
the assembly file, but the .xinfo for the nntp server doesn't have an entry
for the UsersStore, which is present in the .xinfo for other services.

	--- Noel

-----Original Message-----
From: Jason Webb [mailto:jw@inovem.com]
Sent: Thursday, August 15, 2002 6:30
To: 'James Developers List'
Subject: NNTP auth issues


I'm trying to link our database into the NNTP auth mechanism as we
provide an MLM that has a lot of NNTP style features. However, when I
ask for a DataSource from the ComponentManager, I get an exception
thrown at me:

org.apache.avalon.framework.component.ComponentException: Unable to
provide implementation for
org.apache.avalon.cornerstone.services.datasource.DataSourceSelector
        at
org.apache.avalon.framework.component.DefaultComponentManager.lookup
DefaultComponentManager.java:70)
        at
org.apache.james.nntpserver.AuthServiceImpl.isAuthenticated(AuthServiceI
mpl.java:84)
        at
org.apache.james.nntpserver.AuthServiceImpl.isAuthorized(AuthServiceImpl
.java:53)


Etc....

It all works fine in the mailet we use for our MLM. Is NNTP special with
regards to DataSources?

Help!

-- Jason


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>