Common issues with Profile2

Common issues with Profile2

The following are commonly reported issues that are easily resolved.

Fails to build

You get build errors similar to these:

[INFO] Error building POM (may not be this project's POM).


Project ID: uk.ac.lancs.e_science:sakai-profile2-api
POM Location: /Users/swinsbur/dev/sakai/src/2.6.x/profile2-trunk/api/pom.xml
Validation Messages:

    [0]  'dependencies.dependency.version' is missing for org.sakaiproject.kernel:sakai-kernel-api
    [1]  'dependencies.dependency.version' is missing for org.sakaiproject.kernel:sakai-component-manager
    [2]  'dependencies.dependency.version' is missing for org.sakaiproject.kernel:sakai-kernel-util

...
Solution

Make sure you have edited the PROFILE2-SRC/pom.xml and uncommented the right parent version and that you are building with the appropriate -P flag.

Fails to build, possibly in the 'Common' project

You get build errors, maybe in the Common project only, similar to these:

Users/jimeng/dev26/sakai/common/common-composite-component/src/java/ 
org/sakaiproject/component/common/edu/person/ 
FileSystemPhotoService.java:[9,34] package org.apache.commons.logging  
does not exist

/Users/jimeng/dev26/sakai/common/common-composite-component/src/java/ 
org/sakaiproject/component/common/edu/person/ 
FileSystemPhotoService.java:[10,34] package org.apache.commons.logging  
does not exist

/Users/jimeng/dev26/sakai/common/common-composite-component/src/java/ 
org/sakaiproject/component/common/edu/person/ 
FileSystemPhotoService.java:[11,46] package  
org.sakaiproject.api.common.edu.person does not exist

....
Solution

What version Maven are you building with? Try running this on the commandline:

mvn -v

if you get a Maven version below 2.0.8 it's time to upgrade Maven. See here for instructions:
http://steve-on-sakai.blogspot.com/2009/04/updating-maven-on-mac-os-x.html

Builds fine but Tomcat fails to startup/fails when visiting a profile.

Everything builds fine but on visiting a profile you get errors like these:

17 Mar 2009 16:58:04,221 ERROR [org.hibernate.impl.SessionFactoryImpl] [] - Error in named query: findSakaiPersonsByInterest
org.hibernate.QueryException: could not resolve property: favouriteBooks of: org.sakaiproject.component.common.edu.person.SakaiPersonImpl [
   	select sp.agentUuid from org.sakaiproject.component.common.edu.person.SakaiPersonImpl as sp where sp.favouriteBooks like :search or sp.favouriteTvShows like :search or sp.favouriteMovies like :search or sp.favouriteQuotes like :search or sp.notes like :search
 	]
	at org.hibernate.persister.entity.AbstractPropertyMapping.propertyException(AbstractPropertyMapping.java:44)
	at org.hibernate.persister.entity.AbstractPropertyMapping.toType(AbstractPropertyMapping.java:38)
	at org.hibernate.persister.entity.AbstractEntityPersister.toType(AbstractEntityPersister.java:1358)
	at org.hibernate.hql.ast.tree.FromElementType.getPropertyType(FromElementType.java:279)
	at org.hibernate.hql.ast.tree.FromElement.getPropertyType(FromElement.java:386)
	at org.hibernate.hql.ast.tree.DotNode.getDataType(DotNode.java:566)
	at org.hibernate.hql.ast.tree.DotNode.prepareLhs(DotNode.java:241)
	at org.hibernate.hql.ast.tree.DotNode.resolve(DotNode.java:188)
	at org.hibernate.hql.ast.tree.FromReferenceNode.resolve(FromReferenceNode.java:94)
	at org.hibernate.hql.ast.tree.FromReferenceNode.resolve(FromReferenceNode.java:90)
	at org.hibernate.hql.ast.HqlSqlWalker.resolve(HqlSqlWalker.java:728)
.....
Solution

Either you have not built and deployed the updated Common project, or you have multiple jars deployed to shared. If you are certain you have built and deployed Common correctly, check TOMCAT/shared/lib/. If you can find multiple versions of jars named:

  • sakai-common-composite-component-data-*
  • sakai-common-edu-person-api-*
  • sakai-common-manager-api-*
  • sakai-common-type-api-*

then simply remove them all and redeploy the common project to make sure you get the correct version.