[JBossWS] - Re: JBOSS-5.1.0.GA web service client doesn't work ( runtime
by rangalo
Thanks,
Now I have at least some other error !
If I use only lib I get this error, I think it is related to stax implementation.
Am I missing some jar?
| [hardik@antariksh: HelloWsClient]$ wsrunclient.sh -cp "dist/hello-client.jar:jboss-generated:lib" com.hardik.mejb.JAXWSClient
| http://localhost:8080/Greeter/HelloBean?WSDL
| Exception in thread "main" 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:513)
| at java.lang.Class.newInstance0(Class.java:355)
| at java.lang.Class.newInstance(Class.java:308)
| at javax.xml.ws.spi.FactoryFinder.newInstance(FactoryFinder.java:31)
| at javax.xml.ws.spi.FactoryFinder.find(FactoryFinder.java:128)
| at javax.xml.ws.spi.Provider.provider(Provider.java:83)
| at javax.xml.ws.Service.<init>(Service.java:56)
| at com.hardik.mejb.Greeter.<init>(Greeter.java:45)
| at com.hardik.mejb.JAXWSClient.main(Unknown Source)
| Caused by: javax.xml.ws.WebServiceException: Error creating JAXBContext for W3CEndpointReference.
| at com.sun.xml.internal.ws.spi.ProviderImpl$2.run(ProviderImpl.java:201)
| at com.sun.xml.internal.ws.spi.ProviderImpl$2.run(ProviderImpl.java:196)
| at java.security.AccessController.doPrivileged(Native Method)
| at com.sun.xml.internal.ws.spi.ProviderImpl.getEPRJaxbContext(ProviderImpl.java:196)
| at com.sun.xml.internal.ws.spi.ProviderImpl.<clinit>(ProviderImpl.java:67)
| ... 12 more
| Caused by: javax.xml.bind.JAXBException: Provider com.sun.xml.bind.v2.ContextFactory not found
| - with linked exception:
| [java.security.PrivilegedActionException: java.lang.ClassNotFoundException: com.sun.xml.bind.v2.ContextFactory]
| at javax.xml.bind.ContextFinder.loadClass(ContextFinder.java:192)
| at javax.xml.bind.ContextFinder.newInstance(ContextFinder.java:205)
| at javax.xml.bind.ContextFinder.find(ContextFinder.java:388)
| at javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:574)
| at javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:522)
| at com.sun.xml.internal.ws.spi.ProviderImpl$2.run(ProviderImpl.java:199)
| ... 16 more
| Caused by: java.security.PrivilegedActionException: java.lang.ClassNotFoundException: com.sun.xml.bind.v2.ContextFactory
| at java.security.AccessController.doPrivileged(Native Method)
| at javax.xml.bind.ContextFinder.loadClass(ContextFinder.java:175)
| ... 21 more
| Caused by: java.lang.ClassNotFoundException: com.sun.xml.bind.v2.ContextFactory
| at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
| at java.security.AccessController.doPrivileged(Native Method)
| at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
| at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
| at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
| at java.lang.ClassLoader.loadClass(ClassLoader.java:252)
| at javax.xml.bind.ContextFinder$1.run(ContextFinder.java:180)
| at javax.xml.bind.ContextFinder$1.run(ContextFinder.java:176)
| ... 23 more
|
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4240248#4240248
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4240248
15 years, 6 months
[JBossWS] - Problem on receiving an object holding datetime
by joaobmonteiro
Hi guys,
I have many services that use complex objects holding datetime (java.util.Date) values. The problem is that I always get null for datetime attributes. How can I solve this?
I'm using JBoss AS 4.2.3-jdk6 and my ws clients are written in Delphi 7.
My classes:
| public class Document implements Serializable {
|
| private static final long serialVersionUID = 2964445290986713245L;
| private Date date;
| //getters and setters
| }
|
My ws looks like this:
| @Stateless
| @WebService
| @SOAPBinding(style=Style.RPC)
| public class DateServices {
|
| @WebMethod
| public Date dateNow(){
| return new Date();
| }
| @WebMethod
| public void printDate(@WebParam(name="documento", mode=Mode.IN) Documento documento){
| if(documento.getDate() == null)
| return;
| SimpleDateFormat dateFormat = new SimpleDateFormat("dd/MM/yyyy");
| String data = dateFormat.format(documento.getDate());
| System.out.println(data);
| }
| }
|
Regards,
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4240043#4240043
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4240043
15 years, 6 months
[JBossWS] - JBOSS-5.1.0.GA web service client doesn't work ( runtime mod
by rangalo
I have a simple hello-world EJB3 successfully deployed as web service. I can check it with url: http://localhost:8080/jbossws/services
Following is the client which works for Glassfish but doesn't work for JBOSS
| package com.hardik.mejb;
|
| import java.net.MalformedURLException;
| import java.net.URL;
| import javax.xml.namespace.QName;
| import javax.xml.ws.Service;
|
| public class JAXWSClient {
|
| private static String host = "localhost";
| private static String portType = "HelloBean";
| private static String serviceName = "Greeter";
| private static String serviceName_jboss = "hello-ws-hello-ws";
|
| // works for glassfish
| // private static String serviceEndpointAddress = "http://"+ host+ ":8080/" + serviceName;
|
| // should work for jboss
| private static String serviceEndpointAddress = "http://"+ host+ ":8080/" + serviceName_jboss;
|
| private static String namespace = "http://mejb.hardik.com/";
|
| public static void main(String[] args) {
|
| URL wsdlLocation = null;
| try {
| String urlstr = serviceEndpointAddress + "/" + portType + "?WSDL";
| System.out.println(urlstr);
| wsdlLocation = new URL(urlstr);
| } catch (MalformedURLException e) {
| // TODO Auto-generated catch block
| e.printStackTrace();
| }
|
| QName serviceNameQ = new QName(namespace,serviceName);
| // dynamic service usage
| Service service = Service.create(wsdlLocation, serviceNameQ);
| Hello firstGreeterPort = service.getPort(Hello.class);
|
| // Object beans[] = service.getPorts();
| System.out.println("1: "+ firstGreeterPort.hello());
| }
| }
|
Here is how I execute the client and the error I get:
wsrunclient.sh -cp "lib/*:dist/hello-client.jar:jboss-generated/*" com.hardik.mejb.JAXWSClient
| http://localhost:8080/hello-ws-hello-ws/HelloBean?WSDL
| Exception in thread "main" com.sun.xml.internal.ws.model.RuntimeModelerException: runtime modeler error: Wrapper class com.hardik.mejb.jaxws.Hello is not found. Have you run APT to generate them?
| at com.sun.xml.internal.ws.model.RuntimeModeler.getClass(RuntimeModeler.java:256)
| at com.sun.xml.internal.ws.model.RuntimeModeler.processDocWrappedMethod(RuntimeModeler.java:567)
| at com.sun.xml.internal.ws.model.RuntimeModeler.processMethod(RuntimeModeler.java:514)
| at com.sun.xml.internal.ws.model.RuntimeModeler.processClass(RuntimeModeler.java:341)
| at com.sun.xml.internal.ws.model.RuntimeModeler.buildRuntimeModel(RuntimeModeler.java:227)
| at com.sun.xml.internal.ws.client.WSServiceDelegate.addSEI(WSServiceDelegate.java:588)
| at com.sun.xml.internal.ws.client.WSServiceDelegate.getPort(WSServiceDelegate.java:291)
| at com.sun.xml.internal.ws.client.WSServiceDelegate.getPort(WSServiceDelegate.java:274)
| at com.sun.xml.internal.ws.client.WSServiceDelegate.getPort(WSServiceDelegate.java:302)
| at com.sun.xml.internal.ws.client.WSServiceDelegate.getPort(WSServiceDelegate.java:306)
| at javax.xml.ws.Service.getPort(Service.java:161)
| at com.hardik.mejb.JAXWSClient.main(Unknown Source)
|
Do I need to generate something ? Am I missing some jar file(s) ?
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4240025#4240025
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4240025
15 years, 6 months