Generating Pear file when using ConceptMapper Annotator - installation

I have an UIMA project that uses the ConceptMapper Annotator. I would like to know how to set up the following:
How to specify the TokenizerDescriptionPath?
I have used the macro $main_root/descriptors/conceptMapper/primitive/OffsetTokenizer.xml, but when I was trying to install the pear file, the installer throws exceptions complaining that the file $main_root/descriptors/conceptMapper/primitive/OffsetTokenizer.xml could not be found
How to set up the value for the DictionaryFileName (A file containing the dictionary)?
In the GUI window for setting up this resource, I've filled the URL value with $main_root/data/dict/concepts.xml (my dictionary file) but at the installation time, the installer throws exceptions complaing that
Verification of uima-pipelines failed:
org.apache.uima.resource.ResourceInitializationException: Initialization of annotator class "org.apache.uima.conceptMapper.ConceptMapper" failed.
Caused by: org.apache.uima.resource.ResourceAccessException: The Resource /ConceptDetector/ConceptMapper/DictionaryFile requires parameters, none were specified.
at org.apache.uima.resource.impl.ResourceManager_impl.getResource(ResourceManager_impl.java:221)
at org.apache.uima.impl.UimaContext_ImplBase.getResourceObject(UimaContext_ImplBase.java:295)
at org.apache.uima.analysis_engine.impl.AnnotatorContext_impl.getResourceObject(AnnotatorContext_impl.java:175)
... 33 more

I had similar problems with the Concept Mapper. The way I solved the TokenizerDescriptorPath problem was to first create a PEAR file with the OffsetTokenizer as its main descriptor and the dependent classes. Then you can install this pear file locally and then set TokenizerDescriptorPath to: C:\path\to\your\pear\file\OffsetTokenizer_pear.xml. Otherwise there appears to be a CLASSPATH inheritance problem. The CLASSPATH does not seem to be passed from the ConceptMapper to the OffsetTokenizer once it is in the PEAR file. I found some great information on the GMANE listserver. user.uima.apache.org ConceptMapper Pear File Thread
I have set DictionaryFileName to file:dict/testDict.xml and this seems to work. To avoid getting a problem at save time you can add resources as a source folder.
When exporting the ConceptMapper to a PEAR file, I have both the resources and bin folder in the CLASSPATH. I have since expanded the Concept Mapper to have other annotators and it is working in a pipeline. It is all exportable to PEAR files which pass the verification step. It also works before export, locally in Eclipse.
Good Luck

Related

Joomla "Fatal error: Cannot redeclare jblogerror() in on line 0"

Here is a weird problem i'm facing; after updating Joomla to the latest version, website failed to up load but, as i've made a backup manually from these folders:
administrator
bin
cli
components
includes
layouts
libraries
modules
plugins
yt-assets
and all the root files, after restoring the backup still the website is not loading and just says
"Fatal error: Cannot redeclare jblogerror() in on line 0" !
Any suggestion? Thank you.
Apparently, the version of jBlog you are using is loading its attempting to load its own classes twice.
Let's assume the jBlog developers already fixed it and you carelessly ignored the warning to ensure all your extensions are compatible before updating.
Are you able to access administrator? Simply go there and upgrade jBlog including any modules.
Else, the issue lies within a plugin. In order to access the administrator and perform the update, you will need to manually disable the offending plugin.
A simple way is to rename its folder: start from plugins/system then plugins/content hopefully you'll have spotted it by then. Look into the subfolders of each and spot any that may be relevant to jBlog (or grep through the folder to locate the specific string)
If you have console access, simply run
# grep -rl jblogerror plugins/system
and you should see all the files that include such string, just rename their main plugin folder. But you could also do all this through ftp and guessing.

Can I run stanza NER without downloading the language modules?

I need to run stanza ner in a platform without any access to external network. The code stanza.download('en') fails. Running without the download function, gives me an exception
Exception: Resources file not found at: \home\stanza_resources\resources.json. Try to download the model again
Is there a way to download and cache all the required modules in a resource directory and point this directory to stanza pipeline?
Thanks
It looks like both download and the Pipeline class take an argument for directory dir
So the below code works
stanza.download('en', dir='resources/', processors={ner_processor: package})
nlp_pipeline = stanza.Pipeline('en', dir='resources/', processors={ner_processor: package})

getResource return null url in context of module

