Hello,
I would really appreciate if someone can let me know if there are any constraints on the objects that can placed in an IData? Please have a look at my previous message to know the error message that I got when i tried to insert a java object into pipeline.
Make sure you have the latest PortfolioEntityPK class in your developer classpath and that it matches the one in the server classpath. You are passing a Long into the constructor - make sure it’s not supposed to be an Integer (or it was changed at some point). Also I’m not sure at what point your error is occurring, but make sure you’re not trying to map it into an Integer and that you’ve declared your output parameters to be Objects. Just some extra things to check…
Hi,
I did not add any classes to my developer classpath. I am able to instantiate/call methods on that object without adding its class to developer’s classpath.
thanks,
hari
Sorry Hari,I am still unable to figure it out the resolvation,since code snippet you wrote seems fine,ok mean while somebody will chim on it for immediate resolution.
Check the hashCode method implementation since it gets called when cursor operations take place. Since you have overidden the hashCode method it is likely that there is an exception that is being thrown in this method. If you have a debug tool, you can set a breakpoint in hashCode() and then try to step through it.
Hari,
Can you confirm whether the ClassCastException occurs inside of your Java service or a few flow steps afterwards? Other than that, have you checked what Will advised you to, i.e. output types in your flow service, etc.?
Hi,
Nick, I do not have any flow services, i am just trying to execute a single java service.
Rupender, I need to check my hashcode() implementation. Will check it and let u know.
Are getting these errors only when testing through the Developer?
There is no restriction on what you can insert into the pipeline for other services to process. However there are some ‘restrictions’ on what can be encoded for transport between the Developer and Integration Server or between Integration Servers (if you are doing remote invokes). If you are testing a service that inserts Java objects into the pipeline there are a couple of things that you need to do:
i) the Java object must either implement IData or Serializable
ii) the classes must be on the classpath of the Developer – as Will pointed out in an earlier post
The ClassCastException occurs when attmepting to decode the pipeline and a Java class is encountered that cannot be found. An error is trapped, but decoding of the data still continues. This puts the decoding into an unknown state when attempting to read the next piece of data.
I have got output variable declared for javaservice , i want to update record from inside the javaservice using
(eg idc.insertAfter("emp\fname ",“XYZ”);
eg idc.insertAfter("emp\lname ",“MNG”);
I am getting the same classcast exception you were getting Hari, except I am not using any custom Java Objects.
The service works fine in developer, but it throws the exception when I try to invoke it through Java. I’m new to webMethods so I don’t understand what you mean by including a class into developer’s classpath.
Note that I only added methods to an existing class. I did not create a new java class.
I insert a custom java object into the pipeline but when I look at the pipeline in the Developer it shows the objects value as ‘null’. I build another service, which uses the object from the pipeline and this is working ok. So the object is actually in the pipeline even though the Developer does not show. I suspect that this is because the Developer does not know the class (not in Developers classpath).
My problem starts when I try to call the service, which returns the custom java object, as a WebService (via automatic webMethods WSDL generation). The WebService call does not involve the developer (done via XML-Spy) but it does not return a value for the object even though I am sure that the object exists in the pipeline.
My hope was that the IntegrationServer takes the custom java object and serializes it into the SOAP WebService message but it does not seem to be that easy…
The WSDL of a flow that returns an object value declares the return type as type=“xsd:anyType”, which does not help too much. I wonder what webMethods will return for a complex object hierarchy when returned via a WebService.