Reflection errors while running via cmd

679 views
Skip to first unread message

Kshitij Bangur

unread,
Feb 12, 2016, 6:31:50 AM2/12/16
to getgauge
I am getting reflections related error while running via cmd as follows -
$GaugeWS>gauge --tags=gaugeTestTag specs
Exception in thread "main" org.reflections.ReflectionsException: Can't resolve member named somemethod for class com.demo.qa.XYZActions
        at org.reflections.util.Utils.getMemberFromDescriptor(Utils.java:94)
        at org.reflections.util.Utils.getMethodsFromDescriptors(Utils.java:101)
        at org.reflections.Reflections.getMethodsAnnotatedWith(Reflections.java:443)
        at com.thoughtworks.gauge.scan.StepsScanner.scan(StepsScanner.java:38)
        at com.thoughtworks.gauge.scan.ClasspathScanner.scan(ClasspathScanner.java:39)
        at com.thoughtworks.gauge.GaugeRuntime.main(GaugeRuntime.java:36)

Things are working perfectly fine when executing via Run or Debug menu options when right clicking a spec file.

Here is what I have already tried -
1. Made sure I have just one reference of Reflections API related jar - reflections-0.9.10.jar
2. Made sure gauge lib is added to Library
3. Made sure I have twist-essentials-1.0.9.jar in the gauge workspace libs as well

Regards,
Kshitij Bangur

Mahendra Kariya

unread,
Feb 15, 2016, 10:25:12 PM2/15/16
to getgauge
Hi Kshitij,

Could you please check if the classpath is same as that of IDE when you are running from command line?

--
You received this message because you are subscribed to the Google Groups "getgauge" group.
To unsubscribe from this group and stop receiving emails from it, send an email to getgauge+u...@googlegroups.com.
To post to this group, send email to getg...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/getgauge/3652acd5-d14c-4571-a85c-0f1624e2d45e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Kshitij Bangur

unread,
Feb 16, 2016, 4:54:19 AM2/16/16
to getgauge
Doesn't looks like the classpath is same. Can you share the basic prerequisites to run test via command line knowing that we have some 3rd party library dependencies? How the classpath should be configured?

Regards,
Kshitij Bangur

Sarita Pol

unread,
Feb 16, 2016, 6:20:12 AM2/16/16
to getgauge

In my case I'm getting the same exception when running through Intellij.

From command prompt I can run successfully.

Please help to fix the issue related to IntelliJ.

Thanks,
Sarita

Kashish Munjal

unread,
Feb 16, 2016, 7:05:00 AM2/16/16
to getg...@googlegroups.com
Hi Kshitij,

You can add additional 3rd party library dependencies to the gauge_additional_libs property present in env/default/java.properties. The values present in gauge_additional_libs will be added to classpath. You can find more details on such properties in docs.


For more options, visit https://groups.google.com/d/optout.



--
Thanks,
Kashish Munjal

Mahendra Kariya

unread,
Feb 16, 2016, 8:05:19 AM2/16/16
to getgauge
Hi Sarita,

Could you please try setting the classpath in IntelliJ? This page has details on how you can do it.

Sarita Pol

unread,
Feb 22, 2016, 2:39:00 AM2/22/16
to getgauge
Hi Mahendra,

I figured out that project was not compiling with JDK 1.8, instead when I used JDK1.7 everything worked perfectly fine.

Whether Gauge doesnt work with JDK1.8?

Thanks,
Sarita

Mahendra Kariya

unread,
Feb 22, 2016, 2:47:38 AM2/22/16
to getg...@googlegroups.com
Hi Sarita,

Gauge works perfectly fine with JDK 1.8.

Looking back at your case, here's my best guess what would have happened. In IntelliJ, there are a couple of places in the project settings where you have to specify the JDK version. And all these settings should be in sync. If one setting is different from the other, there may be issues.

Could you please ensure that you have the same JDK version everywhere in the settings? Here's the list of places where you can specify JDK version in IntelliJ.
  • Project Settings > Project > Project SDK
  • Project Settings > Modules > Sources / Dependencies

Regards,
Mahendra



--
You received this message because you are subscribed to the Google Groups "getgauge" group.
To unsubscribe from this group and stop receiving emails from it, send an email to getgauge+u...@googlegroups.com.
To post to this group, send email to getg...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages