WebService EndPoint Not accessible in Jboss Fuse 6 - web-services

I developed Simple WebService OSGI Bundle with Eclipse Libra, Apache CXF and deployed it in JBoss Fuse 6. But when i tried to access it with http://x.x.x.x:8181/cxf/TestWs?wsdl it shows nothing.
I also tried following URL http://x.x.x.x:8181/cxf and it says no services.
I check status of this with karaf shell osgi:list and it shows me its Active.
Please let me know if i am doing any wrong?
Following is my Manifest.Mf
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: TestWs
Bundle-SymbolicName: TestWs
Bundle-Version: 1.0.0.qualifier
Bundle-ClassPath: WEB-INF/classes/
Export-Package: com.irk.ws,
com.irk.ws.jaxws
Bundle-RequiredExecutionEnvironment: JavaSE-1.7
Import-Package: javax.el,
javax.servlet,
javax.servlet.http,
javax.servlet.jsp,
javax.servlet.jsp.el,
javax.servlet.jsp.tagext
Web-ContextPath: /TestWs
Regards,

did you try adding camel-cxf feature ?

Related

Consuming webservice from application deployed on websphere

I have been trying to consume a webservice(WS-JAX) in java.
I have generated JAVA artifacts using wsimport tool. I constructed a standalone test class(on eclipse) and was able to call the webservice successfully.
But when I use the same actifacts and code in my application(deployed on websphere 8) I get below exception
`
[2/5/16 10:54:13:531 MST] FFDC Exception:java.lang.StackOverflowError SourceId:com.ibm.ejs.container.RemoteExceptionMappingStrategy.setUncheckedException ProbeId:200 Reporter:com.ibm.ejs.container.RemoteExceptionMappingStrategy#625fad44
java.lang.StackOverflowError
at java.util.HashMap.<init>(HashMap.java:367)
at com.ibm.wsdl.DefinitionImpl.getAllServices(DefinitionImpl.java:859)
at com.ibm.wsdl.DefinitionImpl.getAllServices(DefinitionImpl.java:873)
at org.apache.axis2.wsdl.util.WSDLWrapperReloadImpl.getAllServices(WSDLWrapperReloadImpl.java:903)
at org.apache.axis2.wsdl.util.WSDLDefinitionWrapper.getAllServices(WSDLDefinitionWrapper.java:478)
at com.ibm.wspolicy.wsdl.internal.subject.DefinitionSubjectProcessor.<init>(DefinitionSubjectProcessor.java:60)
at com.ibm.wspolicy.wsdl.internal.WSDLProcessorImpl.buildWSDLPolicyModel(WSDLProcessorImpl.java:79)
at com.ibm.ws.wspolicy.wsdl.WSDLProcessor.<init>(WSDLProcessor.java:137)
at com.ibm.ws.wspolicy.policyset.WSDLHelperImpl.processWSPolicyInPackagedWSDL(WSDLHelperImpl.java:80)
at com.ibm.ws.websvcs.deployment.WASAxis2PolicySetConfigurator.associatePolicySets(WASAxis2PolicySetConfigurator.java:385)
at com.ibm.ws.websvcs.client.WSClientConfigurationFactory.completeAxis2Configuration(WSClientConfigurationFactory.java:459)
at org.apache.axis2.jaxws.description.impl.EndpointDescriptionImpl.<init>(EndpointDescriptionImpl.java:286)
at org.apache.axis2.jaxws.description.impl.EndpointDescriptionImpl.<init>(EndpointDescriptionImpl.java:223)
at org.apache.axis2.jaxws.description.impl.ServiceDescriptionImpl.updateEndpointDescription(ServiceDescriptionImpl.java:534)
at org.apache.axis2.jaxws.description.impl.DescriptionFactoryImpl.updateEndpoint(DescriptionFactoryImpl.java:382)
at org.apache.axis2.jaxws.description.DescriptionFactory.updateEndpoint(DescriptionFactory.java:180)
at org.apache.axis2.jaxws.spi.ServiceDelegate.getPort(ServiceDelegate.java:597)
at org.apache.axis2.jaxws.spi.ServiceDelegate.getPort(ServiceDelegate.java:513)
at javax.xml.ws.Service.getPort(Service.java:99)`
Could someone shed some light on why the webservice call is failing when it is originating inside a application server?
Note: I have installed proper server certificates in the application server truststore.
So i found the solution, I had 2 different JRE's installed on my computer. One was from Oracle and the other was the jre bundled with websphere application server. For a application to be deployed on Websphere we have to generate the java artifacts using the IBM jre thats bundled with Websphere.
Thanks,
Harsha

Jersey 1.18 in weblogic 12.2

