Skip to content
This repository has been archived by the owner on Jul 31, 2020. It is now read-only.

Gauge API not started #203

Closed
pvskarps opened this issue Oct 12, 2016 · 31 comments · Fixed by #425
Closed

Gauge API not started #203

pvskarps opened this issue Oct 12, 2016 · 31 comments · Fixed by #425
Assignees
Labels

Comments

@pvskarps
Copy link

Expected behavior

IntelliJ IDEA launches without issue

Actual behavior


When someone starts looking into this from Thoughtworks please e-mail me and I will e-mail you the specs folder to use in the Steps to reproduce. I would rather not attach our specs folder to this public post.

Getting Gauge API failed to start when opening a project inside of IDEA. I believe I've narrowed it down to something with the specs folder as you will notice below in the STR I can get the problem to occur on a brand new java maven project by coping our projects specs folder over to the new project. I've tried deleting the .idea and .iml files but that didn't appear to make a difference.

I ran gauge --validate on our specs folder and other than a bunch of Step implementation not found validation errors on in progress specs I don't see anything else.

Everything runs fine in our CI builds and everything runs fine from a command prompt. This only appears to be an issue when opening the project in IDEA. We can even run specs within IDEA just fine when this error occurs. It's just that all steps in the specs are red and we lose the step suggestion list when we start typing a new step in a spec.

Also I created a new standard Gauge project from within IDEA (File->New->Project->Gauge) and copied the specs folder into that and also ran into the Gauge API not started error so I don't believe it has anything to do with maven.

Steps to reproduce

  1. Create a fresh new Java_Maven project by running gauge --init java_maven
  2. Once project has been created open the project in IDEA to verify everything works as expected.
  3. Copy the spec folder from the specs folder I will email over the spec folder in the new maven project
  4. Open the project in IDEA again. You should now see the Gauge API did not start error

    Information that will help us debug

  5. IntelliJ version and edition(Community/Ultimate) 2016.2.4
  6. OS information - Windows 7 Pro
  7. Gauge IntelliJ plugin version - Version: 0.2.4 from Nightly
  8. Does the project uses any Build tool(Gradle/Maven)? Maven
  9. Machine JDK version - java version "1.8.0_102"
    Java(TM) SE Runtime Environment (build 1.8.0_102-b14)
    Java HotSpot(TM) 64-Bit Server VM (build 25.102-b14, mixed mode)

Gauge version: 0.6.3.nightly-2016-10-06

Plugins

csharp (0.9.2)
html-report (2.1.1)
java (0.5.0)

@kashishm
Copy link
Collaborator

@pvskarps Thanks for logging this issue. The fix is available in latest nightly.

@kashishm kashishm added the bug label Oct 17, 2016
@pvskarps
Copy link
Author

The latest nightly didn't appear to have solved the issue. However another team within the company I work at has made some modifications to the Gauge IntelliJ plugin that appears to have fixed the issue. Please look at the latest note from ocary in issue #177.

@apoorvam
Copy link
Contributor

apoorvam commented Jan 3, 2017

@pvskarps Are you still facing this issue on latest Gauge and its plugins(IntelliJ, Java)?

@pvskarps
Copy link
Author

pvskarps commented Jan 3, 2017

@apoorvam We have been using an internally built version of the IntelliJ plugin as described in issue #177 that has fixed our problem. I have not tried with the newest releases of the plugin since our internally built version is working.

@danut-t
Copy link

danut-t commented Feb 27, 2017

Hello,

I'm encountering the same issue with the latest versions (gauge-0.8.0, java-0.6.0, intellij-plugin-0.3.1, intellij 2016.3.4).

