We have a requirement in which we need to convert a specific flat file structure into XML and then pass the message using XI. For this we have deployed an EJB module which is doing this conversion from flat file to XML. This EJB is being called from XI and takes as input two parameters, the rootnode and namespace.
The flat file is divided into sections delimited with the character '['. One of the requirements for the EJB module is that if a certain section ([TRAILER]) is not present in the flat file then the EJB module should throw an exception. I have used stateless session bean to generate the EJB and if the TRAILER section is not present then have thrown a ModuleException from within the EJB containing a user defined message ("Trailer not present").
Now when I view the log for the Java stack, this user defined message is present when the flat file does not have a TRAILER section. However, in the adapter monitor, for files not containing the TRAILER section, its throwing a NullPointerException.
Can anyone help out as to why this is happening and how to get the user defined exception in the adapter monitor.