WorkAround for XD-2772: No validation for module packaging during module upload - spring-xd

I created a custom module and registered it as mentioned in Spring-XD doc.
During stream deployment, I am getting similar error:
Mar 02, 2015 10:45:48 PM org.springframework.shell.core.SimpleExecutionStrategy invoke
SEVERE: Command failed org.springframework.xd.rest.client.impl.SpringXDException: Multiple top level module resources found :file [/opt/spring-xd/spring-xd-1.1.0.RELEASE/xd/config/jms-activemq.properties],file [/opt/spring-xd/spring-xd-1.1.0.RELEASE/xd/config/xd-container-logger.properties],file [/opt/spring-xd/spring-xd-1.1.0.RELEASE/xd/config/jms-hornetq.properties],file [/opt/spring-xd/spring-xd-1.1.0.RELEASE/xd/config/xd-singlenode-logger.properties],file [/opt/spring-xd/spring-xd-1.1.0.RELEASE/xd/config/xd-admin-logger.properties],file [/opt/spring-xd/spring-xd-1.1.0.RELEASE/xd/config/httpSSL.properties],file [/opt/spring-xd/spring-xd-1.1.0.RELEASE/xd/config/hadoop.properties]
I understand that my module lacks, config file and properties file.
So, I want to understand, can I copy files manually?
If yes, then what will be the location
Thanks in advance.
Resolution:
1. Create "config" directory at $XD_HOME/modules/processor/<name>/
2. Add <name>.xml to $XD_HOME/modules/processor/<name>/config

This error message is misleading (this has been fixed on current master at the time of writing).
Indeed, your module certainly lacks its config/xxx.properties file. If you use one of the dedicated build plugins (either maven or gradle), this should help you packaging your module properly. Those plugins expect that file to be at src/main/resources/config/foo.properties in source form (which will end up as your.jar!/config/foo.properties in built form)

Related

Grails 3 (Gradle) dependency without parent directory

Can I not use the following Gradle approach to dependencies in Grails? I do not have nor want a parent directory;
https://stackoverflow.com/a/19303545/2288004
When I try it, I get the the following error;
Caused by: java.lang.IllegalStateException: Expected method not found:
java.lang.NoSuchMethodException:
org.springframework.boot.context.embedded.tomcat.TomcatEmbeddedContext.addApplicationListener(org.apache.catalina.deploy.ApplicationListener)
It works when I use a parent directory for the settings.gradle, but unfortunately it’s not how I want to structure the project.
The following was indeed the solution I was looking for,
include ":myplugin"
project(':myplugin').projectDir = new File(settingsDir, '../myplugin')
The error was down to how I was managing my tomcat dependencies between the two projects.
Tomcat was already being pulled in via the plugin but while I still needed to reference tomcat at compile time in the application, I also needed to make sure it was the same version, and so added the following just above "dependencies" to target the version I required;
ext['tomcat.version'] = '7.0.70'

Error from XProcxq module in eXist-db