Detailed stacktrace:
com.intellij.openapi.module.impl.ModuleManagerComponent@4e2267: Gauge API not started
java.lang.RuntimeException: Gauge API not started
at com.thoughtworks.gauge.connection.GaugeConnection.createConnection(GaugeConnection.java:76)
at com.thoughtworks.gauge.connection.GaugeConnection.createConnection(GaugeConnection.java:87)
at com.thoughtworks.gauge.connection.GaugeConnection.createConnection(GaugeConnection.java:87)
at com.thoughtworks.gauge.connection.GaugeConnection.createConnection(GaugeConnection.java:87)
at com.thoughtworks.gauge.connection.GaugeConnection.createConnection(GaugeConnection.java:87)
at com.thoughtworks.gauge.connection.GaugeConnection.createConnection(GaugeConnection.java:87)
at com.thoughtworks.gauge.connection.GaugeConnection.(GaugeConnection.java:49)
at com.thoughtworks.gauge.GaugeModuleComponent.initializeGaugeConnection(GaugeModuleComponent.java:114)
at com.thoughtworks.gauge.GaugeModuleComponent.createGaugeService(GaugeModuleComponent.java:106)
at com.thoughtworks.gauge.module.lib.AbstractLibHelper.(AbstractLibHelper.java:37)
at com.thoughtworks.gauge.module.lib.GaugeLibHelper.(GaugeLibHelper.java:51)
at com.thoughtworks.gauge.module.lib.LibHelperFactory.helperFor(LibHelperFactory.java:35)
at com.thoughtworks.gauge.GaugeModuleComponent.projectOpened(GaugeModuleComponent.java:79)
at com.thoughtworks.gauge.GaugeModuleComponent.moduleAdded(GaugeModuleComponent.java:94)
at com.intellij.openapi.module.impl.ModuleImpl.moduleAdded(ModuleImpl.java:208)
at com.intellij.openapi.module.impl.ModuleManagerImpl.lambda$fireModuleAddedInWriteAction$5(ModuleManagerImpl.java:570)
at com.intellij.openapi.application.impl.ApplicationImpl.runWriteAction(ApplicationImpl.java:934)
at com.intellij.openapi.module.impl.ModuleManagerImpl.fireModuleAddedInWriteAction(ModuleManagerImpl.java:569)
at com.intellij.openapi.module.impl.ModuleManagerComponent.lambda$fireModulesAdded$0(ModuleManagerComponent.java:124)
at com.intellij.openapi.application.TransactionGuardImpl.runSyncTransaction(TransactionGuardImpl.java:91)
at com.intellij.openapi.application.TransactionGuardImpl.submitTransactionAndWait(TransactionGuardImpl.java:159)
at com.intellij.openapi.module.impl.ModuleManagerComponent.fireModulesAdded(ModuleManagerComponent.java:124)
at com.intellij.openapi.module.impl.ModuleManagerImpl.projectOpened(ModuleManagerImpl.java:557)
at com.intellij.openapi.project.impl.ProjectImpl.projectOpened(ProjectImpl.java:390)
at com.intellij.openapi.project.impl.ProjectImpl.access$200(ProjectImpl.java:70)
at com.intellij.openapi.project.impl.ProjectImpl$MyProjectManagerListener.projectOpened(ProjectImpl.java:425)
at com.intellij.openapi.project.impl.ProjectManagerImpl$1.projectOpened(ProjectManagerImpl.java:91)
at com.intellij.openapi.project.impl.ProjectManagerImpl.fireProjectOpened(ProjectManagerImpl.java:657)
at com.intellij.openapi.project.impl.ProjectManagerImpl.lambda$null$4(ProjectManagerImpl.java:329)
at com.intellij.openapi.application.TransactionGuardImpl$3.run(TransactionGuardImpl.java:173)
at com.intellij.openapi.application.TransactionGuardImpl.runSyncTransaction(TransactionGuardImpl.java:91)
at com.intellij.openapi.application.TransactionGuardImpl.access$300(TransactionGuardImpl.java:41)
at com.intellij.openapi.application.TransactionGuardImpl$2.run(TransactionGuardImpl.java:116)
at com.intellij.openapi.application.impl.LaterInvocator$FlushQueue.runNextEvent(LaterInvocator.java:417)
at com.intellij.openapi.application.impl.LaterInvocator$FlushQueue.run(LaterInvocator.java:401)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:311)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:756)
at java.awt.EventQueue.access$500(EventQueue.java:97)
at java.awt.EventQueue$3.run(EventQueue.java:709)
at java.awt.EventQueue$3.run(EventQueue.java:703)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:80)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:726)
at com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.java:843)
at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:679)
at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:391)
at com.intellij.ide.IdeEventQueue.pumpEventsForHierarchy(IdeEventQueue.java:930)
at com.intellij.openapi.progress.util.ProgressWindow.startBlocking(ProgressWindow.java:207)
at com.intellij.openapi.progress.util.ProgressWindow.startBlocking(ProgressWindow.java:194)
at com.intellij.openapi.application.impl.ApplicationImpl.runProcessWithProgressSynchronously(ApplicationImpl.java:586)
at com.intellij.openapi.progress.impl.CoreProgressManager.runProcessWithProgressSynchronously(CoreProgressManager.java:435)
at com.intellij.openapi.progress.impl.ProgressManagerImpl.runProcessWithProgressSynchronously(ProgressManagerImpl.java:76)
at com.intellij.openapi.progress.impl.CoreProgressManager$8.run(CoreProgressManager.java:338)
at com.intellij.openapi.progress.impl.CoreProgressManager.runSynchronously(CoreProgressManager.java:342)
at com.intellij.openapi.progress.impl.CoreProgressManager.run(CoreProgressManager.java:321)
at com.intellij.openapi.progress.ProgressManager.run(ProgressManager.java:193)
at com.intellij.openapi.project.impl.ProjectManagerImpl.loadAndOpenProject(ProjectManagerImpl.java:403)
at com.intellij.ide.impl.ProjectUtil.openProject(ProjectUtil.java:189)
at com.intellij.ide.RecentProjectsManagerImpl.doOpenProject(RecentProjectsManagerImpl.java:60)
at com.intellij.ide.RecentProjectsManagerBase.doReopenLastProject(RecentProjectsManagerBase.java:613)
at com.intellij.ide.RecentProjectsManagerBase$MyAppLifecycleListener.appStarting(RecentProjectsManagerBase.java:647)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at com.intellij.util.messages.impl.MessageBusConnectionImpl.deliverMessage(MessageBusConnectionImpl.java:117)
at com.intellij.util.messages.impl.MessageBusImpl.doPumpMessages(MessageBusImpl.java:381)
at com.intellij.util.messages.impl.MessageBusImpl.pumpMessages(MessageBusImpl.java:368)
at com.intellij.util.messages.impl.MessageBusImpl.sendMessage(MessageBusImpl.java:347)
at com.intellij.util.messages.impl.MessageBusImpl.access$200(MessageBusImpl.java:42)
at com.intellij.util.messages.impl.MessageBusImpl$2.invoke(MessageBusImpl.java:230)
at com.sun.proxy.$Proxy43.appStarting(Unknown Source)
at com.intellij.idea.IdeaApplication$IdeStarter.lambda$main$1(IdeaApplication.java:340)
at com.intellij.openapi.application.TransactionGuardImpl.runSyncTransaction(TransactionGuardImpl.java:91)
at com.intellij.openapi.application.TransactionGuardImpl.access$300(TransactionGuardImpl.java:41)
at com.intellij.openapi.application.TransactionGuardImpl$2.run(TransactionGuardImpl.java:116)
at com.intellij.openapi.application.TransactionGuardImpl.submitTransaction(TransactionGuardImpl.java:126)
at com.intellij.openapi.application.TransactionGuard.submitTransaction(TransactionGuard.java:122)
at com.intellij.idea.IdeaApplication$IdeStarter.main(IdeaApplication.java:338)
at com.intellij.idea.IdeaApplication.lambda$run$0(IdeaApplication.java:193)
at com.intellij.openapi.application.TransactionGuardImpl.performUserActivity(TransactionGuardImpl.java:204)
at com.intellij.idea.IdeaApplication.run(IdeaApplication.java:193)
at com.intellij.idea.MainImpl$1.lambda$null$0(MainImpl.java:47)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:311)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:756)
at java.awt.EventQueue.access$500(EventQueue.java:97)
at java.awt.EventQueue$3.run(EventQueue.java:709)
at java.awt.EventQueue$3.run(EventQueue.java:703)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:80)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:726)
at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:363)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:201)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)

