Trouble running DHIS2 on localhost

Hello,

I have followed the quick start instructions here to setup dhis2 locally for development and I get this error

WARNING] Failed startup of context o.e.j.m.p.JettyWebAppContext@26f07261{DHIS Common Resources for Web,/,[file:///Users/stylishcoder/workspace/dhis2/dhis2-core/dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/, file:///Users/stylishcoder/workspace/dhis2/dhis2-core/dhis-2/dhis-web/dhis-web-commons-resources/target/jetty_overlays/release-documentation-2_3_2-docbook_zip/, file:///Users/stylishcoder/workspace/dhis2/dhis2-core/dhis-2/dhis-web/dhis-web-commons-resources/target/jetty_overlays/samples-2_3_2_zip/],UNAVAILABLE}{file:///Users/stylishcoder/workspace/dhis2/dhis2-core/dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/}
java.lang.IllegalStateException: No filter named
    at org.eclipse.jetty.servlet.ServletHandler.updateMappings (ServletHandler.java:1316)
    at org.eclipse.jetty.servlet.ServletHandler.doStart (ServletHandler.java:162)
    at org.eclipse.jetty.util.component.AbstractLifeCycle.start (AbstractLifeCycle.java:72)
    at org.eclipse.jetty.util.component.ContainerLifeCycle.start (ContainerLifeCycle.java:169)
    at org.eclipse.jetty.util.component.ContainerLifeCycle.doStart (ContainerLifeCycle.java:110)
    at org.eclipse.jetty.server.handler.AbstractHandler.doStart (AbstractHandler.java:100)
    at org.eclipse.jetty.security.SecurityHandler.doStart (SecurityHandler.java:405)
    at org.eclipse.jetty.security.ConstraintSecurityHandler.doStart (ConstraintSecurityHandler.java:419)
    at org.eclipse.jetty.util.component.AbstractLifeCycle.start (AbstractLifeCycle.java:72)
    at org.eclipse.jetty.util.component.ContainerLifeCycle.start (ContainerLifeCycle.java:169)
    at org.eclipse.jetty.util.component.ContainerLifeCycle.doStart (ContainerLifeCycle.java:110)
    at org.eclipse.jetty.server.handler.AbstractHandler.doStart (AbstractHandler.java:100)
    at org.eclipse.jetty.server.handler.ScopedHandler.doStart (ScopedHandler.java:120)
    at org.eclipse.jetty.server.session.SessionHandler.doStart (SessionHandler.java:504)
    at org.eclipse.jetty.util.component.AbstractLifeCycle.start (AbstractLifeCycle.java:72)
    at org.eclipse.jetty.util.component.ContainerLifeCycle.start (ContainerLifeCycle.java:169)
    at org.eclipse.jetty.util.component.ContainerLifeCycle.doStart (ContainerLifeCycle.java:110)
    at org.eclipse.jetty.server.handler.AbstractHandler.doStart (AbstractHandler.java:100)
    at org.eclipse.jetty.server.handler.ScopedHandler.doStart (ScopedHandler.java:120)
    at org.eclipse.jetty.server.handler.ContextHandler.startContext (ContextHandler.java:880)
    at org.eclipse.jetty.servlet.ServletContextHandler.startContext (ServletContextHandler.java:356)
    at org.eclipse.jetty.webapp.WebAppContext.startWebapp (WebAppContext.java:1445)
    at org.eclipse.jetty.maven.plugin.JettyWebAppContext.startWebapp (JettyWebAppContext.java:328)
    at org.eclipse.jetty.webapp.WebAppContext.startContext (WebAppContext.java:1409)
    at org.eclipse.jetty.server.handler.ContextHandler.doStart (ContextHandler.java:822)
    at org.eclipse.jetty.servlet.ServletContextHandler.doStart (ServletContextHandler.java:275)
    at org.eclipse.jetty.webapp.WebAppContext.doStart (WebAppContext.java:524)
    at org.eclipse.jetty.maven.plugin.JettyWebAppContext.doStart (JettyWebAppContext.java:397)
    at org.eclipse.jetty.util.component.AbstractLifeCycle.start (AbstractLifeCycle.java:72)
    at org.eclipse.jetty.util.component.ContainerLifeCycle.start (ContainerLifeCycle.java:169)
    at org.eclipse.jetty.util.component.ContainerLifeCycle.doStart (ContainerLifeCycle.java:117)
    at org.eclipse.jetty.server.handler.AbstractHandler.doStart (AbstractHandler.java:100)
    at org.eclipse.jetty.util.component.AbstractLifeCycle.start (AbstractLifeCycle.java:72)
    at org.eclipse.jetty.util.component.ContainerLifeCycle.start (ContainerLifeCycle.java:169)
    at org.eclipse.jetty.util.component.ContainerLifeCycle.doStart (ContainerLifeCycle.java:117)
    at org.eclipse.jetty.server.handler.AbstractHandler.doStart (AbstractHandler.java:100)
    at org.eclipse.jetty.util.component.AbstractLifeCycle.start (AbstractLifeCycle.java:72)
    at org.eclipse.jetty.util.component.ContainerLifeCycle.start (ContainerLifeCycle.java:169)
    at org.eclipse.jetty.server.Server.start (Server.java:407)
    at org.eclipse.jetty.util.component.ContainerLifeCycle.doStart (ContainerLifeCycle.java:110)
    at org.eclipse.jetty.server.handler.AbstractHandler.doStart (AbstractHandler.java:100)
    at org.eclipse.jetty.server.Server.doStart (Server.java:371)
    at org.eclipse.jetty.util.component.AbstractLifeCycle.start (AbstractLifeCycle.java:72)
    at org.eclipse.jetty.maven.plugin.AbstractJettyMojo.startJetty (AbstractJettyMojo.java:450)
    at org.eclipse.jetty.maven.plugin.AbstractJettyMojo.execute (AbstractJettyMojo.java:311)
    at org.eclipse.jetty.maven.plugin.JettyRunMojo.execute (JettyRunMojo.java:152)
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:137)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:210)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
    at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
    at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
    at org.apache.maven.cli.MavenCli.execute (MavenCli.java:957)
    at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:289)
    at org.apache.maven.cli.MavenCli.main (MavenCli.java:193)
    at sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke (Method.java:498)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347)
