在openshift中运行项目后空白页面打开 [英] Blank page opening after running a project in openshift

查看:173
本文介绍了在openshift中运行项目后空白页面打开的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在openshift中部署了一个Web应用程序。尽管构建和部署很成功,但点击应用程序后我得到一个空白页面:



http://adoreindia-adoreindia.a3c1.starter-us-west-1.openshiftapps.com/



下面是pom.xml。

 < project xmlns =http:// maven.apache.org/POM/4.0.0xmlns:xsi =http://www.w3.org/2001/XMLSchema-instancexsi:schemaLocation =http://maven.apache.org/POM/ 4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd\"> 
< modelVersion> 4.0.0< / modelVersion>
< groupId> org.adore.india.actions< / groupId>
< artifactId> Adore_india_project< / artifactId>
< version> 0.0.1-SNAPSHOT< / version>
<包装>战争< / packaging>
<依赖关系>
<! - https://mvnrepository.com/artifact/javax.servlet/javax.servlet-api - >
< dependency>
< groupId> javax.servlet< / groupId>
< artifactId> javax.servlet-api< / artifactId>
< version> 3.1.0< / version>
< scope>提供< / scope>
< /依赖关系>
< dependency>
< groupId> org.ow2.asm< / groupId>
< artifactId> asm< / artifactId>
< version> 5.1< / version>
< /依赖关系>
< dependency>
< groupId> commons-fileupload< / groupId>
< artifactId> commons-fileupload< / artifactId>
< version> 1.3.3< / version>
< /依赖关系>
< dependency>
< groupId> org.apache.commons< / groupId>
< artifactId> commons-lang3< / artifactId>
< version> 3.6< / version>
< /依赖关系>
< dependency>
< groupId> commons-logging< / groupId>
< artifactId> commons-logging< / artifactId>
< version> 1.1.3< / version>
< /依赖关系>
< dependency>
< groupId> org.freemarker< / groupId>
< artifactId> freemarker< / artifactId>
< version> 2.3.23< / version>
< /依赖关系>
< dependency>
< groupId> org.javassist< / groupId>
< artifactId> javassist< / artifactId>
< version> 3.20.0-GA< / version>
< /依赖关系>
< dependency>
< groupId> org.apache.logging.log4j< / groupId>
< artifactId> log4j-api< / artifactId>
< version> 2.8.2< / version>
< /依赖关系>
< dependency>
< groupId> org.apache.logging.log4j< / groupId>
< artifactId> log4j-core< / artifactId>
< version> 2.3< / version>
< /依赖关系>
< dependency>
< groupId> ognl< / groupId>
< artifactId> ognl< / artifactId>
< version> 3.1.12< / version>
< /依赖关系>
< dependency>
< groupId> com.jgeppert.struts2.bootstrap< / groupId>
< artifactId> struts2-bootstrap-plugin< / artifactId>
< version> 2.5.1< / version>
< /依赖关系>
< dependency>
< groupId> org.apache.struts< / groupId>
< artifactId> struts2-convention-plugin< / artifactId>
< version> 2.5.12< / version>
< /依赖关系>
< dependency>
< groupId> org.apache.struts< / groupId>
< artifactId> struts2-core< / artifactId>
< version> 2.5.12< / version>
< /依赖关系>
< /依赖关系>
< build>
< sourceDirectory> src< / sourceDirectory>
<资源>
< resource>
<目录> src< /目录>
<排除>
< exclude> ** / *。java< / exclude>
< /不包括>
< / resource>
< /资源>
< plugins>
< plugin>
< artifactId> maven-compiler-plugin< / artifactId>
< version> 3.5.1< / version>
<配置>
< source> 1.8< / source>
< target> 1.8< / target>
< / configuration>
< / plugin>
< plugin>
< artifactId> maven-war-plugin< / artifactId>
< version> 3.0.0< / version>
<配置>
< warSourceDirectory> WebContent< / warSourceDirectory>
< / configuration>
< / plugin>
< / plugins>
< / build>
<个人资料>
<个人资料>
< id> openshift< / id>
< build>
< finalName> Adore_india_project< / finalName>
< plugins>
< plugin>
< artifactId> maven-war-plugin< / artifactId>
< version> 3.0.0< / version>
<配置>
< outputDirectory> webapps< / outputDirectory>
< warName> ROOT< / warName>
< / configuration>
< / plugin>
< / plugins>
< / build>
< / profile>
< / profiles>
< / project>