@kashishm
Copy link
Collaborator

@geraniumdt Does your project use any build tool (gradle/maven)?

@danut-t
Copy link

danut-t commented Feb 27, 2017

@kashishm Nope

@kashishm
Copy link
Collaborator

@geraniumdt Please try the following steps

  • Delete gauge-lib dependency
    Project Settings -> Modules -> Select your project -> Dependencies -> gauge-lib -> Click on - symbol.

  • Add gauge-java libs
    Project Settings -> Modules -> Select your project -> Dependencies -> Click on + symbol -> Select Library -> Java -> Add ~/.gauge/plugins/java/0.6.0/libs/ for linux/mac or %APPDATA%\gauge\plugins\java\0.6.0\libs\ - > click Apply and Ok.

  • Reopen the project.

@danut-t
Copy link

danut-t commented Feb 27, 2017

@kashishm Still no luck

@kashishm
Copy link
Collaborator

@geraniumdt Could you please send us the logs for the project.
Follow the below steps to get the logs.

  • Close the project in IntelliJ.
  • Delete the logs dir in your project.
  • Open the project in IntelliJ.
  • Send us the content present in gauge.log and api.log file.

@danut-t
Copy link

danut-t commented Feb 27, 2017

api.log: 13:28:51.640 Failed to start execution API Service. GAUGE_API_V2_PORT Environment variable not set

I was not aware of this environment variable. What should it contain?

Also, there was no gauge.log in the project logs dir. Found one in the gauge installation folder, but it only contains details about installing the html-report plugin

@kashishm
Copy link
Collaborator

api.log: 13:28:51.640 Failed to start execution API Service. GAUGE_API_V2_PORT Environment variable not set

It is a warning. This env var is only used by Gauge internally. You don't have to worry about that.
Did api.log contain more content other than the above warning?

@danut-t
Copy link

danut-t commented Feb 27, 2017

Besides information regarding the specs addition, there's this:

14:25:15.269 Api Request Received: messageType:GetStepValueResponse messageId:4 stepValueRequest:<stepText:"Click on button <button>" > 
14:25:15.269 Sending API response: messageType:UnsupportedApiMessageResponse messageId:4 unsupportedApiMessageResponse:<> 

@danut-t
Copy link

danut-t commented Feb 28, 2017

@kashishm Any thoughts on this? I've also tried doing a clean gauge reinstall, with no luck

@kashishm
Copy link
Collaborator

kashishm commented Feb 28, 2017

14:25:15.269 Api Request Received: messageType:GetStepValueResponse messageId:4 stepValueRequest:<stepText:"Click on button <button>" > 
14:25:15.269 Sending API response: messageType:UnsupportedApiMessageResponse messageId:4 unsupportedApiMessageResponse:<> 

@geraniumdt From the above logs, it looks like there is some mismatch of versions betweengauge and gauge-java.

Can you check for m.thoughtworks.gauge.GaugeUtil - executable path: <path> in IntelliJ log files and then run <path_from_log_file> -v in the command line. It should print 0.8.0

If the above outputs 0.8.0, then please run the following command

gauge --uninstall java
gauge --install java

Open the project and make sure you have gauge-java 0.6.0/libs as dependency in your project settings #203 (comment).

@danut-t
Copy link

danut-t commented Feb 28, 2017

@kashishm The versions were the expected ones:
Gauge version: 0.8.0

Plugins

html-report (3.1.0)
java (0.6.0)

I've uninstalled and reinstalled the java plugin, but it's still crashing.
Note that actually running the specs works (if it helps).

@kashishm
Copy link
Collaborator

kashishm commented Mar 1, 2017

@geraniumdt Are you running the specs from the command line or IntelliJ?

Could you please try installing Gauge IntelliJ plugin from Nightly channel. Here's the doc on how to install nightly.

After installing, could you please check IntelliJ idea log files and send us the logs which contain the following lines

GaugeModuleComponent - Setting `gauge_custom_classpath` to ...

OR

GaugeRunConfiguration - Setting `gauge_custom_classpath` to ...

@danut-t
Copy link

danut-t commented Mar 1, 2017

@kashishm I'm running the specs from Intellij.