We're running eXist-db version 3.0 and want to try running XProc within it.
We found that the XProcxq Module is now part of eXist: http://exist-db.org/exist/apps/doc/extensions.xml#module_xprocxq
However, in attempting to use it we get the error below and wondered if anyone had suggestions for where we could be going wrong?
As specified at the top of the module page linked to, we added the module to the conf.xml file and restarted eXist. (This could be where we went wrong, but that's a guess on our part)
This is what the module we added looks like in conf.xml:
<module uri="http://xproc.net/xproc" class="org.exist.xquery.modules.xprocxq.XProcxq/>
Here is the simple started XQuery I've attempted to use:
xquery version "1.0" encoding "UTF-8";
import module namespace const = "http://xproc.net/xproc/const";
import module namespace xproc = "http://xproc.net/xproc";
import module namespace u = "http://xproc.net/xproc/util";
declare variable $local:XPROCXQ_EXAMPLES := "/db/examples"; (:CHANGE ME:)
let $stdin :=document{<test>Hello World</test>}
let $pipeline :=document{
<p:pipeline name="pipeline"
xmlns:p="http://www.w3.org/ns/xproc"
xmlns:c="http://www.w3.org/ns/xproc-step">
<p:identity/>
</p:pipeline>
}
return
xproc:run($pipeline,$stdin)
Here is the error:
error found while loading module xproc: IO exception while loading module 'http://xproc.net/xproc' from 'http://xproc.net/xproc'
I posed your question to the exist-open mailing list (where I'd encourage you to join for future eXist-db questions), and it appears XProc support in eXist is currently between a rock and a hard place. The xprocxq library you mentioned is woefully underdeveloped (abandoned by its original creator), and the much better developed Calabash module is incompatible with the current version of Saxon used in eXist, due to a dependency on that version of Saxon. I'd welcome you to join exist-open to discuss further. Perhaps there's some other workaround for you.
It needs to be rebuilt.
According to http://exist-db.org/exist/apps/wiki/blogs/eXist/eXist30RC1
EXPath packages that incorporate Java libraries may no longer work with eXist 3.0 and may need to be recompiled for our API changes; packages should now explicitly specify the eXist versions that they are compatible with.
I am working on the update to the XProc EXPath module.
The XMLCalabash module for eXist has now been rebuilt for a newer version of eXist and Calabash and should work with eXist 3.0.RC1.
To build your own Jar package for eXist 3.0.RC1 run:
$ git clone https://github.com/eXist-db/eXist-XMLCalabash.git
$ cd eXist-XMLCalabash
$ rm -rf src/test
$ mvn package
The Jar is then in the target/ folder. You should copy it to $EXIST_HOME/lib/user modify $EXIST_HOME/conf.xml to load the module and then restart eXist.
Updated
The XML Calabash module for eXist, now also has a PR so that it will support the upcoming eXist 3.0.RC2 -
https://github.com/eXist-db/eXist-XMLCalabash/pull/2
However you cannot built it remotely until eXist 3.0.RC2 is released.

cleartk dependency not found when calling StanfordCoreNLPAnnotator from UIMA RUTA

I am trying to call ClearTK's StanfordCoreNLPAnnotator from within UIMA RUTA, but cannot get it to work. I am using eclipse with a maven-enabled RUTA project in which I also have Java code for auxiliary tasks. I have imported cleartk-stanford-corenlp 0.8 using maven.
I tried using this line in my script:
ENGINE utils.MyStanfordEngine;
... where utils/MyStanfordEngine.xml is an XML descriptor file created using this java code:
MyStanfordAnnotator.getDescription().toXML(new FileOutputStream("descriptor/utils/MyStanfordEngine.xml"));
No errors appear, but upon execution I get:
Exception in thread "main" org.apache.uima.resource.ResourceInitializationException: Initialization of annotator class ... failed.
(Descriptor: file:.../descriptor/mainScriptEngine.xml)
...
Caused by: org.apache.uima.resource.ResourceInitializationException: Annotator class
"org.cleartk.stanford.StanfordCoreNLPAnnotator" was not found.
(Descriptor: file:.../descriptor/utils/MyStanfordEngine.xml)
...
I think I understand that the RUTA project does not find it in the Maven dependencies, but I need to stick to Maven as my dependency tool because of collaboration purposes.
Can someone help?
UPDATE:
When I encountered the problem, I was using RUTA 2.1.0. I have updated to 2.2.0rc1 since then, but the problem persisted.
With Peter's suggestion below (Thanks!), in the Java build path, I referenced a blank Maven-enabled Java project that does nothing but imports cleartk-stanford-corenlp 0.8. I can now run the following RUTA code:
TYPESYSTEM utils.CleartkRutaTypeSystem;
ENGINE utils.MyStanfordEngine;
Document{-> CALL(MyStanfordEngine)};
... successfully does what looks like all intended annotations for all documents in the input folder, but eventually crashes with this Exception:
[Stanford Tools Logging output ...]
22.02.2014 12:44:22 org.apache.uima.analysis_engine.impl.PrimitiveAnalysisEngine_impl callAnalysisComponentProcess(406)
SCHWERWIEGEND: Exception occurred
org.apache.uima.analysis_engine.AnalysisEngineProcessException: Annotator processing failed.
at org.apache.uima.ruta.engine.RutaEngine.process(RutaEngine.java:477)
at org.apache.uima.analysis_component.JCasAnnotator_ImplBase.process(JCasAnnotator_ImplBase.java:48)
at org.apache.uima.analysis_engine.impl.PrimitiveAnalysisEngine_impl.callAnalysisComponentProcess(PrimitiveAnalysisEngine_impl.java:374)
at org.apache.uima.analysis_engine.impl.PrimitiveAnalysisEngine_impl.processAndOutputNewCASes(PrimitiveAnalysisEngine_impl.java:298)
at org.apache.uima.analysis_engine.impl.AnalysisEngineImplBase.process(AnalysisEngineImplBase.java:267)
at org.apache.uima.ruta.ide.launching.RutaLauncher.processFile(RutaLauncher.java:168)
at org.apache.uima.ruta.ide.launching.RutaLauncher.main(RutaLauncher.java:129)
Caused by: java.lang.NullPointerException
at org.apache.uima.cas.impl.CASImpl.createFS(CASImpl.java:483)
at org.apache.uima.cas.impl.CASImpl.createAnnotation(CASImpl.java:3837)
at org.apache.uima.ruta.action.CallAction.callEngine(CallAction.java:192)
at org.apache.uima.ruta.action.CallAction.execute(CallAction.java:62)
at org.apache.uima.ruta.rule.AbstractRuleElement.apply(AbstractRuleElement.java:130)
at org.apache.uima.ruta.rule.RuleElementCaretaker.applyRuleElements(RuleElementCaretaker.java:111)
at org.apache.uima.ruta.rule.ComposedRuleElement.applyRuleElements(ComposedRuleElement.java:547)
at org.apache.uima.ruta.rule.AbstractRuleElement.doneMatching(AbstractRuleElement.java:84)
at org.apache.uima.ruta.rule.ComposedRuleElement.fallback(ComposedRuleElement.java:468)
at org.apache.uima.ruta.rule.ComposedRuleElement.fallbackContinue(ComposedRuleElement.java:377)
at org.apache.uima.ruta.rule.RutaRuleElement.startMatch(RutaRuleElement.java:100)
at org.apache.uima.ruta.rule.ComposedRuleElement.startMatch(ComposedRuleElement.java:73)
at org.apache.uima.ruta.rule.RutaRule.apply(RutaRule.java:47)
at org.apache.uima.ruta.rule.RutaRule.apply(RutaRule.java:40)
at org.apache.uima.ruta.rule.RutaRule.apply(RutaRule.java:29)
at org.apache.uima.ruta.RutaScriptBlock.apply(RutaScriptBlock.java:63)
at org.apache.uima.ruta.RutaModule.apply(RutaModule.java:48)
at org.apache.uima.ruta.engine.RutaEngine.process(RutaEngine.java:475)
... 6 more
Exception in thread "main" org.apache.uima.analysis_engine.AnalysisEngineProcessException: Annotator processing failed.
at org.apache.uima.ruta.engine.RutaEngine.process(RutaEngine.java:477)
at org.apache.uima.analysis_component.JCasAnnotator_ImplBase.process(JCasAnnotator_ImplBase.java:48)
at org.apache.uima.analysis_engine.impl.PrimitiveAnalysisEngine_impl.callAnalysisComponentProcess(PrimitiveAnalysisEngine_impl.java:374)
at org.apache.uima.analysis_engine.impl.PrimitiveAnalysisEngine_impl.processAndOutputNewCASes(PrimitiveAnalysisEngine_impl.java:298)
at org.apache.uima.analysis_engine.impl.AnalysisEngineImplBase.process(AnalysisEngineImplBase.java:267)
at org.apache.uima.ruta.ide.launching.RutaLauncher.processFile(RutaLauncher.java:168)
at org.apache.uima.ruta.ide.launching.RutaLauncher.main(RutaLauncher.java:129)
Caused by: java.lang.NullPointerException
at org.apache.uima.cas.impl.CASImpl.createFS(CASImpl.java:483)
at org.apache.uima.cas.impl.CASImpl.createAnnotation(CASImpl.java:3837)
at org.apache.uima.ruta.action.CallAction.callEngine(CallAction.java:192)
at org.apache.uima.ruta.action.CallAction.execute(CallAction.java:62)
at org.apache.uima.ruta.rule.AbstractRuleElement.apply(AbstractRuleElement.java:130)
at org.apache.uima.ruta.rule.RuleElementCaretaker.applyRuleElements(RuleElementCaretaker.java:111)
at org.apache.uima.ruta.rule.ComposedRuleElement.applyRuleElements(ComposedRuleElement.java:547)
at org.apache.uima.ruta.rule.AbstractRuleElement.doneMatching(AbstractRuleElement.java:84)
at org.apache.uima.ruta.rule.ComposedRuleElement.fallback(ComposedRuleElement.java:468)
at org.apache.uima.ruta.rule.ComposedRuleElement.fallbackContinue(ComposedRuleElement.java:377)
at org.apache.uima.ruta.rule.RutaRuleElement.startMatch(RutaRuleElement.java:100)
at org.apache.uima.ruta.rule.ComposedRuleElement.startMatch(ComposedRuleElement.java:73)
at org.apache.uima.ruta.rule.RutaRule.apply(RutaRule.java:47)
at org.apache.uima.ruta.rule.RutaRule.apply(RutaRule.java:40)
at org.apache.uima.ruta.rule.RutaRule.apply(RutaRule.java:29)
at org.apache.uima.ruta.RutaScriptBlock.apply(RutaScriptBlock.java:63)
at org.apache.uima.ruta.RutaModule.apply(RutaModule.java:48)
at org.apache.uima.ruta.engine.RutaEngine.process(RutaEngine.java:475)
... 6 more
Sorry for the whole stack trace, but I thought if a RUTA developer is reading this they may want the whole thing.
Is there a way to solve this? What am I doing wrong?
There are several limitations to consider:
UIMA Ruta 2.1.0 does not support mixin projects: maven dependencies need to be specified in another project. The Ruta project then has to depend on the additional java project.
UIMA Ruta Workbench 2.1.0 has some problems validating imported type system that import again other type systems by name. Here, rather import by location should be used.
UIMA CAS Editor 2.5.0 has some problems resolving type system imports using the datapath, which causes problems visualizing the created annotations if the type system descriptor needs additional information such as the datapath. Here, the creation of a type system descriptor of a script should include (not only import) all types of imported type systems. This can be configured in the preferences (I have not used that for a while). This problem can again be prevented by using import by location.
UIMA Ruta 2.2.0 supports mixin projects. Here, only the problem with the CAS Editor remains.
This described project can be created the following way (with UIMA Ruta 2.2.0):
Create a new UIMA Ruta Project
Make it a maven project: popup->Configure->Convert to Maven Project
Add a dependency to cleartk-stanford-corenlp in the pom
<dependency>
<groupId>org.cleartk</groupId>
<artifactId>cleartk-stanford-corenlp</artifactId>
<version>0.8.0</version>
</dependency>
Provide the type systems in the descriptor folder or in a dependent project, e.g., copy the org folder of cleartk-type-system-1.2.0 to the descriptor folder. Mind that the CAS Editor will have problems resolving the imports, if the descriptors are not adapted.
Create a simple script that imports the type system, imports the analysis engine and excutes the analysis engine. Here, the uimaFIT component is directly imported instead of a descriptor. The EXEC action need to be extended with interesting types if later rules should be able to operate on the result of the imported analysis engine.
TYPESYSTEM org.cleartk.TypeSystem;
UIMAFIT org.cleartk.stanford.StanfordCoreNLPAnnotator;
Document{->EXEC(StanfordCoreNLPAnnotator)};
If there is a text file in the import folder, then running this script should be able to annotate it.
This example directly uses the StanfordCoreNLPAnnotator instead of an additional analysis engine, but switching to another implementation or analysis engine should be straightforward.

GradleException Could not create ZIP

Caused by: org.gradle.api.GradleException: Could not create ZIP '/jenkins/repository/workspace/profile/build/libs/../profile.jar'.
Project
common << I build under this directory
profile
build.gradle(in common)
...
dependencies {
compile project(':../profile')
...
settings.gradle(in common)
include '../profile'
It works on windows environment. But it does not work on linux environment even using root account
The project paths accepted by the include and project methods are logical paths, not physical paths. They cannot contain a ... Physical paths must be declared separately in settings.gradle (if they divert from the logical path). The easiest way to declare a flat physical directory layout is to use the includeFlat method:
common/settings.gradle
includeFlat 'profile'
common/build.gradle
dependencies {
compile project(':profile')
}
You can find more information on this topic in the "multi-project builds" chapter of the Gradle User Guide.
Another common issue that can happen here especially if you're using windows is you could have opened the previous jar up in 7zip or some other tool and that's causing the file to be locked. To test this try to delete the jar that's sitting in build/libs if you can't delete the file it's locked by another program more than likely. :D
An even shorter way to fix this: Add the following line to the build.gradle file of the included profile project:
archivesBaseName = 'profile'
This overwrites the default name of the jar.

InstallTask not found

I'm going through the Spring MVC tutorial. I have a build.xml and build.properties file as well as a simple jsp file. When I try to run ant, I get this error:
Buildfile: /<home>/dev/Spring/springapp/build.xml
BUILD FAILED
/<home>/dev/Spring/springapp/build.xml:85: taskdef class org.apache.catalina.ant.InstallTask cannot be found
using the classloader AntClassLoader[/usr/local/apache-tomcat/current/lib/catalina-ant.jar]
Total time: 0 seconds
I looked in the catalina-ant.jar file, and sure enough there is no InstallTask class. Did this jar file change, since the spring tutorial was written? If so, where can I find the InstallTask.
The tutorial you are following is out of date - the InstallTask has been deprecated in favour of the DeployTask.
Newer distributions no longer include the deprecated class. You should be able to revise your buildfile simply by changing 'Install' to 'Deploy', something like:
<taskdef name="install" classname="org.apache.catalina.ant.DeployTask">

Resources