[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
17 years, 11 months
[JBoss jBPM] - jbpmç¯å¢æå»ºåºäºé®é¢
by ljh0242
Buildfile: D:\workspace\jbpm.3\build.deploy.xml
delete.jbpm.configuration:
build.webapp:
compile.jbpm:
compile.identity:
compile.jbpm.test:
compile.webapp:
compile.identity.test:
compile.examples:
compile:
build.webapp:
build.service.archive:
compile.jbpm:
build.jbpm:
compile.identity:
build.identity:
build.service.archive:
declare.jbpm.tasks:
compile.jbpm:
build.jbpm:
build.jbpm.src:
compile.identity:
build.identity:
build.identity.src:
compile.jbpm.test:
compile.webapp:
compile.identity.test:
compile.examples:
compile:
build.webapp:
build.service.archive:
build.converter:
[jar] Warning: skipping jar archive D:\workspace\jbpm.3\build\converter.jar because no files were included.
build:
db.clean:
[delete] Deleting directory D:\workspace\jbpm.3\build\db
[mkdir] Created dir: D:\workspace\jbpm.3\build\db
db.start:
[starthsqldb] starting 'java -cp H:jboss-4.2.2.GAjboss-4.2.2.GA/server/default/lib/hsqldb.jar org.hsqldb.Server -database D:\workspace\jbpm.3/build/db/localDB -port 1701'...
[starthsqldb] Exception in thread "Thread-0" java.lang.NullPointerException
[starthsqldb] at org.apache.tools.ant.Project.fireMessageLoggedEvent(Project.java:2143)
[starthsqldb] at org.apache.tools.ant.Project.fireMessageLogged(Project.java:2271)
[starthsqldb] at org.apache.tools.ant.Project.log(Project.java:449)
[starthsqldb] at org.apache.tools.ant.Task.log(Task.java:294)
[starthsqldb] at org.apache.tools.ant.Task.log(Task.java:281)
[starthsqldb] at org.jbpm.ant.Launcher.run(Launcher.java:51)
create.db:
[jbpmschema] 14:17:56,984 [main] DEBUG AntHelper : creating hibernate configuration from cfg 'D:\workspace\jbpm.3/src/config.files/hibernate.cfg.xml' and properties 'D:\workspace\jbpm.3/src/resources/hsqldb/create.db.hibernate.properties'
BUILD FAILED
D:\workspace\jbpm.3\build.deploy.xml:47: java.lang.NoClassDefFoundError: org/dom4j/DocumentException
Total time: 4 seconds
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4153479#4153479
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4153479
17 years, 11 months