Attaching the GaugeModuleComponent message:
2017-03-01 17:27:43,560 [ 744827] INFO - rks.gauge.GaugeModuleComponent - Setting gauge_custom_classpathtoC:\Program Files\Java\jdk1.8.0_40\jre\lib\charsets.jar;C:\Program Files\Java\jdk1.8.0_40\jre\lib\deploy.jar;C:\Program Files\Java\jdk1.8.0_40\jre\lib\javaws.jar;C:\Program Files\Java\jdk1.8.0_40\jre\lib\jce.jar;C:\Program Files\Java\jdk1.8.0_40\jre\lib\jfr.jar;C:\Program Files\Java\jdk1.8.0_40\jre\lib\jfxswt.jar;C:\Program Files\Java\jdk1.8.0_40\jre\lib\jsse.jar;C:\Program Files\Java\jdk1.8.0_40\jre\lib\management-agent.jar;C:\Program Files\Java\jdk1.8.0_40\jre\lib\plugin.jar;C:\Program Files\Java\jdk1.8.0_40\jre\lib\resources.jar;C:\Program Files\Java\jdk1.8.0_40\jre\lib\rt.jar;C:\Program Files\Java\jdk1.8.0_40\jre\lib\ext\access-bridge-64.jar;C:\Program Files\Java\jdk1.8.0_40\jre\lib\ext\cldrdata.jar;C:\Program Files\Java\jdk1.8.0_40\jre\lib\ext\dnsns.jar;C:\Program Files\Java\jdk1.8.0_40\jre\lib\ext\jaccess.jar;C:\Program Files\Java\jdk1.8.0_40\jre\lib\ext\jfxrt.jar;C:\Program Files\Java\jdk1.8.0_40\jre\lib\ext\localedata.jar;C:\Program Files\Java\jdk1.8.0_40\jre\lib\ext\nashorn.jar;C:\Program Files\Java\jdk1.8.0_40\jre\lib\ext\sunec.jar;C:\Program Files\Java\jdk1.8.0_40\jre\lib\ext\sunjce_provider.jar;C:\Program Files\Java\jdk1.8.0_40\jre\lib\ext\sunmscapi.jar;C:\Program Files\Java\jdk1.8.0_40\jre\lib\ext\sunpkcs11.jar;C:\Program Files\Java\jdk1.8.0_40\jre\lib\ext\zipfs.jar;D:\Repositories\GaugeProject\out\production\GaugeProject;D:\Repositories\GaugeProject\libs\zap-1.jar;D:\Repositories\GaugeProject\libs\poi-3.8.jar;D:\Repositories\GaugeProject\libs\jna-3.4.0.jar;D:\Repositories\GaugeProject\libs\junit-4.9.jar;D:\Repositories\GaugeProject\libs\gson-2.2.2.jar;D:\Repositories\GaugeProject\libs\jxl-2.6.12.jar;D:\Repositories\GaugeProject\libs\dom4j-1.6.1.jar;D:\Repositories\GaugeProject\libs\jsch-0.1.50.jar;D:\Repositories\GaugeProject\libs\zap-api-2.4.jar;D:\Repositories\GaugeProject\libs\httpcore-4.3.jar;D:\Repositories\GaugeProject\libs\im4java-1.3.2.jar;D:\Repositories\GaugeProject\libs\joda-time-2.1.jar;D:\Repositories\GaugeProject\libs\poi-ooxml-3.8.jar;D:\Repositories\GaugeProject\libs\xdb6-11.2.0.4.jar;D:\Repositories\GaugeProject\libs\commons-io-2.4.jar;D:\Repositories\GaugeProject\libs\httpmime-4.3.1.jar;D:\Repositories\GaugeProject\libs\platform-3.4.0.jar;D:\Repositories\GaugeProject\libs\stax-api-1.0.1.jar;D:\Repositories\GaugeProject\libs\velocity-1.5.0.jar;D:\Repositories\GaugeProject\libs\xmlbeans-2.3.0.jar;D:\Repositories\GaugeProject\libs\fluent-hc-4.2.3.jar;D:\Repositories\GaugeProject\libs\httpclient-4.3.1.jar;D:\Repositories\GaugeProject\libs\javax.mail-1.4.4.jar;D:\Repositories\GaugeProject\libs\pdfbox-app-1.4.0.jar;D:\Repositories\GaugeProject\libs\commons-codec-1.8.jar;D:\Repositories\GaugeProject\libs\commons-lang3-3.1.jar;D:\Repositories\GaugeProject\libs\ojdbc6-11.2.0.1.0.jar;D:\Repositories\GaugeProject\libs\jersey-bundle-1.16.jar;D:\Repositories\GaugeProject\libs\jersey-spring-1.16.jar;D:\Repositories\GaugeProject\libs\poi-scratchpad-3.8.jar;D:\Repositories\GaugeProject\libs\taguru-pdf-util-1.0.jar;D:\Repositories\GaugeProject\libs\xmlparserv2-11.2.0.4.jar;D:\Repositories\GaugeProject\libs\commons-logging-1.1.1.jar;D:\Repositories\GaugeProject\libs\poi-ooxml-schemas-3.8.jar;D:\Repositories\GaugeProject\libs\httpclient-cache-4.2.3.jar;D:\Repositories\GaugeProject\libs\org.apache.commons.jexl-1.1.0.jar;D:\Repositories\GaugeProject\libs\twist-precondition-1.30.0.631.jar;D:\Repositories\GaugeProject\libs\selenium-server-standalone-2.52.0.jar;D:\Repositories\GaugeProject\libs\com.springsource.net.sf.json-2.2.2.jar;D:\Repositories\GaugeProject\libs\com.springsource.org.apache.commons.logging-1.1.1.jar;C:\Users\turta\AppData\Roaming\gauge\plugins\java\0.6.0\libs\guava-15.0.jar;C:\Users\turta\AppData\Roaming\gauge\plugins\java\0.6.0\libs\junit-4.12.jar;C:\Users\turta\AppData\Roaming\gauge\plugins\java\0.6.0\libs\commons-io-2.4.jar;C:\Users\turta\AppData\Roaming\gauge\plugins\java\0.6.0\libs\commons-lang-2.6.jar;C:\Users\turta\AppData\Roaming\gauge\plugins\java\0.6.0\libs\gauge-java-0.6.0.jar;C:\Users\turta\AppData\Roaming\gauge\plugins\java\0.6.0\libs\annotations-2.0.1.jar;C:\Users\turta\AppData\Roaming\gauge\plugins\java\0.6.0\libs\hamcrest-core-1.3.jar;C:\Users\turta\AppData\Roaming\gauge\plugins\java\0.6.0\libs\reflections-0.9.10.jar;C:\Users\turta\AppData\Roaming\gauge\plugins\java\0.6.0\libs\javassist-3.19.0-GA.jar;C:\Users\turta\AppData\Roaming\gauge\plugins\java\0.6.0\libs\protobuf-java-3.1.0.jar;C:\Users\turta\AppData\Roaming\gauge\plugins\java\0.6.0\libs\hamcrest-library-1.3.jar;C:\Users\turta\AppData\Roaming\gauge\plugins\java\0.6.0\libs\javaparser-core-2.3.0.jar
At first glance, it looks like it's properly setting the libraries.

