【问题标题】:WAR not deploying on Tomcat [NameNotFoundException]WAR 未在 Tomcat 上部署 [NameNotFoundException]
【发布时间】:2018-09-17 18:44:25
【问题描述】:

我正在尝试在 Tomcat 上部署 WAR,但我的一些环境变量中出现异常,就像这个一样

javax.naming.NameNotFoundException: Name [smartconnect.filestorelocation] is not bound in this Context.

我在 server.xml 中的 Environment 标签中有名称

  <Environment name="smartconnect.filestorelocation" value="/var/www/html/me/smart/filestore" type="java.lang.String" override="false" />
  <Environment name="smartconnect.dataqueue_cleanup_days" value="30" type="java.lang.Integer" override="false" /> 
  <Environment name="smartconnect.spatial_ref_sys_table" value="public.spatial_ref_sys" type="java.lang.String" override="false" />
  <Environment name="smartconnect.number_background_threads" value="5" type="java.lang.Integer" override="false" />
  <Environment name="smartconnect.work_item_history_days_available" value="5" type="java.lang.Integer" override="false" />
  <Environment name="smartconnect.changelog_cleanup_days" value="5" type="java.lang.Integer" override="false" />
  <Environment name="smartconnect.ca_export_days_available" value="5" type="java.lang.Integer" override="false" />
  <Environment name="smartconnect.sync_download_hours_available" value="5" type="java.lang.Integer" override="false" />
  <Environment name="smartconnect.cleanup_task_interval_hours" value="5" type="java.lang.Integer" override="false" />

服务器的context.xml是这样的:

<Context>

<Realm className="org.apache.catalina.realm.LockOutRealm">
    <Realm className="org.apache.catalina.realm.DataSourceRealm"
        dataSourceName="jdbc/smart"
        userTable="connect.users" userNameCol="username" 
        userCredCol="password" userRoleTable="connect.user_roles" roleNameCol="role_id"
        localDataSource="true">
        <CredentialHandler className="org.wcs.smart.connect.apache.BcryptCredentialHandler"/>
    </Realm>
</Realm>

<ResourceLink global="org.wcs.smart.connect.datasource.postgresql" name="jdbc/smart"/>
<ResourceLink global="smartconnect.filestorelocation" name="smartconnect.filestorelocation"/>
<ResourceLink global="smartconnect.dataqueue_cleanup_days" name="smartconnect.dataqueue_cleanup_days"/>
<ResourceLink global="smartconnect.spatial_ref_sys_table" name="smartconnect.spatial_ref_sys_table"/>
<ResourceLink global="smartconnect.number_background_threads" name="smartconnect.number_background_threads"/>
<ResourceLink global="smartconnect.work_item_history_days_available" name="smartconnect.work_item_history_days_available"/>
<ResourceLink global="smartconnect.changelog_cleanup_days" name="smartconnect.changelog_cleanup_days"/>
<ResourceLink global="smartconnect.ca_export_days_available" name="smartconnect.ca_export_days_available"/>
<ResourceLink global="smartconnect.sync_download_hours_available" name="smartconnect.sync_download_hours_available"/>
<ResourceLink global="smartconnect.cleanup_task_interval_hours" name="smartconnect.cleanup_task_interval_hours"/>
<ResourceLink global="mail/Session" name="mail/Session"/>
</Context>

有人知道我该如何解决这个错误吗?

提前致谢。

【问题讨论】:

    标签: tomcat8


    【解决方案1】:

    为什么在 context.xml 中有 [smartconnect.filestorelocation] 变量,而在 server.xml 中没有?我认为您在 context.xml 中引用了未在 server.xml 中定义的变量 smartconnect.filestorelocation

    【讨论】:

    • 对不起,我没有在我的帖子中复制那行,但它在 server.xml 中。我现在已经编辑过了。
    猜你喜欢
    • 1970-01-01
    • 2010-09-13
    • 2012-07-29
    • 2015-05-08
    • 2017-11-08
    • 2015-10-26
    • 2015-05-29
    • 1970-01-01
    • 2016-08-11
    相关资源
    最近更新 更多