on 12-04-2010 2:23 PM
Hello,
After upgrade from XI3.0 to PI7.11,I am trying to adapt code of an adapter module in order to use it in new version.
I have changed the code ,there were no compilation errors and it was deployed successfully.
But when trying to test the scenario ,I am getting following error:
<code>ADAPTER.JAVA_EXCEPTION</code>
<text>javax.ejb.EJBException: (Failed in component: sap.com/ValidationModule7.11_EAR) Exception raised from invocation of public com.sap.aii.af.lib.mp.module.ModuleData com.sapcons.xi.af.validation.ValidationModuleBean711.process(com.sap.aii.af.lib.mp.module.ModuleContext,com.sap.aii.af.lib.mp.module.ModuleData) throws com.sap.aii.af.lib.mp.module.ModuleException method on bean instance com.sapcons.xi.af.validation.ValidationModuleBean711@4dee79d1 for bean sap.com/ValidationModule7.11_EARxml|ValidationModule7.11_EJB.jarxml|ValidationModuleBean711 in application sap.com/ValidationModule7.11_EAR.; nested exception is: java.lang.NullPointerException: while trying to invoke the method com.sap.engine.interfaces.messaging.api.MessageKey.getMessageId() of an object loaded from local variable 'msgKey'
java.lang.NullPointerException: while trying to invoke the method com.sap.engine.interfaces.messaging.api.MessageKey.getMessageId() of an object loaded from local variable 'msgKey'
I am nowhere using variable 'msgkey' in my code.
I was using getMessageId() method and because of this error,I have changed the code such that I am not using this method at all.
After this change ,I have deployed the module again,and the strange part is I am still getting the same error.
Just to be sure that I have deployed the changed code,I created an altogether new module ValidationModule7.11_EAR(it was ValidationModule_EAR before) and deployed it,I am sure ,I am not using getMessageId() method at all,but I am getting the same error (as mentioned above).
I have no idea why I am getting the same error.I can see in the error message that my new module is called which doesn't use this method.
Can anyone please suggest apart from saving the Bean after code changes and redeploying the code,what needs to be done.
(Rebuilding the project,etc.)
It would be great if I can get some inputs on this strange behaviour.
Thanks a lot.
Best Regards,
Shweta
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Shweta ,
Have you checked your bean stateless or stateful , as per documentation it should be stateless
Check this note Note 1062037 java.lang.NullPointerException error in Adapter activation
Have you used new libraries in PI 7.11
You can also add audit logs Note 1004000.
Hope this helps
regards
Ninad
Hi Ninad,
Thanks a lot for your inputs.Regarding your checkpoints:
Have you checked your bean stateless or stateful , as per documentation it should be stateless : Stateless
Have you used new libraries in PI 7.11 : Yes
You can also add audit logs Note 1004000. : I have added audit logs in the code,but this adapter module fails even before it reaches XI,so I cannot see any log or trace in XI.The error mentioned is what I get in SOAPUI when I try to send a request to XI.
I am not able to find out at which point this nummpointer exception is raised as I cannot see any message in XI
Thanks again.
Best Regards,
Shweta
Did you your different with same JNDI name?
In my experience, the reuse of same JNDI name leads to an unstable state in the Java engine, that means you cannot be sure which code is actually processe.
The error could occur because there is not a link to the interface com.sap.aii.af.ifc.facade in application-j2ee-engine.xml
Check if this value exists and is defined as interface.
See also this:
/people/stefan.grube/blog/2008/12/11/adjust-your-pi-70-adapter-modules-for-pi-71-in-15-minutes
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello Stefan,
Thanks for your reply.
I have created my new module with a different JNDI name.
Also,I have verified that there is a link to the interface com.sap.aii.af.ifc.facade in application-j2ee-engine.xml .
This was the code which I was trying to adapt:
if((MessageContext)inputModuleData.getPrincipalData() instanceof MessageContext)
{
MessageContext messsageContext = (MessageContext)inputModuleData.getPrincipalData();
Message message = messsageContext.getMessage();
Attachment rootDocument = message.getRootDocument();
Object data = rootDocument.getData();
if(data instanceof Binary)
{
Binary bin = (Binary)data;
request = bin.getBytes();
String messageID = "1232";
if(dir == Direction.INBOUND)
amk = new AuditMessageKey(messageID, AuditDirection.INBOUND);
else
amk = new AuditMessageKey(messageID, AuditDirection.OUTBOUND);
But I was getting errors like MessageContext not recognized and also,for the statement:
Attachment rootDocument = message.getRootDocument();
I was getting an error in statement : if(data instanceof Binary) as following imports weren't recognized.
import com.sap.aii.messaging.lang.Binary;
import com.sap.aii.messaging.mo.*;
So I used import com.sap.aii.af.service.cpa.BinaryData; and following code
Object obj = null;
Message message = null;
obj = inputModuleData.getPrincipalData();
if(obj instanceof BinaryData)
{
message = (Message)obj;
BinaryData bin = (BinaryData)obj;
request = bin.getData();
String messageID = "1232";
amk = new MessageKey(messageID, message.getMessageDirection());
});
Code was compiled correctly and deployed ,but I get this error with getMessageId() when I try to test it.You can see I am not using getMessageId() and msgkey anywhere in the code
Thanks for your help
Regards,
Shweta
See the link for an example code for PI 7.1
This code was tested by me and worked without issues.
http://wiki.sdn.sap.com/wiki/display/XI/AdaptermoduleexampleforPI+7.1
I think your original wrong EJB is called even after you changed your code.
Make sure that in your communication channel, you have assigned the correct JNDI name for the latest version of your module.
activate the channel again and check the cache. Maybe you have to perform a cache refresh.
Try also to undeploy all EAR files that are related to this issue.
Hi Stefan,
I have verified ,JNDI name is correct in CC,because if I change the name in CC ,I get objectnotfound error.
Also,we tried undeploying all previously deployed modules ,redeployed the new code again,performed cache refresh and I still get exactly same error
Any other hint?
Thanks a lot.
Best Regards,
Shweta
Hello Stefan,
Thanks,I have updated the code still ,I get the same error.
I have noticed one thing,I am changing the code,saving the files and selecting update EAR libraries.
I even tried deleting EAR and deploying it again when EAR is created afresh.
But when I extracted java file from EAR,I see old code,it is not updated in EAR.
What else I need to do so that code is updated in EAR?
Thanks for your help.
Regards,
Shweta
Hello Stefan,
This module is used for XSD schema validation for incoming SOAP request.
I still get lot of errors with this module.
I have just read somewhere that an option for XSD schema validation for incoming SOAP request is already available in PI7.11
Does this mean,we don't need to use this adapter module in PI7.11?
Kindly let me know.
Thanks.
Regards,
Shweta
So the module is used in SOAP sender adapter?
That is the reason why it cannot be transferred to PI 7.1
I should have know, as the line
MessageContext messsageContext = (MessageContext)inputModuleData.getPrincipalData();
There is no upgrade guide for modules used in SOAP sender adapter.
Only specialists know how to create adapter modules for this.
User | Count |
---|---|
90 | |
10 | |
10 | |
10 | |
7 | |
7 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.