[JBossWS] - Cannot find port in wsdl (need help)
by grdzeli_kaci
hi all,
am trying to resolve this problem for a week,
could anybody help me please ?
i download jbossws 1.2.1GA
there is example and i am trying to run it.
1.EndpointInterface
| import java.rmi.Remote;
| import java.rmi.RemoteException;
|
| import javax.jws.WebService;
| import javax.jws.soap.SOAPBinding;
| import javax.jws.soap.SOAPBinding.Style;
|
| /**
| * Test the JSR-181 annotation: javax.jws.WebService
| * This interface is only used in the client deployment.
| *
| * @author Thomas.Diesler(a)jboss.org
| * @since 29-Apr-2005
| */
| @WebService
| @SOAPBinding(style = Style.RPC)
| public interface EndpointInterface extends Remote
| {
| String echo(String input) throws RemoteException;
| }
|
2. EJB3RemoteInterface
| import java.rmi.RemoteException;
|
| public interface EJB3RemoteInterface extends EndpointInterface{
| String echo(String input) throws RemoteException;
| }
|
3. EJB3Bean02
| import java.rmi.RemoteException;
|
| import javax.ejb.Remote;
| import javax.ejb.Stateless;
| import javax.jws.WebMethod;
| import javax.jws.WebService;
| import javax.jws.soap.SOAPBinding;
|
| import org.jboss.annotation.ejb.RemoteBinding;
| import org.jboss.ws.annotation.WebContext;
|
| /**
| * Test the JSR-181 javax.jws.WebService annotation on an EJB3 endpoint.
| *
| * Uses the wsdlLocation attribute.
| *
| * @author Thomas.Diesler(a)jboss.org
| * @since 29-Apr-2005
| */
| @WebService(
| endpointInterface="mypackage.EndpointInterface",
| portName = "EJB3RemoteInterfacePort",
| name = "mypackage.EndpointInterface",
| targetNamespace = "http://org.jboss.ws/samples/jsr181ejb",
| serviceName = "EJB3Bean02",
| wsdlLocation = "WEB-INF/wsdl/EJB3Bean02.wsdl")
|
| @WebContext(contextRoot = "/jaxws-samples-webservice02-ejb3", urlPattern = "/*")
| @SOAPBinding(style = SOAPBinding.Style.RPC)
| @Remote(EJB3RemoteInterface.class)
| @RemoteBinding(jndiBinding = "/ejb3/EJB3EndpointInterface")
| @Stateless
| public class EJB3Bean02 implements EJB3RemoteInterface {
|
| @WebMethod
| public String echo(String input)throws RemoteException {
| System.out.println("Reseive = " + input);
| return input + " - Reseived";
| }
| }
|
after this i tryed to generate wsdl from this class and i got files like this:
1.EJB3Bean02.wsdl
| <?xml version="1.0" encoding="UTF-8"?>
| <definitions name='EJB3Bean02' targetNamespace='urn:mypackage' xmlns='http://schemas.xmlsoap.org/wsdl/' xmlns:soap='http://schemas.xmlsoap.org/wsdl/soap/' xmlns:tns='urn:mypackage' xmlns:xsd='http://www.w3.org/2001/XMLSchema'>
| <types/>
| <message name='EJB3RemoteInterface_echo'>
| <part name='String_1' type='xsd:string'/>
| </message>
| <message name='EJB3RemoteInterface_echoResponse'>
| <part name='result' type='xsd:string'/>
| </message>
| <portType name='EJB3RemoteInterface'>
| <operation name='echo' parameterOrder='String_1'>
| <input message='tns:EJB3RemoteInterface_echo'/>
| <output message='tns:EJB3RemoteInterface_echoResponse'/>
| </operation>
| </portType>
| <binding name='EJB3RemoteInterfaceBinding' type='tns:EJB3RemoteInterface'>
| <soap:binding style='rpc' transport='http://schemas.xmlsoap.org/soap/http'/>
| <operation name='echo'>
| <soap:operation soapAction=''/>
| <input>
| <soap:body namespace='urn:mypackage' use='literal'/>
| </input>
| <output>
| <soap:body namespace='urn:mypackage' use='literal'/>
| </output>
| </operation>
| </binding>
| <service name='EJB3Bean02'>
| <port binding='tns:EJB3RemoteInterfaceBinding' name='EJB3RemoteInterfacePort'>
| <soap:address location='REPLACE_WITH_ACTUAL_URL'/>
| </port>
| </service>
| </definitions>
|
2.jaxrpc-mapping.xml
| <?xml version='1.0' encoding='UTF-8'?><java-wsdl-mapping version='1.1' xmlns='http://java.sun.com/xml/ns/j2ee' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:schemaLocation='http://java.sun.com/xml/ns/j2ee http://www.ibm.com/webservices/xsd/j2ee_jaxrpc_mapping_1_1.xsd'>
| <package-mapping>
| <package-type>mypackage</package-type>
| <namespaceURI>urn:mypackage.types</namespaceURI>
| </package-mapping>
| <service-interface-mapping>
| <service-interface>mypackage.EJB3Bean02</service-interface>
| <wsdl-service-name xmlns:serviceNS='urn:mypackage'>serviceNS:EJB3Bean02</wsdl-service-name>
| <port-mapping>
| <port-name>EJB3RemoteInterfacePort</port-name>
| <java-port-name>EJB3RemoteInterfacePort</java-port-name>
| </port-mapping>
| </service-interface-mapping>
| <service-endpoint-interface-mapping>
| <service-endpoint-interface>mypackage.EJB3RemoteInterface</service-endpoint-interface>
| <wsdl-port-type xmlns:portTypeNS='urn:mypackage'>portTypeNS:EJB3RemoteInterface</wsdl-port-type>
| <wsdl-binding xmlns:bindingNS='urn:mypackage'>bindingNS:EJB3RemoteInterfaceBinding</wsdl-binding>
| <service-endpoint-method-mapping>
| <java-method-name>echo</java-method-name>
| <wsdl-operation>echo</wsdl-operation>
| <method-param-parts-mapping>
| <param-position>0</param-position>
| <param-type>java.lang.String</param-type>
| <wsdl-message-mapping>
| <wsdl-message xmlns:wsdlMsgNS='urn:mypackage'>wsdlMsgNS:EJB3RemoteInterface_echo</wsdl-message>
| <wsdl-message-part-name>String_1</wsdl-message-part-name>
| <parameter-mode>IN</parameter-mode>
| </wsdl-message-mapping>
| </method-param-parts-mapping>
| <wsdl-return-value-mapping>
| <method-return-value>java.lang.String</method-return-value>
| <wsdl-message xmlns:wsdlMsgNS='urn:mypackage'>wsdlMsgNS:EJB3RemoteInterface_echoResponse</wsdl-message>
| <wsdl-message-part-name>result</wsdl-message-part-name>
| </wsdl-return-value-mapping>
| </service-endpoint-method-mapping>
| </service-endpoint-interface-mapping>
| </java-wsdl-mapping>
|
3.web.xml
| <?xml version="1.0" encoding="UTF-8"?>
| <web-app version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee">
| <servlet>
| <servlet-name>/ejb3/EJB3EndpointInterface</servlet-name>
| <servlet-class>mypackage.EJB3Bean02</servlet-class>
| </servlet>
| <servlet-mapping>
| <servlet-name>/ejb3/EJB3EndpointInterface</servlet-name>
| <url-pattern>/*</url-pattern>
| </servlet-mapping>
| </web-app>
|
4.webservices.xml
| <webservices version='1.1' xmlns='http://java.sun.com/xml/ns/j2ee' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:schemaLocation='http://java.sun.com/xml/ns/j2ee http://www.ibm.com/webservices/xsd/j2ee_web_services_1_1.xsd'>
| <webservice-description>
| <webservice-description-name>EJB3Bean02</webservice-description-name>
| <wsdl-file>META-INF/wsdl/EJB3Bean02.wsdl</wsdl-file>
| <jaxrpc-mapping-file>META-INF/jaxrpc-mapping.xml</jaxrpc-mapping-file>
| <port-component>
| <port-component-name>EJB3RemoteInterfacePort</port-component-name>
| <wsdl-port xmlns:portNS='urn:mypackage'>portNS:EJB3RemoteInterfacePort</wsdl-port>
| <service-endpoint-interface>mypackage.EJB3RemoteInterface</service-endpoint-interface>
| <service-impl-bean>
| <ejb-link>/ejb3/EJB3EndpointInterface</ejb-link>
| </service-impl-bean>
| </port-component>
| </webservice-description>
| </webservices>
|
after all when i tried to deploy this project i got an error :
| 13:23:22,998 INFO [Ejb3Deployment] EJB3 deployment time took: 19
| 13:23:23,426 ERROR [ServiceEndpointDeployer] Cannot create service endpoint
| org.jboss.ws.WSException: Cannot find port in wsdl: {http://org.jboss.ws/samples/jsr181ejb}EJB3RemoteInterfacePort
| at org.jboss.ws.metadata.builder.MetaDataBuilder.replaceAddressLocation(MetaDataBuilder.java:378)
| at org.jboss.ws.metadata.builder.jaxws.JAXWSWebServiceMetaDataBuilder.buildWebServiceMetaData(JAXWSWebServiceMetaDataBuilder.java:170)
| at org.jboss.ws.metadata.builder.jaxws.JAXWSServerMetaDataBuilder.setupProviderOrWebService(JAXWSServerMetaDataBuilder.java:49)
| at org.jboss.ws.metadata.builder.jaxws.JAXWSMetaDataBuilderEJB3.buildMetaData(JAXWSMetaDataBuilderEJB3.java:77)
| at org.jboss.ws.core.server.ServiceEndpointDeployer.create(ServiceEndpointDeployer.java:92)
| at org.jboss.ws.integration.jboss42.DeployerInterceptor.createServiceEndpoint(DeployerInterceptor.java:127)
| at org.jboss.ws.integration.jboss42.DeployerInterceptorEJB.createServiceEndpoint(DeployerInterceptorEJB.java:43)
| at org.jboss.ws.integration.jboss42.DeployerInterceptor.create(DeployerInterceptor.java:78)
| at org.jboss.deployment.SubDeployerInterceptorSupport$XMBeanInterceptor.create(SubDeployerInterceptorSupport.java:180)
| at org.jboss.deployment.SubDeployerInterceptor.invoke(SubDeployerInterceptor.java:91)
| at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
| at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
| at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
| at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
| at $Proxy44.create(Unknown Source)
| at org.jboss.deployment.MainDeployer.create(MainDeployer.java:953)
| at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:807)
| at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:771)
| at sun.reflect.GeneratedMethodAccessor11.invoke(Unknown Source)
| at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
| at java.lang.reflect.Method.invoke(Method.java:585)
| at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
| at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
| at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:133)
| at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
| at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:142)
| at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
| at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
| at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
| at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
| at $Proxy6.deploy(Unknown Source)
| at org.jboss.deployment.scanner.URLDeploymentScanner.deploy(URLDeploymentScanner.java:421)
| at org.jboss.deployment.scanner.URLDeploymentScanner.scan(URLDeploymentScanner.java:634)
| at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.doScan(AbstractDeploymentScanner.java:263)
| at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.loop(AbstractDeploymentScanner.java:274)
| at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.run(AbstractDeploymentScanner.java:225)
| 13:23:23,427 ERROR [ServiceEndpointPublisher] Cannot obtain waURL for: WSTest.jar
| 13:23:23,427 ERROR [MainDeployer] Could not create deployment: file:/export/home/jboss/jboss-4.0.4.GA/server/all/deploy/WSTest.jar
| org.jboss.deployment.DeploymentException: Cannot create service endpoint; - nested throwable: (org.jboss.ws.WSException: Cannot find port in wsdl: {http://org.jboss.ws/samples/jsr181ejb}EJB3RemoteInterfacePort)
| at org.jboss.deployment.DeploymentException.rethrowAsDeploymentException(DeploymentException.java:53)
| at org.jboss.ws.integration.jboss42.DeployerInterceptor.create(DeployerInterceptor.java:83)
| at org.jboss.deployment.SubDeployerInterceptorSupport$XMBeanInterceptor.create(SubDeployerInterceptorSupport.java:180)
| at org.jboss.deployment.SubDeployerInterceptor.invoke(SubDeployerInterceptor.java:91)
| at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
| at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
| at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
| at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
| at $Proxy44.create(Unknown Source)
| at org.jboss.deployment.MainDeployer.create(MainDeployer.java:953)
| at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:807)
| at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:771)
| at sun.reflect.GeneratedMethodAccessor11.invoke(Unknown Source)
| at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
| at java.lang.reflect.Method.invoke(Method.java:585)
| at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
| at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
| at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:133)
| at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
| at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:142)
| at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
| at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
| at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
| at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
| at $Proxy6.deploy(Unknown Source)
| at org.jboss.deployment.scanner.URLDeploymentScanner.deploy(URLDeploymentScanner.java:421)
| at org.jboss.deployment.scanner.URLDeploymentScanner.scan(URLDeploymentScanner.java:634)
| at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.doScan(AbstractDeploymentScanner.java:263)
| at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.loop(AbstractDeploymentScanner.java:274)
| at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.run(AbstractDeploymentScanner.java:225)
| Caused by: org.jboss.ws.WSException: Cannot find port in wsdl: {http://org.jboss.ws/samples/jsr181ejb}EJB3RemoteInterfacePort
| at org.jboss.ws.metadata.builder.MetaDataBuilder.replaceAddressLocation(MetaDataBuilder.java:378)
| at org.jboss.ws.metadata.builder.jaxws.JAXWSWebServiceMetaDataBuilder.buildWebServiceMetaData(JAXWSWebServiceMetaDataBuilder.java:170)
| at org.jboss.ws.metadata.builder.jaxws.JAXWSServerMetaDataBuilder.setupProviderOrWebService(JAXWSServerMetaDataBuilder.java:49)
| at org.jboss.ws.metadata.builder.jaxws.JAXWSMetaDataBuilderEJB3.buildMetaData(JAXWSMetaDataBuilderEJB3.java:77)
| at org.jboss.ws.core.server.ServiceEndpointDeployer.create(ServiceEndpointDeployer.java:92)
| at org.jboss.ws.integration.jboss42.DeployerInterceptor.createServiceEndpoint(DeployerInterceptor.java:127)
| at org.jboss.ws.integration.jboss42.DeployerInterceptorEJB.createServiceEndpoint(DeployerInterceptorEJB.java:43)
| at org.jboss.ws.integration.jboss42.DeployerInterceptor.create(DeployerInterceptor.java:78)
| ... 28 more
|
|
can anybody help me, what i did incorrect ???
Regards,
Paata
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4042762#4042762
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4042762
17 years, 8 months
[JBossWS] - wsprovide : NoClassDefFoundError: com/sun/codemodel/JExpress
by PatrickMadden
Hi I'm running wsprovide.bat provided in the JBoss4.2.0.CR2 buid.
I'm getting the following error trying to generate client side artifacts:
anonymous wrote :
| wsprovide:
| [echo] /c C:/apps/jboss/jboss-4.2.0.CR2/bin/wsprovide.bat --show-traces -c ../CloosterRichWeb/classes/model -w -k -o ./bin -s ./src com.clooster.web.services.db.EJB3RemoteDBServiceBean
| [exec] Error: Could not generate. (use --show-traces to see full traces)
| [exec] java.lang.NoClassDefFoundError: com/sun/codemodel/JExpression
| [exec] at org.jboss.ws.tools.jaxws.impl.WSContractProviderImpl.provide(WSContractProviderImpl.java:104)
| [exec] at org.jboss.ws.tools.jaxws.impl.WSContractProviderImpl.provide(WSContractProviderImpl.java:134)
| [exec] at org.jboss.ws.tools.jaxws.command.wsprovide.generate(wsprovide.java:167)
| [exec] at org.jboss.ws.tools.jaxws.command.wsprovide.main(wsprovide.java:76)
| [exec] Result: 1
|
It works when I run wsconsume.bat when the web service is already deployed. Any help is greatly appreciated.
Thanks,
PVM
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4042582#4042582
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4042582
17 years, 8 months