You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@uima.apache.org by Mario Juric <ma...@cactusglobal.com> on 2020/03/28 07:32:17 UTC

About createExternalResourceDescription changes in uimaFit 3.0.0

Hi Richard,

I am in the middle of trying to migrate our codebase to UIMA 3, and I have some questions regarding the changes to org.apache.uima.fit.factory.ExternalResourceFactory.createExternalResourceDescription, which appears to have been replaced by org.apache.uima.fit.factory.ExternalResourceFactory.createResourceDescription. The signatures are not entirely the same, since the deprecated method required a String before the array of paired parameter objects, which was then passed to the load call as the DataResource URI string during initialization. I can’t find any migration documentation for this change, so I wonder whether this is still the way to pass any URI information to the resource, or do I need to define an explicit parameter like I normally do for uimaFit AEs, and then initialise it with a normal array of paired parameter objects only? I.e. can I keep the parameter input as it was with the new method?

Thanks :)

Best
Mario



________________________________
Disclaimer:
This email and any files transmitted with it are confidential and directed solely for the use of the intended addressee or addressees and may contain information that is legally privileged, confidential, and exempt from disclosure. If you have received this email in error, please notify the sender by telephone, fax, or return email and immediately delete this email and any files transmitted along with it. Unintended recipients are not authorized to disclose, disseminate, distribute, copy or take any action in reliance on information contained in this email and/or any files attached thereto, in any manner other than to notify the sender; any unauthorized use is subject to legal prosecution.


Re: About createExternalResourceDescription changes in uimaFit 3.0.0

Posted by Mario Juric <ma...@cactusglobal.com>.
Thanks Richard,

The workaround seems to do the trick, and I agree with your choice to fix this (left a comment). Most of our pipeline seems to work with UIMA 3 now, but there are some issues left unrelated to this, so I might be back with other questions in the near future.

Cheers
Mario


On 4 Apr 2020, at 18:57 , Richard Eckart de Castilho <re...@apache.org> wrote:


Hi Mario,

On 29. Mar 2020, at 15:13, Mario Juric <ma...@cactusglobal.com> wrote:

Done. Sorry for not obeying to the guidelines at this point, since I am not sure it’s a real issue or whether it’s me that has been doing something wrong all along, and it just happens to fail now. I expect you just need this initially to verify the issue and then we can do a proper PR later.

Short story - there is a bug and there is a workaround (based on your PR): cast the aggregate description to ResourceSpecifier:

  bindResource((ResourceSpecifier) aggregateDescription,
          DummyResource.RESOURCE_KEY, createSharedResourceDescription("", DummyResource.class));



Long story ... *sigh* ... we have another signature clash - that's what I hoped to have fixed going from uimaFIT v2 to v3... but while fixing one, I unfortunately introduced another one.

Here is the whole shebang: https://issues.apache.org/jira/browse/UIMA-6214

If you have a moment, maybe you can have a look at the issue and give a comment whether you agree with my choice of how to fix the issue.

Cheers,

-- Richard


________________________________
Disclaimer:
This email and any files transmitted with it are confidential and directed solely for the use of the intended addressee or addressees and may contain information that is legally privileged, confidential, and exempt from disclosure. If you have received this email in error, please notify the sender by telephone, fax, or return email and immediately delete this email and any files transmitted along with it. Unintended recipients are not authorized to disclose, disseminate, distribute, copy or take any action in reliance on information contained in this email and/or any files attached thereto, in any manner other than to notify the sender; any unauthorized use is subject to legal prosecution.


Re: About createExternalResourceDescription changes in uimaFit 3.0.0

Posted by Richard Eckart de Castilho <re...@apache.org>.
Hi Mario,

> On 29. Mar 2020, at 15:13, Mario Juric <ma...@cactusglobal.com> wrote:
> 
> Done. Sorry for not obeying to the guidelines at this point, since I am not sure it’s a real issue or whether it’s me that has been doing something wrong all along, and it just happens to fail now. I expect you just need this initially to verify the issue and then we can do a proper PR later.

Short story - there is a bug and there is a workaround (based on your PR): cast the aggregate description to ResourceSpecifier:

    bindResource((ResourceSpecifier) aggregateDescription, 
            DummyResource.RESOURCE_KEY, createSharedResourceDescription("", DummyResource.class));



