[JVM] AbstractMethodError from SpringFactory.start

65 views
Skip to first unread message

Ethel Ellison

unread,
Mar 28, 2014, 3:31:39 PM3/28/14
to cu...@googlegroups.com
I think my first attempt to post this got rejected because I searched this forum last night, rather than in the last 10 minutes.  If I am wrong, my apologies for the double-post.

I am new to Spring and picking up Java again after ten years of primarily C# and a brief detour through Ruby and Python as primary coding languages.  I want to use cucumber-spring so I can use configuration properties in a way that will be intuitive to my coworkers.  However, after resolving Spring dependencies and some other errors, I am now stuck on this exception.  I've spent over three hours trying to resolve it and gotten two other devs to take a look, but to no avail.

java.lang.AbstractMethodError: cucumber.runtime.java.spring.SpringFactory.start()V
    at cucumber.runtime.java.JavaBackend.buildWorld(JavaBackend.java:101)
    at cucumber.runtime.Runtime.buildBackendWorlds(Runtime.java:138)
    at cucumber.runtime.model.CucumberScenario.run(CucumberScenario.java:38)
    at cucumber.runtime.junit.ExecutionUnitRunner.run(ExecutionUnitRunner.java:83)
    at cucumber.runtime.junit.FeatureRunner.runChild(FeatureRunner.java:63)
    at cucumber.runtime.junit.FeatureRunner.runChild(FeatureRunner.java:18)
    at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238)
    at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63)
    at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236)
    at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53)
    at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229)
    at org.junit.runners.ParentRunner.run(ParentRunner.java:309)
    at cucumber.runtime.junit.FeatureRunner.run(FeatureRunner.java:70)
    at cucumber.api.junit.Cucumber.runChild(Cucumber.java:89)
    at cucumber.api.junit.Cucumber.runChild(Cucumber.java:40)
    at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238)
    at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63)
    at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236)
    at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53)
    at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229)
    at org.junit.runners.ParentRunner.run(ParentRunner.java:309)
    at cucumber.api.junit.Cucumber.run(Cucumber.java:94)
    at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:252)
    at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:141)
    at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:112)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at org.apache.maven.surefire.util.ReflectionUtils.invokeMethodWithArray(ReflectionUtils.java:189)
    at org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke(ProviderFactory.java:165)
    at org.apache.maven.surefire.booter.ProviderFactory.invokeProvider(ProviderFactory.java:85)
    at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:115)
    at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:75)

