2

I am trying to setup a basic DXA application as steps given here: http://www.tridiondeveloper.com/using-and-debugging-dxa-java-with-web-8-5-on-amazon

However, I am facing two issues:

1.)

java.lang.IllegalStateException: Cannot detect ViewModel for ViewData MvcDataImpl(controllerAreaName=Framework, controllerName=Entity, actionName=Entity, areaName=GMENEDxaOamFeatures, viewName=Login, regionAreaName=null, regionName=null, routeValues={}, metadata={})
    at com.sdl.webapp.common.impl.model.ViewModelRegistryImpl.getViewModelType(ViewModelRegistryImpl.java:168)
    at com.sdl.dxa.tridion.mapping.impl.DefaultModelBuilder.buildEntityModel(DefaultModelBuilder.java:101)
    at com.sdl.dxa.tridion.mapping.impl.ModelBuilderPipelineImpl.createEntityModel(ModelBuilderPipelineImpl.java:92)
    at com.sdl.dxa.tridion.mapping.impl.ModelBuilderPipelineImpl.createEntityModel(ModelBuilderPipelineImpl.java:79)
    at com.sdl.dxa.tridion.mapping.impl.DefaultModelBuilder.createEntityModel(DefaultModelBuilder.java:402)
    at com.sdl.dxa.tridion.mapping.impl.DefaultModelBuilder.lambda$addEntitiesToRegionModels$3(DefaultModelBuilder.java:364)

2.) The default pom.xml has dependency versions missing. How to correct this ? enter image description here

2
  • PLease let us know what version of DXA java are you trying to install
    – Anand NS
    May 25 at 6:56
  • I checked the pom.xml of my project. It mentions DXA 2.2.3 May 25 at 7:17
7

The first issue clearly states that the custom models and views have not been registered with DXA. You'd have to create a class that extends AbstractModuleInitializer and register all views and custom entity models. For your setup you should have something like this:

@Component
@Configuration
@ComponentScan("com.sdl.dxa")
public class CustomInitializer extends AbstractModuleInitializer {
    @RegisteredViewModels({ 
        @RegisteredViewModel(viewName = "Login", modelClass = <EntityModelClass>.class)
    })
    @Component
    @ModuleInfo(name = "GMENEDxaOamFeatures Module", areaName = "GMENEDxaOamFeatures", description = "Custom Module")
    public static class GmeneDxaOamFeaturesInitializer extends AbstractModuleInitializer {
        @Override
        protected String getAreaName() {
            return "GMENEDxaOamFeatures";
        }
    }
}

Also, the custom views for your module need to be placed in src/main/resources/WEB-INF/Views/GMENEDxaOamFeatures. So the Login.jsp view should go in this folder.

DXA documentation for registering view models: https://docs.sdl.com/784837/551231/sdl-digital-experience-accelerator-2-2/registering-a-custom-module-in-dxa.

0
0

Please refer to this stack exchange link how to install latest java version and some reference on how to build link

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.