[Building Sakai] UserDirectoryService, SiteService, Injecti on Failure

Matthew Buckett matthew.buckett at oucs.ox.ac.uk
Wed Jun 24 02:46:01 PDT 2009


2009/6/24 <m_yaghmaie at modares.ac.ir>

> Hi,
>
> I have a problem in using the UserDirectoryService in my tool:
>

I think you have deployed the Sakai APIs sakai-site-api and sakai-user-api
into your webapp and as a result the have two SiteService APIs in different
classloaders. Despite the fact that they are the same class the JVM
considers them incompatible because they have different classloaders (hence
convert the DbSiteService to SiteService).

If you are using maven to build to your tool you should prevent the Sakai
APIs getting deployed into your tool's WAR file by making them provided in
the maven dependency section, for example:

    <dependency>
      <groupId>org.sakaiproject</groupId>
      <artifactId>sakai-user-api</artifactId>
      <version>2.5.0</version>
      <scope>provided</scope>
    </dependency>

If you are inheriting from the master Sakai POM in your tool then they
should already be set as scope provided (unless you redeclare the scope) so
you can leave it out.

setting property values; nested exception is
> org.springframework.beans.PropertyBatchUpdateException; nested
> PropertyAccessExceptions (2) are:
> PropertyAccessException 1: org.springframework.beans.TypeMismatchException:
> Failed to convert property value of type
> [org.sakaiproject.site.impl.DbSiteService$$EnhancerByCGLIB$$4182bec6] to
> required type [org.sakaiproject.site.api.SiteService] for property
> 'siteService'; nested exception is java.lang.IllegalArgumentException:
> Cannot convert value of type
> [org.sakaiproject.site.impl.DbSiteService$$EnhancerByCGLIB$$4182bec6] to
> required type [org.sakaiproject.site.api.SiteService] for property
> 'siteService': no matching editors or conversion strategy found
>

DbSiteService implements the SiteService API.

-- 
 Matthew Buckett
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://collab.sakaiproject.org/pipermail/sakai-dev/attachments/20090624/f66e5f5d/attachment.html 


More information about the sakai-dev mailing list