Win a copy of Rust Web Development this week in the Other Languages forum!

Anoobkumar Padmanabhan

Ranch Hand
+ Follow
since Aug 08, 2007
Cows and Likes
Total received
In last 30 days
Total given
Total received
Received in last 30 days
Total given
Given in last 30 days
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Anoobkumar Padmanabhan

JAX-WS service failing with below error while testing from SOAP UI. The service is configured with Annotations, and I could see the Service Class name getting displayed in the logs. The RuntimeException occurring when JAXWSMessageReceiver tries to get the EndpointDescription parameter(org.apache.axis2.jaxws.description.EndpointDescription) from service and is responding with null. Any help?

3 years ago
I am facing "Invalid Reference :XXX"(Where XXX is the content id of the attachment) error while trying to invoke a service which accepts SOAP with attachment request(Axis2 1.6.2/1.6.4, Java 1.8).

When I try debugging, I could see attachment is present in MessageContext.attachmnets and got is printed correct from there. But in the execution flow, The following error trace is getting generated. Looks like there is some issue in my RPCMessageReceiver->RPCUtil->BeanUtil->MultirefHelper flow, as the error is when the reference(href) id is comparing with body.getChildElements(). I think the attachment is transferring as separate, not as a child to SOAP Body. Could you please have a look?

08 Aug 2018 15:26:17 ERROR : Exception occurred while trying to invoke service method orchestrateAcordRequest
org.apache.axis2.AxisFault: Invalid reference :b4f63251-c62e-405f-b2fa-939abd706f43
       at org.apache.axis2.databinding.utils.MultirefHelper.processRef(
       at org.apache.axis2.databinding.utils.BeanUtil.processObject(
       at org.apache.axis2.databinding.utils.BeanUtil.ProcessElement(
       at org.apache.axis2.databinding.utils.BeanUtil.deserialize(
       at org.apache.axis2.rpc.receivers.RPCUtil.processRequest(
       at org.apache.axis2.rpc.receivers.RPCUtil.invokeServiceClass(
       at org.apache.axis2.rpc.receivers.RPCMessageReceiver.invokeBusinessLogic(
       at org.apache.axis2.receivers.AbstractInOutMessageReceiver.invokeBusinessLogic(
       at org.apache.axis2.receivers.AbstractMessageReceiver.receive(
       at org.apache.axis2.engine.AxisEngine.receive(
       at org.apache.axis2.transport.http.HTTPTransportUtils.processHTTPPostRequest(
       at org.apache.axis2.transport.http.AxisServlet.doPost(
       at javax.servlet.http.HttpServlet.service(
       at javax.servlet.http.HttpServlet.service(
       at weblogic.servlet.internal.StubSecurityHelper$
       at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(
       at weblogic.servlet.internal.ServletStubImpl.execute(
       at weblogic.servlet.internal.ServletStubImpl.execute(
       at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.wrapRun(
       at weblogic.servlet.internal.WebAppServletContext$
       at weblogic.servlet.internal.WebAppServletContext.securedExecute(
       at weblogic.servlet.internal.WebAppServletContext.execute(
3 years ago
Hi Ranya,

These methods(before and after) will also do the same checking. right?

If dt1 and dt2 are two date objects,
will give true if, dt1 is prior to dt2(ie, dt1<dt2).
after() will do the exact opposite thing.

The compareTo() is working just like the objects comarison in collections(will return -1,0 or 1) according to the condition.
13 years ago

Read this article, Making a class immutable
13 years ago
Hi Ganesh

how can we know which is narrower than other

Go through the Java API for exceptions.
The oder means the hierarchical order in the parent-class hierarchi like,

java.lang.Throwable -> java.lang.Exception -> java.sql.SQLException
Hi garima jain,

The instance variable value is determined gy the refernce which is used to invoke it. It is not depending on the object used.

In case of method calling, the case is just reversed. Then, the decision, which method is to be called(From Parent or Child) is taken depending on the object used- not on the reference.
Hi Gansesh

if you are assigning one array variable to other variable instead of assigning values in array through index then it will not effect the original array

When you assign one array variable to another(or an object to another object), the refernce will be changed. ie, the actual parameters-in the calling method and the formal parameter-in the called method, will point to different objects. That is why change in one won't affect the other.
Hi Preetha

But i think 4th also correct. any comments?

The 4th answer was, Dividing floating-point numbers with zero is a runtime exception.

But, when we try to divide a floating-point number by zero, it won't give any error or exception. It will result in the value infinity. So,that option will be false.
Hi Narendra shah,

Object type (not the reference variable's type), determines which overridden
method is used at runtime.

it is actually the definition for overriding. right? The method, which will be called is determined by the type of object at runtime, not by the refence used.

But P is just a refence of type animal right?
It is not the actula array or object.

V)what is the difference of these

String s ="abcd";
String s = new String ("abcd");

In the first case, a string object is created into pool, if no one with the same value is not existing. otherwise, it will simply return the refence to the String, "abcd" from the pool.

In second case, it will create a string object, with the value specified. and the reference to the newly created object will be returned.
As Ganesh explains, the program will create an array of type dog, and this array will be refenced using animal refernce. Anyway, the objects that can be stored in the array should be of type dog.

So that will throw an exception, if you try to add an animal object to the array
Ya its just a question on pass by value. Just understand that when a method is called by passing an argument, the thing passed is only the value. It is not the final variable we are passing. But just the value inside it.

I dont think the object referred by s will be available for GC at LINE3 because it has the refernce, s, now also. An object will be available for GC, when it don't have any live references.
In my opinion, it will be available for GC at LINE 4, ie, by the end of that method
13 years ago

In line1, we are doing is that, just giving a new refenrce, z, to the object referred by y. so both y and z are pointing to the same object. In line2, we are assigning the refernce, z to null. ie, only changing the refernce, z. Still, y is pointing to the object. So, this won't be available for garbage collection. So the answer will be right.