You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@uima.apache.org by "Stergos D. Afantenos" <st...@univ-nantes.fr> on 2009/07/15 15:41:50 UTC

Passing parameters to an analysis engine from SimpleRestServer

Dear all,

I am currently developing an application for which I had to change the
parameters that the Simple Rest Server takes by default. Everything
works quite smoothly at the moment, with the exception that when I am
trying to pass the value of a specific REST parameters as a value to a
parameter of an Analysis Engine (extracted from the corresponding
pear) I get a nasty exception:

org.apache.uima.UIMA_IllegalStateException
	org.apache.uima.resource.impl.ConfigurationManagerImplBase.setSessionParam(ConfigurationManagerImplBase.java:713)
	org.apache.uima.resource.impl.ConfigurationManagerImplBase.setConfigParameterValue(ConfigurationManagerImplBase.java:203)
	org.apache.uima.resource.ConfigurableResource_ImplBase.setConfigParameterValue(ConfigurableResource_ImplBase.java:53)
	org.apache.uima.simpleserver.Service.process(Service.java:299)
	org.apache.uima.simpleserver.servlet.SimpleServerServlet.analyze(SimpleServerServlet.java:253)
	org.apache.uima.simpleserver.servlet.SimpleServerServlet.doGet(SimpleServerServlet.java:181)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:802)

Browsing a while at the code of uima-core.jar I have found the
following. The function

  setConfigParameterValue(String aQualifiedParamName, Object aValue)

in the ConfigurationManagerImplBase essentially  calls the function

  setSessionParam(String aCompleteName, Object aValue)

The first thing that this function checks is whether the field

  private Session mSession

is null, in which case it throws a UIMA_IllegalStateException(),
exactly as shown above. The javadoc for the interface
ConfigurationManager (which apparently handles the parameters)
mentions the following:

  "Note that the ConfigurationManager  needs to make use of the
Session object in order to store configuration settings that are
specific to a particular client session."

My question is the following: Has anyone tried to pass a value to an
AE parameter in the context of the Simple Rest Server? Moreover, does
anyone know how to handle sessions in UIMA? Is there a relevant
documentation?

Thanking you in advance,
Stergos D. Afantenos

Fwd: Passing parameters to an analysis engine from SimpleRestServer

Posted by "Stergos D. Afantenos" <st...@univ-nantes.fr>.
Hi,

I have sent the following email to uima-dev, but who knows, maybe
someone in uima-user might have an idea as well.

Best,
Stergos D. Afantenos


---------- Forwarded message ----------
From: Stergos D. Afantenos <st...@univ-nantes.fr>
Date: Wed, Jul 15, 2009 at 15:41
Subject: Passing parameters to an analysis engine from SimpleRestServer
To: uima-dev@incubator.apache.org


Dear all,

I am currently developing an application for which I had to change the
parameters that the Simple Rest Server takes by default. Everything
works quite smoothly at the moment, with the exception that when I am
trying to pass the value of a specific REST parameters as a value to a
parameter of an Analysis Engine (extracted from the corresponding
pear) I get a nasty exception:

org.apache.uima.UIMA_IllegalStateException
       org.apache.uima.resource.impl.ConfigurationManagerImplBase.setSessionParam(ConfigurationManagerImplBase.java:713)
       org.apache.uima.resource.impl.ConfigurationManagerImplBase.setConfigParameterValue(ConfigurationManagerImplBase.java:203)
       org.apache.uima.resource.ConfigurableResource_ImplBase.setConfigParameterValue(ConfigurableResource_ImplBase.java:53)
       org.apache.uima.simpleserver.Service.process(Service.java:299)
       org.apache.uima.simpleserver.servlet.SimpleServerServlet.analyze(SimpleServerServlet.java:253)
       org.apache.uima.simpleserver.servlet.SimpleServerServlet.doGet(SimpleServerServlet.java:181)
       javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
       javax.servlet.http.HttpServlet.service(HttpServlet.java:802)

Browsing a while at the code of uima-core.jar I have found the
following. The function

 setConfigParameterValue(String aQualifiedParamName, Object aValue)

in the ConfigurationManagerImplBase essentially  calls the function

 setSessionParam(String aCompleteName, Object aValue)

The first thing that this function checks is whether the field

 private Session mSession

is null, in which case it throws a UIMA_IllegalStateException(),
exactly as shown above. The javadoc for the interface
ConfigurationManager (which apparently handles the parameters)
mentions the following:

 "Note that the ConfigurationManager  needs to make use of the
Session object in order to store configuration settings that are
specific to a particular client session."

My question is the following: Has anyone tried to pass a value to an
AE parameter in the context of the Simple Rest Server? Moreover, does
anyone know how to handle sessions in UIMA? Is there a relevant
documentation?

Thanking you in advance,
Stergos D. Afantenos