[root#null folder]# java -classpath bin:deps/poi.jar:deps/mysql.jar:deps/mina.jar:deps/slf4j.jar:deps/slf4j-nop.jar:deps/jython.jar:log4j-1.2.15.jar: server.Server
Exception in thread "main" java.lang.InternalError: Can't connect to X11 window server using ':0.0' as the value of the DISPLAY variable.
*at sun.awt.X11GraphicsEnvironment.initDisplay(Native Method)
*at sun.awt.X11GraphicsEnvironment.access$200(X11GraphicsEnvironment.java:65)
*at sun.awt.X11GraphicsEnvironment$1.run(X11GraphicsEnvironment.java:110)
*at java.security.AccessController.doPrivileged(Native Method)
at sun.awt.X11GraphicsEnvironment.(X11GraphicsEnvironment.java:74)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:188)
at java.awt.GraphicsEnvironment.createGE(GraphicsEnvironment.java:102)
at java.awt.GraphicsEnvironment.getLocalGraphicsEnvironment(GraphicsEnvironment.java:81)
* at java.awt.Window.initGC(Window.java:467)
* at java.awt.Window.init(Window.java:487)
at java.awt.Window.(Window.java:536)
at java.awt.Frame.(Frame.java:420)
at java.awt.Frame.(Frame.java:385)
* at javax.swing.JFrame.(JFrame.java:180)
at server.util.ControlPanel.(ControlPanel.java:20)
at server.Server.(Server.java:83)
I'm using a Terminal for this and not a GUI.
Unfortunately, it appears you don't have a valid instance of X server running. Some libraries for Java require that one be running. From my research installing Xvfb (X Virtual Frame Buffer) is the solution to your problem. Once it is installed you will need to go to etc/profile
Then add, inside profile, these lines.
if [ -f /usr/X11R6/bin/Xvfb ]; then
/usr/X11R6/bin/Xvfb :1 -screen 0 1024x768x16
fi
export DISPLAY=localhost:1.0
Hope this helps.
you might need to install Xext devel: http://rpmfind.net/linux/rpm2html/search.php?query=libXext.so.6 I can't remember exactly what is the library name for centos ... but it is something like:
yum install libXext-dev
or a variation of it (devel, xext-dev, xext-devel, libxext ... or something similar). I don't have CentOS here :(
Related
Linux Ubuntu
Firefox 43
Selenium 2.53.1
I installed Xvfb then I did something like this
Xvfb :77 -ac
and
export DISPLAY=:77
then I checked if firefox works on linux ($firefox) -> launched without error, and stay running until I kill it with Control-C
Now I try to start my selenium tests using Jenkins. I indicated my DISPLAY but when I run tests I get:
org.openqa.selenium.firefox.NotConnectedException: Unable to connect to host 127.0.0.1 on port 7055 after 45000 ms. Firefox console output:
at org.openqa.selenium.firefox.internal.NewProfileExtensionConnection.start(NewProfileExtensionConnection.java:113)
at org.openqa.selenium.firefox.FirefoxDriver.startClient(FirefoxDriver.java:271)
at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:119)
at org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:216)
at org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:211)
at org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:207)
at org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:120)
at com.rulefinancial.testing.webdriver.LocalFirefoxDriverProvider.getNewWebDriver(LocalFirefoxDriverProvider.java:16)
at com.rulefinancial.testing.MainTest.beforeClass(MainTest.java:54)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:86)
at org.testng.internal.Invoker.invokeConfigurationMethod(Invoker.java:514)
at org.testng.internal.Invoker.invokeConfigurations(Invoker.java:215)
at org.testng.internal.Invoker.invokeConfigurations(Invoker.java:142)
at org.testng.internal.TestMethodWorker.invokeBeforeClassMethods(TestMethodWorker.java:178)
at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:108)
at org.testng.TestRunner.privateRun(TestRunner.java:782)
at org.testng.TestRunner.run(TestRunner.java:632)
at org.testng.SuiteRunner.runTest(SuiteRunner.java:366)
at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:361)
at org.testng.SuiteRunner.privateRun(SuiteRunner.java:319)
at org.testng.SuiteRunner.run(SuiteRunner.java:268)
at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52)
at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:86)
at org.testng.TestNG.runSuitesSequentially(TestNG.java:1244)
at org.testng.TestNG.runSuitesLocally(TestNG.java:1169)
at org.testng.TestNG.run(TestNG.java:1064)
at org.apache.maven.surefire.testng.TestNGExecutor.run(TestNGExecutor.java:281)
at org.apache.maven.surefire.testng.TestNGXmlTestSuite.execute(TestNGXmlTestSuite.java:75)
at org.apache.maven.surefire.testng.TestNGProvider.invoke(TestNGProvider.java:121)
at org.apache.maven.surefire.booter.ForkedBooter.invokeProviderInSameClassLoader(ForkedBooter.java:290)
at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:242)
at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:121)
Can anyone tell me what happens here? How to solve this problem?
It works fine on windows - I mean ff 43 and selenium 2.53.1
Check the parameters of the X virtual frame buffer, when you start it. I think the issue is here. For me it worked, I did it step by step following headless execution of selenium tests in Jenkins blog post.
I have installed gerrit server setup in localhost. And after making the successful connection the Web UI has been launched. There i have registered with my gmail id in "Sign in with a Launchpad ID" option.
Its worked earlier, but now it shows the error "Provider is not supported, or was incorrectly entered." when i try to login. I had searched a lot and found some solution regarding the security issues in the installed java in the system. I have Oracle Jdk8 not OpenJdk in my system. so should i have to switch to Open Jdk. Here is my error log messages from log file.
Caused by: java.lang.RuntimeException: Unexpected error: java.security.InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty
at sun.security.validator.PKIXValidator.<init>(PKIXValidator.java:90)
at sun.security.validator.Validator.getInstance(Validator.java:179)
at sun.security.ssl.X509TrustManagerImpl.getValidator(X509TrustManagerImpl.java:312)
at sun.security.ssl.X509TrustManagerImpl.checkTrustedInit(X509TrustManagerImpl.java:171)
at sun.security.ssl.X509TrustManagerImpl.checkTrusted(X509TrustManagerImpl.java:184)
at sun.security.ssl.X509TrustManagerImpl.checkServerTrusted(X509TrustManagerImpl.java:124)
at sun.security.ssl.ClientHandshaker.serverCertificate(ClientHandshaker.java:1491)
at sun.security.ssl.ClientHandshaker.processMessage(ClientHandshaker.java:216)
at sun.security.ssl.Handshaker.processLoop(Handshaker.java:979)
at sun.security.ssl.Handshaker.process_record(Handshaker.java:914)
at sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:1062)
at sun.security.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1375)
at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1403)
... 66 more
Caused by: java.security.InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty
at java.security.cert.PKIXParameters.setTrustAnchors(PKIXParameters.java:200)
at java.security.cert.PKIXParameters.<init>(PKIXParameters.java:120)
at java.security.cert.PKIXBuilderParameters.<init>(PKIXBuilderParameters.java:104)
at sun.security.validator.PKIXValidator.<init>(PKIXValidator.java:88)
... 78 more
Issue Fixed !
As i have been using Oracle Java 8, i have installed Open Jdk 7 with the following commnad.
sudo apt-get install ca-certificates-java
But issue resolved only when i have changed java home variable in gerrit.config file.
javaHome = /usr/lib/jvm/java-7-openjdk-amd64/jre
Now the issues fixed for me..
In my Java code, when i change the SATSolver from SAT4J to MiniSatJNI or MiniSatProverJNI in:
A4Options options = new A4Options();
options.solver = A4Options.SatSolver.SAT4J;
For instance, to:
A4Options options = new A4Options();
options.solver = A4Options.SatSolver.MiniSatProverJNI;
And then call:
A4Solution currentAns = TranslateAlloyToKodkod.execute_command(null,
javaMetamodel.getAllReachableSigs(), command, options);
I receive the following execution error:
Fatal error:
The required JNI library cannot be found: java.lang.UnsatisfiedLinkError: no minisatproverx5 in java.library.path
at edu.mit.csail.sdg.alloy4compiler.translator.TranslateAlloyToKodkod.execute_command(TranslateAlloyToKodkod.java:390)
at ejdolly.JDollyImp.initializeAlloyAnalyzer(JDollyImp.java:128)
at ejdolly.JDolly.hasNext(JDolly.java:181)
at org.testorrery.ForLoopIterator.hasNext(ForLoopIterator.java:40)
at refactoringTest.RefactoringTest.runTests(RefactoringTest.java:145)
at refactoringTest.MainRunner.main(MainRunner.java:83)
Caused by: java.lang.UnsatisfiedLinkError: no minisatproverx5 in java.library.path
at java.lang.ClassLoader.loadLibrary(Unknown Source)
at java.lang.Runtime.loadLibrary0(Unknown Source)
at java.lang.System.loadLibrary(Unknown Source)
at kodkod.engine.satlab.NativeSolver.loadLibrary(NativeSolver.java:73)
at kodkod.engine.satlab.MiniSatProver.<clinit>(MiniSatProver.java:148)
at kodkod.engine.satlab.SATFactory$5.instance(SATFactory.java:106)
at kodkod.engine.fol2sat.Bool2CNFTranslator.translate(Bool2CNFTranslator.java:55)
at kodkod.engine.fol2sat.Translator.toCNF(Translator.java:426)
at kodkod.engine.fol2sat.Translator.generateSBP(Translator.java:365)
at kodkod.engine.fol2sat.Translator.toBoolean(Translator.java:343)
at kodkod.engine.fol2sat.Translator.translate(Translator.java:189)
at kodkod.engine.fol2sat.Translator.translate(Translator.java:143)
at kodkod.engine.Solver$SolutionIterator.next(Solver.java:495)
at kodkod.engine.Solver$SolutionIterator.next(Solver.java:1)
at edu.mit.csail.sdg.alloy4compiler.translator.A4Solution$Peeker.<init>(A4Solution.java:719)
at edu.mit.csail.sdg.alloy4compiler.translator.A4Solution$Peeker.<init>(A4Solution.java:709)
at edu.mit.csail.sdg.alloy4compiler.translator.A4Solution.solve(A4Solution.java:941)
at edu.mit.csail.sdg.alloy4compiler.translator.TranslateAlloyToKodkod.execute_command(TranslateAlloyToKodkod.java:388)
... 5 more
java.lang.NullPointerException
at ejdolly.JDolly.hasNext(JDolly.java:182)
at org.testorrery.ForLoopIterator.hasNext(ForLoopIterator.java:40)
at refactoringTest.RefactoringTest.runTests(RefactoringTest.java:145)
at refactoringTest.MainRunner.main(MainRunner.java:83)
Any help?
The solution pointed by #Aleksandar in:
Alloy API resulting in java.lang.UnsatisfiedLinkError
worked for me on linux!!! But it does not work on windows.
Thank you for all the help !
Alloy invokes native solvers (such as MiniSAT) by using JNDI/JNI. That means that the native libraries must be correctly configured before. If you do not have the library correclty configured, Java will produce a "java.lang.UnsatisfiedLinkError" exception.
The Alloy distributable jar includes correctly configured libraries for Windows "x86" and for Linux and Mac in "x86" and "x64". That means that the jar will work in Windows, without any additional configuration, if you are using the Java 32 bits, but not with Java 64 bits. In the other operating systems you can use both Java versions (32 and 64 bits).
You may check other questions in StackOverflow for the same explanation.
I have installed chef-plugin in jenkins and did the following configurations:
Run chef client on remote host:
enabled: checked
ssh host: "remote host"
ssh login: root
chef_json template: "{
"run-list" :[
"recipe[test]"
]
}"
color output: checked
and got the following error:
Started by user swetha sreeramoju
Building in workspace C:\.jenkins\workspace\chef-sample
[2015-05-27 19:06:44 +0530] INFO: [34m[47mrendering ERB template[0m[0m
[2015-05-27 19:06:44 +0530] INFO: [34m[47mparsing JSON string[0m[0m
[2015-05-27 19:06:44 +0530] INFO: [34m[47msaving JSON to file[0m[0m
[2015-05-27 19:06:44 +0530] INFO: [2m[1m[34m[47m[4mchef json url[0m[0m[0m[0m[0m[34m[47m : http://localhost:8080/jenkins//job/chef-sample/ws/chef.json[0m[0m
[2015-05-27 19:06:44 +0530] INFO: [2m[1m[34m[47m[4mhost[0m[0m[0m[0m[0m[34m[47m : 10.0.12.209[0m[0m
$ bash -c "ssh root#10.0.12.209 sudo chef-client -l info -j http://localhost:8080/jenkins//job/chef-sample/ws/chef.json "
ERROR: Cannot run program "bash": CreateProcess error=2, The system cannot find the file specified (Java::JavaIo::IOException)
java.lang.ProcessBuilder.start(Unknown Source)
hudson.Proc$LocalProc.<init>(Proc.java:244)
hudson.Proc$LocalProc.<init>(Proc.java:216)
hudson.Launcher$LocalLauncher.launch(Launcher.java:816)
hudson.Launcher$ProcStarter.start(Launcher.java:382)
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
java.lang.reflect.Method.invoke(Unknown Source)
org.jruby.javasupport.JavaMethod.invokeDirectWithExceptionHandling(JavaMethod.java:440)
org.jruby.javasupport.JavaMethod.invokeDirect(JavaMethod.java:304)
org.jruby.java.invokers.InstanceMethodInvoker.call(InstanceMethodInvoker.java:52)
org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:134)
org.jruby.ast.CallNoArgNode.interpret(CallNoArgNode.java:64)
org.jruby.ast.CallOneArgNode.interpret(CallOneArgNode.java:57)
org.jruby.ast.NewlineNode.interpret(NewlineNode.java:105)
org.jruby.ast.BlockNode.interpret(BlockNode.java:71)
org.jruby.evaluator.ASTInterpreter.INTERPRET_METHOD(ASTInterpreter.java:75)
org.jruby.internal.runtime.methods.InterpretedMethod.call(InterpretedMethod.java:112)
org.jruby.internal.runtime.methods.InterpretedMethod.call(InterpretedMethod.java:126)
org.jruby.internal.runtime.methods.DefaultMethod.call(DefaultMethod.java:163)
org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:70)
org.jruby.ast.FCallSpecialArgNode.interpret(FCallSpecialArgNode.java:45)
org.jruby.ast.CallNoArgNode.interpret(CallNoArgNode.java:64)
org.jruby.ast.NewlineNode.interpret(NewlineNode.java:105)
org.jruby.evaluator.ASTInterpreter.INTERPRET_METHOD(ASTInterpreter.java:75)
org.jruby.internal.runtime.methods.InterpretedMethod.call(InterpretedMethod.java:112)
org.jruby.internal.runtime.methods.InterpretedMethod.call(InterpretedMethod.java:126)
org.jruby.internal.runtime.methods.DefaultMethod.call(DefaultMethod.java:163)
org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:70)
org.jruby.ast.CallManyArgsNode.interpret(CallManyArgsNode.java:59)
org.jruby.ast.CallOneArgFixnumNode.interpret(CallOneArgFixnumNode.java:59)
org.jruby.ast.IfNode.interpret(IfNode.java:110)
org.jruby.ast.NewlineNode.interpret(NewlineNode.java:105)
org.jruby.ast.BlockNode.interpret(BlockNode.java:71)
org.jruby.ast.IfNode.interpret(IfNode.java:116)
org.jruby.ast.NewlineNode.interpret(NewlineNode.java:105)
org.jruby.evaluator.ASTInterpreter.INTERPRET_METHOD(ASTInterpreter.java:75)
org.jruby.internal.runtime.methods.InterpretedMethod.call(InterpretedMethod.java:268)
org.jruby.internal.runtime.methods.DefaultMethod.call(DefaultMethod.java:220)
org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:236)
org.jruby.ast.CallThreeArgNode.interpret(CallThreeArgNode.java:61)
org.jruby.ast.NewlineNode.interpret(NewlineNode.java:105)
org.jruby.evaluator.ASTInterpreter.INTERPRET_BLOCK(ASTInterpreter.java:112)
org.jruby.runtime.Interpreted19Block.evalBlockBody(Interpreted19Block.java:209)
org.jruby.runtime.Interpreted19Block.yield(Interpreted19Block.java:160)
org.jruby.runtime.Interpreted19Block.yieldSpecific(Interpreted19Block.java:133)
org.jruby.runtime.Block.yieldSpecific(Block.java:99)
org.jruby.ast.ZYieldNode.interpret(ZYieldNode.java:25)
org.jruby.ast.NewlineNode.interpret(NewlineNode.java:105)
org.jruby.ast.BlockNode.interpret(BlockNode.java:71)
org.jruby.ast.RescueNode.executeBody(RescueNode.java:224)
org.jruby.ast.RescueNode.interpret(RescueNode.java:119)
org.jruby.ast.BeginNode.interpret(BeginNode.java:83)
org.jruby.ast.NewlineNode.interpret(NewlineNode.java:105)
org.jruby.evaluator.ASTInterpreter.INTERPRET_METHOD(ASTInterpreter.java:75)
org.jruby.internal.runtime.methods.InterpretedMethod.call(InterpretedMethod.java:204)
org.jruby.internal.runtime.methods.DefaultMethod.call(DefaultMethod.java:196)
org.jruby.runtime.callsite.CachingCallSite.callBlock(CachingCallSite.java:177)
org.jruby.runtime.callsite.CachingCallSite.callIter(CachingCallSite.java:188)
org.jruby.ast.FCallOneArgBlockNode.interpret(FCallOneArgBlockNode.java:34)
org.jruby.ast.NewlineNode.interpret(NewlineNode.java:105)
org.jruby.evaluator.ASTInterpreter.INTERPRET_METHOD(ASTInterpreter.java:75)
org.jruby.internal.runtime.methods.InterpretedMethod.call(InterpretedMethod.java:112)
org.jruby.internal.runtime.methods.InterpretedMethod.call(InterpretedMethod.java:126)
org.jruby.internal.runtime.methods.DefaultMethod.call(DefaultMethod.java:163)
org.jruby.javasupport.proxy.JavaProxyConstructor$2.invoke(JavaProxyConstructor.java:224)
org.jruby.proxy.hudson.tasks.Builder$Proxy2.perform(Unknown Source)
hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:764)
hudson.model.Build$BuildExecution.build(Build.java:205)
hudson.model.Build$BuildExecution.doRun(Build.java:162)
hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:537)
hudson.model.Run.execute(Run.java:1744)
hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
hudson.model.ResourceController.execute(ResourceController.java:98)
hudson.model.Executor.run(Executor.java:374)
Build step 'Run chef client on remote host' marked build as failure
Finished: FAILURE
Chef client and server is running in Linux machine, and jenkins is configured in Windows7.
The problems seems a bit wider as explained here SSH+slaves+and+Cygwin:
This is because Jenkins is trying to call Windows API and execute "/bin/bash" without going through Cygwin path translation. Windows interprets /bin/bash as c:\bin\bash.exe, and unless that path exists, it will fail.
A quick solutions is to pass from a linux node.
Another quick possibility is to make an on-demand Jenkins node out of the Chef-client linux machine (a few clicks) and run there the proper shell line (although it's probably more an hack):
chef-client -l info -j http://localhost:8080/jenkins//job/chef-sample/ws/chef.json
Jenkins client and server is running in Linux machine, and jenkins is configured in Windows7.
That makes no sense.
What's "Jenkins client"? The browser that you used to connect to Jenkins? You can connect through any browser on any OS. It has no affect whatsoever on the execution. The execution happens on master/slave nodes.
"Jenkins [...] server is running in Linux". OK. But then why does your log say Building in workspace C:\.jenkins\workspace\chef-sample. Clearly it is running on Windows node. So either there is a Windows slave node that you are not mentioning, or the Jenkins server is not on Linux but on Windows.
"Jenkins is configured in Windows7". Well, that just continues to add to the confusion. Is Jenkins server running on Windows or Linux, you just said "Linux" in the previous sentence.
Your issue is that you cannot run bash in Jenkins on Windows (and everything points to that being the case here), unless you have a bash equivalent (Cygwin) installed on Windows
I wanted to run groovy on jamvm in an embedded hardware. The following is what I have tried, but nothing works.
1)
$GROOVY_HOME/bin/groovy ...
It complains that JAVA_HOME is not set. Since JamVm is a standalone executable, how, if possible, to set JAVA_HOME in JamVM? If the problem reduces to setting that, it's easy to solve.
2)
jamvm -cp $GROOVY_HOME/embedded/embeddable/groovy-all-2.0.5.jar:. TestClass
I ran the example in http://groovy.codehaus.org/Embedding+Groovy ('full example' part) and got the following exception. I ran the same example on Mac, it was fine.
Exception in thread "main" BUG! exception in phase 'semantic analysis' in source unit '/root/test/Tester.groovy' 0
at org.codehaus.groovy.control.CompilationUnit.applyToSourceUnits(CompilationUnit.java:907)
at org.codehaus.groovy.control.CompilationUnit.doPhaseOperation(CompilationUnit.java:566)
at org.codehaus.groovy.control.CompilationUnit.compile(CompilationUnit.java:515)
at groovy.lang.GroovyClassLoader.doParseClass(GroovyClassLoader.java:279)
at groovy.lang.GroovyClassLoader.parseClass(GroovyClassLoader.java:258)
at groovy.lang.GroovyClassLoader.parseClass(GroovyClassLoader.java:244)
at groovy.lang.GroovyClassLoader.parseClass(GroovyClassLoader.java:185)
at TestClass.main(TestClass.java:8)
Caused by: java.lang.ArrayIndexOutOfBoundsException: 0
at org.codehaus.groovy.vmplugin.v5.Java5.makeParameters(Java5.java:396)
3) I tried
java -cp ../groovy-2.0.5/embeddable/groovy-all-2.0.5.jar groovy.lang.GroovyShe
ll <script.groovy>
didn't work, got the following
java.lang.ExceptionInInitializerError
at org.codehaus.groovy.reflection.ReflectionCache.getCachedClass(ReflectionCache.java:107)
Please suggest a way to run groovy on jamvm. Thanks!
JAVA_HOME is an environment variable. You can set this one by using the command "export". ExceptionInInitializerError means it could not create a class. To actually know the problem, we would need the embedded exception