Skip to Main Content

Application Development Software

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

FullTextSearch giving an exception com.bea.content.RepositoryException:

657795Sep 2 2008 — edited Sep 9 2008
Hi all,
I'm trying to search a repository with libraries enabled using Full text search.
the code is

queryExpression= this.mQuery.buildContains(IMetadataQuery.SystemProperty.cm_objectClass,new String[]{"Article"});
IFullTextSearch expression = FullTextSearchFactory.buildFullTextSearch(queryExpression, null, true);
Search search = new Search(path, 10000, sort, expression,true);
ISortableFilterablePagedList<Node> results = searchManager.search(context, search);

and when the search is perfomed with searchManager.search it throws me the following Exception:

com.bea.content.RepositoryException: The Type is not specified in the query, so sorting on user-defined properties cannot be performed.
at com.bea.content.repo.internal.server.logic.search.AutonomyExpression.setSortParameters(AutonomyExpression.java:451)
at com.bea.content.repo.internal.server.logic.search.AutonomyClient46.executeQuery(AutonomyClient46.java:88)
at com.bea.content.repo.internal.server.logic.SearchOpsLogic.fullTextSearch(SearchOpsLogic.java:195)
at com.bea.content.repo.internal.server.logic.SearchOpsLogic.search(SearchOpsLogic.java:146)
at com.bea.content.repo.internal.server.bean.SearchOpsBean.search(SearchOpsBean.java:76)
at com.bea.content.repo.internal.server.bean.RepoSearchOps_xxpfs2_ELOImpl.search(RepoSearchOps_xxpfs2_ELOImpl.java:220)
at com.bea.content.spi.internal.SearchOpsImpl.search(SearchOpsImpl.java:89)
at sun.reflect.GeneratedMethodAccessor677.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at com.bea.content.manager.internal.delegate.LatestInterfaceVersionWrapper.invoke(LatestInterfaceVersionWrapper.java:57)
at $Proxy64.search(Unknown Source)
at com.bea.content.manager.internal.delegate.LatestSearchOpsDelegate.search(LatestSearchOpsDelegate.java:47)
at com.bea.content.manager.internal.SearchOpsImpl.searchRepository(SearchOpsImpl.java:231)
at com.bea.content.manager.internal.SearchOpsImpl.search(SearchOpsImpl.java:167)
at com.bea.content.federated.internal.itemloader.NodeSearchItemLoader.fetchItemIdentifiers(NodeSearchItemLoader.java:74)
at com.bea.content.paging.internal.OnDemandQueryProcessorImpl.initializeItemIdsIfNeeded(OnDemandQueryProcessorImpl.java:90)
at com.bea.content.paging.internal.OnDemandQueryProcessorImpl.fetchItems(OnDemandQueryProcessorImpl.java:330)
at com.bea.content.paging.internal.DirectAccessQueryProcessor.fetchItems(DirectAccessQueryProcessor.java:111)
at com.bea.content.paging.internal.ItemLoadingAdapter.fetchItemsImpl(ItemLoadingAdapter.java:237)
at com.bea.content.paging.internal.ItemLoadingAdapter.fetchItems(ItemLoadingAdapter.java:126)
at com.bea.content.paging.internal.ItemLoadingAdapter.initialize(ItemLoadingAdapter.java:97)
at com.bea.content.paging.internal.PagedListImpl.<init>(PagedListImpl.java:100)
at com.bea.content.federated.internal.SearchManagerImpl.search(SearchManagerImpl.java:60)


Any ideas????

Any help is very appreciated.

Regards, Armando

Comments

Birthe Gebhardt

Hi Shubham,
depend if you have APEX installed on your database or not.
If APEX is installed, you can use APEX.WEB_SERVICE.make_request. Otherwise you can use UTL_HTTP.
Further you need access to the URL from inside the database. Please check your ACE/L configuration. For this check you need the PLS/SQL packages DBMS_NETWORK_ACL_ADMIN.

For you REST call you need to clarify which kind of authentification is used. Befoer I transfer the REST call into the database I ceck the connection and the calls using POSTMAN.
To post a working snippet is difficulty, because of the missing information:
Database Version
APEX Installation
REST authentification
Wallets
Here is an example for an REST call: https://apex.oracle.com/pls/apex/germancommunities/apexcommunity/tipp/6121/index-en.html

Bye,
Birthe

Bilal

Hi Shubham,
Try out the following PLSQL code. Pls, note it is for calling HTTP request to make it simple but not HTTPS which will require you to do some extra work. Also to call the URL you need to register it DBMS_NETWORK_ACL_ADMIN as suggested above.

procedure call_rest_from_plsql_with_params(p$company_name varchar2) as
 l$request utl_http.req;
 l$response utl_http.resp;
 l$crawler_url varchar2(4000) := 'http://localhost:5000/get_company_data'; --Change to suit yours
 l$buffer varchar2(4000); 
 l$response_text varchar2(4000);
 l$params varchar2(4000) := '{"companyname":"'||p$company_name||'"}'; -- Pass your parameter here  as JSON
 begin
 -- Setting up the request and response objects
  l$request := utl_http.begin_request(l$crawler_url, 'GET',' HTTP/1.1');
  utl_http.set_header(l$request, 'user-agent', 'mozilla/4.0'); 
  utl_http.set_header(l$request, 'Content-Type', 'application/json'); 
  utl_http.set_header(l$request, 'Content-Length', length(l$params));
     -- Passing parameteres to GET call
  utl_http.write_text(l$request, l$params);
  -- Getting the response object
  l$response := utl_http.get_response(l$request);
  -- Reading the data from response object
  begin
    loop
     utl_http.read_line(l$response, l$buffer);  
     l$response_text := l$response_text || l$buffer;
    end loop;
    utl_http.end_response(l$response);

  exception
    when utl_http.end_of_body then
     utl_http.end_response(l$response);
  end;
  -- Print the l$response or do whatever you want to using Oracle SQL JSON functions
end;

I hope this will be useful for what you seek.
Wish you the best of luck.
Take care and best Regards
Bilal

User_A8XLF

Thanks you for the response. I have to use utl_http package. Is it possible to use utl_http in case some user authentication is required. If yes how we do that?

Billy Verreynne

UTL_HTTP supports Basic Authentication.
Other types of authentication like NTLM needs to be implemented by the developer.

Bilal
Answer

You can find basic authentication examples on this link: https://oracle-base.com/articles/misc/utl_http-and-ssl

Marked as Answer by User_A8XLF · Feb 4 2021
1 - 5
Locked Post
New comments cannot be posted to this locked post.

Post Details

Locked on Oct 7 2008
Added on Sep 2 2008
3 comments
462 views