How to install a war file into JbossFuse? - 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

Related

Angular portlet throws exception path does not start with a "/" character

On Liferay github there is sample portlet which uses Angular https://github.com/liferay/liferay-blade-samples/tree/master/gradle/apps/npm/angular-npm-portlet
I've created my own portlet using maven command mvn archetype:generate -Dfilter=liferay
choose: 12
and after that I've built it and deployed to tomcat and exception was thrown:
07:29:02,097 ERROR [http-nio-8080-exec-2][ComboServlet:89] java.lang.IllegalArgumentException: Path samplePortlet#1.0.0.js does not start with a "/" character
any idea how to fix this ?
I guess that you run the generate command and then you try to do mvn clean install. The error is a cryptic one but one of the cases that you can get it is when the combo servlet can't find the dependency in the jar file. There is not yet a maven wrapper for the npm functionality.
You can do 2 things.
Without gradle:
mvn clean install
npm run build
copy the js from build folder into the target folder. cp -R build/resources/main/META-INF/resources/ target/classes/META-INF/resources/
mvn install (don't clean!)
With gradle:
gradle build
Few remarks:
If you want to work with the npm stuff I suggest that you go for Liferay workspace, blade tools and Gradle combinations. It works smoother.
When you create the project with the archetype you might need to fix the ID for the component. In the JS code will contain something with the artefact name - root but the actual id in the JSP will probably be just namespace.

Jrebel not initializing for embedded tomcat

I have been unable to get Jrebel to run. I am running a Hippo Java project on mac with the Eclipse plugin. I run the project using mvn from a command line (not through the eclipse IDE). I have followed these instructions for Hippo and JRebel
I have located the JRebel Eclipse plugin files here:
/Applications/Eclipse.app/Contents/Eclipse/plugins
From here I copied the contents of
org.zeroturnaround.eclipse.embedder_6.5.0.RELEASE/jrebel/
which contains 2 files: jrebel.jar and jrebel.plugininfo
I put these copies into a created directory ~/Tools/jrebel and pointed the environment variable REBEL_HOME to it.
export REBEL_HOME=~/Tools/jrebel
When I echo $REBEL_HOME I get the correct path. When I cd to that path and ls I get the 2 files.
In my hippo project, from the command line I run
mvn clean verify -Djrebel
I get build success. Then I run
mvn -Pcargo.run -Djrebel
This gives the error:
[INFO] [talledLocalContainer] Error opening zip file or JAR manifest missing : ${env.REBEL_HOME}/jrebel.jar
[INFO] [talledLocalContainer] Error occurred during initialization of VM
[INFO] [talledLocalContainer] agent library failed to init: instrument
I have read here to specify the path of jrebel.jar to -javaagent , but I don't know what this means or how to do it?
Hippo has built in JRebel configurations in the pom.xml. These should be activated with the -Djrebel flag. Why isn't this working?
The error shows that in that process REBEL_HOME isn't defined. I don't see anything wrong with what you did here so there may be some peculiarity to your local setup or to MacOS (I'm not a mac user). In any case your environment variable is not being passed to the process.
Everything you said works for me on Linux (Mint).
You can try setting the property in the cargo profile.
Or you could set the variable in your global environment.

Cannot get CoreNLP models files from JBoss Fuse ESB

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.

Karaf 3.0.3: MalFormedURLException: Invalid syntax for instruction [Bundle-SymbolicName=

I am creating a simple Bundle in Eclipse Luna Java EE edition and am able to Run the bundle within Eclipse using Equinox framework.
When I export this bundle (Export->Plug-in Development->Deployable Plug-ins and fragments) directly into Karaf-3.0.3's deploy directory, the bundle doesn't start and the karaf log shows (NOTE: Karaf is deployed onto C:\Karaf303 directory). Thanks for any insights:
2015-02-16 09:47:26,747 | ERROR | \Karaf303/deploy | fileinstall | 7 - org.apache.felix.fileinstall - 3.4.2 | Failed to install artifact: C:\Karaf303\deploy\plugins
java.net.MalformedURLException: Invalid syntax for instruction [Bundle-SymbolicName=C:\Karaf303\deploy\plugins]. Take a look at http://www.aqute.biz/Code/Bnd.
at org.ops4j.pax.swissbox.bnd.BndUtils.parseInstructions(BndUtils.java:302)[2:org.ops4j.pax.url.wrap:2.3.0]
at org.ops4j.pax.url.wrap.internal.Parser.<init>(Parser.java:116)[2:org.ops4j.pax.url.wrap:2.3.0]
at org.ops4j.pax.url.wrap.internal.Connection.<init>(Connection.java:67)[2:org.ops4j.pax.url.wrap:2.3.0]
at org.ops4j.pax.url.wrap.internal.Activator$1.createConnection(Activator.java:59)[2:org.ops4j.pax.url.wrap:2.3.0]
at org.ops4j.pax.url.wrap.internal.Activator$1.createConnection(Activator.java:49)[2:org.ops4j.pax.url.wrap:2.3.0]
at org.ops4j.pax.url.commons.handler.HandlerActivator$Handler.openConnection(HandlerActivator.java:222)[2:org.ops4j.pax.url.wrap:2.3.0]
at org.apache.felix.framework.URLHandlersStreamHandlerProxy.openConnection(URLHandlersStreamHandlerProxy.java:271)[org.apache.felix.framework-4.2.1.jar:]
at java.net.URL.openConnection(URL.java:971)[:1.7.0_51]
at java.net.URL.openStream(URL.java:1037)[:1.7.0_51]
at org.apache.felix.fileinstall.internal.DirectoryWatcher.install(DirectoryWatcher.java:943)[7:org.apache.felix.fileinstall:3.4.2]
at org.apache.felix.fileinstall.internal.DirectoryWatcher.install(DirectoryWatcher.java:865)[7:org.apache.felix.fileinstall:3.4.2]
at org.apache.felix.fileinstall.internal.DirectoryWatcher.doProcess(DirectoryWatcher.java:482)[7:org.apache.felix.fileinstall:3.4.2]
at org.apache.felix.fileinstall.internal.DirectoryWatcher.process(DirectoryWatcher.java:358)[7:org.apache.felix.fileinstall:3.4.2]
at org.apache.felix.fileinstall.internal.DirectoryWatcher.run(DirectoryWatcher.java:310)[7:org.apache.felix.fileinstall:3.4.2]
Figured out what the problem was - Eclipse is exporting the jar to the specified deploy directory of Karaf, but is placing the jar under a sub-directory, plugins, under deploy. Moving the JAR directly under deploy made it deploy successfully.

See OSGi bundles

I have Eclipse 3.8.1 and I want to see which OSGi bundles are started so I wrote in cmd from eclipse/plugins directory:
java -jar org.eclipse.osgi_3.8.1.v20120830-144521.jar -console
But nothing happens only empty line
Do I have to install something to see them?
If you have eclipse already running then you can access the Host OSGI Console from the Console view
UPDATE
I think this is what you are looking for
$ java -Dosgi.bundles=org.eclipse.equinox.console_1.0.0.v20120522-1841.jar#start,org.apache.felix.gogo.command_0.8.0.v201108120515.jar#start,org.apache.felix.gogo.runtime_0.8.0.v201108120515.jar#start,org.apache.felix.gogo.shell_0.8.0.v201110170705.jar#start -jar org.eclipse.osgi_3.8.1.v20120830-144521.jar -console
There are two options. These are as follows:
Create a configuration folder and put a config.ini file. Set the below content in the config.ini file:
osgi.console.enable.builtin=true
This will start equinox framework with the default console.
Or take the following steps. For details check: http://help.eclipse.org/juno/index.jsp?topic=%2Forg.eclipse.platform.doc.isv%2Fguide%2Fconsole_shell.htm
Place the necessary bundles in a folder. The bundles are:
org.apache.felix.gogo.command_0.8.0v<version>.jar
org.apache.felix.gogo.runtime_0.8.0v<version>.jar
org.apache.felix.gogo.shell_0.8.0v<version>.jar
org.eclipse.equinox.console_1.0.0v<version>.jar
org.eclipse.osgi.jar
Create a configuration subfolder and a config.ini file in it.
Add the following entries in the config.ini file:
osgi.bundles=./org.apache.felix.gogo.runtime_0.8.0v<version>.jar#start,\
./org.apache.felix.gogo.command_0.8.0v<version>.jar#start,\
./org.apache.felix.gogo.shell_0.8.0v<version>.jar#start,\
./org.eclipse.equinox.console.jar#start,\
osgi.console.enable.builtin=false
osgi.console=<port>
Start the Equinox framework with the following command line: java -jar org.eclipse.osgi.jar