Thilo Goetz | 1 Dec 12:12
Picon
Picon

Re: Get annotation class from Type


On 12/1/2009 09:46, Tommaso Teofili wrote:
> 2009/11/29 Steven Bethard<steven.bethard@...>
>
>> On Sat, Nov 28, 2009 at 1:12 AM, Fabien POULARD<grdscarabe@...>
>> wrote:
>>> On Fri, Nov 27, 2009 at 4:56 PM, Thilo Goetz<twgoetz@...>  wrote:
>>>> I guess this will work, as long as there even is a JCas type
>>>> for the type you're looking for.  There may not always be one,
>>>> and we have this whole meta-programming kind of API for this
>>>> kind of situation.  If you tell us what you need the class for,
>>>> we may be able to suggest alternative ways of handling this.
>>>
>>> My need is quite simple, a component I develop work on some types
>>> passed to the component in parameter. I retrieve the type from its
>>> name passed in parameter with a simple :
>>>
>>> Type mMonType  = cas.getTypeSystem().getType(theParameterTypeStr);
>>>
>>> ... and I check it is not null before using it.
>>>
>>> Now I use some generic classes (java generics) for my processing and I
>>> need to "configure" them with the class of the annotation
>>> corresponding to this type. That's where I'm lost...
>>
>> If you know you're loading a Java class for a type, why not have your
>> "theParameterTypeStr" be the fully qualified Java class name instead
>> of the UIMA type? Then you can use the usual Java Class.forName()
>> directly.
>>
(Continue reading)

Fabien POULARD | 1 Dec 16:37
Picon

Re: Get annotation class from Type

Hi,

On Tue, Dec 1, 2009 at 12:12 PM, Thilo Goetz <twgoetz@...> wrote:
> I'll debate this just for the sake of other people who
> may be following this thread.  It seems much simpler
> and less error prone to use the built-in UIMA CAS APIs
> for this, as described here:
> http://incubator.apache.org/uima/downloads/releaseDocs/2.2.2-incubating/docs/html/references/references.html#ugr.ref.cas
> And it'll be faster, too, without the JCas/Java reflection
> detour.

May you point to something more specific ? I've looked over the
documentation and the API but I still did not find anything relevant
for my problem (other than Java reflection).

--
Fabien Poulard

Thilo Goetz | 1 Dec 16:51
Picon
Picon

Re: Get annotation class from Type

On 12/1/2009 16:37, Fabien POULARD wrote:
> Hi,
>
> On Tue, Dec 1, 2009 at 12:12 PM, Thilo Goetz<twgoetz@...>  wrote:
>> I'll debate this just for the sake of other people who
>> may be following this thread.  It seems much simpler
>> and less error prone to use the built-in UIMA CAS APIs
>> for this, as described here:
>> http://incubator.apache.org/uima/downloads/releaseDocs/2.2.2-incubating/docs/html/references/references.html#ugr.ref.cas
>> And it'll be faster, too, without the JCas/Java reflection
>> detour.
>
> May you point to something more specific ? I've looked over the
> documentation and the API but I still did not find anything relevant
> for my problem (other than Java reflection).
>
> --
> Fabien Poulard

Sorry, but I still don't understand what your problem is.
This tells you how to read/write feature values in a
generic way.  If that's not what you need, this solution
is not for you.  If you must know the JCas type to use it
in Java Generics in some way, this does not help.

I was responding directly to Tommaso, since his example
did not seem very compelling to me.

--Thilo

(Continue reading)

William Colen | 1 Dec 22:42
Picon

Re: PEAR Packaging Maven Plugin

Hi, Marshall,

Thanks for pointing where to find the documentation. Now I could move a
little bit more.
Now I have other issues.

1. I tried to perform a mvn install in PearPackagingMavenPlugin source but
got the following error:

java.lang.NullPointerException: The scm url cannot be null.
    at
org.apache.maven.scm.manager.AbstractScmManager.makeScmRepository(AbstractScmManager.java:181)
    at
org.codehaus.mojo.build.CreateMojo.getScmRepository(CreateMojo.java:722)
    at org.codehaus.mojo.build.CreateMojo.getScmBranch(CreateMojo.java:593)
    at org.codehaus.mojo.build.CreateMojo.execute(CreateMojo.java:452)
    at
org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:451)
    at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:558)
    at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:499)
    at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:478)
    at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:330)
    at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:291)
    at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:142)
(Continue reading)

Marshall Schor | 2 Dec 06:25

Re: PEAR Packaging Maven Plugin

Hi William,

William Colen wrote:
> Hi, Marshall,
>
> Thanks for pointing where to find the documentation. Now I could move a
> little bit more.
> Now I have other issues.
>
> 1. I tried to perform a mvn install in PearPackagingMavenPlugin source but
> got the following error:
>
> java.lang.NullPointerException: The scm url cannot be null.
>   

I've never seen that message.  I don't know what causes it...  A quick
web-search found this message with maven - 1 - but I presume you're
using the latest Maven or something close to that, right?

What source did you use (e.g., 2.2.2 source distribution, the current
SVN / trunk or tag?)?

>     at
> org.apache.maven.scm.manager.AbstractScmManager.makeScmRepository(AbstractScmManager.java:181)
>     at
> org.codehaus.mojo.build.CreateMojo.getScmRepository(CreateMojo.java:722)
>     at org.codehaus.mojo.build.CreateMojo.getScmBranch(CreateMojo.java:593)
>     at org.codehaus.mojo.build.CreateMojo.execute(CreateMojo.java:452)
>     at
> org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:451)
(Continue reading)

