hapi-fhir-jpaserver-starter icon indicating copy to clipboard operation
hapi-fhir-jpaserver-starter copied to clipboard

Can't resolve the 404 error

Open krisdas73 opened this issue 4 years ago • 9 comments

I have build the module in IntelliJ and have the ROOT.war file. Deployed the WAR in Apache Tomcat, and while accessing http://localhost:8080/fhir/metadata, I am getting:

HTTP Status 404 – Not Found Type Status Report

Message The requested resource [/fhir/metadata] is not available

Description The origin server did not find a current representation for the target resource or is not willing to disclose that one exists.

Do I need to update any source code or configuration? Thankn you.

krisdas73 avatar Feb 20 '21 21:02 krisdas73

Can you try with below path, I also face the same problem http://localhost:8080/ROOT/fhir/metadata

shubhamparikh927 avatar Feb 23 '21 11:02 shubhamparikh927

Try this:

http://localhost:8080/metadata

On Tue, Feb 23, 2021 at 6:53 AM Shubham Parikh [email protected] wrote:

Can you try with below path, I also face the same problem http://localhost:8080/ROOT/fhir/metadata

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/hapifhir/hapi-fhir-jpaserver-starter/issues/213#issuecomment-784147062, or unsubscribe https://github.com/notifications/unsubscribe-auth/ARFQKGKN2N67TSXWJYCD3WLTAOJKJANCNFSM4X6IFCKQ .

KevinDougan avatar Feb 23 '21 12:02 KevinDougan

Tried both, but still same issue.

krisdas73 avatar Mar 01 '21 20:03 krisdas73

Under the http://localhost:8080/manager/html/, I can see the following:

Path: / Version:None Specified

Any idea, why it is not showing? It got deployed.

krisdas73 avatar Mar 03 '21 14:03 krisdas73

The Dockerfile actually deploys the war file to Tomcat (https://github.com/hapifhir/hapi-fhir-jpaserver-starter/blob/master/Dockerfile#L28). I don't see any errors when running the service from Docker @krisdas73

jkiddo avatar Jun 26 '21 19:06 jkiddo

Could you please share your configurations?

fragaLY avatar Jul 02 '21 08:07 fragaLY

I am facing the same issue. I just pulled the docker and ran the command.. server is up but I am seeing 404 no matter what resource endpoint or /metdata i try. Check the screenshot image

and in CLI i have noticed this some URLMalformed error :

image

Some class format Exception :

image

RafiqueMohammed avatar Sep 16 '21 11:09 RafiqueMohammed

I guess you need to keep coherence in several configurations:

  • In the application.yaml: server.servlet.context-path, hapi.fhir.server_address and hapi.fhir.tester.home.server_address, packaging war/jar...
  • In the pom you could set the target generated WAR file other that the default ROOT.war
    • build>finalName>${project.artifactId}
    • If using jetty to boot it, jetty-maven-plugin:configuration>webApp>contextPath>/${project.artifactId}
    • If using just spring boot, the previous context-path should be ok, note there is a re-build! when using the boot profile, that changes the structure of the generated artifact
  • In the Dockerfile, depending on how you boot later the app (spring boot? placing the war in a tomcat?), rename and place the proper file: COPY --from=build-hapi --chown=1001:1001 /tmp/hdh-cdr/target/{theProjectArtifactId}.war /opt/bitnami/tomcat/webapps/theProjectArtifactId}.war CMD ["java", "-jar", "/app/{theProjectArtifactId}.war"]

albertoacebeseviden avatar May 10 '23 16:05 albertoacebeseviden

Hi, I am facing the same issue. I can run the application locally with Jetty and Spring Boot. However after I do a clean build with "mvn clean install" or "mvn clean package" and drop the ROOT.war to webapps in standalone Tomcat, I keep getting the 404 for localhost:8080 or localhost:8080/fhir. I am deploying it to the root in Tomcat so I am guessing I do not need to any configurative changes in any of the files (such as application.yaml). I am also using he default settings for the H2 DB.

Unlike the OP, I don't get any errors / stack traces on deployment to Tomcat, nothing in the server logs too.

Any one know how to resolve this 404?

dinipc avatar Aug 11 '23 22:08 dinipc

Closing as stale

jkiddo avatar Apr 17 '24 05:04 jkiddo