cancel
Showing results for 
Search instead for 
Did you mean: 

SiteService not found

nilsw
Champ in-the-making
Champ in-the-making
I want to use SiteService in a Java-backed web script, so I have included this reference in the Spring context:

<property name="siteService" ref="SiteService"/>

and a corresponding property in the web script class. But, on startup, the alfresco webapp won't load due to

ERROR [org.springframework.web.context.ContextLoader] Context initialization failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'webscript.com.cadq.alfresco.common.slingshot.documentlibrary.action.order-print.post' defined in file [C:\Users\nils.weinander\Program\Alfresco-3.1\tomcat\shared\classes\alfresco\extension\cadq-projektnavet-alfresco-context.xml]: Instantiation of bean failed; nested exception is java.lang.NoClassDefFoundError: org/alfresco/service/cmr/site/SiteService
Caused by: java.lang.NoClassDefFoundError: org/alfresco/service/cmr/site/SiteService

I notice that the org/alfresco/service/cmr/site package is not present in alfresco-repository.jar, which other service packages are.

What do I need to do for my web script to find SiteService?

Alfresco version is community edition 3.1.
4 REPLIES 4

mrogers
Star Contributor
Star Contributor
Are you sure you are using the correct version of Repository.jar?

(I think not)

nilsw
Champ in-the-making
Champ in-the-making
alfresco-repository.jar is from the packaged 3.1 community (alfresco-labs-tomcat-3Stable.zip). I checked it directly in the ZIP and it doesn't include the org.alfresco.service.cmr.site package.

mrogers
Star Contributor
Star Contributor
What has happened is that in the early versions of SiteService the interface was in the wrong package; in Labs 3 stable it is in org.alfresco.repo.site which is the wrong place for a public interface.

This got fixed to "org.alfresco.service.cmr.site" in later versions.

So you can either use the old path.   Or upgrade to a version that has the SiteService in the package you are looking for.

nilsw
Champ in-the-making
Champ in-the-making
Ah! That makes sense. My development environment reads the new package name so I don't get any compile time errors, but when deployed I have an older repository jar. I'll build a new one and try it. Thanks!