Cannot get CoreNLP models files from JBoss Fuse ESB - apache-felix

I have a problem with CoreNLP using in JBoss Fuse ESB. I installed CoreNLP with it's models on ESB by
install wrap:mvn:edu.stanford.nlp/stanford-corenlp/3.6.0
install wrap:mvn:edu.stanford.nlp/stanford-corenlp/3.6.0//models-english
Then, when my module tries to use models-english I have error log message
Caused by: java.io.IOException: Unable to open "edu/stanford/nlp/models/pos-tagger/english-left3words/english-left3words-distsim.tagger" as class path, filename or URL
at edu.stanford.nlp.io.IOUtils.getInputStreamFromURLOrClasspathOrFileSystem(IOUtils.java:485)[275:org.opengravity.camel.nlp:1.0.0.SNAPSHOT]
at edu.stanford.nlp.tagger.maxent.MaxentTagger.readModelAndInit(MaxentTagger.java:765)[275:org.opengravity.camel.nlp:1.0.0.SNAPSHOT]
... 69 more
I tried to solve this problem by maven-bundle-plugin configurations
<Embed-Dependency>stanford-corenlp</Embed-Dependency>
but unfortunately it didn't help.

First of all I install two modules
install wrap:mvn:edu.stanford.nlp/stanford-corenlp/3.6.0
install wrap:mvn:edu.stanford.nlp/stanford-corenlp/3.6.0//models-english
and then, as it was advised by Claus Ibsen, I enabled dynamic import on the first bundle dev:dynamic-import XXX where XXX is the stanford-corenlp-3.6.0 bundle id. It solved my problem.

Related

Error occurred during initialization of boot layer java.lang.module.FindException executing Selenium tests using TestNG and Java 12 through Eclipse

ErrorOccuredDuringInitializationofbootlayer I keep getting this error when I run
my test:
Error occurred during initialization of boot layer
java.lang.module.FindException: Unable to derive module descriptor for
C:\Users\Bonfire.eclipse\org.eclipse.platform_4.12.0_867647348_win32_win32_x86_64\plugins\com.beust.jcommander_1.72.0.jar
Caused by: java.lang.IllegalArgumentException:
com.beust.jcommander.1.72.0: Invalid module name: '1' is not a Java
identifier
How can I fix it?
Add TestNG Library to classpath in buildpath ( not to module path). It will work fine.
To avoid this error, do not add TestNG library in the project or src folder. Try adding it into the package. To do so , follow the below mentioned procedure.
Right click on the package, click Build Path->Configure Build Path, go to Libraries tab, select Classpath and click on Add Library to select TestNG.
This error message...
Error occurred during initialization of boot layer java.lang.module.FindException:
Unable to derive module descriptor for C:\Users\Bonfire.eclipse\org.eclipse.platform_4.12.0_867647348_win32_win32_x86_64\plugins\com.beust.jcommander_1.72.0.jar
Caused by: java.lang.IllegalArgumentException: com.beust.jcommander.1.72.0: Invalid module name: '1' is not a Java identifier
...implies that there was an issue with the java classpath.
As per the discussion Launch with java 11 fails: Error: Could not find or load main class with Caused by: java.lang.ClassNotFoundException: with there are some issues with some particular classpaths for java-11 and the launch fails if:
The classpath contains a folder with spaces
The classpath length is larger than 32767 characters.
Where as java-8 works fine.
Reference
Unable to import org.openqa.selenium.WebDriver using Selenium and Java 11
Outro
Eclipse plugin: TestNG testcase does not run with Jdk11
Need to add 1.8 version library
Remove TestNG from build path library and add again
Recheck - the issue should be resolved.
I got same issue and I solved it. When creating the project, don't create module-info.java. When the project was already created with the module-info.java, deleting this file didn't help me.
I just created new project without module-info.java, and all works good now.
Best option to resolve this:
Find all file and folder starting with . e.g. — .metadata / .setting and delete them.
Add all the JARS.
Add testNG Libraries.
Execute it.
Done.

How to install a war file into JbossFuse?

I have a project that generates some war files. Right now I'm trying to install it into jbossfuse before creating a container to it.
So into fuse I've done that:
features:install war
I'm using a virtual machine with CentOS7 and jbossfuse, so I copied my war file into // and then I run this to install the war:
JBossFuse:admin#root> install war:file://my_project.war
When I run this I get this:
Bundle IDs:
Error executing command: Error installing bundles:
Unable to install bundle war:file://my_project.war
Basically I've followed the steps here:
https://access.redhat.com/documentation/en-US/Red_Hat_JBoss_Fuse/6.0/html/Deploying_into_the_Container/files/DeployWar-Convert.html
Is there something that I'm missing?
If your file is accessible it should work , can you please post the whole stack trace

How do I ignore/upgrade a module in JBoss Wildfly 9?

