WebLogic部署成功,但出现错误

时间:2018-08-30 14:57:58

标签: java weblogic12c bean-validation dtd

我们正在将运行在Java 6上的WebLogic 10升级到运行在Java 8上的WebLogic 12C。

最初,我无法在WebLogic 12C上部署我的应用程序。我认为,使用以下命令,我应该更新“ WEB_APPLICATION” .ear文件中的几个 ejb-jar.xml 文件,以克服验证错误。

  

java weblogic.DDConverter -d。 “ WEB_APPLICATION”。耳朵

确切地说,我已经更新了所有“消息驱动的目标” 标签,以与新版本的Java和WebLogic兼容。例如,我的 ejb-jar.xml 文件之一看起来像波纹管

<?xml version="1.0" encoding="UTF-8"?>
<ejb-jar xmlns="http://xmlns.jcp.org/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="3.2">
    <display-name>CacheNotificationsMDBeanModule</display-name>
    <enterprise-beans>
    <message-driven>
      <description>Message driven bean for cache notifications</description>
      <display-name>CacheNotificationsMDB</display-name>
      <ejb-name>CacheNotificationsMDB</ejb-name>
      <ejb-class>com.cache.CacheNotificationsMDB</ejb-class>
      <transaction-type>Bean</transaction-type>   
      <activation-config>
        <activation-config-property>
          <activation-config-property-name>destinationType</activation-config-property-name>
          <activation-config-property-value>javax.jms.Topic</activation-config-property-value>
        </activation-config-property>
        <activation-config-property>
          <activation-config-property-name>subscription-durability</activation-config-property-name>
          <activation-config-property-value>NonDurable</activation-config-property-value>
        </activation-config-property>
      </activation-config>    
    </message-driven>
    </enterprise-beans>
    <assembly-descriptor>
    <container-transaction>
      <method>
        <ejb-name>CacheNotificationsMDB</ejb-name>
        <method-name>*</method-name>
      </method>
      <trans-attribute>NotSupported</trans-attribute>
    </container-transaction>
    </assembly-descriptor>
</ejb-jar>

尽管我现在可以部署我的应用程序,但仍收到以下消息和错误。

  

<**********> <******> <[ACTIVE] ExecuteThread:'19'   对于队列:'weblogic.kernel.Default(自我调整)'> <> <>   <37954930-b27e-4d11-86e2-87dc139d7fda-00000012> <1535573307036>   <[severity-value:16] [rid:0] [partition-id:0] [partition-name:   DOMAIN]>,EJBComponent:   common-utils-mdbs.jar)配置为未知   激活配置属性名称subscription-durability>

     

<**********> <******> <[待机]   ExecuteThread:队列为'1':'weblogic.kernel.Default(自调整)'>    <> <37954930-b27e-4d11-86e2-87dc139d7fda-00000007>   <1535573336247> <[severity-value:16] [rid:0] [partition-id:0]   [分区名:DOMAIN]> /kuy712/war/WEB-INF/validation.xml,不符合JSR 303规范。>

     

<**********> <******> <[STANDBY] ExecuteThread:'1'表示队列:   'weblogic.kernel.Default(自我调整)'> <>   <37954930-b27e-4d11-86e2-87dc139d7fda-00000007> <1535573336243>   <[severity-value:32] [rid:0] [partition-id:0] [partition-name:   DOMAIN]>

指定目录中的 validation.xml 文件如下所示

<!DOCTYPE form-validation PUBLIC
          "-//Apache Software Foundation//DTD Commons Validator Rules Configuration 1.1//EN"
          "dtds/validator_1_1_3.dtd">
<form-validation>

  <!--  Default locale validation -->

  <!--  Some of the example validation in the default formset are diabled for now,
    but can be enabled and customized as needed
    for your default and other formsets formset. Note that http://www.regexlib.com/ may
    contain usefull regular expressions to apply to your customization
    with the "mask" validator! -->
  <formset>
    .......

validator_1_1_3.dtd 文件位于以下目录中。

  

/ u01 / app / oracle / config / domains / Domainlab / servers / ******** / tmp / _WL_user // kuy712 / war / WEB-INF / dtds

我是weblogic的新手,不确定如何解决此问题。有人可以帮我吗?

1 个答案:

答案 0 :(得分:1)

您的ejb-jar.xml应该是:

<?xml version="1.0" encoding="UTF-8"?>
<ejb-jar xmlns="http://xmlns.jcp.org/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="3.2">
    <display-name>CacheNotificationsMDBeanModule</display-name>
    <enterprise-beans>
    <message-driven>
      <description>Message driven bean for cache notifications</description>
      <display-name>CacheNotificationsMDB</display-name>
      <ejb-name>CacheNotificationsMDB</ejb-name>
      <ejb-class>com.cache.CacheNotificationsMDB</ejb-class>
      <transaction-type>Bean</transaction-type>   
      <activation-config>
        <activation-config-property>
          <activation-config-property-name>destinationType</activation-config-property-name>
          <activation-config-property-value>javax.jms.Topic</activation-config-property-value>
        </activation-config-property>
        <activation-config-property>
          <activation-config-property-name>subscriptionDurability</activation-config-property-name>
          <activation-config-property-value>NonDurable</activation-config-property-value>
        </activation-config-property>
      </activation-config>    
    </message-driven>
    </enterprise-beans>
    <assembly-descriptor>
    <container-transaction>
      <method>
        <ejb-name>CacheNotificationsMDB</ejb-name>
        <method-name>*</method-name>
      </method>
      <trans-attribute>NotSupported</trans-attribute>
    </container-transaction>
    </assembly-descriptor>
</ejb-jar>

允许的属性名称为:cknowledgeMode,messageSelector,destinationType,subscriptionDurability,destinationLookup,connectionFactoryLookup,subscriptionName和clientId。不允许订阅持久性。