Unable to run the FIT test using fit runner in java - java

As per the example stated in the following link I tried on running the program.
But my eclipse is throwing an error stated as
An error has occurred. See error log for more details.
org/eclipse/jdt/internal/debug/ui/launcher/JavaLaunchConfigurationTab
Also the Two minitue example montioned at the Fitnesse.org also not functioning.
It says as 0 test run.
Thanks in advance

Related

When i try to debug my project it throws no such file error

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

Unrecognized VM option 'ShowCodeDetailsInExceptionMessages'

I'm new to java and I met this problem when I learnt about running junits testing in intelliJ. I changed run/debuug configurations templates for new projects->Junit->VM options to "-XX:+ShowCodeDetailsInExceptionMessages". Then when I ran the test file, it showed error message like :
Unrecognized VM option 'ShowCodeDetailsInExceptionMessages'
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.
Could anyone help me figure out this problem? Thanks
The option -XX:+ShowCodeDetailsInExceptionMessages was introduced in Java 14 (https://openjdk.java.net/jeps/358), I suppose that you are trying to use this option in a previous version of Java.

Debugging Java in eclipse error

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.

Calling Java from Python: "Can't find or load class" Error

I'm trying to call a java program from python using command line. The code is as follows:
subprocess.check_output(["java", "pitt.search.semanticvectors.CompareTerms", "-queryvectorfile","termvectors.bin","term1","term2"])
I get the following error:
Error: Could not find or load main class pitt.search.semanticvectors.CompareTerms
This happens when I run the program from PyDev (version 2.5 in Eclipse 3.7.2). However, if I run the same code from the terminal, it works and I get the result I want.
I'm almost sure that the problem is related with some configuration of PyDev and how it handles the java CLASSPATH, which is:
/Users/feralvam/Programas/semanticvectors-3.4/semanticvectors-3.4.jar:/Users/feralvam/Programas/lucene-3.5.0/lucene-core-3.5.0.jar:/Users/feralvam/Programas/lucene-3.5.0/contrib/demo/lucene-demo-3.5.0.jar:
The class "pitt.search.semanticvectors.CompareTerms" is in "semanticvectors-3.4.jar".
Any help you could give me would be really appreciated.
Thanks!
The solution proposed by #eis worked. Now, the command is:
subprocess.check_output(["java", "-classpath", "/Users/feralvam/Programas/semanticvectors-3.4/semanticvectors-3.4.jar:/Users/feralvam/Programas/lucene-3.5.0/lucene-core-3.5.0.jar:/Users/feralvam/Programas/lucene-3.5.0/contrib/demo/lucene-demo-3.5.0.jar:", "pitt.search.semanticvectors.CompareTerms", "-queryvectorfile","/Users/feralvam/termvectors.bin","term1","term2"])

Selenium running as junit in ant prematurely closes browser but not in IDE

I've got a bunch of selenium test cases set up in a JUnit class as four methods. The first runs fine - but the remaining three close the Firefox browser before the final step of the method is complete - giving a
ERROR: Command execution failure. Please search the forum at http://clearspace.openqa.org for error details from the log window. The error message is: this.page().currentDocument is undefined
com.thoughtworks.selenium.SeleniumException: ERROR: Command execution failure. Please search the forum at http://clearspace.openqa.org for error details from the log window. The error message is: this.page().currentDocument is undefined
Setup is following:
Ant based execution
Java 1.5
Eclipse 3.5
Selenium Server 1.0.1
Selenium Client Driver 1.0.1
IDE
Java 1.5
Eclipse 3.5
Selenium Server 1.0.1
Selenium Client Driver 1.0.1
I'm hoping to track down the root cause
It is crashing on the following line:
This is the modification to the user-extensions.js file:
Selenium.prototype.getElementBody = function(elementId) {
return this.outerHTML(this.page().currentDocument.getElementById(elementId));
};
This is what is being called:
commandProcessor.getString("getElementBody", "idOfElement");
I have never seen a command called getString part of the Selenium API so think that is why your tests are failing.
The other thing is have you told Selenium RC to use the user-extensions.js file that you have modified with the following -userExtensions user-extensions.js argument? I have never found it beneficial to use user-extensions in Se:RC and instead use .getEval() commands.
what you want would be selenium.getEval("this.browserbot.getUserWindow().getElementByID(id).outerHTML");
I have cleaned up your JavaScript for you. The this.browserbot.getUserWindow() gives you access to the Selenium JavaScript object which has the page in it.
I hope that helps
Can you show us your JUnit test class ?
I know from personnal experience that once in a while Selenium tests can crash for no apparent reason, but your problem seems to be happening each time so it might have something to do with your code/script.
Afraid I can't help you without some more details.

Categories

Resources