Long story ... *sigh* ... we have another signature clash - that's what I hoped to have fixed going from uimaFIT v2 to v3... but while fixing one, I unfortunately introduced another one.

Here is the whole shebang: https://issues.apache.org/jira/browse/UIMA-6214

If you have a moment, maybe you can have a look at the issue and give a comment whether you agree with my choice of how to fix the issue.

Cheers,

-- Richard

Re: About createExternalResourceDescription changes in uimaFit 3.0.0

Posted by Mario Juric <ma...@cactusglobal.com>.
Hi Richard

Done. Sorry for not obeying to the guidelines at this point, since I am not sure it’s a real issue or whether it’s me that has been doing something wrong all along, and it just happens to fail now. I expect you just need this initially to verify the issue and then we can do a proper PR later.

Cheers
Mario


> On 29 Mar 2020, at 12:54 , Richard Eckart de Castilho <re...@apache.org> wrote:
>
> External email – Do not click links or open attachments unless you recognize the sender and know that the content is safe.
>
>
> Hi Mario,
>
> On 28. Mar 2020, at 17:14, Mario Juric <ma...@cactusglobal.com> wrote:
>>
>> I forgot to cleanup the imports in my example, so I just post a new version to avoid any trouble related to this.
>
> Looks like the attachment didn't make it through. Maybe you could submit it through a unit-test PR against the master branch on GitHub?
>
>  https://github.com/apache/uima-uimafit
>
> Cheers,
>
> -- Richard


________________________________
Disclaimer:
This email and any files transmitted with it are confidential and directed solely for the use of the intended addressee or addressees and may contain information that is legally privileged, confidential, and exempt from disclosure. If you have received this email in error, please notify the sender by telephone, fax, or return email and immediately delete this email and any files transmitted along with it. Unintended recipients are not authorized to disclose, disseminate, distribute, copy or take any action in reliance on information contained in this email and/or any files attached thereto, in any manner other than to notify the sender; any unauthorized use is subject to legal prosecution.


Re: About createExternalResourceDescription changes in uimaFit 3.0.0

Posted by Richard Eckart de Castilho <re...@apache.org>.
Hi Mario,

On 28. Mar 2020, at 17:14, Mario Juric <ma...@cactusglobal.com> wrote:
> 
> I forgot to cleanup the imports in my example, so I just post a new version to avoid any trouble related to this.

Looks like the attachment didn't make it through. Maybe you could submit it through a unit-test PR against the master branch on GitHub?

  https://github.com/apache/uima-uimafit

Cheers,

-- Richard

Re: About createExternalResourceDescription changes in uimaFit 3.0.0

Posted by Mario Juric <ma...@cactusglobal.com>.
Hi again,

I forgot to cleanup the imports in my example, so I just post a new version to avoid any trouble related to this.

Cheers
Mario




On 28 Mar 2020, at 17:08 , Mario Juric <ma...@cactusglobal.com>> wrote:

Hi,

Attached is a simple example that works with uimaj-core 2.10.4 and uimaFit 2.4.0. It fails with uimaj-core 3.1.1 and uimaFit 3.0.0, but you will have to comment out the line with the deprecated createExternalResourceDescription and then comment in the line with the createSharedResourceDescription to make it compile with uimaFit 3.

I can see in org.apache.uima.resource.impl.ResourceManager_impl#resolveAndValidateResourceDependencies that the mResourceMap keys is different when running with the two version. It appears that the map is not constructed with the proper qualified names in 3.0, and I am not sure if I am doing anything wrong here, which just previously happened to work.

Thanks :)

Cheers
Mario




> On 28 Mar 2020, at 14:20 , Mario Juric <ma...@cactusglobal.com>> wrote:
>
> I’ll try to do it ASAP, but I am not sure when I will be able to. I’ll stay in touch. Thanks :)
>
> Best
> Mario
>
>
> On 28 Mar 2020, at 14:11 , Richard Eckart de Castilho <re...@apache.org>> wrote:
>
>
> On 28. Mar 2020, at 14:07, Mario Juric <ma...@cactusglobal.com>> wrote:
>
> I am now wondering what to do about this, because this resources is used in many different contexts, and I am not really interested in binding it to all of them individually, since this would make our pipeline more fragile to changes.
>
> Can you produce a small unit test showcasing the problem?
>
> -- Richard
>
>
>




