문제

I'm trying to add a message driven bean to my existing Java EE application. I'm in the process of modifying my deployment descriptor ejb-jar.xml. My ejb-jar.xml looks like this.

    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE ejb-jar PUBLIC "-//Sun Microsystems, Inc.//DTD EnterpriseJavaBeans          2.0//EN" "http://java.sun.com/dtd/ejb-jar_2_0.dtd">
    <ejb-jar xmlns="http://java.sun.com/xml/ns/j2ee"  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" id="ejb-jar_1" version="2.1" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee/ejb-jar_2_1.xsd">
          ...
          <enterprise-beans>
                  ...
                  <session> 
                      ...
                      <service-ref> ... <service-ref>
                  </session>
                  <message-driven>
                        <ejb-name>Services</ejb-name>
                        <ejb-class>com.pega.pegarules.internal.etier.mdb.PRJMSListenerBoot</ejb-class>
                        <transaction-type>Container</transaction-type>
                        <message-driven-destination id="MessageDrivenDestination_Services">
                           <destination-type>javax.jms.Queue</destination-type>
                        </message-driven-destination>
                  </message-driven>
                    ...
       </ejb-jar>

When I try to deploy my application on websphere, it gives me the following error.

    [10/16/12 17:20:05:671 CDT] 00000024 webapp I com.ibm.ws.webcontainer.webapp.WebApp log SRVE0292I: Servlet Message -   [isclite#isclite.war]:.action: ApplicationDeploymentDetailForm was null.Creating new form bean and storing in session 
    [10/16/12 17:20:19:524 CDT] 00000046 wtp W Parse exception for [ public ID [ null ] and system ID [ null ] ] [ java.lang.IllegalStateException: Parent Translator (EnterpriseBeansTranslator(entity|session|message-driven,1696032023)) did not find a Child Translator for "message-driven-destination". ] 

After several days of playing around with the xml file, I found out that, when I remove the namespaces given in the ejb-jar element above, message-driven-destination is translated properly but element failes with the same Child translator not found error.

So i believe this is a namespace conflict issue. I apriciate if someone can help me resolve this.

Thanks In Advance.

도움이 되었습니까?

해결책

I figured out the issue. ejb-jar-2.1.xsd deprecated message-driven-destination element from the message-driven type. message-driven-destination is part of ejb-jar_2.0 spec.Here is the conversion from 2.0 to 2.1:

An example of message-driven bean elements in EJB 2.0:

   <message-driven id="Mdb20">
       <ejb-name>Mdb</ejb-name>
       <ejb-class>ejbs.MdbBean</ejb-class>
       <transaction-type>Bean</transaction-type>
       <message-selector>mdbMessage</message-selector>
       <acknowledge-mode>Auto-acknowledge</acknowledge-mode>
       <message-driven-destination>
      <destination-type>javax.jms.Topic</destination-type>
      <subscription-durability>Durable</subscription-durability>
       </message-driven-destination>
   </message-driven>

An example of message-driven bean elements in EJB 2.1:

<message-driven id="Mdb21">
   <ejb-name>Foo/ejb-name>
   <ejb-class>ejbs.FooBean</ejb-class>
   <messaging-type>javax.jms.MessageListener</messaging-type>
   <transaction-type>Bean/transaction-type>
   <message-destination-type>javax.jms.Topic</message-destination-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>Durable</activation-config-property-value>
  </activation-config-property>
  <activation-config-property>
     <activation-config-property-name>acknowledgeMode</activation-config-property-name>
     <activation-config-property-value>AutoAcknowledge</activation-config-property-value>
  </activation-config-property>
  <activation-config-property>
    <activation-config-property-name>messageSelector</activation-config-property-name>
    <activation-config-property-value>fooSelector</activation-config-property-value>
  </activation-config-property>
 </activation-config>
</message-driven>
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top