java.lang.NoClassDefFoundError: org/slf4j/LoggerFactory at org.apache.nifi.bootstrap.RunNiFi.main - noclassdeffounderror

i use intellij idea to run the nifi source code from bootstrap/.../RunNiFi.main("start"): github link, but it get wrong like this: picture here
can you help me ?
thanks
and should i run the code from bootstrap/.../RunNiFi.main("start")?

You won't be able to launch a single Java class from your IDE to start NiFi, the classpath won't be setup correctly.
You'll need to run a full build and get the assembly from nifi-assembly/target and then run NiFi from the built assembly by using "bin/nifi.sh start".
You can run it directly from the unpacked assembly target, for example:
cd nifi-assembly/target/nifi-1.6.0-SNAPSHOT-bin/nifi-1.6.0-SNAPSHOT
./bin/nifi.sh start
EDIT: You can still use debugger, but it will be debugging a remote Java application. In NiFi's bootstrap.conf, uncomment the following line and restart NiFi:
#java.arg.debug=-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=8000
This tells the NiFi JVM to listen for incoming debug requests on port 8000.
In your IDE, create a Remote debugging configuration and connect to localhost port 8000. Your break points should work like normal.

if you can read chinese, you can read my personal blog link here
I found the methods,
if you want remote debug nifi, please follow remote debug link.
if you want local debug, you can follow bellow.
(I used Intellij idea in windows to debug)
1.
$ git config --global core.longpaths true
$ git config --global core.autocrlf false
open intellij idea to git clone https://github.com/apache/nifi,
picture here,
set the import configure as default, next...
after opened the project, the nifi may get wrong message, just ignore it.
mvn -T 2 clean install -DskipTests
configure debugger
picture here,
picture here
acknowledge:
nifi quick start link: https://nifi.apache.org/quickstart.html
Running NiFi in Debug mode link: https://cwiki.apache.org/confluence/display/NIFI/Contributor+Guide#ContributorGuide-RunningNiFiinDebugmode

Related

Why isn't my luminus app working on Heroku?

