3 Replies Latest reply on May 22, 2002 1:30 PM by johnson_sb

    DeploymentException when env-entry-value missing

    johnson_sb

      I have defined several env-entry blocks in the ejb-jar.xml descriptor for my message-driven bean. I would like to have the option to NOT set a value in some cases, and I see that the env-entry-value is supposed to be an optional element according to the ejb spec. Everything deploys without errors if I define an env-entry-value tag in the descriptor like so:

      <env-entry>
      <env-entry-name>processor</env-entry-name>
      <env-entry-type>java.lang.String</env-entry-type>
      <env-entry-value>PROCESSOR</env-entry-value>
      </env-entry>

      However, when I attempt to deploy this bean with the env-entry-value missing, like so:

      <env-entry>
      <env-entry-name>processor</env-entry-name>
      <env-entry-type>java.lang.String</env-entry-type>
      </env-entry>

      I get an org.jboss.ejb.DeploymentException and the bean will not deploy.

      [Container factory] org.jboss.ejb.DeploymentException: Error in ejb-jar.xml for Message Driven Bean BatchPendingSubscriberMDB: expected one env-entry-value tag

      Is this a known bug? Or am I doing something wrong?

      I am running JBoss 2.4.1a. Thanks in advance.

        • 1. Re: DeploymentException when env-entry-value missing
          vlafo

          using jboss 3.0.0beta2
          does someone knows how you can get an "env-entry" of a session-bean ?

          ->binding is ok according server log-file
          2002-03-25 23:27:58,114 DEBUG [org.jboss.ejb.StatelessSessionContainer] Begin java:comp/env for EJB: UIDHighKeyGenerator
          ...
          2002-03-25 23:27:58,114 DEBUG [org.jboss.ejb.StatelessSessionContainer] Binding env-entry: DBNameColumn of type: java.lang.String to value:NAME
          ...
          2002-03-25 23:27:58,124 DEBUG [org.jboss.ejb.StatelessSessionContainer] End java:comp/env for EJB: UIDDispenserServerTestBean

          ->but [return (String) ContextUtil.getInitContext().lookup("java:comp/env/DBNameColumn");] throws an javax.naming.NameNotFoundException !!!???

          • 2. Re: DeploymentException when env-entry-value missing

            Did the original poster ever get an answer.
            It would be nice to know if this is an intentional feature or a bug. That is, not being able to deploy a bean with a env-entry that looks like
            [pre]
            <env-entry>
            <env-entry-name>Name</env-entry-name>
            <env-entry-type>Type</env-entry-type>
            </env-entry>
            [/pre]
            or
            [pre]
            <env-entry>
            <env-entry-name>Name</env-entry-name>
            <env-entry-type>Type</env-entry-type>
            <env-entry-value></env-entry-value>
            </env-entry>
            [/pre]

            cheers
            oliver

            • 3. Re: DeploymentException when env-entry-value missing
              johnson_sb

              No sir, I never got an answer. I ended up having to work around the problem by using a value like "null" or "none" and specifically looking for that in the code to signify a null.