I just downloaded Wildfly 9.0.0.CR2 with Java 7 on Mac 10.9.5. I notice by default, Wildfly 9 includes a bouncycastle module (modules/system/layers/base/org/bouncycastle/main/bcprov-jdk15on-1.52.jar) . I would like to install another bouncycastle module in Wildfly (bcprov-jdk16-1.46.jar). Is there a way I can disable the one that JBoss has included? When I tried to delete the module Jboss included (the modules/system/layers/base/org/bouncycastle/ folder), I get the error upon JBoss startup
08:36:19,086 ERROR [org.jboss.as.server] (Controller Boot Thread) WFLYSRV0055: Caught exception during boot: org.jboss.as.controller.persistence.ConfigurationPersistenceException: WFLYCTL0085: Failed to parse configuration
at org.jboss.as.controller.persistence.XmlConfigurationPersister.load(XmlConfigurationPersister.java:131)
at org.jboss.as.server.ServerService.boot(ServerService.java:350)
at org.jboss.as.controller.AbstractControllerService$1.run(AbstractControllerService.java:271)
at java.lang.Thread.run(Thread.java:745)
Caused by: javax.xml.stream.XMLStreamException: WFLYCTL0083: Failed to load module org.jboss.as.weld
at org.jboss.as.controller.parsing.ExtensionXml.parseExtensions(ExtensionXml.java:155)
at org.jboss.as.server.parsing.StandaloneXml.readServerElement_1_4(StandaloneXml.java:433)
at org.jboss.as.server.parsing.StandaloneXml.readElement(StandaloneXml.java:144)
at org.jboss.as.server.parsing.StandaloneXml.readElement(StandaloneXml.java:106)
at org.jboss.staxmapper.XMLMapperImpl.processNested(XMLMapperImpl.java:110)
at org.jboss.staxmapper.XMLMapperImpl.parseDocument(XMLMapperImpl.java:69)
at org.jboss.as.controller.persistence.XmlConfigurationPersister.load(XmlConfigurationPersister.java:123)
... 3 more
You might have a look at this discussion, it is almost the same thing you want to do (opposite direction w.r.t. versions):
BouncyCastle 1.51 loading in war on Wildfly 8.0
The long and the short of it is, you can create a custom module (or, I think, another slot for the existing module?) and reference that one in your jboss-deployment-structure.xml instead of the default module wildfly is bringing with it.
If you don't want/need BC as a module, you could also just include it in the lib folder of your EAR/WAR and it will be loadable from there.
Our deployment structure looks essentially like this:
my.ear
+ lib/ <-- dependencies for multi-submodule deployment
+ META-INF/ <-- application.xml defines submodule(s) e.g. web.war,
<-- also jboss-deployment-structure.xml to include/export wildfly core modules for your EAR
+ web.war <-- our core deployment
And we include e.g. a different version of hibernate than in wildfly. I expect you can include a different BC version in your ear as well.
See also:
https://docs.jboss.org/author/display/WFLY8/Class+Loading+in+WildFly
Custom module tutorial:
http://middlewaremagic.com/jboss/?p=1933
Similar issue with resolution: https://developer.jboss.org/thread/175395
WildFly uses modular classloading and as such not everything is on classpath of every module.
Deployment itself is just another module that gets extra dependencies based on what deployment descriptors tell server should be added.
When it comes to bouncycastle, there are modules that themselves require it, but that doesn't mean they will expose this dependency to your deployment.
There was a bug in 8.0 that caused that BC was exposed to user deployment in case when user deployment was using web services. This was fixed since than.
Given that you use WildFly 9 that shouldn't a problem anymore.
As other suggested, you can create new module with different name or at least different slot name, which you can than include via your jboss-deployment-structure.xml
Just btw, bcprov-jdk16-1.46 is much older than what is provided in WildFly.

Need bundle with javax.persistence on OSGi

I get this error when I try to install my bundle in Servicemix:
Error executing command: Error starting bundles:
Unable to start bundle 179: Unresolved constraint in bundle de.edigrid.edigrid-servicemix-util [179]: Unable to resolve 179.0: missing requirement [179.0] osgi.wiring.package; (osgi.wiring.package=javax.persistence)
Can anybody tell me if is there a standard jar file, OSGi compliant, that exports javax.persistence package?
Thanks.
Just install the jpa feature. If this feature is not available in your servicemix version then try:
install -s mvn:org.apache.geronimo.specs/geronimo-jpa_2.0_spec/1.1
EclipseLinks has a bundle, it's included in their download: http://www.eclipse.org/downloads/download.php?file=/rt/eclipselink/releases/2.5.2/eclipselink-plugins-2.5.2.v20140319-9ad6abd.zip
Alternatively you can also get the same bundle from the Amdatu Dependencies repository: https://bitbucket.org/amdatu/amdatu-repository/src/53bb0dd92bcf005da5a6937c2034d366e9f21365/dependencies/javax.persistence/javax.persistence-2.0.3.jar?at=master#

Adding JDK dependencies to jboss 6

I am using JBOSS EAP 6.1 using JDK 1.6. I have registered all my dependencies as static module. I have dependencies on JDK apis.
During deployment I am faced with following issue:
java.lang.NoClassDefFoundError: javax/crypto/CipherInputStream
java.lang.NoClassDefFoundError: org/omg/CORBA/portable/IDLEntity
java.lang.NoClassDefFoundError: javax/swing/ImageIcon
I was able to resolve the above issue by creating a static module and adding rt.jar and des.jar as resources in moudle.xml but then I am facing another issue regarding algorithm not found.
java.security.NoSuchAlgorithmException: PBEWithMD5AndDES SecretKeyFactory not available
at javax.crypto.SecretKeyFactory.(DashoA13*..)
at javax.crypto.SecretKeyFactory.getInstance(DashoA13*..)
at utilities.algorithm.DesEncrypter.(DesEncrypter.java:49)
at utilities.algorithm.DesEncrypter.decryptStream(DesEncrypter.java:177)
I want to add include these dependencies from system without creating static module as shown on different forums.
https://community.jboss.org/thread/195182
https://community.jboss.org/message/717881#717881#717881
Can we do it in for EAP 6.1 or its just available for JBOSS AS 7. Can someone please show me an example for EAP 6.1.
I have been able to fix the issue. The api included in JDK are exported in different modules and we need to include those modules in our modules as dependences.
For Example: org/omg/CORBA/portable/IDLEntity was available in org.omg.api module.
Similarly, javax/swing/ImageIcon & javax/crypto/CipherInputStream was available in javax.api.