Run selenium test using firefox on LInux - linux

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.

Related

Play2 IntelliJ leads to akka.stream.BindFailedException$: bind failed on Linux

When I try to run my (local) play application via the play2 plugin from intellij I get:
[ERROR] [06/03/2017 23:21:10.985] [play-dev-mode-akka.actor.default-dispatcher-2] [akka://play-dev-mode/system/IO-TCP/selectors/$a/0] Bind failed for TCP channel on endpoint [/0.0.0.0:80]
java.net.SocketException: Permission denied
at sun.nio.ch.Net.bind0(Native Method)
at sun.nio.ch.Net.bind(Net.java:433)
at sun.nio.ch.Net.bind(Net.java:425)
at sun.nio.ch.ServerSocketChannelImpl.bind(ServerSocketChannelImpl.java:223)
at sun.nio.ch.ServerSocketAdaptor.bind(ServerSocketAdaptor.java:74)
at akka.io.TcpListener.liftedTree1$1(TcpListener.scala:56)
at akka.io.TcpListener.<init>(TcpListener.scala:53)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
at akka.util.Reflect$.instantiate(Reflect.scala:65)
at akka.actor.ArgsReflectConstructor.produce(IndirectActorProducer.scala:96)
at akka.actor.Props.newActor(Props.scala:213)
at akka.actor.ActorCell.newActor(ActorCell.scala:555)
at akka.actor.ActorCell.create(ActorCell.scala:581)
at akka.actor.ActorCell.invokeAll$1(ActorCell.scala:454)
at akka.actor.ActorCell.systemInvoke(ActorCell.scala:476)
at akka.dispatch.Mailbox.processAllSystemMessages(Mailbox.scala:282)
at akka.dispatch.Mailbox.run(Mailbox.scala:223)
at akka.dispatch.Mailbox.exec(Mailbox.scala:234)
at akka.dispatch.forkjoin.ForkJoinTask.doExec(ForkJoinTask.java:260)
at akka.dispatch.forkjoin.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1339)
at akka.dispatch.forkjoin.ForkJoinPool.runWorker(ForkJoinPool.java:1979)
at akka.dispatch.forkjoin.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:107)
akka.stream.BindFailedException$: bind failed
If however, I run it via sbt run, everything works like a charm.
1) Why is that?
2) How can I fix this? (Running on Linux 4.11 here - I understand that the port is only allowed "sudoers", but then I wonder why the sbt-way works)
3) Any other way to run play in "debug mode"? I would like to set some break points and analyze the flow.
I ran into similiar issues before. Deploying to port requires permissions, if you want to strt the service on local, you can change the port to 9000, if you don'5 want this issue to occur. Then, when you deploy on production, you can change it to 80 and follow this guide :
https://www.playframework.com/documentation/2.5.x/Deploying
If you have changed build.sbt to listen on port 80, remove that line. IntelliJ still thinks app wants to run on 80
And also:
If you have changed application.conf, make sure port is not set to 80.

Getting " Cannot run program "bash"" while building chef in jenkins

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

protractor web-driver with selenium on linux

