WarBuild -tomcat9 issue - error 404 after depoyment

Hi,

From the documentation of Jmix & cuba i found how to build & deploy a war file.

@SpringBootApplication
@Configuration
@PropertySource(value = { "classpath:application.properties" })
public class FlexidataApplication extends SpringBootServletInitializer {

	public static void main(String[] args) {
		SpringApplication.run(FlexidataApplication.class, args);
	}



	@Override
	protected SpringApplicationBuilder configure(SpringApplicationBuilder builder) {
		return builder.sources(SpringApplication.class);
	}

	@Bean
	@Primary
	@ConfigurationProperties(prefix="main.datasource")
	DataSource dataSource() {
		return DataSourceBuilder.create().build();
	}
}

This is the code that I added as well as in the application.properties. However when deploying I’m always getting a 404 error

jelastic stack
Tomcat 9
java 11

I also tested this with the basic setup (new project & run) that has the same result.

Hi,
We had some problems with deployable WAR file.
See ticket: https://github.com/Haulmont/jmix-core/issues/155
It’s resolved in the Jmix 1.0.0 which will be released soon.

Hi

Unfortunately this is not fixed with version 1.0.1

there a re not logs to speak of indicating any issue. The war deployment itself went without any problem or error in tomcat (jelastic)

Please help.

I’m sorry, but if there aren’t any logs that indicate the root cause of the problem, how anyone could help?

Do you expect forum members guessing possible causes one by one?
Well,

  • the most probable reason is database connection properties specified incorrectly
  • or wrong version of Java
  • or unwriteable temporary directory

Honestly, I would suggest you to switch the deployment platform to the platform that provides enough troubleshooting information when something goes wrong.

Hi,

I do understand that without logs this is hard.

Database connection was verified to work with the jar compilation - I do understand that postgresql is a more tricky customer (from other similar issues on the forums here)

  • Java version was aligned: openjdk java 11
  • Tomcat v9

Sample war file deployment works fine on both ROOT & /sample locations

14-Sep-2021 07:35:07.665 INFO [main] org.apache.catalina.core.StandardEngine.startInternal Starting Servlet engine: [Apache Tomcat/9.0.50]
14-Sep-2021 07:35:07.693 INFO [main] org.apache.catalina.startup.HostConfig.deployWAR Deploying web application archive [/opt/tomcat/webapps/sample.war]
14-Sep-2021 07:35:08.354 INFO [main] org.apache.catalina.startup.HostConfig.deployWAR Deployment of web application archive [/opt/tomcat/webapps/sample.war] has finished in [659] ms
14-Sep-2021 07:35:08.355 INFO [main] org.apache.catalina.startup.HostConfig.deployWAR Deploying web application archive [/opt/tomcat/webapps/ROOT.war]
14-Sep-2021 07:35:23.860 INFO [main] org.apache.catalina.startup.HostConfig.deployWAR Deployment of web application archive [/opt/tomcat/webapps/ROOT.war] has finished in [15,505] ms
14-Sep-2021 07:35:23.861 INFO [main] org.apache.catalina.startup.HostConfig.deployWAR Deploying web application archive [/opt/tomcat/webapps/ARekegCRM.war]
14-Sep-2021 07:35:33.631 INFO [main] org.apache.catalina.startup.HostConfig.deployWAR Deployment of web application archive [/opt/tomcat/webapps/ARekegCRM.war] has finished in [9,770] ms
14-Sep-2021 07:35:33.649 INFO [main] org.apache.coyote.AbstractProtocol.start Starting ProtocolHandler [“http-nio-80”]
14-Sep-2021 07:35:33.713 INFO [main] org.apache.coyote.AbstractProtocol.start Starting ProtocolHandler [“http-nio-8080”]
14-Sep-2021 07:35:33.716 INFO [main] org.apache.coyote.AbstractProtocol.start Starting ProtocolHandler [“ajp-nio-127.0.0.1-8009”]
14-Sep-2021 07:35:33.719 INFO [main] org.apache.catalina.startup.Catalina.start Server startup in [26192] milliseconds

Is there anything specific for jelastic cloud ? (One Click Cloud Deployment with Jelastic – Jmix)

According to the startrup log, all web applications have started successfully.
So “/ARekegCRM” just answers with 404 ?

If you try to deploy the same WAR file locally to the normal Tomcat 9 server with the same web app name - does it start and serve requests normally?

Hi,

Fixed it :smile:

Seems that what I forgot to add:

@SpringBootApplication
@PropertySource(“file:application.properties”)
public class ArekegcrmApplication extends SpringBootServletInitializer {

Maybe you could add this in the deployment documentation for the war file?

1 Like