I am running some unit tests on a headless linux machine, but with Xvfb server started.
The Browser gets created but seems that it has problems displaying it - see the exception.
03:53:39 INFO: OS name: Linux
03:53:39 INFO: JRE version: 1.8.0_31 64-bit
03:53:39 INFO: JxBrowser version: 6.4
03:53:39 INFO: JxBrowser type: HEAVYWEIGHT
My code looks similar to this
Frame frame = new JFrame("myFrame");
Browser browser = new Browser();
BrowserView view = new BrowserView(browser);
frame.add(view, BorderLayout.CENTER);
frame.setVisible(true);
On Windows environment works fine, but on Linux I get the following error
Caused by: java.lang.RuntimeException: java.lang.NoSuchMethodException: getWindow
at com.teamdev.jxbrowser.chromium.internal.ReflectionUtil.invokeMethod(Unknown Source)
at com.teamdev.jxbrowser.chromium.swing.internal.NativeLinux.getWindowHandle(Unknown Source)
at com.teamdev.jxbrowser.chromium.swing.internal.HeavyWeightWidget.a(Unknown Source)
at com.teamdev.jxbrowser.chromium.swing.internal.HeavyWeightWidget.b(Unknown Source)
at com.teamdev.jxbrowser.chromium.swing.internal.HeavyWeightWidget$d.hierarchyChanged(Unknown Source)
at java.awt.Component.processHierarchyEvent(Component.java:6692)
at java.awt.Component.processEvent(Component.java:6311)
at java.awt.Container.processEvent(Container.java:2234)
at java.awt.Component.dispatchEventImpl(Component.java:4881)
at java.awt.Container.dispatchEventImpl(Container.java:2292)
at java.awt.Component.dispatchEvent(Component.java:4703)
at java.awt.Component.createHierarchyEvents(Component.java:5541)
at java.awt.Container.createHierarchyEvents(Container.java:1443)
at java.awt.Container.createHierarchyEvents(Container.java:1439)
at java.awt.Container.createHierarchyEvents(Container.java:1439)
at java.awt.Container.createHierarchyEvents(Container.java:1439)
at java.awt.Container.createHierarchyEvents(Container.java:1439)
at java.awt.Container.createHierarchyEvents(Container.java:1439)
at java.awt.Component.show(Component.java:1622)
at java.awt.Window.show(Window.java:1042)
I have in my lib folder the following
jxbrowser-6.4.jar
jxbrowser-linux64-6.4.jar
jxbrowser-mac-6.4.jar
jxbrowser-win-6.4.jar
and in the build.xml of my tests this
<fileset dir="${myproject.dir}/lib">
<include name="**/*.jar"/>
<exclude name="**/jxbrowser-mac*.jar"/>
<exclude name="**/jxbrowser-win*.jar"/>
</fileset>
Any suggestions?
By default JxBrowser is run in the heavyweight rendering mode. In this mode we embed a native window into your Java application window and configure Chromium engine to render content into this native window using GPU. In order to embed a native window we need to get a handle of the top-level window in your Java application. The exception you see indicates that JxBrowser failed to get that handle. What Linux distribution you use?
You mentioned that you use JxBrowser in a headless Linux environment. In this case you don't need to create a BrowserView instance and embed it into a JFrame, so that should resolve the issue.
Also, you can use JxBrowser in the lightweight rendering mode that does not require a window handle:
Browser browser = new Browser(BrowserType.LIGHTWEIGHT);
Related
I am trying to use Default Azure credential to connect to a Service Bus Queue from my Spring Boot application (Kotlin) and have trouble getting the setup to work locally with the IntelliJ plugin.
I am trying to connect to a Service Bus queue to send a message, if I use a connection string it works fine but I would like to handle access with the default credentials.
val predictionRequestsClient = ServiceBusClientBuilder()
.credential(topicModelingProperties.namespace, credential)
.sender()
.queueName(topicModelingProperties.predictionQueue.requests)
.buildClient()
I've tried using the IntellijCredentials directly:
val credential = IntelliJCredentialBuilder()
.keePassDatabasePath("<MY PATH TO PWD STORAGE>")
.build()
or the default credentials (long term goal):
val credential = DefaultAzureCredentialBuilder()
.intelliJKeePassDatabasePath("<MY PATH TO PWD STORAGE>")
.build()
I did install the Azure Toolkit plugin in IntelliJ, logged in in my IDE, the plugin tells me even so in this screenshot:
Nevertheless when I try to send something to the queue I get the following error using the IntelliJCredentials:
[2022-06-28 08:47:13.285] ERROR [task-4] --- o.s.a.i.SimpleAsyncUncaughtExceptionHandler: Unexpected exception occurred invoking async method: public void at.teamecho.topic.CommentClassifier.addToClassificationQueue(at.teamecho.comment.CommentSubmissionEvent)
com.azure.messaging.servicebus.ServiceBusException: IntelliJ Authentication not available. Please log in with Azure Tools for IntelliJ plugin in the IDE.
at com.azure.messaging.servicebus.ServiceBusSenderAsyncClient.mapError(ServiceBusSenderAsyncClient.java:820)
at reactor.core.publisher.Mono.lambda$onErrorMap$31(Mono.java:3733)
at reactor.core.publisher.FluxOnErrorResume$ResumeSubscriber.onError(FluxOnErrorResume.java:94)
at reactor.core.publisher.MonoFlatMap$FlatMapMain.onError(MonoFlatMap.java:172)
at reactor.core.publisher.MonoPeekTerminal$MonoTerminalPeekSubscriber.onError(MonoPeekTerminal.java:258)
at reactor.core.publisher.SerializedSubscriber.onError(SerializedSubscriber.java:124)
at reactor.core.publisher.FluxRetryWhen$RetryWhenMainSubscriber.whenError(FluxRetryWhen.java:225)
at reactor.core.publisher.FluxRetryWhen$RetryWhenOtherSubscriber.onError(FluxRetryWhen.java:274)
at reactor.core.publisher.FluxConcatMap$ConcatMapImmediate.drain(FluxConcatMap.java:415)
at reactor.core.publisher.FluxConcatMap$ConcatMapImmediate.onNext(FluxConcatMap.java:251)
at reactor.core.publisher.EmitterProcessor.drain(EmitterProcessor.java:491)
at reactor.core.publisher.EmitterProcessor.tryEmitNext(EmitterProcessor.java:299)
at reactor.core.publisher.SinkManySerialized.tryEmitNext(SinkManySerialized.java:100)
at reactor.core.publisher.InternalManySink.emitNext(InternalManySink.java:27)
at reactor.core.publisher.FluxRetryWhen$RetryWhenMainSubscriber.onError(FluxRetryWhen.java:190)
at reactor.core.publisher.SerializedSubscriber.onError(SerializedSubscriber.java:124)
at reactor.core.publisher.SerializedSubscriber.onError(SerializedSubscriber.java:124)
at reactor.core.publisher.FluxTimeout$TimeoutMainSubscriber.onError(FluxTimeout.java:219)
at reactor.core.publisher.FluxPeekFuseable$PeekFuseableSubscriber.onError(FluxPeekFuseable.java:234)
at reactor.core.publisher.MonoFlatMap$FlatMapMain.secondError(MonoFlatMap.java:192)
at reactor.core.publisher.MonoFlatMap$FlatMapInner.onError(MonoFlatMap.java:259)
at reactor.core.publisher.MonoFlatMap$FlatMapMain.secondError(MonoFlatMap.java:192)
at reactor.core.publisher.MonoFlatMap$FlatMapInner.onError(MonoFlatMap.java:259)
at reactor.core.publisher.FluxMap$MapSubscriber.onError(FluxMap.java:132)
at reactor.core.publisher.FluxMap$MapSubscriber.onError(FluxMap.java:132)
at reactor.core.publisher.MonoIgnoreThen$ThenIgnoreMain.onError(MonoIgnoreThen.java:278)
at reactor.core.publisher.MonoWhen$WhenCoordinator.signalError(MonoWhen.java:172)
at reactor.core.publisher.MonoWhen$WhenInner.onError(MonoWhen.java:288)
at reactor.core.publisher.FluxMapFuseable$MapFuseableSubscriber.onError(FluxMapFuseable.java:140)
at reactor.core.publisher.MonoFlatMap$FlatMapMain.secondError(MonoFlatMap.java:192)
at reactor.core.publisher.MonoFlatMap$FlatMapInner.onError(MonoFlatMap.java:259)
at reactor.core.publisher.MonoFlatMap$FlatMapMain.secondError(MonoFlatMap.java:192)
at reactor.core.publisher.MonoFlatMap$FlatMapInner.onError(MonoFlatMap.java:259)
at reactor.core.publisher.MonoFlatMap$FlatMapMain.onError(MonoFlatMap.java:172)
at reactor.core.publisher.MonoPeekTerminal$MonoTerminalPeekSubscriber.onError(MonoPeekTerminal.java:258)
at reactor.core.publisher.FluxPeekFuseable$PeekConditionalSubscriber.onError(FluxPeekFuseable.java:903)
at reactor.core.publisher.FluxMap$MapConditionalSubscriber.onError(FluxMap.java:259)
at reactor.core.publisher.Operators$MultiSubscriptionSubscriber.onError(Operators.java:2063)
at reactor.core.publisher.Operators.error(Operators.java:198)
at reactor.core.publisher.MonoError.subscribe(MonoError.java:53)
at reactor.core.publisher.MonoDefer.subscribe(MonoDefer.java:52)
at reactor.core.publisher.Mono.subscribe(Mono.java:4400)
at reactor.core.publisher.FluxSwitchIfEmpty$SwitchIfEmptySubscriber.onComplete(FluxSwitchIfEmpty.java:82)
at reactor.core.publisher.Operators.complete(Operators.java:137)
at reactor.core.publisher.MonoEmpty.subscribe(MonoEmpty.java:46)
at reactor.core.publisher.MonoDefer.subscribe(MonoDefer.java:52)
at reactor.core.publisher.InternalMonoOperator.subscribe(InternalMonoOperator.java:64)
at reactor.core.publisher.MonoFlatMap$FlatMapMain.onNext(MonoFlatMap.java:157)
at reactor.core.publisher.Operators$MonoSubscriber.complete(Operators.java:1816)
at com.azure.core.amqp.implementation.AmqpChannelProcessor$ChannelSubscriber.onNext(AmqpChannelProcessor.java:398)
at com.azure.core.amqp.implementation.AmqpChannelProcessor.lambda$onNext$0(AmqpChannelProcessor.java:112)
at java.base/java.util.concurrent.ConcurrentLinkedDeque.forEach(ConcurrentLinkedDeque.java:1650)
at com.azure.core.amqp.implementation.AmqpChannelProcessor.onNext(AmqpChannelProcessor.java:112)
at reactor.core.publisher.FluxRepeatPredicate$RepeatPredicateSubscriber.onNext(FluxRepeatPredicate.java:86)
at reactor.core.publisher.FluxPeekFuseable$PeekFuseableSubscriber.onNext(FluxPeekFuseable.java:210)
at reactor.core.publisher.FluxMapFuseable$MapFuseableSubscriber.onNext(FluxMapFuseable.java:127)
at reactor.core.publisher.FluxMapFuseable$MapFuseableSubscriber.onNext(FluxMapFuseable.java:127)
at reactor.core.publisher.Operators$MonoSubscriber.complete(Operators.java:1816)
at reactor.core.publisher.MonoFlatMap$FlatMapInner.onNext(MonoFlatMap.java:249)
at reactor.core.publisher.MonoIgnoreThen$ThenIgnoreMain.complete(MonoIgnoreThen.java:292)
at reactor.core.publisher.MonoIgnoreThen$ThenIgnoreMain.onNext(MonoIgnoreThen.java:187)
at reactor.core.publisher.MonoIgnoreThen$ThenIgnoreMain.subscribeNext(MonoIgnoreThen.java:236)
at reactor.core.publisher.MonoIgnoreThen$ThenIgnoreMain.onComplete(MonoIgnoreThen.java:203)
at reactor.core.publisher.SerializedSubscriber.onComplete(SerializedSubscriber.java:146)
at reactor.core.publisher.SerializedSubscriber.onComplete(SerializedSubscriber.java:146)
at reactor.core.publisher.FluxTimeout$TimeoutMainSubscriber.onComplete(FluxTimeout.java:234)
at reactor.core.publisher.MonoNext$NextSubscriber.onComplete(MonoNext.java:102)
at reactor.core.publisher.MonoNext$NextSubscriber.onNext(MonoNext.java:83)
at reactor.core.publisher.FluxFilterFuseable$FilterFuseableSubscriber.onNext(FluxFilterFuseable.java:118)
at reactor.core.publisher.FluxReplay$SizeBoundReplayBuffer.replayNormal(FluxReplay.java:856)
at reactor.core.publisher.FluxReplay$SizeBoundReplayBuffer.replay(FluxReplay.java:944)
at reactor.core.publisher.FluxReplay$ReplaySubscriber.onNext(FluxReplay.java:1323)
at reactor.core.publisher.FluxPeek$PeekSubscriber.onNext(FluxPeek.java:200)
at reactor.core.publisher.FluxPeek$PeekSubscriber.onNext(FluxPeek.java:200)
at reactor.core.publisher.FluxMap$MapSubscriber.onNext(FluxMap.java:120)
at reactor.core.publisher.FluxDistinctUntilChanged$DistinctUntilChangedSubscriber.tryOnNext(FluxDistinctUntilChanged.java:149)
at reactor.core.publisher.FluxDistinctUntilChanged$DistinctUntilChangedSubscriber.onNext(FluxDistinctUntilChanged.java:102)
at reactor.core.publisher.FluxReplay$SizeBoundReplayBuffer.replayNormal(FluxReplay.java:856)
at reactor.core.publisher.FluxReplay$SizeBoundReplayBuffer.replay(FluxReplay.java:944)
at reactor.core.publisher.ReplayProcessor.tryEmitNext(ReplayProcessor.java:508)
at reactor.core.publisher.SinkManySerialized.tryEmitNext(SinkManySerialized.java:100)
at reactor.core.publisher.InternalManySink.emitNext(InternalManySink.java:27)
at com.azure.core.amqp.implementation.handler.Handler.onNext(Handler.java:89)
at com.azure.core.amqp.implementation.handler.SessionHandler.onSessionRemoteOpen(SessionHandler.java:87)
at org.apache.qpid.proton.engine.BaseHandler.handle(BaseHandler.java:146)
at org.apache.qpid.proton.engine.impl.EventImpl.dispatch(EventImpl.java:108)
at org.apache.qpid.proton.reactor.impl.ReactorImpl.dispatch(ReactorImpl.java:324)
at org.apache.qpid.proton.reactor.impl.ReactorImpl.process(ReactorImpl.java:291)
at com.azure.core.amqp.implementation.ReactorExecutor.run(ReactorExecutor.java:91)
at reactor.core.scheduler.SchedulerTask.call(SchedulerTask.java:68)
at reactor.core.scheduler.SchedulerTask.call(SchedulerTask.java:28)
at java.base/java.util.concurrent.FutureTask.run$$$capture(FutureTask.java:264)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java)
at java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:304)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
at java.base/java.lang.Thread.run(Thread.java:834)
Suppressed: java.lang.Exception: #block terminated with an error
at reactor.core.publisher.BlockingSingleSubscriber.blockingGet(BlockingSingleSubscriber.java:139)
at reactor.core.publisher.Mono.block(Mono.java:1731)
at com.azure.messaging.servicebus.ServiceBusSenderClient.sendMessage(ServiceBusSenderClient.java:178)
at at.teamecho.topic.CommentClassifier.addToClassificationQueue(CommentClassificationService.kt:41)
at at.teamecho.topic.CommentClassifier$$FastClassBySpringCGLIB$$8be0e530.invoke(<generated>)
at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:218)
at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:783)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163)
at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:753)
at net.bull.javamelody.MonitoringSpringInterceptor.invoke(MonitoringSpringInterceptor.java:76)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:753)
at org.springframework.aop.interceptor.AsyncExecutionInterceptor.lambda$invoke$0(AsyncExecutionInterceptor.java:115)
at java.base/java.util.concurrent.FutureTask.run$$$capture(FutureTask.java:264)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java)
... 3 common frames omitted
Caused by: com.azure.identity.CredentialUnavailableException: IntelliJ Authentication not available. Please log in with Azure Tools for IntelliJ plugin in the IDE.
at com.azure.identity.implementation.IdentityClient.authenticateWithIntelliJ(IdentityClient.java:358)
at com.azure.identity.IntelliJCredential.lambda$getToken$2(IntelliJCredential.java:87)
at reactor.core.publisher.MonoDefer.subscribe(MonoDefer.java:44)
... 56 common frames omitted
[2022-06-28 08:47:13.328] INFO [reactor-executor-5] --- c.a.c.a.i.h.SendLinkHandler: {"az.sdk.message":"onLinkRemoteOpen","connectionId":"MF_4ff63d_1656398832884","linkName":"cbs:sender","entityPath":"$cbs","remoteTarget":"Target{address='$cbs', durable=NONE, expiryPolicy=SESSION_END, timeout=0, dynamic=false, dynamicNodeProperties=null, capabilities=null}"}
[2022-06-28 08:47:13.328] INFO [reactor-executor-5] --- c.a.c.a.i.AmqpChannelProcessor: {"az.sdk.message":"Channel is now active.","connectionId":"MF_4ff63d_1656398832884","entityPath":"$cbs"}
[2022-06-28 08:47:13.328] INFO [reactor-executor-5] --- c.a.c.a.i.h.ReceiveLinkHandler: {"az.sdk.message":"onLinkRemoteOpen","connectionId":"MF_4ff63d_1656398832884","entityPath":"$cbs","linkName":"cbs:receiver","remoteSource":"Source{address='$cbs', durable=NONE, expiryPolicy=SESSION_END, timeout=0, dynamic=false, dynamicNodeProperties=null, distributionMode=null, filter=null, defaultOutcome=null, outcomes=null, capabilities=null}"}
Which basically tells me IntelliJ Authentication not available. Please log in with Azure Tools for IntelliJ plugin in the IDE, but in the IDE I am logged in.
After googling and debugging a bit it seems I am missing the AuthMethodDetails.json file, that should be written by the plugin - it does not exist on my machine.
I have tried to log in with OAuth 2.0 and the Device Login already but none of the options were writing the AuthMethodDetails / making the connection work.
TLDR;
Do I need the AuthMethodDetails.json for the Intellij plugin to work?
What could be a reason for it not being written for me and how can I get it written?
Versions:
com.azure:azure-identity:1.5.2
com.azure:azure-messaging-servicebus:7.9.1
IntelliJ IDEA 2022.1.3 (Ultimate Edition) - Build #IU-221.5921.22, built on June 21, 2022
I am not able to start application it gives below exception :
Java.lang.IllegalArgumentException
At com.bea.objectweb.asm.ClassReader.(Unknownsource)com.bea.objectweb.asm.ClassReader.(Unknown source)
Application got started after replacing below jars
Log4j-1.2-api-2.9.1.jar
Log4j-api-2.9.1.jar
Log4j-core-2.9.1.jar
Log4j-slf4j-impl-2.10.0.jar
With
Log4j-1.2-api-2.8.2.jar
Log4j-api-2.8.2jar
Log4j-core-2.8.2.jar
Log4j-slf4j-impl-2.8.2.jar
Since version 2.9.0 there are classes compiled in java 9.
One workaround is to remove them from log4j-api-2.x.y.jar
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 am trying to run j2me app in emulator using eclipse but when i run the app i am getting following error
Error installing IMlet. See logs for details.
i tried to explore different thread but could not get definite answer.it asks to download IMlet Suite but i didnt find a place from where i can download it.
i am using windows 8 64bit machine
i am pretty new to this so please guide accordingly.
when i m trying to run following command
C:\WTK22\bin>emulator.bat
it shows following error
C:\WTK22\bin>C:\PROGRA~2\Java\JRE18~1.0_3\bin\java.exe -Dkvem.home=C:\WTK22 -Dja
va.library.path=C:\WTK22/bin -Dsun.java2d.ddlock=true -Dsun.java2d.gdiblit=false
-cp C:\WTK22/wtklib/kenv.zip;C:\WTK22/wtklib/ktools.zip;C:\WTK22/wtklib/customj
mf.jar com.sun.kvem.environment.EmulatorWrapper
Exception in thread "main" java.lang.IllegalStateException: KeepAliveConnection
not initialized
at com.sun.kvem.environment.KeepAliveConnection.run(Unknown Source)
at com.sun.kvem.environment.EmulatorWrapper.main(Unknown Source)
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.