@kashishm
Copy link
Collaborator

kashishm commented Mar 2, 2017

@geraniumdt The classpath looks fine. I am not sure why it is not working for you.

After opening the project, do you see a gauge process running in task manager?
and please send us all the exceptions(there should be 2 exceptions) and their stack traces after opening the project.

@danut-t
Copy link

danut-t commented Mar 2, 2017

@kashishm So, I dug a little deeper and explored other alternatives as to why this might fail (other than incompatible libraries) and I've started thinking that it might have to do with the actual specifications. On a hunch, I've removed all my specifications and added a basic new one. And it worked. The Gauge API no longer crashed.

Afterwards, on another hunch, I added all the specs back, without closing Intellij. Adding them this way also worked and the specifications compiled without any problems. But on closing and reopening Intellij, it crashed again. So this led me to the idea that the Gauge API might crash because of the number of specifications (in our project we have several thousands) and this reminded me of a similar bug logged here: #177 (comment)

I've updated the plugin code with the lines mentioned in that bug and after installing it, the problem was solved.

So I can safely say that the root cause is the sheer number of specifications when opening the project. The fix works, but it should be added to the master version (and probably in a more elegant version) as others might encounter this issue as well.

Let me know your thoughts on this.

@v-mwalk
Copy link

v-mwalk commented Apr 18, 2018

Not sure really is fixed is it?

Vanilla everything and when I try to create a new Gauge project in IntelliJ I get the "Error adding module to project: Gauge API not started" error.

@jbadeau
Copy link

jbadeau commented Sep 17, 2019

I'm also getting the error as well.

