Mehta Tejas

Greenhorn
+ Follow
since Aug 16, 2009
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Mehta Tejas

I was able to find a workaround for the AXIS issue. I created a sample webservice to test and analyse this issue and got the same error with the sample service. Upon debugging, I found that the issue happens due to the “id” attributes of the array elements within the webservice response.

For example:
Fails:


Works:


Solution:
To resolve this, I downloaded the axis 1.4 source code and made a small change in the DeserializerImpl class to prefix the “id” with the elementName. This id was being used in a Map which was causing the deserialization to break when the nested elements contain the same value for “id”.  I tested the updated axis.jar with the sample service and the service works fine.

The exact changes done in the DeserializerImpl class are as below:


Thanks,
Tejas
6 years ago
Hello Ranchers,

Need some help with an error related to AXIS webservice.

We have an integration with a third-party for tax calculation. Recently, they have asked us to upgrade to a newer version of their services. The new version of wsdl adds an array of jurisdiction objects. We are getting a NullPointerException when the Axis library tries to deserialize the response received for this new service.  We are using Axis 1.4 library.

The error trace that I have attached is from a standalone test program which I am using to debug the issue.
It appears that the error happens due to nested array of complex type objects. Somehow i feel that AXIS is unable to deserialize the response when it contains a nested array of complex objects.

I beleive this issue occurs when response is of type, Axis deserializer breaks after parsing the first <c:frtype> element.
<c:replyMessage>
<c:field1>abc</c:field1>
<c:taxReply>
<c:frItem id="0">
  <c:frName>Apple</c:frName>
  <c:frColor>Red</c:frColor>
  <c:frTaste>abc</c:frTaste>
 <c:frtype id="0">
 <c:frName id="0">Type1</c:frName>
 <c:frType id="0">absdf</c:frType>
 <c:frDesc id="0">trfdgd</c:frDesc>
 </c:frtype>
 <c:frtype id="1">
 <c:frName id="0">Type2</c:frName>
 <c:frType id="0">abhg</c:frType>
 <c:frDesc id="0">yiuhj</c:frDesc>
 </c:frtype>
</c:frItem>
</c:taxReply>
</c:replyMessage>    


5136 [main] DEBUG org.apache.axis.encoding.DeserializationContext  - Popped element stack to org.apache.axis.message.MessageElement:item
5136 [main] DEBUG org.apache.axis.encoding.DeserializationContext  - Exit: DeserializationContext::endElement()
5136 [main] DEBUG org.apache.axis.i18n.ProjectResourceBundle  - org.apache.axis.i18n.resource::handleGetObject(exception00)
5136 [main] ERROR org.apache.axis.client.Call  - Exception:
java.lang.NullPointerException
      at org.apache.axis.encoding.ser.BeanPropertyTarget.set(BeanPropertyTarget.java:135)
      at org.apache.axis.encoding.DeserializerImpl.valueComplete(DeserializerImpl.java:249)
      at org.apache.axis.encoding.DeserializerImpl.endElement(DeserializerImpl.java:509)
      at org.apache.axis.encoding.DeserializationContext.endElement(DeserializationContext.java:1087)
      at org.apache.axis.message.SAX2EventRecorder.replay(SAX2EventRecorder.java:171)
      at org.apache.axis.message.MessageElement.publishToHandler(MessageElement.java:1141)
      at org.apache.axis.message.RPCElement.deserialize(RPCElement.java:236)
      at org.apache.axis.message.RPCElement.getParams(RPCElement.java:384)
      at org.apache.axis.client.Call.invoke(Call.java:2467)
      at org.apache.axis.client.Call.invoke(Call.java:2366)
      at org.apache.axis.client.Call.invoke(Call.java:1812)
      at com.provider.stub.ITransactionProcessorStub.runTransaction(ITransactionProcessorStub.java:2019)
      at Sample.main(Sample.java:143)
AxisFault: java.lang.NullPointerException

Please let me know if you have seen any similar issues or have any ideas on why this could be happening. I have attached the sample response and the detailed logs with this post.

I found a couple of similar posts upon googling but none of them had any solutions.
https://coderanch.com/t/475583/java/Illegal-Argument-exception-consuming-WS
https://webcache.googleusercontent.com/search?q=cache:yR1hOs79sCIJ:https://groups.google.com/d/topic/comp.lang.java.programmer/OVpX8-YeFvU+&cd=3&hl=en&ct=clnk&gl=in


Thanks,
Tejas
6 years ago
Just to add to this post.

One of the errors that i faced was due to a comment that was written between the container tag and the jsp:attribute tag. It basically means that there should be no content (not even a comment) between <template:page> and the <jsp:attribute> tags

For example: Using the same example given above. If i add a comment.
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@taglib prefix="template" tagdir="/WEB-INF/tags/mypagetemplates" %>

<template:page>
<!- some useless comment which will throw this subelement error ->
<jsp:attribute name="headContent">
some html stuff
</jsp:attribute>
<jsp:body>
main html content
</jsp:body>
</template:page>
10 years ago
JSP
Cheese-Crust-Pizza
14 years ago
Hi All,
I am a 3+ yrs experienced Java developer and i've worked on ATG framework. This framwork uses some of the most sophisticated concepts in J2EE such as DI, ORM , Servlet pipelines, State Machines ,etc. However, I know a lot of these things I'm still not clear about wht exact steps occur when a Web App runs.
It would be nice if anyone can explain the basic steps that are followed when a J2EE application server gets a request from the web browser. I would like to know the basics of any Application Server and Web Server, The role of different components involved here such as Servlets, Filters (in a web.xml), Request Dispatcher , EJB's and their basic role.
I have referred quite a few books while studying for different components but none of them clearly gives a picture of the entire process involved in request processing. I found a few books but they were too big (700+ pages) and would take months to finish.
If someone can list out the steps like the steps of an Algorithm here, then it would become very easy and clear for any new J2EE developers to get a holistic picture of the entire Web Application and would thereby help in clearly understanding of any other J2EE frameworks/products.

Thanks,
Tejas
14 years ago
Reincarnation

----------------------
14 years ago
I saw Orphan this weekend. It's too good . It's a horror thriller (with no ghosts). Amazing movie!!!
14 years ago
Hi Brian,
Thanks for the response. Your explanation was quite helpful. Since you have worked on BLC as well as ATG Commerce, it would be very helpful if you could list down the differences in the out-of-box features from both. I would like to know if BLC also provides something similar to scenarios/targeters , Shopping process & fullfillment, Search, Merchandising, content management and so on.
I have downloaded both BLC as well as OFBiz and am trying to figure out which one works the best. You may visit the demo site of OFBiz at http://demo.ofbiz.org/ecommerce/control/main . There also quite a few live sites as well as products that are based on OFBiz. You can find the complete details at http://ofbiz.apache.org/
One thing I would like to mention here is that I'm very much impressed with the Fundamental Dynamo Framework and the Repositories. This has been implemented by ATG (Component model and Nucleus for DI and Repositories for ORM) in a highly sophisticated although very simple and easy to use manner. Is there a similar implementation in the BLC too?

I would be glad if others could also share their experience on this topic.

Thanks,
Tejas
tejashello.it@gmail.com