[JBossWS] - setRollbackOnly() error during WebService invocation
by rohit.macherla
Hi all,
I am using the JBoss 4.2.2.GA server installed on HP-UX platform. I have some WebServices deployed in this server. These WebServices connect to the Oracle Database 9 and after that, they invoke other WebServices. We are not using Connection Pooling when we connect to the Database and are using the regular :
| Class.forName("oracle.jdbc.driver.OracleDriver").newInstance();
| con=DriverManager.getConnection("jdbc:oracle:thin:@hostname:sid","user","pwd");
|
We are closing the connection when all the things are done in our code. Since we are using Java, this closing of connection happens in the :
| finally{
|
| }
| block.
Note that our WebServices are just Java classes that have been annotated. Hence, we are not using any EJB or Servlets directly. Atleast we are not developing them. When our WebService is invoking other WS, we sometimes get the following exception :
anonymous wrote :
|
| javax.xml.ws.soap.SOAPFaultException: java.lang.IllegalStateException: Cannot call setRollbackOnly() current thread is NOT ass
| ociated with a transaction
| at org.jboss.ws.core.jaxws.SOAPFaultHelperJAXWS.getSOAPFaultException(SOAPFaultHelperJAXWS.java:69)
| at org.jboss.ws.core.jaxws.binding.SOAP11BindingJAXWS.throwFaultException(SOAP11BindingJAXWS.java:109)
| at org.jboss.ws.core.CommonSOAPBinding.unbindResponseMessage(CommonSOAPBinding.java:553)
| at org.jboss.ws.core.CommonClient.invoke(CommonClient.java:371)
| at org.jboss.ws.core.jaxws.client.ClientImpl.invoke(ClientImpl.java:243)
| at org.jboss.ws.core.jaxws.client.ClientProxy.invoke(ClientProxy.java:164)
| at org.jboss.ws.core.jaxws.client.ClientProxy.invoke(ClientProxy.java:150)
| at $Proxy300.process(Unknown Source)
| at com.clarity.oss.ws.ServiceManagerCallbackImpl.orderStateChanged(ServiceManagerCallbackImpl.java:481)
| 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.jboss.wsf.container.jboss42.DefaultInvocationHandler.invoke(DefaultInvocationHandler.java:102)
| at org.jboss.ws.core.server.ServiceEndpointInvoker.invoke(ServiceEndpointInvoker.java:220)
| at org.jboss.wsf.stack.jbws.RequestHandlerImpl.processRequest(RequestHandlerImpl.java:408)
| at org.jboss.wsf.stack.jbws.RequestHandlerImpl.handleRequest(RequestHandlerImpl.java:272)
| at org.jboss.wsf.stack.jbws.RequestHandlerImpl.doPost(RequestHandlerImpl.java:189)
| at org.jboss.wsf.stack.jbws.RequestHandlerImpl.handleHttpRequest(RequestHandlerImpl.java:122)
| at org.jboss.wsf.stack.jbws.EndpointServlet.service(EndpointServlet.java:84)
| at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
| at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
| at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
| at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
| at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
| at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
| at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
| at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
| at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:179)
| at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
| at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
| at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
| at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:157)
| at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
| at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:262)
| at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
| at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
| at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:446)
| at java.lang.Thread.run(Thread.java:595)
|
According to the web, this error occurs when a transaction is marked for rollback while it is already closed. I have also found that a transaction timeout attribute needs to be updated, I don't know if it is relevant or not and I am unable to understand which timeout variable to update.
Any help on this issue is much appreciated. Thank you.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4168723#4168723
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4168723
16 years, 5 months
[JBossWS] - Re: No tests for @SchemaValidation annotation in 3.0.1 ?
by anaholzbach
Hi,
To answer ljgp ("does the schema validation feature really work?"), I've implemented a service endpoint that uses SchemaValidation and it seems to work. I started with an xsd, generated jaxb objects from it and implemented my endpoint using those jaxb objects and the @WebService and @WebMethod annotations. Upon deployment the WSDL was automatically generated. Then I added the @SchemaValidation tag and ran into problems with multiple schema elements and multiple namespaces, because the generated wsdl had one schema for the jaxb objects and another one (with a different namespace) for binding, service, message, portType, etc. I solved that by editing the wsdl to consolidate everything into one schema tag with one namespace and added that edited wsdl locally to my application under META-INF/wsdl. I also had to add minOccurs=1 and maxOccurs=1 in places, since the wsdl's schema ended up with less information than my original schema.
A call to this webservice with a message that does not conform to the schema results in an Exception which is thrown by the StrictlyValidErrorHandler and wrapped in a SOAP Fault - something like:
org.xml.sax.SAXException: cvc-complex-type.2.4.b: The content of element 'specimen' is not complete. One of '{specimen_id}' is expected.
|
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4168580#4168580
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4168580
16 years, 5 months
[JBossWS] - Re: WS-RM Exception: cannot be cast to org.jboss.ws.core.Stu
by moweis
Hi Richard,
You were right.
I went ahead and added all the jboss/jbossws jars to my classpath, and I no longer get the cannot be cast exception.
However, I get a new exception now:
anonymous wrote : Exception in thread "main" org.jboss.ws.extensions.wsrm.api.RMException: Unable to create WSRM sequence
| at org.jboss.ws.core.jaxws.client.ClientImpl.createSequence(ClientImpl.java:563)
| at org.jboss.ws.core.jaxws.client.ClientProxy.invoke(ClientProxy.java:170)
| at org.jboss.ws.core.jaxws.client.ClientProxy.invoke(ClientProxy.java:152)
| at $Proxy16.ping(Unknown Source)
| at org.jboss.test.ws.jaxws.samples.wsrm.client.SimpleServiceTestCase.main(SimpleServiceTestCase.java:33)
| Caused by: javax.xml.ws.WebServiceException: java.lang.UnsupportedOperationException: setProperty must be overridden by all subclasses of SOAPMessage
| at org.jboss.ws.core.jaxws.client.ClientImpl.handleRemoteException(ClientImpl.java:410)
| at org.jboss.ws.core.jaxws.client.ClientImpl.invoke(ClientImpl.java:316)
| at org.jboss.ws.core.jaxws.client.ClientImpl.createSequence(ClientImpl.java:550)
| ... 4 more
| Caused by: java.lang.UnsupportedOperationException: setProperty must be overridden by all subclasses of SOAPMessage
| at javax.xml.soap.SOAPMessage.setProperty(SOAPMessage.java:441)
| at org.jboss.ws.core.soap.SOAPMessageImpl.(SOAPMessageImpl.java:84)
| at org.jboss.ws.core.soap.MessageFactoryImpl.createMessage(MessageFactoryImpl.java:171)
| at org.jboss.ws.core.CommonSOAP11Binding.createMessage(CommonSOAP11Binding.java:59)
| at org.jboss.ws.core.CommonSOAPBinding.bindRequestMessage(CommonSOAPBinding.java:158)
| at org.jboss.ws.core.CommonClient.invoke(CommonClient.java:292)
| at org.jboss.ws.core.jaxws.client.ClientImpl.invoke(ClientImpl.java:304)
| ... 5 more
|
Here is my client code:
package org.jboss.test.ws.jaxws.samples.wsrm.client;
|
| import java.net.URL;
| import javax.xml.namespace.QName;
| import javax.xml.ws.Service;
| import org.jboss.ws.core.StubExt;
| import org.jboss.ws.extensions.wsrm.api.RMProvider;
|
| import org.jboss.test.ws.jaxws.samples.wsrm.generated.SimpleService;
|
|
| public final class SimpleServiceTestCase
| {
|
| private static final String serviceURL = "http://localhost:8080/jaxws-samples-wsrm/SimpleService";
|
| public static void main(String[] args) throws Exception
| {
| String url = null;
| if ( args != null && args.length > 0 && args[0] != null )
| url = args[0];
| else
| url = serviceURL;
| System.out.println("Calling wsdl");
| QName serviceName = new QName("http://www.jboss.org/jbossws/ws-extensions/wsrm", "SimpleService");
| QName portName = new QName("http://www.jboss.org/jbossws/ws-extensions/wsrm", "SimpleServicePort");
| URL wsdlURL = new URL(url + "?wsdl");
| Service service = Service.create(wsdlURL, serviceName);
| SimpleService proxy = (SimpleService)service.getPort(SimpleService.class);
|
| ((StubExt)proxy).setConfigName("Standard Anonymous WSRM Client", "META-INF/wsrm-jaxws-client-config.xml");
|
| proxy.ping(); // one way call
| proxy.echo("Hello World!"); // request responce call
| ((RMProvider)proxy).closeSequence();
| }
|
| }
|
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4168502#4168502
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4168502
16 years, 5 months
[JBossWS] - javax.naming.Name is an interface, and JAXB can't handle int
by kosulin
Hi,
I have a single POJO with 2 methods, first method accesses filesystem, and second - invokes SLSB. When I deploy it to JBoss 5.0.0CR1 (jre 1.6.0_07, Windows Vista SP1), I am getting the following error message:
10:16:02,418 ERROR [AbstractKernelController] Error installing to Real: name=vfszip:/C:/java/jboss-5.0.0.CR1/server/cpportal2/deploy/cpportal2-ear.ear state=PreReal mode=Manual requiredState=Real
org.jboss.deployers.spi.DeploymentException: Error during deploy: vfszip:/C:/java/jboss-5.0.0.CR1/server/cpportal2/deploy/cpportal2-ear.ear/statements-web.war
at org.jboss.deployers.spi.DeploymentException.rethrowAsDeploymentException(DeploymentException.java:49)
at org.jboss.deployers.plugins.deployers.DeployerWrapper.deploy(DeployerWrapper.java:180)
at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:970)
at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:1023)
at org.jboss.deployers.plugins.deployers.DeployersImpl.install(DeployersImpl.java:911)
at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:348)
at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:1392)
at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:784)
at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:912)
at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:834)
at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:672)
at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:455)
at org.jboss.deployers.plugins.deployers.DeployersImpl.process(DeployersImpl.java:594)
at org.jboss.deployers.plugins.main.MainDeployerImpl.process(MainDeployerImpl.java:541)
at org.jboss.system.server.profileservice.hotdeploy.HDScanner.scan(HDScanner.java:290)
at org.jboss.system.server.profileservice.hotdeploy.HDScanner.run(HDScanner.java:221)
at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
at java.util.concurrent.FutureTask$Sync.innerRunAndReset(Unknown Source)
at java.util.concurrent.FutureTask.runAndReset(Unknown Source)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$101(Unknown Source)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.runPeriodic(Unknown Source)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.IllegalStateException: Cannot build JAXB context
at org.jboss.ws.metadata.builder.jaxws.JAXWSMetaDataBuilder.createJAXBContext(JAXWSMetaDataBuilder.java:955)
at org.jboss.ws.metadata.builder.jaxws.JAXWSWebServiceMetaDataBuilder.buildWebServiceMetaData(JAXWSWebServiceMetaDataBuilder.java:156)
at org.jboss.ws.metadata.builder.jaxws.JAXWSServerMetaDataBuilder.setupProviderOrWebService(JAXWSServerMetaDataBuilder.java:52)
at org.jboss.ws.metadata.builder.jaxws.JAXWSMetaDataBuilderJSE.buildMetaData(JAXWSMetaDataBuilderJSE.java:63)
at org.jboss.wsf.stack.jbws.UnifiedMetaDataDeploymentAspect.start(UnifiedMetaDataDeploymentAspect.java:67)
at org.jboss.wsf.framework.deployment.DeploymentAspectManagerImpl.start(DeploymentAspectManagerImpl.java:146)
at org.jboss.wsf.container.jboss50.BareWSFRuntime.start(BareWSFRuntime.java:66)
at org.jboss.wsf.container.jboss50.deployer.JAXWSDeployerHookPostJSE.deploy(JAXWSDeployerHookPostJSE.java:54)
at org.jboss.wsf.container.jboss50.deployer.AbstractWebServiceDeployer.internalDeploy(AbstractWebServiceDeployer.java:62)
at org.jboss.deployers.spi.deployer.helpers.AbstractRealDeployer.deploy(AbstractRealDeployer.java:50)
at org.jboss.deployers.plugins.deployers.DeployerWrapper.deploy(DeployerWrapper.java:174)
... 23 more
Caused by: org.jboss.ws.WSException: Failed to create JAXBContext
at org.jboss.ws.core.jaxws.CustomizableJAXBContextFactory.createContext(CustomizableJAXBContextFactory.java:116)
at org.jboss.ws.metadata.builder.jaxws.JAXWSMetaDataBuilder.createJAXBContext(JAXWSMetaDataBuilder.java:951)
... 33 more
Caused by: com.sun.xml.bind.v2.runtime.IllegalAnnotationsException: 3 counts of IllegalAnnotationExceptions
javax.naming.Name is an interface, and JAXB can't handle interfaces.
this problem is related to the following location:
at javax.naming.Name
at private javax.naming.Name com.wsc.cp.web.statements.jaxws.NamingExceptionBean.remainingName
at com.wsc.cp.web.statements.jaxws.NamingExceptionBean
javax.naming.Name does not have a no-arg default constructor.
this problem is related to the following location:
at javax.naming.Name
at private javax.naming.Name com.wsc.cp.web.statements.jaxws.NamingExceptionBean.remainingName
at com.wsc.cp.web.statements.jaxws.NamingExceptionBean
java.lang.StackTraceElement does not have a no-arg default constructor.
this problem is related to the following location:
at java.lang.StackTraceElement
at public java.lang.StackTraceElement[] java.lang.Throwable.getStackTrace()
at java.lang.Throwable
at private java.lang.Throwable com.wsc.cp.web.statements.jaxws.NamingExceptionBean.rootCause
at com.wsc.cp.web.statements.jaxws.NamingExceptionBean
at com.sun.xml.bind.v2.runtime.IllegalAnnotationsException$Builder.check(IllegalAnnotationsException.java:102)
at com.sun.xml.bind.v2.runtime.JAXBContextImpl.getTypeInfoSet(JAXBContextImpl.java:438)
at com.sun.xml.bind.v2.runtime.JAXBContextImpl.(JAXBContextImpl.java:286)
at com.sun.xml.bind.v2.ContextFactory.createContext(ContextFactory.java:139)
at com.sun.xml.bind.api.JAXBRIContext.newInstance(JAXBRIContext.java:105)
at org.jboss.ws.core.jaxws.CustomizableJAXBContextFactory.createContext(CustomizableJAXBContextFactory.java:110)
... 34 more
10:16:03,189 WARN [HDScanner] Failed to process changes
org.jboss.deployers.client.spi.IncompleteDeploymentException: Summary of incomplete deployments (SEE PREVIOUS ERRORS FOR DETAILS):
*** CONTEXTS IN ERROR: Name -> Error
vfszip:/C:/java/jboss-5.0.0.CR1/server/cpportal2/deploy/cpportal2-ear.ear -> com.sun.xml.bind.v2.runtime.IllegalAnnotationsException: 3 counts of IllegalAnnotationExceptions
javax.naming.Name is an interface, and JAXB can't handle interfaces.
this problem is related to the following location:
at javax.naming.Name
at private javax.naming.Name com.wsc.cp.web.statements.jaxws.NamingExceptionBean.remainingName
at com.wsc.cp.web.statements.jaxws.NamingExceptionBean
javax.naming.Name does not have a no-arg default constructor.
this problem is related to the following location:
at javax.naming.Name
at private javax.naming.Name com.wsc.cp.web.statements.jaxws.NamingExceptionBean.remainingName
at com.wsc.cp.web.statements.jaxws.NamingExceptionBean
java.lang.StackTraceElement does not have a no-arg default constructor.
this problem is related to the following location:
at java.lang.StackTraceElement
at public java.lang.StackTraceElement[] java.lang.Throwable.getStackTrace()
at java.lang.Throwable
at private java.lang.Throwable com.wsc.cp.web.statements.jaxws.NamingExceptionBean.rootCause
at com.wsc.cp.web.statements.jaxws.NamingExceptionBean
at org.jboss.deployers.plugins.deployers.DeployersImpl.checkComplete(DeployersImpl.java:676)
at org.jboss.deployers.plugins.main.MainDeployerImpl.checkComplete(MainDeployerImpl.java:661)
at org.jboss.system.server.profileservice.hotdeploy.HDScanner.scan(HDScanner.java:291)
at org.jboss.system.server.profileservice.hotdeploy.HDScanner.run(HDScanner.java:221)
at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
at java.util.concurrent.FutureTask$Sync.innerRunAndReset(Unknown Source)
at java.util.concurrent.FutureTask.runAndReset(Unknown Source)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$101(Unknown Source)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.runPeriodic(Unknown Source)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
===============================================
Here is my code which causes the problem:
@WebMethod(operationName = "GetStatements")
public StatementListDO getReportingDates(@WebParam(name = "Username") final String user,
@WebParam(name = "ClientId") final String clientId,
@WebParam(name = "TaxYear") final String taxYear,
@WebParam(name = "AccountNo") final String custAccountNo)
throws IncorrectParameterException, DBConnectionException, NamingException
{
StatementHandler.logger.info("Received request from user '" + user +
"' for a list of statements available for Client Id " + clientId + ", Tax Year " +
taxYear + ", AccountNo " + custAccountNo);
StatementListDO sldo = new StatementListDO();
try
{
InitialContext ic = new InitialContext();
// Statements stmts = (Statements)ic.lookup(Statements.class.getName());
// sldo = stmts.getReportingDates(clientId, taxYear, custAccountNo);
}
catch(NamingException e)
{
StatementHandler.logger.error(e);
throw new DBConnectionException("Processing error");
}
return sldo;
}
If I comment InitalContext out (as I did for the SLSB invocation code), it deploys fine. But how can I resolve my SLSB then?
I'd prefer not to expose SLSB directly through WS annotations, becuase this means having 2 endpoints and 2 WSDL definitions.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4168479#4168479
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4168479
16 years, 5 months