Bug 4968 - WS-Notification error: java.lang.ClassCastException: org.globus.exec.generated.StateChangeNotificationMessageWrapperType cannot be cast to org.w3c.dom.Element
: WS-Notification error: java.lang.ClassCastException: org.globus.exec.generate...
Status: CLOSED FIXED
: GRAM
wsrf gram clients
: 4.0.3
: PC Linux
: P3 blocker
: 4.0.6
Assigned To:
:
:
:
:
  Show dependency treegraph
 
Reported: 2007-01-17 20:58 by
Modified: 2007-11-30 15:59 (History)


Attachments
Java Gram client using GramJob (15.03 KB, text/plain)
2007-01-19 03:17, Martin Feller
Details
Patch for GramJob.java (1.91 KB, patch)
2007-03-10 15:43, Andre Luckow
Details


Note

You need to log in before you can comment on or make changes to this bug.


Description From 2007-01-17 20:58:59
My service submits a job to a remote ManagedJobService (which all works fine)
but the listener doesn't work properly - I am using an implementation of
org.globus.exec.client.GramJobListener ....

2007-01-18 10:45:56,508 ERROR client.GramJob [ServiceThread-8,deliver:1611]
Notification message processing FAILED:Could not get value or set new status.
java.lang.ClassCastException:
org.globus.exec.generated.StateChangeNotificationMessageWrapperType cannot be
cast to org.w3c.dom.Element
        at org.globus.exec.client.GramJob.deliver(GramJob.java:1572)
        at
org.globus.wsrf.impl.notification.NotificationConsumerProvider.notify(NotificationConsumerProvider.java:109)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at
org.apache.axis.providers.java.RPCProvider.invokeMethod(RPCProvider.java:384)
        at
org.globus.axis.providers.RPCProvider.invokeMethodSub(RPCProvider.java:107)
        at
org.globus.axis.providers.PrivilegedInvokeMethodAction.run(PrivilegedInvokeMethodAction.java:42)
        at java.security.AccessController.doPrivileged(Native Method)
        at javax.security.auth.Subject.doAs(Subject.java:396)
        at org.globus.gsi.jaas.GlobusSubject.runAs(GlobusSubject.java:55)
        at org.globus.gsi.jaas.JaasSubject.doAs(JaasSubject.java:90)
        at
org.globus.axis.providers.RPCProvider.invokeMethod(RPCProvider.java:97)
        at
org.apache.axis.providers.java.RPCProvider.processMessage(RPCProvider.java:281)
        at
org.apache.axis.providers.java.JavaProvider.invoke(JavaProvider.java:319)
        at
org.apache.axis.strategies.InvocationStrategy.visit(InvocationStrategy.java:32)
        at org.apache.axis.SimpleChain.doVisiting(SimpleChain.java:118)
        at org.apache.axis.SimpleChain.invoke(SimpleChain.java:83)
        at
org.apache.axis.handlers.soap.SOAPService.invoke(SOAPService.java:450)
        at org.apache.axis.server.AxisServer.invoke(AxisServer.java:285)
        at
org.globus.wsrf.container.ServiceThread.doPost(ServiceThread.java:676)
        at
org.globus.wsrf.container.ServiceThread.process(ServiceThread.java:397)
        at
org.globus.wsrf.container.GSIServiceThread.process(GSIServiceThread.java:151)
        at org.globus.wsrf.container.ServiceThread.run(ServiceThread.java:302)
------- Comment #1 From 2007-01-19 03:17:14 -------
Created an attachment (id=1169) [details]
Java Gram client using GramJob

Please run the attached program against your container.
It's a Java Gram client that uses GramJob to submit a job,
outputs information about job state changes and terminates
if the job is done.
On my host this program does not fail and I can't reproduce your
error. But it should fail on yours if it's a general GramJob
problem.
If it does not fail please attach your code here and tell me
what version you are using (4.0.3?).


To run the attached program:

1. Create the following job description and store it
   in /tmp/simple.xml

   <job>
     <executable>/bin/date</executable>
   </job>


2. Adjust the values in main:
   contact: host the job will be submitted to (container host)
   rslFile: file that contains a job description. If you use
            /tmp/simple.xml like mentioned above as file, you
            need not touch this value.

3. Compile the class:
  source $GLOBUS_LOCATION/etc/globus-devel-env.sh # (bash)
  javac GRAMClient.java

4. Create a proxy
   grid-proxy-init

5. Run the client
   java -DGLOBUS_LOCATION=$GLOBUS_LOCATION GRAMClient
------- Comment #2 From 2007-01-20 07:43:16 -------
(In reply to comment #1)

(From Bug Author)

I installed my gt4 using the fedora core 4 installer on fedora core 6 and
thought maybe that was the problem - either a fault in the installer, installed
materials or an incompatibility with fc6.  So I downloaded the wscore and built
and installed it over my toolkit but then it started complaining about security
so I assume there was a configuration that was undone by installing over the
previous container.  I am currently building the toolkit from scratch under fc6
on another machine (I have noticed any jdk above 1.4.3 fails to build the
wscore because enum is used as a symbol in the code - though thats another
matter entirely)  - so I'll see how that container behaves as well as do a
fresh install on here and see if it was perhaps a complication from the fc
versions.

Once I have a container that operates if the error has not gone I will proceed
with your suggested action - it seems to be a problem receiving the
notification from the remote site but I'll see soon enough hopefully.

Thanks for your time,
Shane.
------- Comment #3 From 2007-02-08 08:31:02 -------
Shane, what's the status here: Are you still running into these
notification problems after a new install?
------- Comment #4 From 2007-03-05 03:55:39 -------
I'll close this bug due to unresponsiveness and because i
was never able to reproduce it.
Shane: reopen it in case you still run into that problem.
------- Comment #5 From 2007-03-10 15:43:03 -------
Created an attachment (id=1205) [details]
Patch for GramJob.java
------- Comment #6 From 2007-03-10 15:43:52 -------
I received a similar problem when I tried to receive a notification from within
a GT4 web service:

Notification message processing FAILED:Could not get value or set new status.
java.lang.ClassCastException:
org.globus.exec.generated.StateChangeNotificationMessageWrapperType
        at org.globus.exec.client.GramJob.deliver(GramJob.java:1629)
        at
org.globus.wsrf.impl.notification.NotificationConsumerProvider.notify(NotificationConsumerProvider.java:126)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:585)
        at
org.apache.axis.providers.java.RPCProvider.invokeMethod(RPCProvider.java:384)
        at
org.globus.axis.providers.RPCProvider.invokeMethodSub(RPCProvider.java:107)
        at
org.globus.axis.providers.PrivilegedInvokeMethodAction.run(PrivilegedInvokeMethodAction.java:42)
        at java.security.AccessController.doPrivileged(Native Method)
        at javax.security.auth.Subject.doAs(Subject.java:396)
        at org.globus.gsi.jaas.GlobusSubject.runAs(GlobusSubject.java:55)
        at org.globus.gsi.jaas.JaasSubject.doAs(JaasSubject.java:90)
        at
org.globus.axis.providers.RPCProvider.invokeMethod(RPCProvider.java:97)
        at
org.apache.axis.providers.java.RPCProvider.processMessage(RPCProvider.java:281)
        at
org.apache.axis.providers.java.JavaProvider.invoke(JavaProvider.java:319)
        at
org.apache.axis.strategies.InvocationStrategy.visit(InvocationStrategy.java:32)
        at org.apache.axis.SimpleChain.doVisiting(SimpleChain.java:118)
        at org.apache.axis.SimpleChain.invoke(SimpleChain.java:83)
        at
org.apache.axis.handlers.soap.SOAPService.invoke(SOAPService.java:450)
        at org.apache.axis.server.AxisServer.invoke(AxisServer.java:285)
        at
org.globus.wsrf.container.ServiceThread.doPost(ServiceThread.java:664)
        at
org.globus.wsrf.container.ServiceThread.process(ServiceThread.java:382)
        at
org.globus.wsrf.container.GSIServiceThread.process(GSIServiceThread.java:147)
        at org.globus.wsrf.container.ServiceThread.run(ServiceThread.java:291)

There seems to be a error in the GramJob.java. I prepared a patch which can be
applied to GramJob.java and should eliminate the ClassCastException.  Please
let me know whether it works.
------- Comment #7 From 2007-03-10 16:30:07 -------
I forgot to mention: The patch above was created for GT 4.0.4.
------- Comment #8 From 2007-06-28 08:15:57 -------
Andre,
sorry for the delay and thanks for the patch. It's not yet applied 
but probably we'll have that in the next release.
I'm still unsure why and under what circumstances this happens.
Does this happen to you all the time?
If not: can you tell when it happens?
Is the calling service located in the same container?
Thanks, Martin
------- Comment #9 From 2007-07-03 13:06:59 -------
Martin,

>Does this happen to you all the time?
>If not: can you tell when it happens?
>Is the calling service located in the same container?

The Exception can be reproduced in GT4.0.5. The error occurs every time I am
calling the WS GRAM from within another web service, to be precise the error
only occurs if I use the GramJob class from within a service. It does not
matter whether I call the WS GRAM in the same container or an instance on
another host. 

In my setup, I am using a simple service, which make the respective calls to
the GramJob class. In particular I am just using the following client
http://download.boulder.ibm.com/ibmdl/pub/software/dw/grid/gr-wsgramclient.java
from within the service. The error does not occur if I use the client from
outside the GT4 hosting environment.

The GramJob object seems to receive a notification
org.globus.exec.generated.StateChangeNotificationMessageWrapperType which
cannot be casted to a StateChangeNotificationMessageType object.

If helpful, I can send you the test service I created, so that the error can be
reproduced.
Thanks in advance,
André
------- Comment #10 From 2007-07-06 11:16:57 -------
Andre,
I can reproduce the problem, so there's no need for sending
the test-service.
Thanks, Martin
------- Comment #11 From 2007-11-28 00:14:10 -------
I tried the same thing with code from cvs trunk. GramJob does not
run into the ClassCastException here. So upcoming 4.2 will not have
this problem.
The difference between trunk to the 4.0 branch is that the notification
message gets converted into a MessageElement in ws-gram before the
notification is sent.
I'll apply this fix or the patch that had been attached to this thread
when we're preparing 4.0.6.
I set the milestone to 4.0.6 and made it a blocker for that release.
------- Comment #12 From 2007-11-30 15:59:37 -------
I Committed the fix to the 4.0 branch. So it will be
in 4.0.6
Closing this bug.