java.lang.RuntimeException: Gauge API not started
at com.thoughtworks.gauge.connection.GaugeConnection.createConnection(GaugeConnection.java:76)
at com.thoughtworks.gauge.connection.GaugeConnection.createConnection(GaugeConnection.java:87)
at com.thoughtworks.gauge.connection.GaugeConnection.createConnection(GaugeConnection.java:87)
at com.thoughtworks.gauge.connection.GaugeConnection.createConnection(GaugeConnection.java:87)
at com.thoughtworks.gauge.connection.GaugeConnection.createConnection(GaugeConnection.java:87)
at com.thoughtworks.gauge.connection.GaugeConnection.createConnection(GaugeConnection.java:87)
at com.thoughtworks.gauge.connection.GaugeConnection.(GaugeConnection.java:49)
at com.thoughtworks.gauge.GaugeModuleComponent.initializeGaugeConnection(GaugeModuleComponent.java:81)
at com.thoughtworks.gauge.GaugeModuleComponent.createGaugeService(GaugeModuleComponent.java:74)
at com.thoughtworks.gauge.module.lib.AbstractLibHelper.(AbstractLibHelper.java:37)
at com.thoughtworks.gauge.module.lib.LibHelperFactory$GaugeModuleLibHelper.(LibHelperFactory.java:43)
at com.thoughtworks.gauge.module.lib.LibHelperFactory.helperFor(LibHelperFactory.java:33)
at com.thoughtworks.gauge.GaugeModuleComponent.moduleAdded(GaugeModuleComponent.java:62)
at com.intellij.openapi.module.impl.ModuleImpl.moduleAdded(ModuleImpl.java:216)
at com.intellij.openapi.module.impl.ModuleManagerImpl.lambda$fireModuleAddedInWriteAction$4(ModuleManagerImpl.java:649)
at com.intellij.openapi.application.impl.ApplicationImpl.runWriteAction(ApplicationImpl.java:994)
at com.intellij.openapi.module.impl.ModuleManagerImpl.fireModuleAddedInWriteAction(ModuleManagerImpl.java:647)
at com.intellij.openapi.module.impl.ModuleManagerComponent.lambda$fireModulesAdded$1(ModuleManagerComponent.java:131)
at com.intellij.openapi.application.TransactionGuardImpl.runSyncTransaction(TransactionGuardImpl.java:82)
at com.intellij.openapi.application.TransactionGuardImpl.submitTransactionAndWait(TransactionGuardImpl.java:148)
at com.intellij.openapi.module.impl.ModuleManagerComponent.fireModulesAdded(ModuleManagerComponent.java:131)
at com.intellij.openapi.module.impl.ModuleManagerImpl.projectOpened(ModuleManagerImpl.java:98)
at com.intellij.openapi.project.impl.ProjectManagerImpl.lambda$fireProjectOpened$18(ProjectManagerImpl.java:823)
at com.intellij.ide.startup.impl.StartupManagerImpl.runActivity(StartupManagerImpl.java:467)
at com.intellij.openapi.project.impl.ProjectManagerImpl.fireProjectOpened(ProjectManagerImpl.java:818)
at com.intellij.openapi.project.impl.ProjectManagerImpl.lambda$null$5(ProjectManagerImpl.java:397)
at com.intellij.openapi.application.TransactionGuardImpl.lambda$submitTransactionAndWait$2(TransactionGuardImpl.java:161)
at com.intellij.openapi.application.TransactionGuardImpl.runSyncTransaction(TransactionGuardImpl.java:82)
at com.intellij.openapi.application.TransactionGuardImpl.lambda$submitTransaction$1(TransactionGuardImpl.java:106)
at com.intellij.openapi.application.impl.LaterInvocator$FlushQueue.doRun(LaterInvocator.java:433)
at com.intellij.openapi.application.impl.LaterInvocator$FlushQueue.runNextEvent(LaterInvocator.java:416)
at com.intellij.openapi.application.impl.LaterInvocator$FlushQueue.run(LaterInvocator.java:399)
at java.desktop/java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:313)
at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:776)
at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:727)
at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:721)
at java.base/java.security.AccessController.doPrivileged(Native Method)
at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:85)
at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:746)
at com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.java:878)
at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:827)
at com.intellij.ide.IdeEventQueue.lambda$dispatchEvent$8(IdeEventQueue.java:466)
at com.intellij.openapi.progress.impl.CoreProgressManager.computePrioritized(CoreProgressManager.java:704)
at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:465)
at com.intellij.ide.IdeEventQueue.pumpEventsForHierarchy(IdeEventQueue.java:935)
at com.intellij.openapi.progress.util.ProgressWindow.startBlocking(ProgressWindow.java:205)
at com.intellij.openapi.progress.util.ProgressWindow.startBlocking(ProgressWindow.java:191)
at com.intellij.openapi.application.impl.ApplicationImpl.runProcessWithProgressSynchronously(ApplicationImpl.java:566)
at com.intellij.openapi.progress.impl.CoreProgressManager.runProcessWithProgressSynchronously(CoreProgressManager.java:459)
at com.intellij.openapi.progress.impl.ProgressManagerImpl.runProcessWithProgressSynchronously(ProgressManagerImpl.java:82)
at com.intellij.openapi.progress.impl.CoreProgressManager.runProcessWithProgressSynchronously(CoreProgressManager.java:256)
at com.intellij.platform.PlatformProjectOpenProcessor.doOpenProject(PlatformProjectOpenProcessor.java:199)
at com.intellij.ide.RecentProjectsManagerBase.doOpenProject(RecentProjectsManagerBase.java:508)
at com.intellij.ide.RecentProjectsManagerBase.doReopenLastProject(RecentProjectsManagerBase.java:636)
at com.intellij.ide.RecentProjectsManagerBase.reopenLastProjectOnStart(RecentProjectsManagerBase.java:614)
at com.intellij.idea.IdeaApplication$IdeStarter.lambda$main$1(IdeaApplication.java:410)
at com.intellij.openapi.application.TransactionGuardImpl.runSyncTransaction(TransactionGuardImpl.java:82)
at com.intellij.openapi.application.TransactionGuardImpl.lambda$submitTransaction$1(TransactionGuardImpl.java:106)
at com.intellij.openapi.application.TransactionGuardImpl.submitTransaction(TransactionGuardImpl.java:115)
at com.intellij.openapi.application.TransactionGuard.submitTransaction(TransactionGuard.java:121)
at com.intellij.idea.IdeaApplication$IdeStarter.main(IdeaApplication.java:402)
at com.intellij.idea.IdeaApplication.lambda$null$3(IdeaApplication.java:154)
at com.intellij.openapi.application.TransactionGuardImpl.performUserActivity(TransactionGuardImpl.java:192)
at com.intellij.idea.IdeaApplication.lambda$executeInitAppInEdt$5(IdeaApplication.java:154)
at java.desktop/java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:313)
at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:776)
at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:727)
at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:721)
at java.base/java.security.AccessController.doPrivileged(Native Method)
at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:85)
at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:746)
at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:438)
at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:203)
at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:124)
at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:113)
at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:109)
at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
at java.desktop/java.awt.EventDispatchThread.run(EventDispatchThread.java:90)