[INFO] Started ServerConnector@60317de8{HTTP/1.1,[http/1.1]}{0.0.0.0:8080}
[INFO] Started @68402ms
[INFO] Started Jetty Server

The steps I followed exactly where

  1. git clone git@github.com:ivange94/dhis2-core.git
  2. cd dhis2-core/dhis-2
  3. mvn install
  4. cd dhis-web
  5. mvn install -U
  6. mvn jetty:run

Maven commands in line 3 and 5 were successful. I get the above error after executing line 6. Trying to access the application on http://localhost:8080, I get a server error.

1 Like

Hi @stylishcoder!

Welcome to the DHIS2 Community! Tagging @julhas to advise on this.

1 Like

Hi @stylishcoder,

Can you connect with me? My skype id is julhas08.

Thanks @James.

Regards
Julhas

1 Like

Hello @julhas

I’ve added you on skype. My skype ID is ivange94.

1 Like

Ok. Thank you.

1 Like

Hi everybody!

I’m encountering the same issue, did you have the chance to solve this one a few weeks ago?

Thanks a lot!

François

1 Like

@stylishcoder are you able to share with us the fix for your issue please? @dupirefr would like to know how you worked it out with the mighty @julhas!

Best,
James.

Hi @jomutsani!
Thanks for the answer.
Is there anyone else who can help with this issue :slight_smile: ? I’m really looking forward to get started with the project, but can’t do so for now :-/.
Best,
François

Hi @dupirefr,

Sorry for late reply. Can you ping me on skype “julhas08” with your current issues?

Regards
Julhas

Hi @julhas,

Thanks for reaching out. I’ll try to get back at you during week days, but it may be in the weekend.

Regards,

François

Hi @julhas, can you help me with the same issue? I would like to contribute to the project.

Thanks,
Marco

Hi @marco,

Sure, you can ping me anytime.

Julhas

Thanks @julhas!

