1

I tried to install DXA 2.2 Java to Red Hat Linux 8.2. However, When Executing prepare.sh, the Following build Error Occurred:

There is no '2.2.0-SNAPSHOT' on following URL, which is seen in error message. https://repo.maven.apache.org/maven2/com/sdl/dxa/dxa-builder/

Why is dxa-builder:2.2.0-SNAPSHOT missing?

FAILURE: Build failed with an exception.

* What went wrong:
A problem occurred configuring root project 'installer'.
> Could not resolve all artifacts for configuration ':classpath'.
   > Could not find com.sdl.dxa:dxa-builder:2.2.0-SNAPSHOT.
     Searched in the following locations:
       - file:/root/.m2/repository/com/sdl/dxa/dxa-builder/2.2.0-SNAPSHOT/maven-metadata.xml
       - file:/root/.m2/repository/com/sdl/dxa/dxa-builder/2.2.0-SNAPSHOT/dxa-builder-2.2.0-SNAPSHOT.pom
       - file:/root/.m2/repository/com/sdl/dxa/dxa-builder/2.2.0-SNAPSHOT/dxa-builder-2.2.0-SNAPSHOT.jar
       - https://repo.maven.apache.org/maven2/com/sdl/dxa/dxa-builder/2.2.0-SNAPSHOT/maven-metadata.xml
       - https://repo.maven.apache.org/maven2/com/sdl/dxa/dxa-builder/2.2.0-SNAPSHOT/dxa-builder-2.2.0-SNAPSHOT.pom
       - https://repo.maven.apache.org/maven2/com/sdl/dxa/dxa-builder/2.2.0-SNAPSHOT/dxa-builder-2.2.0-SNAPSHOT.jar
       - https://oss.sonatype.org/content/repositories/snapshots/com/sdl/dxa/dxa-builder/2.2.0-SNAPSHOT/maven-metadata.xml
       - https://oss.sonatype.org/content/repositories/snapshots/com/sdl/dxa/dxa-builder/2.2.0-SNAPSHOT/dxa-builder-2.2.0-SNAPSHOT.pom
       - https://oss.sonatype.org/content/repositories/snapshots/com/sdl/dxa/dxa-builder/2.2.0-SNAPSHOT/dxa-builder-2.2.0-SNAPSHOT.jar

Update In DXA 2.2's known issues, there is an issue 'Version 2.2.1 required when building a Java web application'

https://docs.sdl.com/784837/743044/sdl-digital-experience-accelerator-2-2/issue--version-------------2-2-1-required-when-building-a-java-web-application

So I download DXA 2.2.1, and executed following command in dxa-webapp directory.

mvn clean package

Then, following error occurred.