________________________________
Disclaimer:
This email and any files transmitted with it are confidential and directed solely for the use of the intended addressee or addressees and may contain information that is legally privileged, confidential, and exempt from disclosure. If you have received this email in error, please notify the sender by telephone, fax, or return email and immediately delete this email and any files transmitted along with it. Unintended recipients are not authorized to disclose, disseminate, distribute, copy or take any action in reliance on information contained in this email and/or any files attached thereto, in any manner other than to notify the sender; any unauthorized use is subject to legal prosecution.


Re: About createExternalResourceDescription changes in uimaFit 3.0.0

Posted by Mario Juric <ma...@cactusglobal.com>.
Hi,

Attached is a simple example that works with uimaj-core 2.10.4 and uimaFit 2.4.0. It fails with uimaj-core 3.1.1 and uimaFit 3.0.0, but you will have to comment out the line with the deprecated createExternalResourceDescription and then comment in the line with the createSharedResourceDescription to make it compile with uimaFit 3.

I can see in org.apache.uima.resource.impl.ResourceManager_impl#resolveAndValidateResourceDependencies that the mResourceMap keys is different when running with the two version. It appears that the map is not constructed with the proper qualified names in 3.0, and I am not sure if I am doing anything wrong here, which just previously happened to work.

Thanks :)

Cheers
Mario




> On 28 Mar 2020, at 14:20 , Mario Juric <ma...@cactusglobal.com> wrote:
>
> I’ll try to do it ASAP, but I am not sure when I will be able to. I’ll stay in touch. Thanks :)
>
> Best
> Mario
>
>
> On 28 Mar 2020, at 14:11 , Richard Eckart de Castilho <re...@apache.org>> wrote:
>
>
> On 28. Mar 2020, at 14:07, Mario Juric <ma...@cactusglobal.com>> wrote:
>
> I am now wondering what to do about this, because this resources is used in many different contexts, and I am not really interested in binding it to all of them individually, since this would make our pipeline more fragile to changes.
>
> Can you produce a small unit test showcasing the problem?
>
> -- Richard
>
>
>


________________________________
Disclaimer:
This email and any files transmitted with it are confidential and directed solely for the use of the intended addressee or addressees and may contain information that is legally privileged, confidential, and exempt from disclosure. If you have received this email in error, please notify the sender by telephone, fax, or return email and immediately delete this email and any files transmitted along with it. Unintended recipients are not authorized to disclose, disseminate, distribute, copy or take any action in reliance on information contained in this email and/or any files attached thereto, in any manner other than to notify the sender; any unauthorized use is subject to legal prosecution.


Re: About createExternalResourceDescription changes in uimaFit 3.0.0

Posted by Mario Juric <ma...@cactusglobal.com>.
I’ll try to do it ASAP, but I am not sure when I will be able to. I’ll stay in touch. Thanks :)

Best
Mario


On 28 Mar 2020, at 14:11 , Richard Eckart de Castilho <re...@apache.org>> wrote:

External email – Do not click links or open attachments unless you recognize the sender and know that the content is safe.


On 28. Mar 2020, at 14:07, Mario Juric <ma...@cactusglobal.com>> wrote:

I am now wondering what to do about this, because this resources is used in many different contexts, and I am not really interested in binding it to all of them individually, since this would make our pipeline more fragile to changes.

Can you produce a small unit test showcasing the problem?

-- Richard


________________________________
Disclaimer:
This email and any files transmitted with it are confidential and directed solely for the use of the intended addressee or addressees and may contain information that is legally privileged, confidential, and exempt from disclosure. If you have received this email in error, please notify the sender by telephone, fax, or return email and immediately delete this email and any files transmitted along with it. Unintended recipients are not authorized to disclose, disseminate, distribute, copy or take any action in reliance on information contained in this email and/or any files attached thereto, in any manner other than to notify the sender; any unauthorized use is subject to legal prosecution.


Re: About createExternalResourceDescription changes in uimaFit 3.0.0

