Web test failing, Unable to start container

I am trying to include test to my company proyect, and I am begining for the web ones because Is relevant now. I am getting this error:
Invalid bean definition with name ‘cuba_web_MBeanExporter’ defined in class path resource [com/haulmont/cuba/web-spring.xml]: Could not resolve placeholder ‘cuba.webContextName’ in value “${cuba.webContextName}.cuba:type=ConfigStorage”; nested exception is java.lang.IllegalArgumentException: Could not resolve placeholder ‘cuba.webContextName’ in value “${cuba.webContextName}.cuba:type=ConfigStorage”

It’s looks like a bad configuration on my web-app.properties but I am newb on this company so am I not sure. I have cuba.webContextName = rm-test, but I dont understand what means “${cuba.webContextName}.cuba:type=ConfigStorage” .

I little orientation at least will ne nice, thanks. Greetings.

I can’t edit or I don know how to so, I am writing a new post. I solve part of problem, the thing was i was missing the right route for my web-app.properties on the container. How ever i still stuck on the tests. Now when I try to create a new entiti with factoring according to the documentation I am unable to do it, first I get:

Returning null from public abstract java.lang.Long com.haulmont.cuba.core.sys.NumberIdSequence.createLongId(java.lang.String,java.lang.String)

And then a null pointer in the create method:

MyEntity = myEntityFactory.create(
“name”, “Antonio”,
“iva”, 0.21);

I create the factory like this, and I am no getting an error from here:

TestEntityFactory myEntityFactory =
environment.getContainer().getEntityFactory(MyEntity.class, TestEntityState.NEW);

I am missing a middle step or is agina configuration error?

Hi,
Probably one of files created manually by you contains invalid properties (test container class or web-app.properties).

You can do the following:

  • create fresh project from Studio with the same project ID, root package etc.
  • create simple web integration test there and check that it launches successfully.
  • compare contents of configuraton files, test containers in the web module and build.gradle configuration section.

The question is that I have a lot of properties on this proyect, and the person who was maintening this proyect is not loger here. So can I debug this some how to see wich ones are the properties that are falling, cuze otherwise I can’t take it of. I can use debug so I can se what’s on factory, and is getting the correct entity and is set to NEW, but i see this con metadata.config :

Method threw ‘java.lang.RuntimeException’ exception. Cannot evaluate com.sun.proxy.$Proxy107.toString()

Also I can tell you tha I just copy and modify the example in the documentation for the testContainer:
package es.properly.pg.web;

import com.haulmont.cuba.web.testsupport.TestContainer;

import java.util.Arrays;

public class webTestContainer extends TestContainer {

public webTestContainer() {
    appComponents = Arrays.asList(
            "com.haulmont.cuba",
            "it.nexbit.cuba.security.forgotpassword",
            "org.strangeway.responsive",
            "com.haulmont.addon.helium",
            "com.haulmont.addon.restapi",
            "com.haulmont.charts",
            "com.haulmont.addon.globalevents",
            "com.haulmont.addon.dashboard");
    appPropertiesFiles = Arrays.asList(
            // List the files defined in your web.xml
            // in appPropertiesConfig context parameter of the web module
            "es/properly/pg/web-app.properties",
            // Add this file which is located in CUBA and defines some properties
            // specifically for test environment. You can replace it with your own
            // or add another one in the end.
            "com/haulmont/cuba/web/testsupport/test-web-app.properties"
    );
}

public static class Common extends webTestContainer {

    // A common singleton instance of the test container which is initialized once for all tests
    public static final webTestContainer.Common INSTANCE = new webTestContainer.Common();

    private static volatile boolean initialized;

    private Common() {
    }

    @Override
    public void before() throws Throwable {
        if (!initialized) {
            super.before();
            initialized = true;
        }
        setupContext();
    }

    @Override
    public void after() {
        cleanupContext();
        // never stops - do not call super
    }
}

}

In my web-app.properties, I have this ones that my be wrong?:

cuba.availableLocales = Spanish (Spain)|es_ES;English|en
cuba.webContextName = rm-test
cuba.rest.responseView=false

I can’t show you al the file because there are keys on there. I really apreciate you take a time to help me.
Regards.

This content is OK.

I suggest you to create fresh empty project with the same root package and project ID, and same CUBA platform version.

Then compare the following files:

  • TestContainer and other files in the “test” source root of the web module
  • web-app.properties
  • build.gradle

You can also debug how your WebTestContainer starts and compare it to the starting of a TestContainer in a fresh project.