I'm a complete beginner and following this book: https://pragprog.com/titles/dswdcloj3/web-development-with-clojure-third-edition/
I followed the instructions about deploying to Heroku from the book and from here: https://luminusweb.com/docs/deployment.html#heroku_deployment but I'm having some issues.
Here is my problem and the steps I've taken. I'm using the source code from guestbook-controllers here and modifying it, just trying to get the app working in Heroku (ie able to make an account, log in and post a message). Here is my repo: https://github.com/johnbradens/guestbook-heroku
Here are my steps:
git init
git add .
git commit -m "initial commit"
I added a bin/build file and ran chmod u+x bin/build (based on instructions from https://folcon.github.io/post/2020-04-12-Fulcro-on-Heroku/, because it was saying that react wasn't installed)
I added heroku buildpacks nodejs & clojure (otherwise it said it couldn't read the npm from bin/build)
heroku addons:create heroku-postgresql
git push heroku main
This is what I see when I look at the Heroku app:
Error 1
Error 2
When I run heroku run lein run migrate I get the following error:
Syntax error compiling at (/tmp/form-init6415984187052473661.clj:1:73).
could not find a non empty configuration file to load. looked in the classpath (as a "resource") and on a file system via "conf" system property
I tried editing the env/prod/resources/config.edn but I'm not sure what to do with it. I tried a lot of things and none of them worked.
Here's an example of something I tried, in changing the env/prod/resources/config.edn file. One of the links above says to just have {:prod true} so that's what I have right now, but I also tried:
{:prod true
:port (System/getenv "PORT")
:database-url (System/getenv "JDBC_DATABASE_URL")
}
EDIT: I found out thanks to the clojure slack that my env folder is being ignored, and to create a prod-config.edn file where I have the above text in that file. I tried pushing to Heroku again and I still get the same errors as in the images on the web app, and I still get the same error message when I run heroku run lein run migrate that the config file is not being found.
What should I do?
Ok everyone this is what finally fixed it. I found this in this github post: https://github.com/luminus-framework/luminus/issues/231
it seems that
heroku run lein run migrate
from the documentation is not going to work.
Migration could be done running the generated jar file:
heroku run java -cp target/uberjar/<app name>.jar clojure.main -m guestbook.core migrate
Leaving this here in case anyone else has the same issue.

Running mapbox-gl-js locally (unable to serve debug page)

Edit:
Summary, I tried to follow only the steps listed in the below two links as applies to windows:
https://github.com/mapbox/mapbox-gl-js/blob/master/CONTRIBUTING.md
https://github.com/stackgl/headless-gl#windows
Here I have reattached the screenshot of the commands that I had problems with:
https://imgur.com/RCQCNU5
One more step I took that I should mention is I also did not find the headless gl when I downloaded the repository, when the install headless gl command did not work I manually copied the file and put it in my local copy under the nodemodules directory thinking it would work but it didnt solve anything. I do think this is related to access issues but I dont know what else I should try to get it working?
First, let's clarify your problem: you want a version of mapbox-gl.js which contains a recently fixed bug.
Your best option is to just wait a couple of weeks for a release.
Failing that, you should build your own, from master. You don't need to set up a debug server for that. You can skip straight to the "Creating a Standalone Build" section.
If the steps for building on Windows don't work for some reason, you could set up a local virtual machine running Ubuntu and use that.
But honestly, just wait a couple of weeks. :)
Just in case some one else need to run this on local server.
After clone
Run npm install
npm run start-debug
It will start listening on port 9966.
Test the debug html files entering to
localhost:9966/debug/FILE_NAME_TO_TEST.html

Running a Tika server from eclipse to be accessed from hosts other than localhost

I have the following question: I have imported in eclipse the tika-server subdirectory of the tika-trunk main repository and managed to import it to eclipse and I am able to start the "Apache Tika 1.7-SNAPSHOT server" on the machine I run eclipse (localhost). My problem is that I can only access Tika from this machine (localhost).
I know how to solve this problem when I start the Tika server from my command line (see post Stopping a Tika server properly ), but I do not know how I can pass "-host 0.0.0.0" in order to instruct eclipse to do the same. I know that this might be solved through the "Run Configurations" eclipse menu but it is not intuitive to me how I can accomplish that. Thank you in advance !
First up, you need to open the Tika Server Cli class in eclipse. Then, do Run As followed by Run Configuration, as shown here:
Now, in the configuration for the Tika Server CLI, in the program arguments box, enter the arguments you want to give to Tika, eg --port 9876 as shown here
Finally, hit Run and the Tika Server will start with the alternate port you've givne
I think the only solution so far I found is to edit "TikaServerCli.java" and switch "public static final String DEFAULT_HOST" from "localhost" to "0.0.0.0". Then you can start the server in a way that can be accessed by everyone and not only by localhost.

How to disable/bypass JBoss EWS 2.0 logging on OpenShift?

I am able to deploy a war on OpenShift using git (git add, push ...) and it works. The only problem that I encountered is that all my logs are doubled (only when I deploy on OpenShift) whereas locally (using apache tomcat 7 with only log4j framework) all my logs are only logged one time.
After having searched one day on the Internet, I have found two ways to normally fix that problem, which is to find how to disable/bypass JBoss EWS 2.0 logging on OpenShift:
Clues found on Google
1) Add a JAVA_OPT to Startup
Now, when starting the application server, you will need to add a JAVA_OPT. This flag will make sure that the JBoss Log Manager does not pick up your logging configuration and your own logging JARs will work as normal.
./standalone.sh -Dorg.jboss.as.logging.per-deployment=false
And now your application will now log using the packaged JARs, effectively bypassing JBoss Logging.
Source: http://blog.jyore.com/?p=234
2) It looks like you have a log4j configuration file in your deployment. Try passing
-Dorg.jboss.as.logging.per-deployment=false
to disable that configuration from being used.
--
James R. Perkins
Source: https://community.jboss.org/thread/224127
My implementation of these clues
For implementing these solutions I did two things:
1) I created and git push this hook below:
vim .openshift/action_hooks/pre_start_jbossews-2.0
echo "executing pre_start_jbossews-2.0"
# I also tried with JAVA_OPTS
export JAVA_OPTS_EXT="-Dorg.jboss.as.logging.per-deployment=false"
echo "Value is: $JAVA_OPTS_EXT"
Note: this hook is well triggered, because I can see the echo when the server restarts after having pushed the modifications.
2) I also added this line in catalina.properties:
vim .openshift/config/catalina.properties
-Dorg.jboss.as.logging.per-deployment=false
Conclusion at that time:
Unfortunately none of these solutions disable/bypass JBoss EWS 2.0 default logging.
I am currently stuck with double log lines, so any help would be greatly appreciated, I count on you guys.
Thank you very much in advance for your help.
On Openshift the right way to setup persistent environment values is to use rhc tool:
rhc set-env JAVA_OPTS_EXT=-Dorg.jboss.as.logging.per-deployment=false -a myapp
Then try to explicitly stop and start your application (with rhc stop and rhc start).

maven was6:installApp TransferFailed

I'm trying to deploy my ear to a remote Websphere 8.5 with maven plugin was6 via SOAP.
I set up the correct ear with correct host, node,cell,server, port etc.
But when I try to install app I got WASX7017E: ConnectException - Connection refused with a TransferFailedException
In logs, there is nothing in local and remote neither. As I see with netstat when I run the mvn installApp there are many connection trying on serverside whiches have status TIME_WAIT.
The plugin seems to be working with v8.5 cause other functions for example wsListApp work.
I tried to google it but with no results.
Does anyone get this error before me? Or has anyone idea what should I do?
Thank you.
was6-maven-plugin generates a temporal ant file under "target\was6-maven-plugin\" folder and then calls $WAS_HOME\bin\ws_ant.sh/bat utility using -f option with the previously generated ant file.
If you don't use the clean target, the files should continue there so you can use ws_ant to find the real error and find if there is an error on your configuration or in the plugin.
If you find an error in the plugin, please open an issue here: http://jira.codehaus.org/browse/MWAS
In this link you'll find all the options available in the wsInstallApp target:
http://pic.dhe.ibm.com/infocenter/wasinfo/v8r5/index.jsp?topic=%2Fcom.ibm.websphere.javadoc.doc%2Fweb%2Fapidocs%2Fcom%2Fibm%2Fwebsphere%2Fant%2Ftasks%2FInstallApplication.html
Regards,
Javier Murciego