Posted by Richard Eckart de Castilho <re...@apache.org>.
On 28. Mar 2020, at 14:07, Mario Juric <ma...@cactusglobal.com> wrote:
> 
> I am now wondering what to do about this, because this resources is used in many different contexts, and I am not really interested in binding it to all of them individually, since this would make our pipeline more fragile to changes.

Can you produce a small unit test showcasing the problem?

-- Richard

Re: About createExternalResourceDescription changes in uimaFit 3.0.0

Posted by Mario Juric <ma...@cactusglobal.com>.
Hi again,

Here is an update on my resource binding issue:

It seems that Resource_ImplBase adds a qualified context name to the qname that is used to lookup the resource in a resource map, but the resource is registered without the context name in the key, so it isn’t found. This is a dependent inside a named aggregate, and the name of this aggregate seems to be used to form the qname, and I wonder if this also happened in UIMA 2.x. The fallback tries then to resolve the resource from a file URL, which expectedly fails in my case, so the whole resource resolution throws an exception.

I am now wondering what to do about this, because this resources is used in many different contexts, and I am not really interested in binding it to all of them individually, since this would make our pipeline more fragile to changes.

Best,
Mario



On 28 Mar 2020, at 13:45 , Mario Juric <ma...@cactusglobal.com>> wrote:

Thanks for the quick response, Richard.

I managed to build everything now, but I now seem to get resource binding failures in my pipeline. I haven’t figured what this is all about yet, but please let me know if there is something I need to know about changes in the way resource bindings works.

Cheers
Mario


On 28 Mar 2020, at 12:41 , Richard Eckart de Castilho <re...@apache.org>> wrote:

External email – Do not click links or open attachments unless you recognize the sender and know that the content is safe.


On 28. Mar 2020, at 08:49, Mario Juric <ma...@cactusglobal.com>> wrote:

I think I figured it out. I need to use createSharedResourceDescription instead, correct?

If you used