@Apoorva-GA
Copy link
Contributor

@jbadeau Could you please try with latest gauge-java nightly. We have added more relevant logs to debug this issue.

Refer nightly installation instructions to install gauge-java from nightly.

@jbadeau
Copy link

jbadeau commented Oct 14, 2019

@Apoorva-GA the gauge-java nightly did not solve the issue unfortunately.

@jbadeau
Copy link

jbadeau commented Oct 14, 2019

@Apoorva-GA The java-gauge issue did not fix the problem but the latest nightly intellij plugin fixes the issue.

@negiDharmendra
Copy link
Contributor

@jbadeau I am glad to know that the issue is resolved for you. We would like to know what has caused the issue in the first place. Please provide more information.

  • run gauge -v on your terminal and share the output with us
  • which os your working on
  • java version
  • Intellij version and Gauge Intellij Plugin version.
  • Were you able to replicate this issue with a new Gauge Java project. If not is it possible for you to share the sample project.

@jbadeau
Copy link

jbadeau commented Oct 15, 2019

Version info

`
Gauge version: 1.0.5
Commit Hash: 562f036

Plugins

html-report (4.0.8)
java (0.7.2)
json-report (0.3.1)
python (0.3.5)
reportportal (1.1.0)
screenshot (0.0.1)
xray-report (0.0.1)
`
Please note that I am using Gauge 1.0.5 due to a bug in 1.0.6 which causes excessive logging (don't remember the issue number). The issue occurs in 1.0.6 as well.

After using the nightly build it seems the issue is not completely resolved but it happens a lot less frequently.

If I close all files and reopen the project then it tends to work. This leads me to believe that:

  • The issue might be time related (not really familiar with the lifecycle of intellij plugins & editors)
  • If a spec file is open when intellij starts then it might try to start gauge before intellij is ready
  • The issue sometimes appears than goes away after intellij finishes updating the index which makes sense. However; it doesn't always go away.

On another note. I will dig into the editor soon as I guess it's using LSP which is not officially supported by intellij. Curious how it's working.

@negiDharmendra
Copy link
Contributor

@jbadeau Few more details

  • which os your working on
  • java version
  • Intellij version and Gauge Intellij Plugin version.

On another note. I will dig into the editor soon as I guess it's using LSP which is not officially supported by intellij. Curious how it's working.

No Gauge Intellij plugin does not uses LSP.

@jbadeau
Copy link

jbadeau commented Oct 15, 2019

windows 7
Java 1.8
IntelliJ 2019.2.3

Oh OK, was really curious how you would have got it to work.

@pvskarps
Copy link
Author

pvskarps commented Oct 15, 2019

Over 3 years since I first logged this issue and the fact it is still open and active is surprising to me.

Everyone having these Gauge API not started errors should read this comment in issue #177.. You'll notice the fix has been referenced many times throughout the comment history of this issue.

I'm not saying the fix in the linked comment will fix all Gauge API not started errors but since we have implemented the fix in our own version of the Gauge IntelliJ plugin we no longer get reports from developers or software quality engineers related to Gauge API not started issues. The fix does require you to clone the Gauge-IntelliJ repo and update it but It is a simple fix to a frustrating problem.

@nehashri
Copy link
Contributor

nehashri commented Nov 7, 2019

@pvskarps I have incorporated a similar fix with getgauge/gauge-java@1fcfc56 and getgauge/gauge-java@03df27f

@negiDharmendra negiDharmendra self-assigned this Feb 7, 2020
negiDharmendra added a commit that referenced this issue Feb 7, 2020
     - This solution has been suggested by the users facing this issue.
       #177
Debashis9012 pushed a commit that referenced this issue Feb 28, 2020
- This solution has been suggested by the users facing this issue.
       #177
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Development

Successfully merging a pull request may close this issue.

9 participants