8 Replies Latest reply on Jun 29, 2009 1:09 PM by pathuri

    Can not pass null value to the argument when using EJBProces

      We are using EJBProcessor to invoke EJB's on one hand and send the response to ESB aware callers on the other hand.

      We have EJB functions where some values passed in can be null but when we configured the same at ESB, it is not allowing to pass null values.

      Is this by design or a bug in EJBProcessor?

      Can we extend to EJBProcessor and override some functions to get around to this issue?

        • 1. Re: Can not pass null value to the argument when using EJBPr
          beve

          Hi,

          could you post a stacktrace of the error you are seeing?

          Thanks,

          /Daniel

          • 2. Re: Can not pass null value to the argument when using EJBPr

            Here is the stacktrace from the test client program that I ran simulating the esb aware callers call:
            ====================================================
            java.lang.IllegalArgumentException: null 'value' arg in method call.
            at org.jboss.internal.soa.esb.assertion.AssertArgument.isNotNull(AssertArgument.java:43)
            at org.jboss.internal.soa.esb.message.format.xml.BodyImpl.add(BodyImpl.java:83)
            at com.intelliverse.gf.components.core.esbcomm.AbstractEsbCommunicationImpl.deliver(AbstractEsbCommunicationImpl.java:138)
            at com.intelliverse.gf.components.core.esbcomm.AbstractEsbCommunicationImpl.deliverSync(AbstractEsbCommunicationImpl.java:98)
            at test.message.TestMessage.searchMessages(TestMessage.java:81)
            at test.message.TestMessage.main(TestMessage.java:113)
            ====================================================

            Looks like the check is in jboss esb message api and not in the EJBProcessor.

            • 3. Re: Can not pass null value to the argument when using EJBPr

              Hi Daniel,

              Did the stacktrace give any clue? Is this by design?

              • 4. Re: Can not pass null value to the argument when using EJBPr
                beve

                From that stacktrace it does not look like you are calling the EJBProcessor.
                What is com.intelliverse.gf.components.core.esbcomm.AbstractEsbCommunicationImpl.deliver supposed to to?

                Have you tried this using the ejbprocessor quickstart? If you modify it to reproduce you issue and I'd happy to take a look.

                Regards,

                /Daniel

                • 5. Re: Can not pass null value to the argument when using EJBPr

                  Hi Daniel,

                  I started the post with EJBProcessor issue but after you asked me for the stack trace and it became apparent to me when I looked at the stack trace that it may not be an EJBProcessor issue but with the jboss esb api.

                  com.intelliverse.gf.components.core.esbcomm.AbstractEsbCommunicationImpl.deliver is just a wrapper function to construct the message for esb using the jboss esb api. So the callers call this wrapper with java objects as parameters and this function will construct the esb aware message to the esb using jboss esb api.

                  Looks like in the esb api, when a call is made to org.jboss.internal.soa.esb.message.format.xml.BodyImpl.add, it is checking for null values so this is preventing us from passing null values to esb where the service configuration is invoking the EJB using EJBProcessor.

                  Hope this clarifies my post.

                  Do you know how we can work around this? May be I need to look into ESB api and see whether this checking for null values is by design. Whichever case may be, the end result is that it is preventing us to pass null values to EJBProcessor for onward invocation of EJB.

                  • 6. Re: Can not pass null value to the argument when using EJBPr
                    beve

                    Hi,

                    perhaps you could try not adding anything to the body at all if your payload is null.
                    I've tried this with the EJBProcessor unit test but in the process found a bug in ConfigTree's toString method where a NullPointerException can be thrown. Fixing the ConfigTree allowed me to simply have an empty message body and still have the EJB invoked.

                    I'll post back when I've checked this in (just need to make sure this does not break something else).

                    Are you in a position where you can bulid this from the main trunk later and see if this will work for you?

                    Regards,

                    /Daniel

                    • 7. Re: Can not pass null value to the argument when using EJBPr

                      Co-incidence.

                      Somehow it occurred to me that I can try without adding the parameter to the body of the message and bingo - it worked.

                      I came to update the forum and I see the same suggestion.

                      Thanks for the suggestion.

                      But I did not get any null pointer exception.

                      • 8. Re: Can not pass null value to the argument when using EJBPr

                        Got it. If eventually esb api does allow passing null values then EJBProcessor will throw null pointer but if we simply not add the parameter, it is fine.