该应用程序在本地系统中运行良好。请建议如何解决该问题。

解决方案

删除配置文件标记并更正上下文根,artifact id为您的-context-root-name 已解决此问题。



应用程序网址 -



http://adoreindia-project-adore-india-project.a3c1.starter-us-west-1.openshiftapps.com/your-context-root-name-0.0.1-SNAPSHOT/



下面是修改的pom.xml。

 < project xmlns = http://maven.apache.org/POM/4.0.0xmlns:xsi =http://www.w3.org/2001/XMLSchema-instancexsi:schemaLocation =http://maven.apache。 org / POM / 4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd\"> 
< modelVersion> 4.0.0< / modelVersion>
< groupId> org.adore.india.actions< / groupId>
< artifactId> adore-india-project< / artifactId>
< version> 0.0.1-SNAPSHOT< / version>
<包装>战争< / packaging>
<依赖关系>
<! - https://mvnrepository.com/artifact/javax.servlet/javax.servlet-api - >
< dependency>
< groupId> javax.servlet< / groupId>
< artifactId> javax.servlet-api< / artifactId>
< version> 3.1.0< / version>
< scope>提供< / scope>
< /依赖关系>
< dependency>
< groupId> org.ow2.asm< / groupId>
< artifactId> asm< / artifactId>
< version> 5.1< / version>
< /依赖关系>
< dependency>
< groupId> commons-fileupload< / groupId>
< artifactId> commons-fileupload< / artifactId>
< version> 1.3.3< / version>
< /依赖关系>
< dependency>
< groupId> org.apache.commons< / groupId>
< artifactId> commons-lang3< / artifactId>
< version> 3.6< / version>
< /依赖关系>
< dependency>
< groupId> commons-logging< / groupId>
< artifactId> commons-logging< / artifactId>
< version> 1.1.3< / version>
< /依赖关系>
< dependency>
< groupId> org.freemarker< / groupId>
< artifactId> freemarker< / artifactId>
< version> 2.3.23< / version>
< /依赖关系>
< dependency>
< groupId> org.javassist< / groupId>
< artifactId> javassist< / artifactId>
< version> 3.20.0-GA< / version>
< /依赖关系>
< dependency>
< groupId> org.apache.logging.log4j< / groupId>
< artifactId> log4j-api< / artifactId>
< version> 2.8.2< / version>
< /依赖关系>
< dependency>
< groupId> org.apache.logging.log4j< / groupId>
< artifactId> log4j-core< / artifactId>
< version> 2.3< / version>
< /依赖关系>
< dependency>
< groupId> ognl< / groupId>
< artifactId> ognl< / artifactId>
< version> 3.1.12< / version>
< /依赖关系>
< dependency>
< groupId> com.jgeppert.struts2.bootstrap< / groupId>
< artifactId> struts2-bootstrap-plugin< / artifactId>
< version> 2.5.1< / version>
< /依赖关系>
< dependency>
< groupId> org.apache.struts< / groupId>
< artifactId> struts2-convention-plugin< / artifactId>
< version> 2.5.12< / version>
< /依赖关系>
< dependency>
< groupId> org.apache.struts< / groupId>
< artifactId> struts2-core< / artifactId>
< version> 2.5.12< / version>
< /依赖关系>
< /依赖关系>
< build>
< sourceDirectory> src< / sourceDirectory>
<资源>
< resource>
<目录> src< /目录>
<排除>
< exclude> ** / *。java< / exclude>
< /不包括>
< / resource>
< /资源>
< plugins>
< plugin>
< artifactId> maven-compiler-plugin< / artifactId>
< version> 3.5.1< / version>
<配置>
< source> 1.8< / source>
< target> 1.8< / target>
< / configuration>
< / plugin>
< plugin>
< artifactId> maven-war-plugin< / artifactId>
< version> 3.0.0< / version>
<配置>
< warSourceDirectory> WebContent< / warSourceDirectory>
< / configuration>
< / plugin>
< / plugins>
< / build>
<! - <个人资料>
<个人资料>
< id> openshift< / id>
< build>
< finalName> Adore_india_project< / finalName>
< plugins>
< plugin>
< artifactId> maven-war-plugin< / artifactId>
< version> 3.0.0< / version>
<配置>
< outputDirectory> webapps< / outputDirectory>
< warName> ROOT< / warName>
< / configuration>
< / plugin>
< / plugins>
< / build>
< / profile>
< / profiles> - >
< / project>