Rogan Creswick | 2 Dec 06:44
Picon

Re: PEAR Packaging Maven Plugin

On Tue, Dec 1, 2009 at 9:25 PM, Marshall Schor <msa@...> wrote:
>> 1. I tried to perform a mvn install in PearPackagingMavenPlugin source but
>> got the following error:
>>
>> java.lang.NullPointerException: The scm url cannot be null.
>>

I've experienced that one.  If I remember correctly, it's actually a
red herring, and doesn't have anything to do with the scm url.  I'm
guessing (based on what parts of my local uimaj pom I have commented
out) that it's part of the Distribution Management configuration, but
I can't say for sure.
>>
>> 2. After that I tried to use the compiled version, but I got another error:
>> [INFO] Internal error in the plugin manager executing goal
>> 'org.apache.uima:PearPackagingMavenPlugin:2.2.2-incubating:package': Unable
>> to find the mojo
>> 'org.apache.uima:PearPackagingMavenPlugin:2.2.2-incubating:package' in the
>> plugin 'org.apache.uima:PearPackagingMavenPlugin'
>> org/apache/uima/pear/tools/PackageCreatorException
>>

I've had this sort of thing happen because maven gets hungup somehow
after it's tried and failed to satisfy a dependency.  (I can't say
it's exactly the same... I'm running from memory.)  Something ends up
stuck in ~/.m2/repository that prevents subsequent queries from
working correctly.  Anyhow, try (manually) deleting the
PearPackagingMavenPlugin directory tree from your ~/.m2 directory and
try again.

(Continue reading)

Picon

Exception thrown when deploying CAS Processors in managed mode

My CAS processors works fine when deployed in integrated mode, but not when 
deployed in managed mode.   

The following exception was thrown instead (notice the path in the exception
message is referring to a directory instead of a file - no idea where the path
came from and how to it was formulated to become like that):

org.apache.uima.util.InvalidXMLException: Invalid descriptor at 
file:/H:/ttsrc/javasoe/documentconversion.
	at org.apache.uima.util.impl.XMLParser_impl.parse(XMLParser_impl.java:193)
	at
org.apache.uima.util.impl.XMLParser_impl.parseResourceSpecifier(XMLParser_impl.j
ava:365)
	at
org.apache.uima.util.impl.XMLParser_impl.parseResourceSpecifier(XMLParser_impl.j
ava:346)
	at
org.apache.uima.collection.impl.cpm.container.CPEFactory.getSpecifier(CPEFactory
.java:809)
	at
org.apache.uima.collection.impl.cpm.engine.CPMEngine.isMultipleDeploymentAllowed
(CPMEngine.java:900)
	at
org.apache.uima.collection.impl.cpm.engine.CPMEngine.isParallizable(CPMEngine.ja
va:973)
	at
org.apache.uima.collection.impl.cpm.engine.CPMEngine.classifyCasProcessors(CPMEn
gine.java:1104)
	at
org.apache.uima.collection.impl.cpm.engine.CPMEngine.deployCasProcessors(CPMEngi
(Continue reading)

William Colen | 3 Dec 14:34
Picon

Re: PEAR Packaging Maven Plugin

Thank you!

To build the PearPackagingMavenPlugin I added a dummy scm configuration to
override any other configuration.

  <scm>
    <connection>scm:svn:http://127.0.0.1/svn/my-project</connection>
    <developerConnection>scm:svn:https://127.0.0.1/svn/my-project</developerConnection>
    <tag>HEAD</tag>
    <url>http://127.0.0.1/websvn/my-project</url>
  </scm>

With that I could execute "mvn install" and now I'm able to use the plugin.

On Wed, Dec 2, 2009 at 3:44 AM, Rogan Creswick <creswick@...> wrote:

> On Tue, Dec 1, 2009 at 9:25 PM, Marshall Schor <msa@...> wrote:
> >> 1. I tried to perform a mvn install in PearPackagingMavenPlugin source
> but
> >> got the following error:
> >>
> >> java.lang.NullPointerException: The scm url cannot be null.
> >>
>
> I've experienced that one.  If I remember correctly, it's actually a
> red herring, and doesn't have anything to do with the scm url.  I'm
> guessing (based on what parts of my local uimaj pom I have commented
> out) that it's part of the Distribution Management configuration, but
> I can't say for sure.
> >>
(Continue reading)

William Colen | 3 Dec 16:01
Picon

Tips for a beginner

Hello,

We are moving our Brazilian Portuguese annotators (sentence detector,
tokenizer, tagger, parser) to UIMA. We have different implementations of
some annotators: some were created using OpenNLP, others where written from
scratch.
We would like to have .PEARs for each annotator, so in the applications we
would change the annotators easily. Also we don't want to have duplicated
resources (mostly dictionaries, and the UIMA typesystem descriptor), so we
need a way to share.

The first thing we did was to create the UIMA wrappers and descriptors. They
are ready and we were able to create a UIMA application that uses the
annotators (but we had to put all the code and descriptors in only one
Eclipse project. No .pear yet).

Now we are splitting the projects in smaller ones. For instance, we create
only one TypeSystem.xml and would like every project to use it. So I created
a simple .pear with the TypeSystem.xml.
After that I created another pear for the sentence detector, but I couldn't
import the TypeSystem.xml of the first pear. The only way to do that was
using the relative path or if I put the TypeSystem.xml inside the JAR file
of the first pear, and import it using classpath.
Do you know a better way to do that?

Latter I'll have to do the same with the dictionaries. I'm not sure if the
best approach is to create a .pear only for it. Will it work?

Thanks
William
(Continue reading)


Gmane