public static ExternalResourceDescription createExternalResourceDescription(final String aName,
        Class<? extends SharedResourceObject> aInterface, String aUrl, Object... aParams) {

in uimaFIT v2, then the replacement in uimaFIT v3 should be

public static ExternalResourceDescription createSharedResourceDescription(
        String aUrl, Class<? extends SharedResourceObject> aInterface, Object... aParams) {

The URI parameter has moved to the front instead. That method seems to have been there previously, but I never used it.

The second signature is only present in uimaFIT v3, not in v2. The signatures and naming were changed from v2 to v3 to avoid ambiguities.

Cf. https://issues.apache.org/jira/browse/UIMA-3928

Cheers,

-- Richard



________________________________
Disclaimer:
This email and any files transmitted with it are confidential and directed solely for the use of the intended addressee or addressees and may contain information that is legally privileged, confidential, and exempt from disclosure. If you have received this email in error, please notify the sender by telephone, fax, or return email and immediately delete this email and any files transmitted along with it. Unintended recipients are not authorized to disclose, disseminate, distribute, copy or take any action in reliance on information contained in this email and/or any files attached thereto, in any manner other than to notify the sender; any unauthorized use is subject to legal prosecution.



________________________________
Disclaimer:
This email and any files transmitted with it are confidential and directed solely for the use of the intended addressee or addressees and may contain information that is legally privileged, confidential, and exempt from disclosure. If you have received this email in error, please notify the sender by telephone, fax, or return email and immediately delete this email and any files transmitted along with it. Unintended recipients are not authorized to disclose, disseminate, distribute, copy or take any action in reliance on information contained in this email and/or any files attached thereto, in any manner other than to notify the sender; any unauthorized use is subject to legal prosecution.


Re: About createExternalResourceDescription changes in uimaFit 3.0.0

Posted by Mario Juric <ma...@cactusglobal.com>.
Thanks for the quick response, Richard.

I managed to build everything now, but I now seem to get resource binding failures in my pipeline. I haven’t figured what this is all about yet, but please let me know if there is something I need to know about changes in the way resource bindings works.

Cheers
Mario


> On 28 Mar 2020, at 12:41 , Richard Eckart de Castilho <re...@apache.org> wrote:
>
> External email – Do not click links or open attachments unless you recognize the sender and know that the content is safe.
>
>
> On 28. Mar 2020, at 08:49, Mario Juric <ma...@cactusglobal.com> wrote:
>>
>> I think I figured it out. I need to use createSharedResourceDescription instead, correct?
>
> If you used
>
>  public static ExternalResourceDescription createExternalResourceDescription(final String aName,
>          Class<? extends SharedResourceObject> aInterface, String aUrl, Object... aParams) {
>
> in uimaFIT v2, then the replacement in uimaFIT v3 should be
>
>  public static ExternalResourceDescription createSharedResourceDescription(
>          String aUrl, Class<? extends SharedResourceObject> aInterface, Object... aParams) {
>
>> The URI parameter has moved to the front instead. That method seems to have been there previously, but I never used it.
>
> The second signature is only present in uimaFIT v3, not in v2. The signatures and naming were changed from v2 to v3 to avoid ambiguities.
>
> Cf. https://issues.apache.org/jira/browse/UIMA-3928
>
> Cheers,
>
> -- Richard
>


________________________________
Disclaimer:
This email and any files transmitted with it are confidential and directed solely for the use of the intended addressee or addressees and may contain information that is legally privileged, confidential, and exempt from disclosure. If you have received this email in error, please notify the sender by telephone, fax, or return email and immediately delete this email and any files transmitted along with it. Unintended recipients are not authorized to disclose, disseminate, distribute, copy or take any action in reliance on information contained in this email and/or any files attached thereto, in any manner other than to notify the sender; any unauthorized use is subject to legal prosecution.


Re: About createExternalResourceDescription changes in uimaFit 3.0.0

Posted by Richard Eckart de Castilho <re...@apache.org>.
On 28. Mar 2020, at 08:49, Mario Juric <ma...@cactusglobal.com> wrote:
> 
> I think I figured it out. I need to use createSharedResourceDescription instead, correct?

If you used 

  public static ExternalResourceDescription createExternalResourceDescription(final String aName,
          Class<? extends SharedResourceObject> aInterface, String aUrl, Object... aParams) {

in uimaFIT v2, then the replacement in uimaFIT v3 should be

  public static ExternalResourceDescription createSharedResourceDescription(
          String aUrl, Class<? extends SharedResourceObject> aInterface, Object... aParams) {

> The URI parameter has moved to the front instead. That method seems to have been there previously, but I never used it.

The second signature is only present in uimaFIT v3, not in v2. The signatures and naming were changed from v2 to v3 to avoid ambiguities.

Cf. https://issues.apache.org/jira/browse/UIMA-3928

Cheers,

-- Richard


Re: About createExternalResourceDescription changes in uimaFit 3.0.0

Posted by Mario Juric <ma...@cactusglobal.com>.
Hi again,

I think I figured it out. I need to use createSharedResourceDescription instead, correct?

The URI parameter has moved to the front instead. That method seems to have been there previously, but I never used it.

Best
Mario


> On 28 Mar 2020, at 08:32 , Mario Juric <ma...@cactusglobal.com> wrote:
>
>
> Hi Richard,
>
> I am in the middle of trying to migrate our codebase to UIMA 3, and I have some questions regarding the changes to org.apache.uima.fit.factory.ExternalResourceFactory.createExternalResourceDescription, which appears to have been replaced by org.apache.uima.fit.factory.ExternalResourceFactory.createResourceDescription. The signatures are not entirely the same, since the deprecated method required a String before the array of paired parameter objects, which was then passed to the load call as the DataResource URI string during initialization. I can’t find any migration documentation for this change, so I wonder whether this is still the way to pass any URI information to the resource, or do I need to define an explicit parameter like I normally do for uimaFit AEs, and then initialise it with a normal array of paired parameter objects only? I.e. can I keep the parameter input as it was with the new method?
>
> Thanks :)
>
> Best
> Mario


________________________________
Disclaimer:
This email and any files transmitted with it are confidential and directed solely for the use of the intended addressee or addressees and may contain information that is legally privileged, confidential, and exempt from disclosure. If you have received this email in error, please notify the sender by telephone, fax, or return email and immediately delete this email and any files transmitted along with it. Unintended recipients are not authorized to disclose, disseminate, distribute, copy or take any action in reliance on information contained in this email and/or any files attached thereto, in any manner other than to notify the sender; any unauthorized use is subject to legal prosecution.