I am new to Java Modularity. I am using Java 9.
The program compiles without complaint. It also runs perfectly well from the "exploded module" folder, but with one exception: it throws an exception whose cause originates with the following line of code:
URL introURL = AboutPanel.class.getResource("help.html");
introURL is being assigned null.
When running the program in Eclipse, or from a jar file exported from Eclipse, the URL is populated correctly with the address of a resource file (help.html) that is in the same directory as the calling class.
Here is the command I use to run the program from the "exploded module" that is in the "out" folder:
java -p out/ -m moduleTCD/com.adonax.tanpura.TCDLaunch
The project consists of two packages that I am bundling together in a single module.
src/moduleTCD/com/adonax/tanpura
/pfaudio
The "main" class (entry point) is tanpura.TCDLaunch.
Here is the module-info.java class contents:
module moduleTCD {
exports com.adonax.tanpura;
requires java.base;
requires java.desktop;
}
The error statement, when trying to run from the command line:
java.io.IOException: invalid url
at java.desktop/javax.swing.JEditorPane.setPage(Unknown Source)
at moduleTCD/com.adonax.tanpura.documentation.AboutPanel.<init>(AboutPanel.java:28)
at moduleTCD/com.adonax.tanpura.panels.ControlPanel.initializeHelpPanel(ControlPanel.java:525)
at moduleTCD/com.adonax.tanpura.panels.ControlPanel.<init>(ControlPanel.java:163)
at moduleTCD/com.adonax.tanpura.TCDLaunch.main(TCDLaunch.java:43)
This exception is thrown in a try/catch for IOException at the point where the JEditorPane method setPage is called with null as an argument.
textArea.setPage(introURL);
At first, I didn't have an exports line in my module-info.java, but added it when I read the following from the API for Class.getResource:
Returns:
A URL object; null if no resource with this name is found, the resource cannot be located by a URL, the resource is in a package that
is not open to at least the caller module, or access to the resource
is denied by the security manager.
This raised the possibility that the package might be needed by Class in the module Java.base. The exports command there now is the broadest possible. But adding it did not change the error. I'm wondering if there is something wrong with how I did this, or if there is something else I am overlooking.
Classic error on my part. I made assumptions about the error being related to tech that is new and unfamiliar to me, rather than first verifying the obvious.
The fail was due to not realizing that the javac command did not move required resources into the target folder system.
I also verified that an "exports" statement is NOT needed in module-info in order to allow the loading of the resource.
So, in fact, this was not a java-module issue at all, just an oversight which I credit in part to a lack of chops using shell-level Java commands.
Big thank you to Alan Bateman!

scald.rb results in error (could not find or load main class)

I am trying to run the tutorial files from https://github.com/twitter/scalding/tree/develop/tutorial.
I cloned the 0.17.x branch and current develop branch and haven't had much success with either.
I have also already ran "sbt update" and "sbt assembly" to create the fat jar which is used by this scald.rb script.
Upon running the command below from the root scalding directory
scripts/scald.rb --local tutorial/Tutorial0.scala
I receive either of these errors:
Error: Could not find or load main class Files
[SUGGESTION]: Try scald.rb --clean, you may have corrupt jars lying around
or
Error: Could not find or load main class scala.tools.nsc.Main
[SUGGESTION]: Try scald.rb --clean, you may have corrupt jars lying around
Whatever I try to do I cannot get the scald.rb script to work. I have tried the clean option and many other stackoverflow answers such as setting scala_home in my environment variables and path to scala/bin. Many versions of sbt/scala and nothing works.
Current Software:
-Ruby 2.4.2-2-x86
-sbt 0.13.15
-Scala 2.11.8
-scalding 0.17.x branch

WiX can'f find my file : unable to load file, error LGHT0103

I am using WiX 3.5 and making an installer. I have used heat.exe to bundle all the files.
It produced a WiX file. I referred in main wxs files as componentgroup ref. When I build my installer, it throws the following exception.
light.exe : error LGHT0103 : The system cannot find the file
'..........\target\tmp-release\jboss-eap-5.0\jboss-as\server\all\deploy\httpha-invoker.sar\invoker.war\WEB-INF\classes\org\jboss\invocation\http\servlet\ReadOnlyAccessFilter.class'
with type ''.
It is able load many files from this location, except the above file, even though the file is present.
Looks like you've hit the linker bug. As far as I can see, it was already reported to the WiX team, and was scheduled for v4.0. The comment to the issue states the path is more than 255 characters, so a possible workaround for you is to re-work the files/folders layout to avoid the paths of that length.
Hope this helps.
The answer of Ravz1234 works ! I used it with a environment variable e.g. env.SourcePath.
1) Set an environment variable to show on your Source Dir e.g. C:\SourceDir
2) On heat.exe add the argument -var env.SourcePath along with the other arguments
I used the variable for the directory, sys.SOURCEFILEDIR, and it worked well.

Resources