[jboss-user] [JBoss jBPM] - Re: Problem testing Hello BPEL sample
zauberlehrling
do-not-reply at jboss.com
Wed Dec 27 05:35:05 EST 2006
Hi Alex,
thank you very much for your advice! I've found in one implementation of QName the following explanation:
* <p>Due to a historical defect, QName was released with multiple
| * serialVersionUID values even though its serialization was the
| * same.</p>
| *
| * <p>To workaround this issue, serialVersionUID is set with either
| * a default value or a compatibility value. To use the
| * compatiblity value, set the system property:</p>
| *
| * <code>com.sun.xml.namespace.QName.useCompatibleSerialVersionUID=1.0</code>
| *
| * <p>This workaround was inspired by classes in the javax.management
| * package, e.g. ObjectName, etc.
| * See CR6267224 for original defect report.</p>
| */
| private static final long serialVersionUID;
| /**
| * <p>Default <code>serialVersionUID</code> value.</p>
| */
| private static final long defaultSerialVersionUID = -9120448754896609940L;
| /**
| * <p>Compatibility <code>serialVersionUID</code> value.</p>
| */
| private static final long compatibleSerialVersionUID = 4418622981026545151L;
| /**
| * <p>Flag to use default or campatible serialVersionUID.</p>
| */
| private static boolean useDefaultSerialVersionUID = true;
|
In my test code I inserted the value 1.0 for the system property com.sun.xml.namespace.QName.useCompatibleSerialVersionUID:
public void test()
| {
| try {
| Properties system = System.getProperties();
| system.put("com.sun.xml.namespace.QName.useCompatibleSerialVersionUID", "1.0");
| System.setProperties(system);
|
| Properties properties = new Properties();
| properties.setProperty("java.naming.provider.url","jnp://localhost:1099");
| properties.setProperty("java.naming.factory.initial","org.jnp.interfaces.NamingContextFactory");
| properties.setProperty("java.naming.factory.url.pkgs","org.jboss.naming.client");
| properties.setProperty("j2ee.clientName", "jbpmbpel-client");
| Service service = null;
| if (service == null) {
| InitialContext iniCtx = new InitialContext(properties);
| Object object = iniCtx.lookup("java:comp/env/service/Hello");
| service = (Service)object;
| String portTypeNS = "http://jbpm.org/examples/hello";
| Call call = service.createCall(new QName(portTypeNS, "GreeterPort"),"sayHello");
| String greeting = (String) call.invoke(new Object[] { "Olive" });
| System.out.println("Greeting: "+greeting);
| }
| } catch (Exception e) {
| e.printStackTrace();
| }
| }
With this code code I got an answer:
....
| <env:Envelope xmlns:env='http://schemas.xmlsoap.org/soap/envelope/'>
| <env:Header/>
| <env:Body>
| <ns1:sayHelloResponse xmlns:ns1='http://jbpm.org/examples/hello'>
| <greeting>Hello, Olive!</greeting>
| </ns1:sayHelloResponse>
| </env:Body>
| </env:Envelope>
| 11:21:44,647 DEBUG SOAPBindingProvider : unbindResponseMessage: {http://jbpm.org/examples/hello}sayHello
| 11:21:44,653 DEBUG EndpointInvocation : setReturnValue: org.jboss.ws.soap.SOAPContentElement
| 11:21:44,653 DEBUG EndpointInvocation : getReturnValue
| 11:21:44,657 DEBUG SOAPContentElement : getObjectValue [xmlType={http://www.w3.org/2001/XMLSchema}string,javaType=class java.lang.String]
| 11:21:44,658 DEBUG SOAPContentElement : getXMLFragment from DOM
| 11:21:44,658 DEBUG SOAPContentElement : xmlFragment: <greeting>Hello, Olive!</greeting>
| 11:21:44,659 DEBUG SimpleDeserializer : deserialize: [xmlName=greeting,xmlType={http://www.w3.org/2001/XMLSchema}string]
| 11:21:44,662 DEBUG SOAPContentElement : objectValue: java.lang.String
| 11:21:44,662 DEBUG EndpointInvocation : transformPayloadValue: org.jboss.ws.soap.SOAPContentElement -> java.lang.String
| 11:21:44,663 DEBUG MessageContextAssociation : popMessageContext: org.jboss.ws.soap.SOAPMessageContextImpl at 53ab04
| Greeting: Hello, Olive!
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3996416#3996416
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3996416
More information about the jboss-user
mailing list