4

I have a custom ServerControl to retrieve taxonomies information on context Page.

With the following code get the identifier of the page:

System.Collections.IList pageMetaList = pageMetaFactory.GetMetaByUrl(pageUrl);
if (pageMetaList.Count > 0)
  pageMeta = pageMetaList[0] as IPageMeta;

and after invoke the method GetTaxonomiesKeywords

CompositeFilter cf = new CompositeFilter();
Keyword[] selectedKeywords = _pmFactory.GetTaxonomyKeywords(pageUri, new Keyword[] { }, cf);

when Page is published on root folder, method GetTaxonomyKeywords return a runtime exception:

RuntimeException: com.tridion.storage.StructureGroup cannot be cast to com.tridion.storage.Keyword]
Codemesh.JuggerNET.NTypeValue.Throw(Int64 inst) +514
Codemesh.JuggerNET.JavaClass.ThrowTypedException(Int64 inst) +1243
Codemesh.JuggerNET.JavaMethod.CallObject(JavaProxy jpo, JavaMethodArguments args) +907
Com.Tridion.Meta.PageMetaFactory.GetTaxonomyKeywords(String taxonomyURI, String pageURI, KeywordArray arg2, TaxonomyFilter taxonomyFilter) +221
Tridion.ContentDelivery.Meta.PageMetaFactory.GetTaxonomyKeywords(String taxonomyUri, String pageUri, Keyword[] contextKeyword, TaxonomyFilter taxonomyFilter) +80
Tridion.ContentDelivery.Meta.PageMetaFactory.GetTaxonomyKeywords(String pageUri, Keyword[] contextKeyword, TaxonomyFilter taxonomyFilter) +22

otherwise if the Page is published in a subfolder, no exception is returned and method retrieves taxonomies info.

What could be the problem?

1
  • Do any Broker API calls work from the root SG? I'm thinking it's something to do with your virtual path configuration in IIS, e.g. the scope of the files in BIN isn't being applied to the root SG. Commented Mar 19, 2014 at 21:23

1 Answer 1

1

Does the URL contain a page name and an extension? If the URL does not it will assume it is a StructureGroup. Make sure, when your URL ends with a trailing slash, you add your default page (index.html).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.