- cfg = new com.indexdata.masterkey.pazpar2.client.Pazpar2ClientConfiguration(pz2conf.getConfig());\r
- client = new com.indexdata.masterkey.pazpar2.client.Pazpar2ClientGeneric(cfg);\r
- resetDataObjects();\r
- } catch (ProxyErrorException e) {\r
- e.printStackTrace();\r
- } catch (IOException ioe) {\r
- ioe.printStackTrace();\r
- }\r
- } else {\r
- logger.warn("Attempt to configure session but it already has a configured client");\r
- }\r
+ searchClient.configure(configReader); \r
+ // At the time of writing this search client is injected using Weld. \r
+ // However, the client is used for asynchronously sending off requests\r
+ // to the server AND propagation of context to threads is currently \r
+ // not supported. Trying to do so throws a WELD-001303 error. \r
+ // To avoid that, a context free client is cloned from the context \r
+ // dependent one. \r
+ // If propagation to threads gets supported, the cloning can go. \r
+ this.searchClient = searchClient.cloneMe(); \r
+ \r
+ } catch (ConfigurationException e) {\r
+ configurationErrors.add(new ConfigurationError("Search Client","Configuration",e.getMessage(),new ErrorHelper(configReader))); \r
+ } \r
+ logger.info(configReader.document());\r
+ resetDataObjects();\r