I just configured Eclipse with the development environment for Hadoop(v 1.0.1). When I run one of the tests /src/test/org/apache/hadoop/hdfs/BenchmarkThroughput.java it crashes with a NullPointerException.
The problem seems to be in BenchmarkThroughput.run(), line 196 where it does System.setProperty("test.build.data", localDir). The localDir shows up as null because mapred.temp.dir is not set.
How should I correct this problem? Should I set the value of mapred.temp.dir in core-site.xml or is there a problem in the way I configured Eclipse?
Make sure that you are able to start the namenode. Run start-all and check the log. most probably it is not running.
Related
So the problem is that my project do not debug correctly, it is pretty big so i can not figure out when it started throw this error:
error image
java.nio.file.NoSuchFileException: /Users/similization/Library/Java/JavaVirtualMachines/openjdk-18.0.1.1/Contents/Home/conf/jndi.properties
P.S. I tried to use another versions of tomcat and tried to reinstall everything, but nothing changed and also none of my JVM version have such file (jndi.properties). When i just run my project - everything works fine but i'd like to have debug ability. After i stopped debugging my project i got this message from IntelliJ Idea:
Application Server was not connected before run configuration stop, reason:
javax.management.InstanceNotFoundException: Catalina:type=Server
UPDATE 1
Here is a full
stack trace
"java.base/sun.nio.fs.UnixException.translateToIOException(UnixException.java:92)"
"java.base/sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:106)"
"java.base/sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:111)"
"java.base/sun.nio.fs.UnixFileSystemProvider.newByteChannel(UnixFileSystemProvider.java:218)"
"java.base/java.nio.file.Files.newByteChannel(Files.java:380)"
"java.base/java.nio.file.Files.newByteChannel(Files.java:432)"
"java.base/java.nio.file.spi.FileSystemProvider.newInputStream(FileSystemProvider.java:422)"
"java.base/java.nio.file.Files.newInputStream(Files.java:160)"
"java.naming/com.sun.naming.internal.VersionHelper.lambda$getJavaHomeConfStream$4(VersionHelper.java:228)"
"java.base/java.security.AccessController.doPrivileged(AccessController.java:318)" "java.naming/com.sun.naming.internal.VersionHelper.getJavaHomeConfStream(VersionHelper.java:233)"
"java.naming/com.sun.naming.internal.ResourceManager.getApplicationResources(ResourceManager.java:530)"
"java.naming/com.sun.naming.internal.ResourceManager.getInitialEnvironment(ResourceManager.java:188)"
"java.naming/javax.naming.InitialContext.init(InitialContext.java:232)"
"java.naming/javax.naming.InitialContext.<init>(InitialContext.java:184)"
"org.apache.catalina.mbeans.GlobalResourcesLifecycleListener.createMBeans(GlobalResourcesLifecycleListener.java:99)"
"org.apache.catalina.mbeans.GlobalResourcesLifecycleListener.lifecycleEvent(GlobalResourcesLifecycleListener.java:82)"
"org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:123)"
"org.apache.catalina.util.LifecycleBase.setStateInternal(LifecycleBase.java:423)"
"org.apache.catalina.util.LifecycleBase.setState(LifecycleBase.java:366)"
"org.apache.catalina.core.StandardServer.startInternal(StandardServer.java:923)"
"org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)"
"org.apache.catalina.startup.Catalina.start(Catalina.java:772)"
"java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:104)"
"java.base/java.lang.reflect.Method.invoke(Method.java:577)"
"org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:345)"
"org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:476)"
there maybe 2 diffrent posssblity
1.there should be run time error
2.your file name has mis matched javac MyFirstJavaProgram. java'
or can you just share image of your code
To run my application from the command line, I run:
java -Dconfig.file=./config/devApp.config -jar ./build/libs/myJar.jar
and inside my code, I have:
String configPath = System.getProperty("config.file");
Which gets the property just fine. However, when I try to debug using the built in debug Netbeans task, the property is null. The output of my run is:
Executing: gradle debug
Arguments: [-Dconfig.file=./config/devApp.config, -PmainClass=com.comp.entrypoints.Runner, -c, /home/me/Documents/projects/proj/settings.gradle]
JVM Arguments: [-Dconfig.file=./config/devApp.config]
Which is coming from:
I set it in both the arguments and JVM arguemtns to see if either would set it. Regardless of what I do, it is null. Can someone help me figure out how to set the system property so my app can get it?
You are setting the property on the Gradle JVM which has almost nothing to do with the JVM your application runs in. If you want to use Gradle to start your app for debugging, you have to tweak your Gradle build file to set or forward the system property to the debug task.
Assuming the debug task is of type JavaExec this would be something like
systemProperty 'config.file', System.properties.'config.file'
in the configuration of your debug task to forward what you set up in the "JVM Arguments" field in Netbeans.
It seems that the "Arguments (each line is an argument):" and "JVM Arguments (each line is an argument):" fields provide values to the Gradle task itself. How I managed to pass properties over to the application was to append them to the jvmLineArgs argument (see image).
My application is now receiving the profiles property.
Thanks to #Vampire for the "guess work", lol!
I have one Linux VPS dedicated just for running a jmeter. The tests run fine, but failed requests are not written to error.jtl with SimpleDataWriter. Java error is written to jmeter.log instead.
I run the tests in non-gui mode:
jmeter -n -t om5.jmx -j results-tmp1/t3-l1-jmeter.log
The error
2016/07/08 16:59:35 ERROR - jmeter.reporters.ResultCollector:
Error trying to record a sample java.lang.IllegalArgumentException: Failed marshalling:class:class
org.apache.jmeter.samplers.SampleResult,content:org.apache.jmeter.samplers.SampleResult#1f605bfa[saveConfig=org.apache.jmeter.samplers.SampleSaveConfiguration#b4a9237e,parent=<null>,
responseData={},responseCode=500,label=03 add to cart,resultFileName=,samplerData=<null>,threadName=Thread Group 1-149,responseMessage=Number of samples in transaction : 2, number of failing samples : 1,
responseHeaders=,contentType=,requestHeaders=,timeStamp=1467989884109,startTime=1467989884109,endTime=1467989975286,idleTime=1001,pauseTime=0,assertionResults=<null>,subResults=[reset basketItems, /some-page],
dataType=,success=false,files=[res-tmp/t400-l5-errors.jtl],dataEncoding=<null>,elapsedTime=90176,latency=0,connectTime=0,startNextThreadLoop=false,stopThread=false,stopTest=false,
stopTestNow=false,isMonitor=false,sampleCount=1,bytes=806,headersSize=192,bodySize=614,groupThreads=400,allThreads=400,nanoTimeOffset=1467988012523,useNanoTime=true,nanoThreadSleep=5000,location=<null>]
at org.apache.jmeter.save.SaveService.saveSampleResult(SaveService.java:345)
at org.apache.jmeter.reporters.ResultCollector.sampleOccurred(ResultCollector.java:557)
at org.apache.jmeter.threads.ListenerNotifier.notifyListeners(ListenerNotifier.java:67)
at org.apache.jmeter.threads.JMeterThread.notifyListeners(JMeterThread.java:819)
at org.apache.jmeter.threads.JMeterThread.doEndTransactionSampler(JMeterThread.java:534)
at org.apache.jmeter.threads.JMeterThread.triggerEndOfLoopOnParentControllers(JMeterThread.java:342)
at org.apache.jmeter.threads.JMeterThread.run(JMeterThread.java:258)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.NullPointerException
I cannot find what is wrong. It is only that one machine, that gives me this error. Everywhere else I try it, it works correctly.
The OS is Debian Jessie (8.5) - minimal from official repositories. I tried many different versions of java (1.7, 1.8) - currently running on the latest 1.8 (1.8.0_92-b14) and I have the latest apache-jmeter 3.0 r1743807, but previously I used 2.13 r1665067. I don't use any third-party plugins.
I didn't notice exactly when it stopped working, what change was done (some os update, maybe some change in jmx), but I have my tests in git, so I checked out older version from the date of my last full error.jtl and it is not writing the errors to jtl as well.
I reinstalled the Debian to Ubuntu 16.04 and nothing changed.
I don't know how to debug that problem, what should I do, because on any other machine I have an access to, it works fine.
I don't know if you've fixed this problem until now?
I had the same issue, and I fixed it just now.
I guess in your jmeter script, you checked the hostname to record sample result, in jmeter.log, you could find such message: jmeter couldn't get the linux Local IP, so hostname is Null, exception threw out.
So what you need to do is remove 'Save Hostname' from 'Sample Result Save Configuration' tab.
So, finally trying to come up from the stone age, upgraded 1.514 to 1.644 without realizing all slaves need to be running Java 1.7 as well. So I install Java 7 on my master, swap .war files to run 1.644 and start it up. Slaves don't come up due to the aforementioned Java req. After stopping Jenkins and removing Java 1.7, I swap back to the 1.514 .war and start Jenkins back up. Now my build history is gone from all jobs with this error in the log:
WARNING: could not load /var/lib/jenkins/jobs/[job name removed]/builds/312 hudson.util.IOException2: Invalid directory name /var/lib/jenkins/jobs/YYMM Check and Build/builds/312 at hudson.model.Run.parseTimestampFromBuildDir(Run.java:354)
...
Caused by: java.text.ParseException: Unparseable date: "312" at java.text.DateFormat.parse(DateFormat.java:354) at hudson.model.Run.parseTimestampFromBuildDir(Run.java:352) ... 155 more
The only things I can find online relate to issues that were fixed pre-1.514. Anyone have any ideas? Thanks for helping.
Installed the latest version that works with Java 1.6: 1.607, and that fixed the issue as soon as it started up.
Your issues are likely related the change to the build directory naming, see JENKINS-24380+Migration.
In case you want to downgrade, there is an “unmigrate” script provided to reverse the migration of $JENKINS_HOME. To do this:
Start Jenkins ≥1.597.
Visit http://server/jenkins/JENKINS-24380/ and copy the unmigration instruction.
Shut down Jenkins completely.
Run the command as instructed by the step above.
Start Jenkins <1.597 with the same $JENKINS_HOME.
I am trying to debug my simple program in Eclipse. When I run it, the program runs as expected. But when I try to debug it, the program output is as expected but there is an error
ERROR: JDWP Unable to get JNI 1.2 environment, jvm->GetEnv() return code = -2
JDWP exit error AGENT_ERROR_NO_JNI_ENV(183): [util.c:838]
I would like to use the advantage of debugging mode. I want to know how to tweak this error.
Use
System.exit(0);
at the end of main() method
That is a bug when you have some breakpoints marked. Simply the easiest way is to clear all breakpoints in your code. That worked for me.
To find all breakpoints switch to DEBUG mode.