Here are the dependencies and properties from my pom.xml - let me know if other parts of the POM might also be useful:

 <properties>
        <cucumber-version>1.1.6</cucumber-version>
        <spring.version>4.0.3.RELEASE</spring.version>
        <!-- Jacoco -->
        <jacoco.out.file>jacoco-it.exec</jacoco.out.file>
        <jacoco.out.path>../target/</jacoco.out.path>
    </properties>
    <dependencies>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-beans</artifactId>
            <version>${spring.version}</version>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-web</artifactId>
            <version>${spring.version}</version>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-context</artifactId>
            <version>${spring.version}</version>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-core</artifactId>
            <version>${spring.version}</version>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-test</artifactId>
            <version>${spring.version}</version>
        </dependency>
        <dependency>
            <groupId>javax.servlet</groupId>
            <artifactId>servlet-api</artifactId>
            <version>2.5</version>
        </dependency>
        <dependency>
            <groupId>info.cukes</groupId>
            <artifactId>cucumber-java</artifactId>
            <version>${cucumber-version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>info.cukes</groupId>
            <artifactId>cucumber-junit</artifactId>
            <version>${cucumber-version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
        <groupId>info.cukes</groupId>
        <artifactId>cucumber-spring</artifactId>
        <version>${cucumber-version}</version>
    </dependency>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>4.11</version>
            <scope>test</scope>
        </dependency>
    </dependencies>

Here is my cucumber.xml:

<?xml version="1.0" encoding="UTF-8"?>
<beans
  xmlns="http://www.springframework.org/schema/beans"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xmlns:context="http://www.springframework.org/schema/context"
  xsi:schemaLocation=
    "http://www.springframework.org/schema/beans
     http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
     http://www.springframework.org/schema/context
     http://www.springframework.org/schema/context/spring-context-3.0.xsd">

    <context:component-scan base-package="cucumber.runtime.java.spring"/>
    <context:annotation-config/>

    <bean class="org.springframework.web.context.support.ServletContextPropertyPlaceholderConfigurer">
        <property name="locations">
            <list>
                <value>file:///${APPS_CONFIG}/service/config.properties</value>
            </list>
        </property>
    </bean>

</beans>

Here is my step defintion file:

package com.company.team.service;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.web.WebAppConfiguration;
import junit.framework.TestCase;
import cucumber.api.java.en.Given;
import cucumber.api.java.en.Then;
import cucumber.api.java.en.When;


@ContextConfiguration(locations = "classpath:cucumber.xml")
public class TestSteps {

    @Value("${service.external.endpoint}")
    private String externalEndpoint;

//...
//Some other steps here
//...

    @Given("I have an external endpoint string")
    public void I_have_an_external_endpoint_string() throws Throwable {
        TestCase.assertEquals(externalEndpoint, "Value of the external endpoint config", "Config for external endpoint not resolving properly");
    }
}

Can anyone see what I am doing wrong here?

Thank you for any help.

Ethel

aslak hellesoy

unread,
Mar 28, 2014, 3:59:18 PM3/28/14
to Cucumber Users
On Fri, Mar 28, 2014 at 7:31 PM, Ethel Ellison <eth...@gmail.com> wrote:
I think my first attempt to post this got rejected because I searched this forum last night, rather than in the last 10 minutes.  If I am wrong, my apologies for the double-post.

I am new to Spring and picking up Java again after ten years of primarily C# and a brief detour through Ruby and Python as primary coding languages.  I want to use cucumber-spring so I can use configuration properties in a way that will be intuitive to my coworkers.  However, after resolving Spring dependencies and some other errors, I am now stuck on this exception.  I've spent over three hours trying to resolve it and gotten two other devs to take a look, but to no avail.


I don't understand how this can happen. cucumber.runtime.java.spring.SpringFactory.start() is not abstract.
Can you share some code to reproduce this?

Aslak
 

--
Posting rules: http://cukes.info/posting-rules.html
---
You received this message because you are subscribed to the Google Groups "Cukes" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cukes+un...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Ethel Ellison

unread,
Mar 28, 2014, 5:42:55 PM3/28/14
to cu...@googlegroups.com
I made an attempt at this, but it's quickly becoming clear to me that teasing apart the code that reproduces this from the code that is company property is going to be time-consuming.  We're doing some other "magic" on our end that is provided through a company platform library to integrate cucumber into our code coverage / build process, so I think I'd need to dig through their stuff as well.

It sounds (if I can read between the lines a bit) like that "magic" is probably where the issue lies, so I'm getting in touch with the team who manages that platform code. It also doesn't sound like this is an obvious error caused by some noobishness on my part, which was my initial assumption. I'll update if I can get any more information about what is going on.

Ethel Ellison

unread,
Mar 28, 2014, 5:44:34 PM3/28/14
to cu...@googlegroups.com


On Friday, March 28, 2014 12:59:18 PM UTC-7, Aslak Hellesøy wrote:



On Fri, Mar 28, 2014 at 7:31 PM, Ethel Ellison <eth...@gmail.com> wrote:
I think my first attempt to post this got rejected because I searched this forum last night, rather than in the last 10 minutes.  If I am wrong, my apologies for the double-post.

I am new to Spring and picking up Java again after ten years of primarily C# and a brief detour through Ruby and Python as primary coding languages.  I want to use cucumber-spring so I can use configuration properties in a way that will be intuitive to my coworkers.  However, after resolving Spring dependencies and some other errors, I am now stuck on this exception.  I've spent over three hours trying to resolve it and gotten two other devs to take a look, but to no avail.


I don't understand how this can happen. cucumber.runtime.java.spring.SpringFactory.start() is not abstract.
Can you share some code to reproduce this?

Aslak

Reposting because I accidentally broke a rule last time - sorry, not used to this forum.

Thank you, Aslak,

I made an attempt at this, but it's quickly becoming clear to me that teasing apart the code that reproduces this from the code that is company property is going to be time-consuming.  We're doing some other "magic" on our end that is provided through a company platform library to integrate cucumber into our code coverage / build process, so I think I'd need to dig through their stuff as well.

It sounds (if I can read between the lines a bit) like that "magic" is probably where the issue lies, so I'm getting in touch with the team who manages that platform code. It also doesn't sound like this is an obvious error caused by some noobishness on my part, which was my initial assumption. I'll update if I can get any more information about what is going on.
 
 
java.lang.AbstractMethodError: cucumber.runtime.java.spring.SpringFactory.start()V

Ethel Ellison

unread,
Mar 28, 2014, 6:20:24 PM3/28/14
to cu...@googlegroups.com


On Friday, March 28, 2014 2:44:34 PM UTC-7, Ethel Ellison wrote:


On Friday, March 28, 2014 12:59:18 PM UTC-7, Aslak Hellesøy wrote:


On Fri, Mar 28, 2014 at 7:31 PM, Ethel Ellison <eth...@gmail.com> wrote:
I think my first attempt to post this got rejected because I searched this forum last night, rather than in the last 10 minutes.  If I am wrong, my apologies for the double-post.

I am new to Spring and picking up Java again after ten years of primarily C# and a brief detour through Ruby and Python as primary coding languages.  I want to use cucumber-spring so I can use configuration properties in a way that will be intuitive to my coworkers.  However, after resolving Spring dependencies and some other errors, I am now stuck on this exception.  I've spent over three hours trying to resolve it and gotten two other devs to take a look, but to no avail.


I don't understand how this can happen. cucumber.runtime.java.spring.SpringFactory.start() is not abstract.
Can you share some code to reproduce this?

Aslak

Reposting because I accidentally broke a rule last time - sorry, not used to this forum.

Thank you, Aslak,

I made an attempt at this, but it's quickly becoming clear to me that teasing apart the code that reproduces this from the code that is company property is going to be time-consuming.  We're doing some other "magic" on our end that is provided through a company platform library to integrate cucumber into our code coverage / build process, so I think I'd need to dig through their stuff as well.

It sounds (if I can read between the lines a bit) like that "magic" is probably where the issue lies, so I'm getting in touch with the team who manages that platform code. It also doesn't sound like this is an obvious error caused by some noobishness on my part, which was my initial assumption. I'll update if I can get any more information about what is going on.

I reached out to the platform team, and their advice was essentially "Don't use Spring for tests. Everyone else uses Spring, and there are too many issues with version conflicts."

I'm going to try a different solution than Spring for using properties, and not dig into this any further.

Thanks for your help - the knowledge that it wasn't an obvious problem was valuable.
Reply all
Reply to author
Forward
0 new messages