When I launch start-dfs.sh in Hadoop 2.2.0 on Mac OS X, buried in the error messages, I have this:
2014-02-24 14:48:23,448 FATAL org.apache.hadoop.hdfs.server.datanode.DataNode: Exception in secureMain
java.lang.InternalError: Can't connect to window server - not enough permissions.
at java.lang.ClassLoader$NativeLibrary.load(Native Method)
at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1833)
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1730)
...
I've dealt with this error before - it happens when Java is trying to access the window server (even though it's a command line program). For security reasons, this isn't allowed without a graphical login. This of course means that if you're running a headless server, you have to physically log in before your daemons run.
Now, without going into a rant about how STUPID Java and/or the developers are for doing this (it seems to be a trend; the only other Java server component I use does the same thing), I found the option:
-Djava.awt.headless=true
which looks like a possible solution. But not only do I have no idea where to pass the option to Hadoop, but I tried it on the other software, and it still gives the error.
I'd appreciate any help.
So I tried it, and it turns out there's two things going on. The option DOES in fact work... for Hadoop. But here's where it gets weird:
Hadoop won't append to a log file... if one exists, it leaves it and silently fails to write any logs. So I was looking at old log files.
The other software still doesn't work, but they said they're aware of the bug and they're fixing it.
I fixed it using:
export HADOOP_OPTS="-Djava.security.krb5.realm=OX.AC.UK -Djava.security.krb5.kdc=kdc0.ox.ac.uk:kdc1.ox.ac.uk -Djava.awt.headless=true"
in my bashrc
Related
I am not very familiar with the Ubuntu. I have moved a jar file relatd to Blazegraph which I used on my Windows machine to my Ubuntu VM (Ubuntu 18.04 LTS Bionic).
I have also used chmod +x filename to make it executable. But when running the file, I get the following error:
ERROR: Banner.java:160: Uncaught exception in thread
java.lang.NullPointerException at
com.bigdata.rdf.sail.webapp.StandaloneNanoSparqlServer.main(StandaloneNanoSparqlServer.java:142)
Why do I get this message? I also found this thread on GitHub, but seems no one had a chance in fixing it!
Note: The file is blazegraph.jar which acts as a local server for the blazegraph so I can run SPARQL queries on some ontologies. Is this because the file is trying to act as a server and possibly firewall issues? However, the server will be at http://localhost:9999/blazegraph/ which I think shouldn't have to do anything with the firewall (if there is any on Linux).
Seems this is a bug with the Blazegraph.
See these links to read more about the problem: [1] [2].
PS: There have been some ways for getting rid of the problem but they did not work for me or I could't make them work. I initially wanted to remove this question but thought maybe others have the same problem.
I am trying to run the JAR "buildtools.jar" but a message keeps popping up:
The Java JAR file "BuildTools.jar" could not be launched.
in smaller writing underneath:
Check the Console for possible error messages.
The console says
12/31/14 10:19:44.021 AM WindowServer[113]: _CGXGetWindowMovementGroup: Operation on a window 0x14 requiring rights 0x5 by caller Dashboard or 12/31/14 10:19:44.021 AM DashboardClient[2747]: _NXMoveWindow: error moving window (1000)
every time I try to open the jar thing up. I know that my Java is updated because I updated before trying anything with this.
I am trying to create a minecraft server with spigot and if you have a step by step process or any hinters about please tell me but my main focus is opening up the jar.
Unfortunately this isn't the very right place to ask this question. You can ask this question at the Spigot Forums.
Are you using the very latest version of BuildTools? You seem like running on MacOS. You may need to run it with this flag, -Dmac.supported=true(refer to this post). Also, The Java JAR file "BuildTools.jar" could not be launched. most likely, you have a broken Jar file. Try to re-download it from {1}(I need 10 population to post more than 2 links). You will also need JDK(Java Development Kits) but I think it is came by default in MacOS and Git {2}.
After you've installed all required things, you can run the BuildTools from Terminal by java -Dmac.supported=true -jar BuildTools.jar You need to wait few minutes for it to be finished.
I have a single application which will cause eclipse itself to hang when run via eclipse. If I export this application as a jar and run it it works fine. But if I run (or debug) it the application will appear to start (according to ps) and run; but eclipse itself will hang, and is reported as a 'stopped' program with no CPU or memory usage. I've placed a breakpoints on the first line of this application and it doesn't even get there before eclipse ends up stopped. If I forcefully wake eclipse out of stopped state it will work; but it will also lose it's connection with the program I started. My program I want to debug will continue running but eclipse can't control or kill it after I resume the stopped eclipse.
I can run plenty of other applications without issue from eclipse. Oddly I had this issue before, then I could run my application for a day, and now I'm back to the original issue. I don't know what changed between those that would matter.
Can anyone suggest what may cause this or how to repair it?
UPDATE:
I did some more linux magic. It seems that eclipse is stopped while waiting for the command:
sh -c stty -lcanon min 1
It also seems that before that there was a sh (defunct) command which also hung without being reaped for a few minutes which I think was keeping eclipse from running properly; the sh (defunct) finally goes away if I wait long enough; but then the sh command I just linked comes up. I don't know what the original defunct SH command was; I can't do ps fast enough to catch it before it goes defunct. Both issues occur only with eclipse; as a jar file this program runs perfectly fine.
My running assumption is that eclipse isn't getting or handling the sigchild correctly? that would explain the sh (defunct) application at least. It doesn't explain the current SH command which doesn't show as defunct; despite it being something that should execute in seconds?
UPDATE 2.0:
I found this link: http://linux.about.com/od/srl_howto/a/hwtsrl13t04_3.htm basically stty is known to hang when it uses the < /dev/tty syntax; which is why the syntax is deprecated and replaced with a newer syntax. I'm pretty sure this is the problem. Sadly I have no way of figuring out what library is using the deprecated command. I think this all started with the ConsoleReader being constructed; but who knows what code actually ran the command that freezes? also, it seems if this was that broken anyone running consoleReader from eclipse on a linux environment would have the same problem; which I think is safe to assume isn't the case or it would be documented all over the net; so maybe my understanding is still off?
It is related to the configuration of the stty process that is created to attach the console and hence will occur only on UNIX like systems. Seems fixed on current 2.11 jline version.
To bypass the problem you can disable the special unix-terminal capabilities using:
-Djline.terminal=none
as VM argument on the eclipse launch configuration.
Try increasing -Xms<abc>m/-Xmx<efg>m (depending on the system memory) on eclipse.ini in the root directory of eclipse installation.
The problem was that we were using an older version of 'jline' which used deprecated functionality. The new jline jar fixed the problem, as it no longer used the deprecated stty calls. I'm not quite certain why eclipse caused this to happen every time; it seems as if it should be an intermittent error, but jline was definitely the cause.
I followed the instructions on the Datomic site: http://docs.datomic.com/getting-started.html, but I'm getting this error when trying to start up the datomic shell prompt. I'm using a windows machine. Any suggestions? I tried the same thing on my linux box and did not get this error.
Edit: moved to a different windows machine and it's working. If I have time to troubleshoot this problem and I find a solution I'll report back
I noticed that you cannot run the shell.cmd from within the bin directory, you need to call it with bin\shell.cmd from the parent directory... hope that helps.
In case you are using cygwin/bash and call bin/shell :
The java runtime on windows does not understand classpath with a ":"
but this is what you get from bin/classpath.
Either correct this or use DOS-CMD shell and call bin/shell.cmd inside.
Regards
Some tips for running datomic on Windows (7 at least):
Do not download datomic into Program Files. On startup, it creates logging directories and temp files into its own directories, so unless you run the command prompt as Administrator, you're gonna have screens full of Unable to write to file... errors.
You need to run datomic as such (assuming you extracted the download to C:)
c:\datomic-free-0.x.xxxx>bin\shell.cmd
Note the backslash. Tripped me up forever coming from *nix world.
After that, return to your regularly scheduled datomic tutorials.
Sometimes on the start STS hangs.
Does it possible found the reason? May be exists log or possible start in debug mode?
Also how I can distinguish between hangs completely and working very slowly?
Thanks.
P.S. How to fix ?
That is usually for the same resons descibed here tricks-to-speed-up-eclipse.
Garbage collection or validation.
If you have enough RAM I would suggest that you set -Xmx768m or higher (in eclipse.ini).
Under Windows->Preferences->Validation you can switch off a lot of stuff.
My STS hanged when I tried to start it. Couldn't tell why.
Doing this fixed things for me:
Shut down eclipse and then navigate to /.metadata/.plugins/org.eclipse.core.resources and remove the .snap file.
Courtesy: https://doctorjw.wordpress.com/2011/12/05/eclipse-locking-upnot-responding-try-this/
There's a log file I think it's in .metadata/.log in the workspace used. To see if memory causes the issue, and it usually does, try to run jconsole (part of the JDK) and connect to the running eclipse process, and see the memory stats.
Ensure that STS is running with admin privileges to avoid permission problems.
In ubuntu edit the following line in STS.desktop launch file:
Exec=gksu /etc/springsource/sts-3.4.0.RELEASE/STS
Complete file:
[Desktop Entry]
Name=STS
Comment=SpringSource Tool Suite
Exec=gksu /etc/springsource/sts-3.4.0.RELEASE/STS
Icon=/etc/springsource/sts-3.4.0.RELEASE/icon.xpm
StartupNotify=true
Terminal=false
Type=Application
Categories=Development;IDE;Java;