I have a web service in a weblogic 12.1 server (where it works) that I now have to transfer in a new weblogic 12.2 server. In my WEB-INF/lib jars I have jersey 1.18 files. However when I deploy it, it seems that Jersey 1.18 gets overridden by Jersey 2.21 and by calling the web service I get a "404 not found error". Application.wadl now has <ns0:doc ns1:generatedBy="Jersey: 2.21.1 2015-09-16..."/> so I guess that's where the problem is.
I tried putting a weblogic.xml file in WEB-INF with:
<container-descriptor>
<prefer-web-inf-classes>true</prefer-web-inf-classes>
</container-descriptor>
but nothing changed. How can I force using Jersey 1.18 ?
weblogic 12.2.x does not support jersey 1.x server api any more. It is better to use jersey 2.x api. For the 404 issue, I think you can use this link to change your app .
http://docs.oracle.com/middleware/1221/wls/RESTF/jersey-back-comp.htm#RESTF385
You may resolve the issue by changing your web.xml:
Before:
<servlet-class>com.sun.jersey.spi.container.servlet.ServletContainer</servlet-class>
After:
<servlet-class>org.glassfish.jersey.servlet.ServletContainer</servlet-class>
A safer way to enforce the library version you need is to use shared-libs and reference then in the weblogic.xml file. Here's a sample so you can take a look:
<?xml version="1.0" encoding="UTF-8"?>
<wls:weblogic-web-app xmlns:wls="http://xmlns.oracle.com/weblogic/weblogic-web-app"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://xmlns.oracle.com/weblogic/weblogic-web-app
http://xmlns.oracle.com/weblogic/weblogic-web-app/1.7/weblogic-web-app.xsd">
<wls:library-ref>
<library-name>jax-rs</library-name>
<specification-version>2.0</specification-version>
<exact-match>false</exact-match>
</wls:library-ref>
</wls:weblogic-web-app>
I invite you to access this link to get the detailed process on how to register your jersey lib as shared libs on weblogic instances.

GlassFish, set context-path of webservice

I have EAR with my web-service. No war module in my application.
I mean
http://[host]:[port]/[context-path]/MyWebService?wsdl
For JBoss I am using jboss.xml
For WebLogic I am using weblogic-webservices.xml
What about GlassFish?
It looks like this document says to use the endpoint-address-uri to set the context-root for your web service on GlassFish... That element would go into the glassfish-ejb-jar.xml file.

Why I can not access Axis2 service at localhost?

I am developing a Web Service project using axis2, tomcat and eclipse.
I download axis2 war package and drop it to tomcat/webapps, then I start tomcat , I can access tomcat at http://localhost:8080, but failed to access http://localhost:8080/axis2,please tell me what the problem might be.
Thanks in advance.
Set TOMCAT_HOME environment variable, Set the value to top level directory of your Tomcat install (e.g. D:\programs\apache-tomcat-6.0.29)
what error you are receiving in logs and what version of tomcat using.
If no error is there , please check , the default web services included with Axis2 will be available by visiting http://localhost:8080/axis2/services/
For reference : http://axis.apache.org/axis2/java/core/docs/installationguide.html

Axis2 webservice client weblogic webservice client jar confilct

My application is a war deployed in weblogic 10. In one of my class, I need to make 2 webservice calls A and W. A is based on AXIS2 using wstx-asl-3.2.4.jar, W is based on weblogic webservice using jars in weblogic. I guess due to the conflict between wstx-asl and weblogic stax implementation, they can not be made at the same time.
Here is the detail of the problem:
1. If I remove wstx-asl-3.2.4.jar from web-inf/lib folder,
B is OK but A is faild due to exception: ClassCastException:weblogic.xml.stax.XMLStreamInputFactory
2. If I keep wstx-asl-3.2.4.jar in web-inf/lib folder,
A is OK but B is faild due to the exception:
[java.lang.ExceptionInInitializerError at com.bea.staxb.runtime.internal.BindingContextImpl.createMarshaller(BindingContextImpl.java:65) at weblogic.wsee.bind.runtime.internal.LiteralSerializerContext.(LiteralSerializerContext.java:54) at weblogic.wsee.bind.runtime.internal.RuntimeBindingsImpl.createSerializerContext(RuntimeBindingsImpl.java:152) at weblogic.wsee.bind.runtime.internal.RuntimeBindingsImpl.createSerializerContext(RuntimeBindingsImpl.java:168) at weblogic.wsee.codec.soap11.SerializationContextUtil.createSerializerContext(SerializationContextUtil.java:26) at weblogic.wsee.codec.soap11.SoapEncoder.encodeParts(SoapEncoder.java:179) at weblogic.wsee.codec.soap11.SoapEncoder.encode(SoapEncoder.java:119) at weblogic.wsee.codec.soap11.SoapCodec.encode(SoapCodec.java:128) at weblogic.wsee.ws.dispatch.client.CodecHandler.encode(CodecHandler.java:52) at weblogic.wsee.ws.dispatch.client.CodecHandler.handleRequest(CodecHandler.java:41) at weblogic.wsee.handler.HandlerIterator.handleRequest(HandlerIterator.java:123) at weblogic.wsee.handler.HandlerIterator.handleRequest(HandlerIterator.java:99) at weblogic.wsee.ws.dispatch.client.ClientDispatcher.dispatch(ClientDispatcher.java:101) at weblogic.wsee.ws.WsStub.invoke(WsStub.java:89) at weblogic.wsee.jaxrpc.StubImpl._invoke(StubImpl.java:331) at
.........................
Please advise how to make them successful together. Thanks.
in your deployment weblogic.xml file, use the <prefer-web-inf-classes> tag and set it to true for the axis2 call. And set it to false for the weblogic web service.
http://download.oracle.com/docs/cd/E13222_01/wls/docs90/programming/classloading.html#1082452