[JBossWS] - POJO webservice in war file under jboss 5 beta 4
by sducas
Hello all!
I'm trying to get my webservice work from as 4.0.2 to 5.0beta4..
It's a POJO implementation bundled in WEB-INF/classes folder of a war archive
I can not make it work with AS 5 beta 4, when starting server has this excpetion:
Caused by: java.lang.IllegalStateException: Cannot obtain context root
at org.jboss.wsf.framework.deployment.BackwardCompatibleURLPatternDeploymentAspect.getExplicitPattern(BackwardCompatibleURLPatternDeploymentAspect.java:50)
at org.jboss.wsf.framework.deployment.URLPatternDeploymentAspect.create(URLPatternDeploymentAspect.java:50)
at org.jboss.wsf.framework.deployment.DeploymentAspectManagerImpl.deploy(DeploymentAspectManagerImpl.java:115)
at org.jboss.wsf.container.jboss50.ArchiveDeployerHook.deploy(ArchiveDeployerHook.java:95)
at org.jboss.wsf.container.jboss50.AbstractWebServiceDeployer.internalDeploy(AbstractWebServiceDeployer.java:63)
at org.jboss.deployers.spi.deployer.helpers.AbstractRealDeployer.deploy(AbstractRealDeployer.java:50)
at org.jboss.deployers.plugins.deployers.DeployerWrapper.deploy(DeployerWrapper.java:169)
... 17 more
Has someone experienced a POJO in war file with jboss5beta4 ?
I've tryed putting it to session EJB3 (still in a war file) but the same exception appear...
Is it still possbile to have a web service in war file with as5?
Where can I find any sample of a such war?
THX!
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4153491#4153491
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4153491
16 years, 7 months
[JBossWS] - New to WS... Need help...
by fil78
Hello people,
I am very new to WS and I try to implement simpliest WS based on EJB3 and I get exception... Please, could somebody tell me what am I doing wrong?
Here is my code:
Bean:
|
|
| import javax.ejb.Remote;
| import javax.ejb.Stateless;
| import javax.jws.WebMethod;
| import javax.jws.WebService;
| import javax.jws.soap.SOAPBinding;
|
| @Stateless
| @Remote(ProfileMgmtRemote.class)
| @WebService
| @SOAPBinding(style = SOAPBinding.Style.RPC)
| public class ProfileMgmtBean {
|
| @WebMethod
| public int summ(int a, int b){
|
| return a+b;
| }
|
| }
|
|
Interface:
|
| public interface ProfileMgmtRemote {
|
| public int summ(int a, int b);
| }
|
|
and client:
|
| import java.net.MalformedURLException;
| import java.net.URL;
|
| import javax.xml.namespace.QName;
| import javax.xml.ws.Service;
|
| import com.tsystems.web.services.sample.ProfileMgmtRemote;
|
| public class WSClient {
|
|
| private String endpointURL = "http://127.0.0.1:8080/WebServiceProject/ProfileMgmtBean?wsdl";
| private String targetNS = "http://sample.services.web.tsystems.com/";
|
| /**
| * @param args
| */
|
| public static void main(String[] args) {
|
| WSClient wsc = new WSClient();
| try {
| System.out.println("");
| URL wsdlURL = new URL(wsc.endpointURL);
| QName serviceName = new QName(wsc.targetNS, "ProfileMgmtBeanService");
| Service service = Service.create(wsdlURL, serviceName);
| ProfileMgmtRemote inst = (ProfileMgmtRemote)service.getPort(ProfileMgmtRemote.class);
| System.out.println("And summ = " + inst.summ(1, 1));
|
| } catch (MalformedURLException e) {
| e.printStackTrace();
| }
|
|
| }
|
| }
|
|
Finally I get the following stack trace:
|
| Exception in thread "main" javax.xml.ws.WebServiceException: Unable to load Provider: Failed to load javax.xml.ws.spi.Provider: com.sun.xml.ws.spi.ProviderImpl
| at javax.xml.ws.spi.Provider.provider(Provider.java:90)
| at javax.xml.ws.Service.<init>(Service.java:81)
| at javax.xml.ws.Service.create(Service.java:98)
| at com.tsystems.test.client.WSClient.main(WSClient.java:28)
| Caused by: java.lang.IllegalStateException: Failed to load javax.xml.ws.spi.Provider: com.sun.xml.ws.spi.ProviderImpl
| at javax.xml.ws.spi.ProviderLoader.loadProvider(ProviderLoader.java:96)
| at javax.xml.ws.spi.Provider.provider(Provider.java:82)
| ... 3 more
| Caused by: java.lang.ExceptionInInitializerError
| at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
| at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
| at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
| at java.lang.reflect.Constructor.newInstance(Constructor.java:494)
| at java.lang.Class.newInstance0(Class.java:350)
| at java.lang.Class.newInstance(Class.java:303)
| at javax.xml.ws.spi.ProviderLoader.loadProvider(ProviderLoader.java:91)
| ... 4 more
| Caused by: javax.xml.ws.WebServiceException: Error creating JAXBContext for W3CEndpointReference.
| at com.sun.xml.ws.spi.ProviderImpl.getEPRJaxbContext(ProviderImpl.java:188)
| at com.sun.xml.ws.spi.ProviderImpl.<clinit>(ProviderImpl.java:65)
| ... 11 more
| Caused by: com.sun.xml.bind.v2.runtime.IllegalAnnotationsException: 2 counts of IllegalAnnotationExceptions
| Two classes have the same XML type name "address". Use @XmlType.name and @XmlType.namespace to assign different names to them.
| this problem is related to the following location:
| at com.sun.xml.ws.developer.MemberSubmissionEndpointReference$Address
| at public com.sun.xml.ws.developer.MemberSubmissionEndpointReference$Address com.sun.xml.ws.developer.MemberSubmissionEndpointReference.addr
| at com.sun.xml.ws.developer.MemberSubmissionEndpointReference
| this problem is related to the following location:
| at javax.xml.ws.wsaddressing.W3CEndpointReference$Address
| at private javax.xml.ws.wsaddressing.W3CEndpointReference$Address javax.xml.ws.wsaddressing.W3CEndpointReference.address
| at javax.xml.ws.wsaddressing.W3CEndpointReference
| Two classes have the same XML type name "elements". Use @XmlType.name and @XmlType.namespace to assign different names to them.
| this problem is related to the following location:
| at com.sun.xml.ws.developer.MemberSubmissionEndpointReference$Elements
| at public com.sun.xml.ws.developer.MemberSubmissionEndpointReference$Elements com.sun.xml.ws.developer.MemberSubmissionEndpointReference.referenceProperties
| at com.sun.xml.ws.developer.MemberSubmissionEndpointReference
| this problem is related to the following location:
| at javax.xml.ws.wsaddressing.W3CEndpointReference$Elements
| at private javax.xml.ws.wsaddressing.W3CEndpointReference$Elements javax.xml.ws.wsaddressing.W3CEndpointReference.referenceParameters
| at javax.xml.ws.wsaddressing.W3CEndpointReference
|
| 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.<init>(JAXBContextImpl.java:286)
| at com.sun.xml.bind.v2.ContextFactory.createContext(ContextFactory.java:139)
| at com.sun.xml.bind.v2.ContextFactory.createContext(ContextFactory.java:117)
| 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 javax.xml.bind.ContextFinder.newInstance(ContextFinder.java:211)
| at javax.xml.bind.ContextFinder.find(ContextFinder.java:372)
| at javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:574)
| at javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:522)
| at com.sun.xml.ws.spi.ProviderImpl.getEPRJaxbContext(ProviderImpl.java:186)
| ... 12 more
|
|
I am using JBoss 4.2.2.GA and jbossws-3.0.1-native-2.0.4.GA.
Thanx for help.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4153483#4153483
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4153483
16 years, 7 months
[JBossWS] - Problems using handlers
by Sancheski
Hi,
I am trying to set a handler to a web method. The problem is that I think that everything is set fine and the execution is not even going trough it.
This is my handler:
| package handlers;
|
| import java.util.Set;
| import java.util.TreeSet;
|
| import javax.xml.namespace.QName;
| import javax.xml.ws.handler.MessageContext;
| import javax.xml.ws.handler.soap.SOAPHandler;
| import javax.xml.ws.handler.soap.SOAPMessageContext;
|
|
| public class AuthenticationHandler implements SOAPHandler <SOAPMessageContext>{
|
| public Set<QName> getHeaders() {
| return new TreeSet<QName>();
| }
|
| public void close(MessageContext msgContext) {
| System.out.println("Closing");
| }
|
| public boolean handleFault(SOAPMessageContext msgContext) {
| System.out.println("FAULT");
| return true;
| }
|
| public boolean handleMessage(SOAPMessageContext msgContext)
| {
| System.out.println("MESSAGE");
| return true;
| }
|
| }
|
|
It is packaged in WEB-INF/clasess/jaxws-location-handlers.xml and its config file is:
| <?xml version="1.0" encoding="UTF-8"?>
|
| <handler-chains xmlns="http://java.sun.com/xml/ns/javaee"
| xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
| xmlns:ns1="http://org.jboss.ws/jaxws/handlerscope"
| xsi:schemaLocation="http://java.sun.com/xml/ns/javaee javaee_web_services_1_2.xsd">
|
| <handler-chain>
| <handler>
| <handler-class>handlers.AuthenticationHandler</handler-class>
| </handler>
| </handler-chain>
|
| </handler-chains>
And this is how I am trying to use it in my web service (just say that the ws works perfectly):
| package ws.impl;
|
| public class ServiceImpl implements Service{
| ........
| ........
| @HandlerChain(file = "jaxws-location-handlers.xml")
| public String getItem(...){
| }
| }
|
They are all together packaged in the same war file. I am using jbossws-2.0.3GA and Jboss-4.2.2.
I do not know why it is not working, as it seems so easy to set it up. Do I have something wrong in the service? Any idea?
Thanks a lot
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4153423#4153423
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4153423
16 years, 7 months
[JBossWS] - Namespace issue for SEIs extending common interface
by yogeshkb
HI Team,
I have two webservices with separate SEIs (say A in targetNamespace X and B in targetNamespace Y) each one extending a common interface (say C)
When I generated the WSDLs using the wsprovide tool, I can see the two wsdl files each containing the schema for the operations of common interface C getting generated as part of the SEI A's namespace and SEI B's namespace individually which is expected as per the standards..
I deployed these webservices in JBoss4.2.2 with JBossWS2.0.3. When I tried to open the wsdls from the JBoss server, the wsdls generated from the jboss server seems to have the operations of common interface C available as part of the SEI A. But for the SEI B, the operations of common interface C are imported from SEI A's namespace.
I was expecting the operations of common interface C to be available in each individual webservice's namespace as unique operations.
I also tried to explicitly specify the XmlType annotation in the common interface class C to have a common namespace but even this attempt got failed.
Pls let me know how to workaround this problem.
Regards,
Yogesh.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4153304#4153304
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4153304
16 years, 7 months