[ERROR] Failed to execute goal on project dxa-webapp: Could not resolve dependencies for project com.sdl.dxa:dxa-webapp:war:2.2.1: Could not find artifact com.sdl.tridion.xo:xo-compatible-client:jar:11.0.0-1057 in central (https://repo.maven.apache.org/maven2) -> [Help 1]

I downloaded dxa-web-application-java-DXA_2.2.5_Hotfix.tar.gz from this page. https://github.com/sdl/dxa-web-application-java/releases/tag/DXA_2.2.5_Hotfix

Then upload it to Linux and it already contains 'dxa-webapp' directory, so I execute following command mvn clean package -P 2.2.5

I get this command from following page(SDL DXA documentation) https://docs.sdl.com/792164/548959/sdl-digital-experience-accelerator-2-0/building-your-web-application--java-

Then followng error occurred.

[INFO] Scanning for projects...
[ERROR] [ERROR] Some problems were encountered while processing the POMs:
[FATAL] 'parent.artifactId' is missing. @ line 7, column 13
 @
[ERROR] The build could not read 1 project -> [Help 1]
[ERROR]
[ERROR]   The project com.sdl.dxa:dxa-webapp:2.2.5 (/home/ec2-user/dxa-web-application-java-DXA_2.2.5_Hotfix/dxa-webapp/pom.xml) has 1 error
[ERROR]     'parent.artifactId' is missing. @ line 7, column 13
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/ProjectBuildingException

I tried DXA 2.2.4, it failed by different error. So I tried DXA 2.2.3, then build succeeded and a file dxa-webapp.war was generated. I'm not sure what was wrong building 2.2.5 and 2.2.4.

After that, 2.2.3 causes following runtime error.

02:31:57.834 [http-nio-8080-exec-2] ERROR c.s.w.c.controller.PageController - Exception while processing request for: /
java.lang.IllegalStateException: Cannot detect ViewModel for ViewData MvcDataImpl(controllerAreaName=Framework, controllerName=Page, actionName=Page, areaName=Core, viewName=GeneralPage, regionAreaName=null, regionName=null, routeValues={}, metadata={})
    at com.sdl.webapp.common.impl.model.ViewModelRegistryImpl.getViewModelType(ViewModelRegistryImpl.java:168)

Update I editted pom.xml and built DXA 2.2.5 by following command

mvn clean package -Pcore-module,cid-module -DskipTests -Dcyclonedx.skip=true

I'm using Linux.There is no following directory in Maven local repository even after executing above command.

/home/ec2-user/.m2/repository/com/sdl/dxa/modules

And following error occurred.

21-Dec-2020 08:57:49.877 SEVERE [main] org.apache.catalina.core.ContainerBase.startInternal A child container failed during start
        java.util.concurrent.ExecutionException: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[]]
                at java.base/java.util.concurrent.FutureTask.report(FutureTask.java:122)
                at java.base/java.util.concurrent.FutureTask.get(FutureTask.java:191)
                at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:916)
                at org.apache.catalina.core.StandardHost.startInternal(StandardHost.java:843)
                at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
                at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1384)
                at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1374)
                at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
                at org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:75)
                at java.base/java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:140)
                at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:909)
                at org.apache.catalina.core.StandardEngine.startInternal(StandardEngine.java:262)
                at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
                at org.apache.catalina.core.StandardService.startInternal(StandardService.java:421)
                at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
                at org.apache.catalina.core.StandardServer.startInternal(StandardServer.java:930)
                at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
                at org.apache.catalina.startup.Catalina.start(Catalina.java:772)
                at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
                at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
                at java.base/java.lang.reflect.Method.invoke(Method.java:566)
                at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:342)
                at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:473)
        Caused by: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[]]
                at org.apache.catalina.util.LifecycleBase.handleSubClassException(LifecycleBase.java:440)
                at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:198)
                at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1384)
                at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1374)
                at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
                at org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:75)
                at java.base/java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:140)
                at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:909)
                ... 21 more
        Caused by: java.lang.NullPointerException: className is marked non-null but is null
                at com.sdl.webapp.common.util.InitializationUtils.classForNameIfPresent(InitializationUtils.java:185)
                at com.sdl.dxa.modules.cid.CidWebInitializer.onStartup(CidWebInitializer.java:21)
                at org.springframework.web.SpringServletContainerInitializer.onStartup(SpringServletContainerInitializer.java:169)
                at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5166)
                at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
                ... 27 more
21-Dec-2020 08:57:49.880 SEVERE [main] org.apache.catalina.core.ContainerBase.startInternal A child container failed during start
        java.util.concurrent.ExecutionException: org.apache.catalina.LifecycleException: A child container failed during start
                at java.base/java.util.concurrent.FutureTask.report(FutureTask.java:122)
                at java.base/java.util.concurrent.FutureTask.get(FutureTask.java:191)
                at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:916)
                at org.apache.catalina.core.StandardEngine.startInternal(StandardEngine.java:262)
                at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
                at org.apache.catalina.core.StandardService.startInternal(StandardService.java:421)
                at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
                at org.apache.catalina.core.StandardServer.startInternal(StandardServer.java:930)
                at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
                at org.apache.catalina.startup.Catalina.start(Catalina.java:772)
                at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
                at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
                at java.base/java.lang.reflect.Method.invoke(Method.java:566)
                at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:342)
                at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:473)
        Caused by: org.apache.catalina.LifecycleException: A child container failed during start
                at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:928)
                at org.apache.catalina.core.StandardHost.startInternal(StandardHost.java:843)
                at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
                at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1384)
                at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1374)
                at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
                at org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:75)
                at java.base/java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:140)
                at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:909)
                ... 13 more
        Caused by: java.util.concurrent.ExecutionException: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[]]
                at java.base/java.util.concurrent.FutureTask.report(FutureTask.java:122)
                at java.base/java.util.concurrent.FutureTask.get(FutureTask.java:191)
                at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:916)
                ... 21 more
        Caused by: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[]]
                at org.apache.catalina.util.LifecycleBase.handleSubClassException(LifecycleBase.java:440)
                at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:198)
                at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1384)
                at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1374)
                at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
                at org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:75)
                at java.base/java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:140)
                at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:909)
                ... 21 more
        Caused by: java.lang.NullPointerException: className is marked non-null but is null
                at com.sdl.webapp.common.util.InitializationUtils.classForNameIfPresent(InitializationUtils.java:185)
                at com.sdl.dxa.modules.cid.CidWebInitializer.onStartup(CidWebInitializer.java:21)
                at org.springframework.web.SpringServletContainerInitializer.onStartup(SpringServletContainerInitializer.java:169)
                at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5166)
                at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
                ... 27 more