I have the following setup:
protractor running from a windows vm using a stand alone selenium server on a linux headless box.
The idea was to have chrome installed on my windows vm and to have protractor use this chrome install to run the tests via the selenium on the linux box. I start the selenium server on the linuxx box using webdriver-manager start.
When I run the tests from the VM I get the folloiwng error
Caused by: org.openqa.selenium.WebDriverException: unknown error: cannot find Chrome binary
(Driver info: chromedriver=2.14.313457 (3d645c400edf2e2c500566c9aa096063e707c9cf),platform=Linux 2.6.32-431.29.2.el6.x86_64 x86_64) (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 134 milliseconds
Build info: version: '2.45.0',java.version: '1.7.0_79'
Driver info: org.openqa.selenium.chrome.ChromeDriver
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
at org.openqa.selenium.remote.ErrorHandler.createThrowable(ErrorHandler.java:204)
at org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(ErrorHandler.java:156)
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:599)
at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:240)
at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:126)
at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:139)
at org.openqa.selenium.chrome.ChromeDriver.<init>(ChromeDriver.java:171)
at org.openqa.selenium.chrome.ChromeDriver.<init>(ChromeDriver.java:139)
... 14 more
10:39:09.119 WARN - Exception: unknown error: cannot find Chrome binary
(Driver info: chromedriver=2.14.313457 (3d645c400edf2e2c500566c9aa096063e707c9cf),platform=Linux 2.6.32-431.29.2.el6.x86_64 x86_64) (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 134 milliseconds
java.version: '1.7.0_79'
Driver info: org.openqa.selenium.chrome.ChromeDriver
In my protractor conf I it configured to use the selenium standalone server by specifying the selenium url.
Any ideas how to resolve this and get the browser to be opened on my windows vm rather than the linux box looking for the chrome binary.
Thanks

WebDriverJS with PhantomJS works on OSX, but not on Linux

I'm using a combination of:
Selenium Standalone - https://github.com/vvo/selenium-standalone
WebDriverJS - https://github.com/webdriverio/webdriverio
Medium's PhantomJS NPM wrapper - https://github.com/Medium/phantomjs
Each component works fine separately, and when I run:
var client = webdriverjs.remote({
desiredCapabilities: {
browserName: 'phantomjs',
'phantomjs.binary.path': '/path-to/node_modules/phantomjs/bin/phantomjs'
},
logLevel: 'silent'
});
client.init();
It works fine on OSX/Mac, but on our CI Linux server (Ubuntu), I get the following error message;
PhantomJS is launching GhostDriver...
Unable to open file '/path/to/phantomjsdriver.log'
Before the ineveitable Java stacktrace...
Driver info: driver.version: unknown
at java.util.concurrent.FutureTask$Sync.innerGet(FutureTask.java:222)
at java.util.concurrent.FutureTask.get(FutureTask.java:83)
at org.openqa.selenium.remote.server.DefaultSession.execute(DefaultSession.java:176)
at org.openqa.selenium.remote.server.DefaultSession.<init>(DefaultSession.java:112)
at org.openqa.selenium.remote.server.DefaultSession.createSession(DefaultSession.java:89)
at org.openqa.selenium.remote.server.DefaultDriverSessions.newSession(DefaultDriverSessions.java:110)
at org.openqa.selenium.remote.server.handler.NewSession.handle(NewSession.java:57)
at org.openqa.selenium.remote.server.handler.NewSession.handle(NewSession.java:1)
at org.openqa.selenium.remote.server.rest.ResultConfig.handle(ResultConfig.java:112)
at org.openqa.selenium.remote.server.JsonHttpCommandHandler.handleRequest(JsonHttpCommandHandler.java:173)
at org.openqa.selenium.remote.server.DriverServlet.handleRequest(DriverServlet.java:200)
at org.openqa.selenium.remote.server.DriverServlet.doPost(DriverServlet.java:162)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
at org.openqa.selenium.remote.server.DriverServlet.service(DriverServlet.java:128)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
at org.openqa.jetty.jetty.servlet.ServletHolder.handle(ServletHolder.java:428)
at org.openqa.jetty.jetty.servlet.ServletHandler.dispatch(ServletHandler.java:680)
at org.openqa.jetty.jetty.servlet.ServletHandler.handle(ServletHandler.java:571)
at org.openqa.jetty.http.HttpContext.handle(HttpContext.java:1526)
at org.openqa.jetty.http.HttpContext.handle(HttpContext.java:1479)
at org.openqa.jetty.http.HttpServer.service(HttpServer.java:920)
at org.openqa.jetty.http.HttpConnection.service(HttpConnection.java:820)
at org.openqa.jetty.http.HttpConnection.handleNext(HttpConnection.java:986)
at org.openqa.jetty.http.HttpConnection.handle(HttpConnection.java:837)
at org.openqa.jetty.http.SocketListener.handleConnection(SocketListener.java:243)
at org.openqa.jetty.util.ThreadedServer.handle(ThreadedServer.java:358)
at org.openqa.jetty.util.ThreadPool$PoolThread.run(ThreadPool.java:537)
Caused by: org.openqa.selenium.WebDriverException: java.lang.reflect.InvocationTargetException
&
Driver info: driver.version: PhantomJSDriver
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:590)
at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:241)
at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:127)
at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:140)
at org.openqa.selenium.phantomjs.PhantomJSDriver.<init>(PhantomJSDriver.java:110)
at org.openqa.selenium.phantomjs.PhantomJSDriver.<init>(PhantomJSDriver.java:99)
... 14 more
Caused by: org.openqa.selenium.WebDriverException: Timed out waiting for driver server to start.
I suspect a permissions issue, but wondered if anyone has run into this problem before.
At the very least, it would be great to work out exactly why this is working on Mac.
This file - phantomjsdriver.log - Can only be created by a user with file write permissions.
Executing the program as 'root' fixed the issue.

Having trouble launching server with Java. Display error [Cent OS 6]

[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 :(

Resources