Re: Problem calling an Indexer method from a jython script

13 views
Skip to first unread message

Lloyd Harischandra

unread,
Mar 12, 2013, 10:22:15 PM3/12/13
to the-fasci...@googlegroups.com
Hi All,

I found the cause of the problem. My mint project has got a reference to fascinator plugin api 1.1.2 in which the Indexer.searchByIndex(...) method is a default method. I made mint pom to point to MY fasinator plugin api version where it has Public void searchByIndex(...) method and it worked.

Thanks
Lloyd

On Thursday, March 7, 2013 1:40:29 PM UTC+11, Lloyd Harischandra wrote:
Hi All,

I am struggling with writing a jython script to query the fascinator event log and got an odd error when I try to call a method in SolrIndexer class. The log says

2013-03-07 13:16:47,686          DEBUG  namicPageServiceImpl Rendering layout default/layout.vm for page home.vm...
2013-03-07 13:16:51,422          INFO   namicPageServiceImpl In reports.py search method.......
2013-03-07 13:16:51,426          INFO   namicPageServiceImpl Indexer attributes are : ['__class__', '__copy__', '__deepcopy__', '__delattr__', '__doc__', '__eq__', '__getattribute__', '__hash__', '__init__', '__ne__', '__new__', '__reduce__', '__reduce_ex__', '__repr__', '__setattr__', '__str__', '__unicode__', 'annotate', 'annotateRemove', 'annotateSearch', 'class', 'commit', 'equals', 'getClass', 'getId', 'getName', 'getPluginDetails', 'hashCode', 'id', 'index', 'init', 'name', 'notify', 'notifyAll', 'pluginDetails', 'remove', 'search', 'shutdown', 'toString', 'wait']
2013-03-07 13:16:51,428          WARN   namicPageServiceImpl Failed to run script!
=====
Traceback (most recent call last):
  File "default/default/scripts/reports.py", line 21, in __activate__
  File "default/default/scripts/reports.py", line 53, in _ReportsData__search
AttributeError: '$Indexer_13d42a0da77' object has no attribute 'searchByIndex'

If you carefully look at the log, I am trying to call the "searchByIndex" method of the "Indexer" interface which is implemented in SolrIndexer class. But script gives an AttributeError as you can see above saying there is no attribute called "searchByIndex". 

If you look at indexer attributes :
Indexer attributes are : ['__class__', '__copy__', '__deepcopy__', '__delattr__', '__doc__', '__eq__', '__getattribute__', '__hash__', '__init__', '__ne__', '__new__', '__reduce__', '__reduce_ex__', '__repr__', '__setattr__', '__str__', '__unicode__', 'annotate', 'annotateRemove', 'annotateSearch', 'class', 'commit', 'equals', 'getClass', 'getId', 'getName', 'getPluginDetails', 'hashCode', 'id', 'index', 'init', 'name', 'notify', 'notifyAll', 'pluginDetails', 'remove', 'search', 'shutdown', 'toString', 'wait']

There is no "searchByIndex" attribute. But it's defined in the "Indexer" interface. What am I missing here? Only difference I saw is that the interface method was NOT declared as Public, but interface methods are implicitly Public and Abstract. Anyway I changed the method signature to Public just to follow the pattern, but still no luck.

Any ideas? Really grateful if someone can give me a solution.

Thank you
Lloyd

Reply all
Reply to author
Forward
0 new messages