21-Dec-2020 08:57:49.880 SEVERE [main] org.apache.catalina.startup.Catalina.start The required Server component failed to start so Tomcat is unable to start.
        org.apache.catalina.LifecycleException: A child container failed during start
                at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:928)
                at org.apache.catalina.core.StandardEngine.startInternal(StandardEngine.java:262)
                at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
                at org.apache.catalina.core.StandardService.startInternal(StandardService.java:421)
                at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
                at org.apache.catalina.core.StandardServer.startInternal(StandardServer.java:930)
                at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
                at org.apache.catalina.startup.Catalina.start(Catalina.java:772)
                at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
                at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
                at java.base/java.lang.reflect.Method.invoke(Method.java:566)
                at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:342)
                at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:473)
        Caused by: java.util.concurrent.ExecutionException: org.apache.catalina.LifecycleException: A child container failed during start
                at java.base/java.util.concurrent.FutureTask.report(FutureTask.java:122)
                at java.base/java.util.concurrent.FutureTask.get(FutureTask.java:191)
                at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:916)
                ... 13 more
        Caused by: org.apache.catalina.LifecycleException: A child container failed during start
                at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:928)
                at org.apache.catalina.core.StandardHost.startInternal(StandardHost.java:843)
                at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
                at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1384)
                at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1374)
                at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
                at org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:75)
                at java.base/java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:140)
                at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:909)
                ... 13 more
        Caused by: java.util.concurrent.ExecutionException: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[]]
                at java.base/java.util.concurrent.FutureTask.report(FutureTask.java:122)
                at java.base/java.util.concurrent.FutureTask.get(FutureTask.java:191)
                at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:916)
                ... 21 more
        Caused by: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[]]
                at org.apache.catalina.util.LifecycleBase.handleSubClassException(LifecycleBase.java:440)
                at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:198)
                at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1384)
                at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1374)
                at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
                at org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:75)
                at java.base/java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:140)
                at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:909)
                ... 21 more
        Caused by: java.lang.NullPointerException: className is marked non-null but is null
                at com.sdl.webapp.common.util.InitializationUtils.classForNameIfPresent(InitializationUtils.java:185)
                at com.sdl.dxa.modules.cid.CidWebInitializer.onStartup(CidWebInitializer.java:21)
                at org.springframework.web.SpringServletContainerInitializer.onStartup(SpringServletContainerInitializer.java:169)
                at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5166)
                at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
                ... 27 more

Building with only core module profile, then DXA works.

mvn clean package -Pcore-module -DskipTests -Dcyclonedx.skip=true

6
  • there was an issue with the DXA 2.2.0 release that it referenced wrong (internal/not published) versions of some of the CD artifacts, Can you try DXA 2.2.5? – Velmurugan Oct 16 '20 at 6:41
  • Building by 'mvn clean package' command for DXA 2.2.5 and DXA 2.2.4 failed, but succeeded for DXA 2.2.3. I wrote result by editing my post. I'm not sure using 2.2.3 is good solution. – Hirokazu Shikata Oct 16 '20 at 8:20
  • Go far 2.2.3, there are no major changes in 2.2.5, just a few references corrections AFAIK – Velmurugan Oct 16 '20 at 13:57
  • 2.2.3 causes runtime error. What is proper way to build and set up DXA? – Hirokazu Shikata Dec 15 '20 at 7:54
  • Choose a number or apply filter (format: [groupId:]artifactId, case sensitive contains): 1674: dxa Choose archetype: 1: remote -> com.sdl.dxa:dxa-webapp-archetype (Example web application for DXA) Choose a number or apply filter (format: [groupId:]artifactId, case sensitive contains): : 1 Choose com.sdl.dxa:dxa-webapp-archetype version: 21: 2.2.5 Choose a number: 21: 21 – Anand NS Dec 15 '20 at 9:53