I have deployed a web application in openshift. Although build and deployment was successful, I am getting a blank page on clicking the application :

http://adoreindia-adoreindia.a3c1.starter-us-west-1.openshiftapps.com/

Below is the pom.xml.

    <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
  <modelVersion>4.0.0</modelVersion>
  <groupId>org.adore.india.actions</groupId>
  <artifactId>Adore_india_project</artifactId>
  <version>0.0.1-SNAPSHOT</version>
  <packaging>war</packaging>
  <dependencies>
    <!-- https://mvnrepository.com/artifact/javax.servlet/javax.servlet-api -->
    <dependency>
        <groupId>javax.servlet</groupId>
        <artifactId>javax.servlet-api</artifactId>
        <version>3.1.0</version>
        <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>org.ow2.asm</groupId>
      <artifactId>asm</artifactId>
      <version>5.1</version>
    </dependency>
    <dependency>
      <groupId>commons-fileupload</groupId>
      <artifactId>commons-fileupload</artifactId>
      <version>1.3.3</version>
    </dependency>
    <dependency>
      <groupId>org.apache.commons</groupId>
      <artifactId>commons-lang3</artifactId>
      <version>3.6</version>
    </dependency>
    <dependency>
      <groupId>commons-logging</groupId>
      <artifactId>commons-logging</artifactId>
      <version>1.1.3</version>
    </dependency>
    <dependency>
      <groupId>org.freemarker</groupId>
      <artifactId>freemarker</artifactId>
      <version>2.3.23</version>
    </dependency>
    <dependency>
      <groupId>org.javassist</groupId>
      <artifactId>javassist</artifactId>
      <version>3.20.0-GA</version>
    </dependency>
    <dependency>
      <groupId>org.apache.logging.log4j</groupId>
      <artifactId>log4j-api</artifactId>
      <version>2.8.2</version>
    </dependency>
    <dependency>
      <groupId>org.apache.logging.log4j</groupId>
      <artifactId>log4j-core</artifactId>
      <version>2.3</version>
    </dependency>
    <dependency>
      <groupId>ognl</groupId>
      <artifactId>ognl</artifactId>
      <version>3.1.12</version>
    </dependency>
    <dependency>
      <groupId>com.jgeppert.struts2.bootstrap</groupId>
      <artifactId>struts2-bootstrap-plugin</artifactId>
      <version>2.5.1</version>
    </dependency>
    <dependency>
      <groupId>org.apache.struts</groupId>
      <artifactId>struts2-convention-plugin</artifactId>
      <version>2.5.12</version>
    </dependency>
    <dependency>
      <groupId>org.apache.struts</groupId>
      <artifactId>struts2-core</artifactId>
      <version>2.5.12</version>
    </dependency>
  </dependencies>
  <build>
    <sourceDirectory>src</sourceDirectory>
    <resources>
      <resource>
        <directory>src</directory>
        <excludes>
          <exclude>**/*.java</exclude>
        </excludes>
      </resource>
    </resources>
    <plugins>
      <plugin>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>3.5.1</version>
        <configuration>
          <source>1.8</source>
          <target>1.8</target>
        </configuration>
      </plugin>
      <plugin>
        <artifactId>maven-war-plugin</artifactId>
        <version>3.0.0</version>
        <configuration>
          <warSourceDirectory>WebContent</warSourceDirectory>
        </configuration>
      </plugin>
    </plugins>
  </build>
  <profiles>
        <profile>
            <id>openshift</id>
            <build>
                <finalName>Adore_india_project</finalName>
                <plugins>
                    <plugin>
                        <artifactId>maven-war-plugin</artifactId>
                        <version>3.0.0</version>
                        <configuration>
                            <outputDirectory>webapps</outputDirectory>
                            <warName>ROOT</warName>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>
</project>

The application is running fine in local system. Please suggest how do I resolve the issue.

解决方案

Removing profiles tag and correcting the context root, artifact id as your-context-root-name has resolved the issue.

Application url -

http://adoreindia-project-adore-india-project.a3c1.starter-us-west-1.openshiftapps.com/your-context-root-name-0.0.1-SNAPSHOT/

Below is the modified pom.xml.

    <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
  <modelVersion>4.0.0</modelVersion>
  <groupId>org.adore.india.actions</groupId>
  <artifactId>adore-india-project</artifactId>
  <version>0.0.1-SNAPSHOT</version>
  <packaging>war</packaging>
  <dependencies>
    <!-- https://mvnrepository.com/artifact/javax.servlet/javax.servlet-api -->
    <dependency>
        <groupId>javax.servlet</groupId>
        <artifactId>javax.servlet-api</artifactId>
        <version>3.1.0</version>
        <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>org.ow2.asm</groupId>
      <artifactId>asm</artifactId>
      <version>5.1</version>
    </dependency>
    <dependency>
      <groupId>commons-fileupload</groupId>
      <artifactId>commons-fileupload</artifactId>
      <version>1.3.3</version>
    </dependency>
    <dependency>
      <groupId>org.apache.commons</groupId>
      <artifactId>commons-lang3</artifactId>
      <version>3.6</version>
    </dependency>
    <dependency>
      <groupId>commons-logging</groupId>
      <artifactId>commons-logging</artifactId>
      <version>1.1.3</version>
    </dependency>
    <dependency>
      <groupId>org.freemarker</groupId>
      <artifactId>freemarker</artifactId>
      <version>2.3.23</version>
    </dependency>
    <dependency>
      <groupId>org.javassist</groupId>
      <artifactId>javassist</artifactId>
      <version>3.20.0-GA</version>
    </dependency>
    <dependency>
      <groupId>org.apache.logging.log4j</groupId>
      <artifactId>log4j-api</artifactId>
      <version>2.8.2</version>
    </dependency>
    <dependency>
      <groupId>org.apache.logging.log4j</groupId>
      <artifactId>log4j-core</artifactId>
      <version>2.3</version>
    </dependency>
    <dependency>
      <groupId>ognl</groupId>
      <artifactId>ognl</artifactId>
      <version>3.1.12</version>
    </dependency>
    <dependency>
      <groupId>com.jgeppert.struts2.bootstrap</groupId>
      <artifactId>struts2-bootstrap-plugin</artifactId>
      <version>2.5.1</version>
    </dependency>
    <dependency>
      <groupId>org.apache.struts</groupId>
      <artifactId>struts2-convention-plugin</artifactId>
      <version>2.5.12</version>
    </dependency>
    <dependency>
      <groupId>org.apache.struts</groupId>
      <artifactId>struts2-core</artifactId>
      <version>2.5.12</version>
    </dependency>
  </dependencies>
  <build>
    <sourceDirectory>src</sourceDirectory>
    <resources>
      <resource>
        <directory>src</directory>
        <excludes>
          <exclude>**/*.java</exclude>
        </excludes>
      </resource>
    </resources>
    <plugins>
      <plugin>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>3.5.1</version>
        <configuration>
          <source>1.8</source>
          <target>1.8</target>
        </configuration>
      </plugin>
      <plugin>
        <artifactId>maven-war-plugin</artifactId>
        <version>3.0.0</version>
        <configuration>
          <warSourceDirectory>WebContent</warSourceDirectory>
        </configuration>
      </plugin>
    </plugins>
  </build>
  <!-- <profiles>
        <profile>
            <id>openshift</id>
            <build>
                <finalName>Adore_india_project</finalName>
                <plugins>
                    <plugin>
                        <artifactId>maven-war-plugin</artifactId>
                        <version>3.0.0</version>
                        <configuration>
                            <outputDirectory>webapps</outputDirectory>
                            <warName>ROOT</warName>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles> -->
</project>

这篇关于在openshift中运行项目后空白页面打开的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