Spring WS with webServiceTemplate.marshalSendAndReceive returns Received error for request, Service Unavailable : Not Found [404] - jaxb

I'm trying to ammend an existing SOAP Webservice that uses Spring-WS and JAXB on Tomcat. I've created the new WAR file with my changes and deployed it in the webapps foder under Tomcat installation.
When calling the original (already existing) methods of the service, the service SOAP request and response is fine. But when calling the service on the new method, I get service SOAP response of service unavailable and not found [404]
2011-07-25 12:58:23,365 DEBUG [org.springframework.ws.client.core.WebServiceTemplate] - Opening [org.springframework.ws.transport.http.HttpUrlConnection#12b9f14] to [http://<service URL>]
2011-07-25 12:58:23,521 DEBUG [org.springframework.ws.soap.saaj.support.SaajUtils] - SOAPElement [com.sun.xml.internal.messaging.saaj.soap.ver1_1.Envelope1_1Impl] implements SAAJ 1.3
2011-07-25 12:58:23,552 DEBUG [org.springframework.ws.soap.saaj.support.SaajUtils] - SOAPElement [com.sun.xml.internal.messaging.saaj.soap.ver1_1.Body1_1Impl] implements SAAJ 1.3
2011-07-25 12:58:23,896 DEBUG [org.springframework.ws.client.MessageTracing.sent] - Sent request [<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"><SOAP-ENV:Header/><SOAP-ENV:Body><ns2:DelRequest xmlns:ns2="http://<changed_address>"><ns2:userId>ncc1#%</ns2:userId><ns2:dateFromMillis>1308956400000</ns2:dateFromMillis><ns2:dateToMillis>1311634800000</ns2:dateToMillis></ns2:DelRequest></SOAP-ENV:Body></SOAP-ENV:Envelope>]
2011-07-25 12:58:25,318 DEBUG [org.springframework.ws.client.core.WebServiceTemplate] - Received error for request [SaajSoapMessage {http://<changed_address>}DelRequest]
2011-07-25 12:58:25,318 ERROR [net.msgplugin.controller.DeleteController] - Conversation service unavailable at: http://, Not Found [404] , null
I've imported the project into Eclipse and have made the following changes to the project properties:
1) With in Project Facets, I've checked the 'Dynamic Web Module' and 'Java' Facets.
2) In Java EE Module Dependencies, I've checked Maven Dependencies.
Two things which are to be noted here are:
a) The developer was using JBoss when developing the Webservice but recently the project was chagned to Tomcat.
b) The project has a MAVEN folder structure, hence the web.xml file is in src/main/webapp/WEB-INF folder rather than WebContent/WEB-INF, taht got created when I selected the 'Dynamic Web Module' facet.
Any suggestions wld be hugely appreciated?
Thanks
========================================================================
HI
I managed to fix the Not Found [404] error but am now getting another error.
Upon further investigation and debuggin into WebServiceTemplate and MessageDispatcher classes, I found that following output on the console:
DEBUG [org.springframework.ws.transport.http.WebServiceMessageReceiverHandlerAdapter] - Accepting incoming [org.springframework.ws.transport.http.HttpServletConnection#11f05a1] to [http://<Service_URL>]
TRACE [org.springframework.ws.server.MessageTracing.received] - Received request [<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"><SOAP-ENV:Header/><SOAP-ENV:Body><ns2:DelRequest xmlns:ns2="http://<changed_address>"><ns2:userId>ncc1#%</ns2:userId><ns2:dateFromMillis>1309042800000</ns2:dateFromMillis><ns2:dateToMillis>1311721200000</ns2:dateToMillis></ns2:DelRequest></SOAP-ENV:Body></SOAP-ENV:Envelope>]
DEBUG [org.springframework.ws.server.endpoint.mapping.PayloadRootAnnotationMethodEndpointMapping] - Looking up endpoint for [{<changed_address>}DelRequest]
DEBUG [org.springframework.ws.soap.server.SoapMessageDispatcher] - Endpoint mapping [org.springframework.ws.server.endpoint.mapping.PayloadRootAnnotationMethodEndpointMapping#6ee035] maps request to endpoint [public final net.org.messagehistory.schema.GetDelResponse net.org.messagehistory.service.endpoint.MessageHistoryEndpoint.delHistory(net.org.messagehistory.schema.GetListRequest) throws javax.xml.datatype.DatatypeConfigurationException]
DEBUG [org.springframework.ws.soap.server.SoapMessageDispatcher] - Testing endpoint adapter [org.springframework.ws.server.endpoint.adapter.GenericMarshallingMethodEndpointAdapter#1a23f67]
DEBUG [org.springframework.ws.server.endpoint.adapter.GenericMarshallingMethodEndpointAdapter] - Unmarshalled payload request to [net.org.messagehistory.schema.DelRequest#c76003]
The end error message is now 'Argument type Mismatch' which I found was generated from one of the methods from within WebServiceTemplate.class
Can somebody suggest what coudl be the problem here?

Managed to get this sorted. So, just wanted to share the solution that somebody might find helpful.
Make sure that the Endpoint method is annotated with the following
#PayloadRoot(localPart = MESSAGES_TO_DELETE, namespace = MESSAGE_NAMESPACE)
where localpart is the same as the your payload request in the schema.xsd
Thanks

Related

enableTransaction not working with J2ee Container

I get below error when I consume message in a Jboss ejb container
2022-05-18 22:37:24,699 ERROR [org.jboss.resource.adapter.jms.inflow.JmsActivation] Unable to reconnect org.jboss.resource.adapter.jms.inflow.JmsActivationSpec#8315a9(ra=org.jboss.resource.adapter.jms.JmsResourceAdapter#10a62f0 destination=queues/Subscriber.global.globalvirtual.e2e.cmdm.changepub.Virtual destinationType=javax.jms.Queue tx=true durable=false reconnect=10 provider=java:/ACTIVEMQJMSNONXAProviderAsync user=ldcp.cmdm pass= )
javax.jms.JMSException: Please enable transactions on PulsarConnectionFactory with enableTransaction=true
After getting this error - I set enableTransaction=true and started getting different error
javax.jms.JMSException: not supported
at com.datastax.oss.pulsar.jms.PulsarConnection.createConnectionConsumer(PulsarConnection.java:685)
the error is in createConnectionConsumer.
This is the method called by the JBoss container.
This method is currently not implemented
https://github.com/datastax/pulsar-jms/blob/96606d0f22a1af8fdde0c5eff0f5dde086d9862c/pulsar-jms/src/main/java/com/datastax/oss/pulsar/jms/PulsarConnection.java#L685
the implementation should be quite straighforward.
There are integration tests for Payara and Apache TomEE but JBoss is still not covered.
Please open an issue on github.

Unable to start guidewire CC server from tomcat

We have been trying to start the claimcenter server from tomcat. The server is getting started even though it throws exception with the message "ClaimCenter unable to start" in the logs. Please find the log details below.
gw.pl.exception.GWLifecycleException: An exception was thrown while starting a component. Setting runlevel to NODAEMONS
Caused by: gw.pl.exception.GWLifecycleException:Messaging plugin does not implement MessageTransport interface error
Possible causes -
The xyzMessageTransport class failed to instantiate due to invalid parameters.
A class which is not implementation of MessageTransport inteface configured under
MessageTransport plugin. check messaging-config.xml.
Also - specify plugin name or attach whole log if possible.

Error 404: ProxyServlet: /activiti-explorer

So, well, I am trying to get started with Workflow for XPages however, I am not able to get the activiti-explorer working. I am trying to setup the application named "Sample Application on Activiti" (this application is present as one of the sample).
I followed the following steps as listed in the tutorial:
Installed Extension Library and H2 Database; and copied the active server plugins.
Installed the site.xml on client and server.
Started the h2 database.
Updated the activiti.workflow file
According to these steps when I visit "myServer/activiti-explorer" a login should come but instead I am getting the above mentioned error. The only solution I thought about was that the activiti-explorer.war file was to be kept in the domino directory somewhere (similar to webapps in tomcat: which works very well btw.). I tried putting it in "domino/data" directory with no success.
Also, there is an open topic on openntf discussion tab of the same project with no response yet. Just for reference the link is:
http://www.openntf.org/main.nsf/project.xsp?r=project/Workflow%20for%20XPages/discussions/6B020B585420E70886257B6E004E5A32
Edit 1: After digging in more, I found out that the domino throws a different error the very first time I try to access the activiti-explorer and rest all times it throws the same error mentioned in the title. However, the console looks something like this after the first request.
18-06-2014 12:17:17 HTTP JVM: Activiti Explore Started
18-06-2014 12:17:17 HTTP JVM: Web Container : com.ibm.pvc.internal.webcontainer.webapp.BundleDeployedModule : CWPWC0032E: Error occured while processing annotation for the servlet java.lang.ClassNotFoundException: org.activiti.explorer.servlet.ExplorerApplicationServlet.
18-06-2014 12:17:17 HTTP JVM: 1. The supported annotations are #DeclareRoles,#PreDestroy and #PostConstruct for servlets.
18-06-2014 12:17:17 HTTP JVM: 2. Check that the class resides in the proper package directory.
18-06-2014 12:17:17 HTTP JVM: 3. Check that the classname has been defined in the server using the proper case and fully qualified package.
18-06-2014 12:17:17 HTTP JVM: 4. Check that the class was transfered to the filesystem using a binary transfer mode.
18-06-2014 12:17:17 HTTP JVM: 5. Check that the class was compiled using the proper case (as defined in the class definition).
18-06-2014 12:17:17 HTTP JVM: 6. Check that the class file was not renamed after it was compiled. Thread[Thread-6,5,main]. For more detailed information, please consult error-log-0.xml located in C:/Program Files/IBM/Lotus/Domino/data/domino/workspace/logs
I understand it is a class not found exception but I am not sure how to get through it.
Any help would really be appreciated here. Thanks.

Error orchestrating web service deployed in azure with Apache ODE

I am trying to orchestrate a web service deployed in Windows Azure with Apache ODE. I am testing the services with the Eclipse integrated Web Service Explorer. The Azure WS works fine but when I test the Artifacts.wsdl it throws the following error:
14:41:38,777 INFO [DeploymentPoller] Deployment of artifact BPEL_process successful: [{http://artifacts}process-132]
14:41:49,474 WARN [SimpleScheduler] Dispatching jobs with more than 5 minutes delay. Either the server was down for some time or the job load is greater than available capacity
14:41:57,594 WARN [ExternalService] Fault response: faultType=(unkown)
<?xml version='1.0' encoding='utf-8'?><s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/"><s:Body><s:Fault><faultcode xmlns:a="http://schemas.microsoft.com/net/2005/12/windowscommunicationfoundation/dispatcher">a:InternalServiceFault</faultcode><faultstring xml:lang="en-US">The server was unable to process the request due to an internal error. For more information about the error, either turn on IncludeExceptionDetailInFaults (either from ServiceBehaviorAttribute or from the <serviceDebug> configuration behavior) on the server in order to send the exception information back to the client, or turn on tracing as per the Microsoft .NET Framework 3.0 SDK documentation and inspect the server trace logs.</faultstring></s:Fault></s:Body></s:Envelope>
14:41:57,620 ERROR [INVOKE] Failure during invoke:
14:41:57,623 INFO [BpelRuntimeContextImpl] ActivityRecovery: Registering activity 15, failure reason: on channel 27
Here are the files:
process.bpel
Artifacts.wsdl
mod2.wsdl
mod2.xsd
EDIT This is what I get when I add the IncludeExceptionDetailInFaults in my Web Service:
17:51:49,762 WARN [ExternalService] Fault response: faultType=(unkown)
<?xml version='1.0' encoding='utf-8'?><s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/"><s:Body><s:Fault><faultcode xmlns:a="http://schemas.microsoft.com/net/2005/12/windowscommunicationfoundation/dispatcher">a:InternalServiceFault</faultcode><faultstring xml:lang="en-US">Object reference not set to an instance of an object.</faultstring><detail><axis2ns1:ExceptionDetail xmlns:axis2ns1="http://schemas.datacontract.org/2004/07/System.ServiceModel" xmlns:i="http://www.w3.org/2001/XMLSchema-instance"><axis2ns1:HelpLink i:nil="true" /><axis2ns1:InnerException i:nil="true" /><axis2ns1:Message>Object reference not set to an instance of an object.</axis2ns1:Message><axis2ns1:StackTrace> at WCFServiceWebRole1.AzureImpl.mod2(String arg0)
at SyncInvokemod2(Object , Object[] , Object[] )
at System.ServiceModel.Dispatcher.SyncMethodInvoker.Invoke(Object instance, Object[] inputs, Object[]& outputs)
at System.ServiceModel.Dispatcher.DispatchOperationRuntime.InvokeBegin(MessageRpc& rpc)
at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage5(MessageRpc& rpc)
at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage31(MessageRpc& rpc)
at System.ServiceModel.Dispatcher.MessageRpc.Process(Boolean isOperationContextSet)</axis2ns1:StackTrace><axis2ns1:Type>System.NullReferenceException</axis2ns1:Type></axis2ns1:ExceptionDetail></detail></s:Fault></s:Body></s:Envelope>
17:51:49,798 ERROR [INVOKE] Failure during invoke:
17:51:49,801 INFO [BpelRuntimeContextImpl] ActivityRecovery: Registering activity 15, failure reason: on channel 27
Still no clue of what it means. Eclipse points out en error on my bpel file. The <copy> tag under <assign> throws:
The from-spec of "<xs:simpleType "string">" is not compatible with to-spec of "<xs:complexType>" but I ignored it because following the xsd schemas it doesn't make sense to me and sometimes it even disappears.
EDIT II:
As mentioned by #vanto the <assign> activity was wrong. I had to add the prefix of the namespace of my wsdl to the CDATA tag:
<bpel:query queryLanguage="urn:oasis:names:tc:wsbpel:2.0:sublang:xpath1.0">
<![CDATA[mod2:mod2Result]]>
</bpel:query>
Still don't fully understantand namespaces but it seems it is related to the fact I had to add elementFormDefault="qualified" to the xsd imported by the wsdl of the Azure Service.
The error means that ODE got a soap fault as a response. This indicates that the invoked Web service raised an exception. Please check the logs of your web service or turn on the IncludeExceptionDetailInFaults feature in order to get details about what went wrong. Please not that ODE does not validate outgoing messages, so if your <assign> activities do not create the correct request, ODE won't notice but the invoked service is likely to complain.

Web application using log4j logs tons of severe error messages

I'm written an application which uses a library (Jabber stream objects) which internally uses log4j. When I deploy the application, there are no errors. However after some time, I could see lots of error message which look like this:
[#|2013-02-26T12:48:56.147+0000|SEVERE|oracle-glassfish3.1.2|javax.enterprise.system.std.com.sun.enterprise.server.logging|_ThreadID=365;_ThreadName=SelectWorker 1;|java.lang.IllegalStateException: WEB9031: WebappClassLoader unable to load resource [org.apache.log4j.spi.NOPLoggerRepository], because it has not yet been started, or was already stopped
at org.glassfish.web.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1401)
at org.glassfish.web.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1359)
at org.apache.log4j.LogManager.getLoggerRepository(LogManager.java:197)
at org.apache.log4j.LogManager.getLogger(LogManager.java:228)
at org.apache.log4j.Logger.getLogger(Logger.java:117)
I have log4j.jar inside the WEB-INF/lib directory of my application, along with the external library (JSO.jar)
The issue [1] looked similar, but doesn't seem to be the same.
[1] Web service is not working on GlassFish
I've found that this happens when I redeploy a Servlet and went away when I overridden destroy() for my Servlet and did some cleanup there.

Resources