3

AFAIK - In the DXA Java 2.2.5, A few dependency jars are missing in Maven, and also XpmRegionConfigImpl class has an initialization error for XpmRegionImpl It was missed in the maven version.

Try following steps to get prepared to use the DXA Java 2.2.5

  1. Ensure Java and maven installed as prerequisites as per SDL docs supported versions
  2. Run the below command to prepare to download the DXA Java version 2.2.5, adjust the parameters as per your needs.

mvn archetype:generate -B -DarchetypeArtifactId=dxa-webapp-archetype -DarchetypeGroupId=com.sdl.dxa -DarchetypeVersion=2.2.5 -DgroupId=com.sdl.dxa -DartifactId=dxa-webapp -Dversion=2.2.5

  1. Verify end of the screen BUILD SUCCESS and dxa-webapp folder created enter image description here

  2. Go to the folder dxa-webapp eg. cd dxa-webapp

  3. Open and update the following dependency to pom.xml

<!-- existing one just add the version to resolve the XPM issue -->
<dependency>
    <groupId>com.sdl.dxa</groupId>
    <artifactId>dxa-tridion-provider</artifactId>
    <version>2.2.7</version>
</dependency>

<!-- Add these missing depedencies -->
<dependency>  
 <groupId>com.sdl.tridion.xo</groupId>
    <artifactId>xo-compatible-client</artifactId>
    <version>11.0.0-1058</version>
</dependency>
<dependency>
    <groupId>com.sdl.delivery</groupId>
    <artifactId>udp-common-config-legacy</artifactId>
    <version>11.0.0-1045</version>
</dependency>
  1. above dependency if you are using 9.0, In case if you are using 9.1+ then refer to this maven links to find out the correct versions
  1. run this below maven command to build

mvn clean package -DskipTests -Dcyclonedx.skip=true

  1. Verify the end of the screen for BUILD SUCCESS

enter image description here

  1. In the Intellij Editor Build you will see this below error message, It means the core-module jar is not downloaded from maven to the local repository. You can verify in this location this jar file is exist or not C:\Users\username.m2\repository\com\sdl\dxa\modules\dxa-module-core\2.2.5\dxa-module-core-2.2.5.jar I had this issue and resolved it by selecting both core-module and cid-module, And noticed both module jars are downloaded in the local repository, and then I disabled the cid-module before build to run the web application in Intellij.

ERROR c.s.w.c.controller.PageController - Exception while processing request for: / java.lang.IllegalStateException: Cannot detect ViewModel for ViewData MvcDataImpl(controllerAreaName=Framework, controllerName=Page, actionName=Page, areaName=Core, viewName=GeneralPage, regionAreaName=null, regionName=null, routeValues={}, metadata={}) at com.sdl.webapp.common.impl.model.ViewModelRegistryImpl.getViewModelType(ViewModelRegistryImpl.java:168)

I hope it helps.

4
  • Indeed build succeed by editing pom.xml, and "Cannot detect ViewModel" error occurred. Then I build DXA with enabling core-module and cid-module but jar files are not created in Maven repository and another error occurred on dxa. I added the command and error message to my question, please see it. – Hirokazu Shikata Dec 21 '20 at 9:15
  • Ensure core-module folder and jar available in the local repository, remove the cid-module and try run, while building you don't need cid-module unless explicitly you need that module. what I noticed in the profile if we select only core-module sometimes that module does not download from maven, it's downloaded if I select both core and cid modules in the profile, then both modules downloaded from maven to local repository and then I removed the cid-module before building using Intellij. – Velmurugan Dec 21 '20 at 10:18
  • Building by selecting only core-module, then DXA works. Even though there is no "module" directory in local repository, following jar file is included in built war file: /WEB-INF/lib/dxa-module-core-2.2.5.jar. I tried building DXA on Windows, then "module" directory was created in local repository, so maven's behavior might be different between Linux and Windows. I appreciate for your advice. I hope DXA can be installed by only following procedure written in documentation. – Hirokazu Shikata Dec 22 '20 at 2:55
  • Good to know it works, if that answer helped upvote and accept to close this ticket. – Velmurugan Dec 23 '20 at 9:20
0

There is latest vesion of dxa-java available on maven 2.2.9, hope that will fix your build related errors.

1
  • FYI DXA Java 2.2.9 all dependencies jars are not in maven – Velmurugan Dec 18 '20 at 8:05

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.