I have also followed the quick start instructions to setup dhis2 locally, but when I try to run the web-portal module (launching the mvn jetty:run command), I get the following error:

[ **INFO** ] jetty-9.4.25.v20191220; built: 2019-12-20T17:00:00.294Z; git: a9729c7e7f33a459d2616a8f9e9ba8a90f432e95; jvm 11.0.2+9-LTS

[ **WARNING** ] Failed startup of context o.e.j.m.p.JettyWebAppContext@2f0e7fa8{/,[file:///Users/marcolecce/git/dhis2-core/dhis-2/dhis-web/dhis-web-portal/src/main/webapp/, file:///Users/marcolecce/git/dhis2-core/dhis-2/dhis-web/dhis-web-portal/target/jetty_overlays/release-documentation-2_3_2-docbook_zip/, file:///Users/marcolecce/git/dhis2-core/dhis-2/dhis-web/dhis-web-portal/target/jetty_overlays/samples-2_3_2_zip/, file:///Users/marcolecce/git/dhis2-core/dhis-2/dhis-web/dhis-web-portal/target/jetty_overlays/dhis-web-commons-resources-2_35-SNAPSHOT_war/, file:///Users/marcolecce/git/dhis2-core/dhis-2/dhis-web/dhis-web-portal/target/jetty_overlays/dhis-web-uaa-2_35-SNAPSHOT_war/, file:///Users/marcolecce/git/dhis2-core/dhis-2/dhis-web/dhis-web-portal/target/jetty_overlays/dhis-web-dataentry-2_35-SNAPSHOT_war/, file:///Users/marcolecce/git/dhis2-core/dhis-2/dhis-web/dhis-web-portal/target/jetty_overlays/dhis-web-maintenance-mobile-2_35-SNAPSHOT_war/, file:///Users/marcolecce/git/dhis2-core/dhis-2/dhis-web/dhis-web-portal/target/jetty_overlays/dhis-web-approval-2_35-SNAPSHOT_war/, file:///Users/marcolecce/git/dhis2-core/dhis-2/dhis-web/dhis-web-portal/target/jetty_overlays/dhis-web-apps-2_35-SNAPSHOT_war/],UNAVAILABLE}{file:///Users/marcolecce/git/dhis2-core/dhis-2/dhis-web/dhis-web-portal/src/main/webapp/}

**java.lang.IllegalStateException** : **Duplicate fragment name: spring_web for jar:file:///Users/marcolecce/git/dhis2-core/dhis-2/dhis-web/dhis-web-portal/target/jetty_overlays/dhis-web-uaa-2_35-SNAPSHOT_war/WEB-INF/lib/spring-web-5.2.4.RELEASE.jar!/META-INF/web-fragment.xml and jar:file:///Users/marcolecce/.m2/repository/org/springframework/spring-web/5.2.4.RELEASE/spring-web-5.2.4.RELEASE.jar!/META-INF/web-fragment.xml**

**at** org.eclipse.jetty.webapp.MetaData.addFragment ( **MetaData.java:283** )

**at** org.eclipse.jetty.webapp.FragmentConfiguration.addWebFragments ( **FragmentConfiguration.java:82** )

**at** org.eclipse.jetty.webapp.FragmentConfiguration.preConfigure ( **FragmentConfiguration.java:38** )

**at** org.eclipse.jetty.webapp.WebAppContext.preConfigure ( **WebAppContext.java:488** )

**at** org.eclipse.jetty.webapp.WebAppContext.doStart ( **WebAppContext.java:523** )

**at** org.eclipse.jetty.maven.plugin.JettyWebAppContext.doStart ( **JettyWebAppContext.java:397** )

**at** org.eclipse.jetty.util.component.AbstractLifeCycle.start ( **AbstractLifeCycle.java:72** )

**at** org.eclipse.jetty.util.component.ContainerLifeCycle.start ( **ContainerLifeCycle.java:169** )

**at** org.eclipse.jetty.util.component.ContainerLifeCycle.doStart ( **ContainerLifeCycle.java:117** )

**at** org.eclipse.jetty.server.handler.AbstractHandler.doStart ( **AbstractHandler.java:100** )

**at** org.eclipse.jetty.util.component.AbstractLifeCycle.start ( **AbstractLifeCycle.java:72** )

**at** org.eclipse.jetty.util.component.ContainerLifeCycle.start ( **ContainerLifeCycle.java:169** )

**at** org.eclipse.jetty.util.component.ContainerLifeCycle.doStart ( **ContainerLifeCycle.java:117** )

**at** org.eclipse.jetty.server.handler.AbstractHandler.doStart ( **AbstractHandler.java:100** )

**at** org.eclipse.jetty.util.component.AbstractLifeCycle.start ( **AbstractLifeCycle.java:72** )

**at** org.eclipse.jetty.util.component.ContainerLifeCycle.start ( **ContainerLifeCycle.java:169** )

**at** org.eclipse.jetty.server.Server.start ( **Server.java:407** )

**at** org.eclipse.jetty.util.component.ContainerLifeCycle.doStart ( **ContainerLifeCycle.java:110** )

**at** org.eclipse.jetty.server.handler.AbstractHandler.doStart ( **AbstractHandler.java:100** )

**at** org.eclipse.jetty.server.Server.doStart ( **Server.java:371** )

**at** org.eclipse.jetty.util.component.AbstractLifeCycle.start ( **AbstractLifeCycle.java:72** )

**at** org.eclipse.jetty.maven.plugin.AbstractJettyMojo.startJetty ( **AbstractJettyMojo.java:450** )

**at** org.eclipse.jetty.maven.plugin.AbstractJettyMojo.execute ( **AbstractJettyMojo.java:311** )

**at** org.eclipse.jetty.maven.plugin.JettyRunMojo.execute ( **JettyRunMojo.java:152** )

**at** org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo ( **DefaultBuildPluginManager.java:137** )

**at** org.apache.maven.lifecycle.internal.MojoExecutor.execute ( **MojoExecutor.java:210** )

**at** org.apache.maven.lifecycle.internal.MojoExecutor.execute ( **MojoExecutor.java:156** )

**at** org.apache.maven.lifecycle.internal.MojoExecutor.execute ( **MojoExecutor.java:148** )

**at** org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject ( **LifecycleModuleBuilder.java:117** )

**at** org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject ( **LifecycleModuleBuilder.java:81** )

**at** org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build ( **SingleThreadedBuilder.java:56** )

**at** org.apache.maven.lifecycle.internal.LifecycleStarter.execute ( **LifecycleStarter.java:128** )

**at** org.apache.maven.DefaultMaven.doExecute ( **DefaultMaven.java:305** )

**at** org.apache.maven.DefaultMaven.doExecute ( **DefaultMaven.java:192** )

**at** org.apache.maven.DefaultMaven.execute ( **DefaultMaven.java:105** )

**at** org.apache.maven.cli.MavenCli.execute ( **MavenCli.java:956** )

**at** org.apache.maven.cli.MavenCli.doMain ( **MavenCli.java:288** )

**at** org.apache.maven.cli.MavenCli.main ( **MavenCli.java:192** )

**at** jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 ( **Native Method** )

**at** jdk.internal.reflect.NativeMethodAccessorImpl.invoke ( **NativeMethodAccessorImpl.java:62** )

**at** jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke ( **DelegatingMethodAccessorImpl.java:43** )

**at** java.lang.reflect.Method.invoke ( **Method.java:566** )

**at** org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced ( **Launcher.java:289** )

**at** org.codehaus.plexus.classworlds.launcher.Launcher.launch ( **Launcher.java:229** )

**at** org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode ( **Launcher.java:415** )

**at** org.codehaus.plexus.classworlds.launcher.Launcher.main ( **Launcher.java:356** )

[ **INFO** ] Started ServerConnector@333d5a0c{HTTP/1.1,[http/1.1]}{0.0.0.0:8080}

[ **INFO** ] Started @24848ms

Can you help me?

Thanks,
Marco

Why not post the solution here, for those of you who have received help on Skype. It’s “a bit” inefficient if every new developer has to call someone on Skype to get started. :upside_down_face: