[JBossWS] - JbossWS 1.2.0
by matienzar
Hello,
With 1.0.4 release, i've a hibernate handler to begiun a transaction and to commit it. With this new realese, the handler is not threadsafe, and when I need to commit the transaction, it's null. I'd defined the handler (with 1.0.4) in standard-jaxrpc-endpoint-config.xml, but with this new realse i've to define it in standard-jaxws-endpoint-config.xml.
The code of the handler is:
public class HibernateWS extends GenericSOAPHandler {
UserTransaction _tx = null;
@Override
public boolean handleFault(MessageContext arg0) {
try {
_tx.rollback();
} catch (Exception e) {
Log.error("No se ha podido hacer el rollback", e);
throw new RuntimeException(e);
}
return super.handleFault(arg0);
}
protected boolean handleInbound(MessageContext msgContext) {
try {
HibernateUtil.openSession();
_tx = (UserTransaction) new InitialContext()
.lookup("java:comp/UserTransaction");
_tx.begin();
} catch (Exception e) {
Log.error("Cogiendo la transacción.", e);
}
return true;
}
protected boolean handleOutbound(MessageContext msgContext) {
try {
_tx.commit();
} catch (Exception e) {
Log.error("Haciendo el commit", e);
try {
_tx.rollback();
} catch (Exception e2) {
Log.error("Haciendo el rollback", e2);
}
throw new RuntimeException(e);
}
return true;
}
}
And the config-handler:
<endpoint-config>
<config-name>Handler hibernate gnomo</config-name>
<pre-handler-chains>
<javaee:handler-chain>
<javaee:protocol-bindings>##SOAP11_HTTP</javaee:protocol-bindings>
<javaee:handler>
<javaee:handler-name>WSHibernateHandlerInbound</javaee:handler-name>
<javaee:handler-class>org.muvale.utilidades.handlers.HibernateWS</javaee:handler-class>
</javaee:handler>
</javaee:handler-chain>
</pre-handler-chains>
</endpoint-config>
A lot of thanks,
Marcial
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4024562#4024562
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4024562
17 years, 10 months
[JBossWS] - Re: JBossWS 1.2.0.GA
by greenbean
I did not try the samples. I upgraded from the version shipping with JBoss 4.0.5.GA. The version included in JBoss 4.0.5.GA worked, but had a problem.
2007-02-27 22:59:30,052 ERROR [org.jboss.ws.jaxrpc.CallImpl] Call invocation failed with unkown Exception
javax.xml.rpc.JAXRPCException: Cannot obtain deserializer factory for: [xmlType=
{http://localhost:8080/xxx/}>XXX,javaType=class com.XXX]
at org.jboss.ws.soap.SOAPContentElement.getDeserializerFactory(SOAPContentElement.java:421)
at org.jboss.ws.soap.SOAPContentElement.getObjectValue(SOAPContentElement.java:230)
at org.jboss.ws.binding.EndpointInvocation.transformPayloadValue(EndpointInvocation.java:233)
at org.jboss.ws.binding.EndpointInvocation.getReturnValue(EndpointInvocation.java:182)
After I upgraded, this problem went away. However, I ran into this new issue.
"heiko.braun(a)jboss.com" wrote : Did you try the samples that ship with 1.2.0? When exactly does this error occur?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4024376#4024376
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4024376
17 years, 10 months