关于java:Spring部署设置openshift | 珊瑚贝

Spring deployment settings openshift


我有一个问题让我抓狂了三天。

我根据 OpenShift 帐户上的教程部署了 spring-eap6-quickstart 代码。我已配置调试选项,并且已将 Eclipse 工作区与 OpehShift 服务器同步 – 服务器上的一切工作正常,但在 Eclipse 中出现无法消除的错误。

我有这个错误:

1
cvccomplextype.2.4.a: Invalid content was found starting with element ‘deployment’. One of ‘{ear-subdeployments-isolated, deployment, sub-deployment, module}’ is expected.   jbossdeploymentstructure.xml  /springeap6quickstart/src/main/webapp/WEBINF line 2

这表示部署标签上的错误。

我的 jboss 部署结构 xml 是:

1
2
3
4
5
6
7
8
9
10
<jbossdeploymentstructure xmlns=“urn:jboss:deployment-structure:1.0”>
   <deployment>
       <dependencies>
            <module name=“com.h2database.h2”/>
            <module name=“org.codehaus.jackson.jackson-core-asl”/>
            <module name=“org.codehaus.jackson.jackson-mapper-asl”/>
            <module name=“org.slf4j”/>
       </dependencies>
   </deployment>
</jbossdeploymentstructure>

当我将部署结构更改为:

1
<jbossdeploymentstructure xmlns=“urn:jboss:deployment-structure:2.0”>

eclipse 中的这个更改纠正了错误,但随后应用程序无法在 OpenShift 服务器上运行。

我意识到问题出在设置中,但我不知道如何解决问题。有谁知道我必须做什么?请帮忙。谢谢。


使用 urn:jboss:deployment-structure:1.0 时,您的 xml 绝对有效。不幸的是,jbossas 部署结构方案中存在错误,因此 Eclipse 会抱怨:

https://issues.jboss.org/browse/JBIDE-15311

将引用方案的版本升级到 2.0 通过引用一个不存在的方案在 Eclipse 中修复它,2.0 尚不存在。因此 OpenShift 将失败。目前有 1.0、1.1 和 1.2。即将到来的 2.0 应该修复该方案,从而使 Eclipse 正确验证。但不幸的是,我们还没有到达那里。我建议您只需关闭验证,全部或仅方案验证:Window->Preferences->Validation:

validation


更新您的 xml 以定义命名空间,即:

1
2
3
4
5
6
7
8
<?xml version=“1.0” encoding=“UTF-8”?>
<jds:jbossdeploymentstructure xmlns:jds=“urn:jboss:deployment-structure:1.0”>
  <deployment>
    <dependencies>
      <module name=“org.dom4j” />
    </dependencies>
  </deployment>
</jds:jbossdeploymentstructure>

来源:https://www.codenong.com/20466351/

微信公众号
手机浏览(小程序)

Warning: get_headers(): SSL operation failed with code 1. OpenSSL Error messages: error:14090086:SSL routines:ssl3_get_server_certificate:certificate verify failed in /mydata/web/wwwshanhubei/web/wp-content/themes/shanhuke/single.php on line 57

Warning: get_headers(): Failed to enable crypto in /mydata/web/wwwshanhubei/web/wp-content/themes/shanhuke/single.php on line 57

Warning: get_headers(https://static.shanhubei.com/qrcode/qrcode_viewid_8698.jpg): failed to open stream: operation failed in /mydata/web/wwwshanhubei/web/wp-content/themes/shanhuke/single.php on line 57
0
分享到:
没有账号? 忘记密码?