[JBossWS] - jdk 1.6, jbossws 2.0.1 and jboss as 4.2.2.ga
by grdzeli_kaci
hi all,
i tried to use jbossws but i got this error :
| 15:56:43,829 ERROR [[WebServicesForPHPBean]] Servlet.service() for servlet WebServicesForPHPBean threw exception
| java.lang.NoSuchMethodError: org.jboss.ejb3.stateless.StatelessBeanContext.getWebServiceContextProperty()Lorg/jboss/injection/lang/reflect/BeanProperty;
| at org.jboss.wsf.container.jboss42.InvocationHandlerEJB3$CallbackImpl.attached(InvocationHandlerEJB3.java:129)
| at org.jboss.ejb3.EJBContainerInvocation.setBeanContext(EJBContainerInvocation.java:77)
| at org.jboss.ejb3.stateless.StatelessInstanceInterceptor.invoke(StatelessInstanceInterceptor.java:56)
| at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| at org.jboss.aspects.security.AuthenticationInterceptor.invoke(AuthenticationInterceptor.java:77)
| at org.jboss.ejb3.security.Ejb3AuthenticationInterceptor.invoke(Ejb3AuthenticationInterceptor.java:110)
| at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| at org.jboss.ejb3.ENCPropagationInterceptor.invoke(ENCPropagationInterceptor.java:46)
| at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| at org.jboss.ejb3.asynchronous.AsynchronousInterceptor.invoke(AsynchronousInterceptor.java:106)
| at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| at org.jboss.wsf.container.jboss42.InvocationHandlerEJB3.invoke(InvocationHandlerEJB3.java:103)
| at org.jboss.ws.core.server.ServiceEndpointInvoker.invoke(ServiceEndpointInvoker.java:220)
| at org.jboss.wsf.stack.jbws.RequestHandlerImpl.processRequest(RequestHandlerImpl.java:408)
| at org.jboss.wsf.stack.jbws.RequestHandlerImpl.handleRequest(RequestHandlerImpl.java:272)
| at org.jboss.wsf.stack.jbws.RequestHandlerImpl.doPost(RequestHandlerImpl.java:189)
| at org.jboss.wsf.stack.jbws.RequestHandlerImpl.handleHttpRequest(RequestHandlerImpl.java:122)
| at org.jboss.wsf.stack.jbws.EndpointServlet.service(EndpointServlet.java:84)
| at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
| at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
| at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
| at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
| at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
| at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
| at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
| at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
| at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:179)
| at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
| at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
| at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
| at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:157)
| at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
| at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:262)
| at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
| at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
| at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:446)
| at java.lang.Thread.run(Thread.java:619)
|
|
my env:
os : sun solaris
as : jboss 4.2.2.ga
jbossws 2.0.1.ga
java : jdk 1.6
also i use the endorsed directory mechanism, as described here
http://www.bhaskarvk.info/content/jboss/jbossws_2_0_1.html
can anybody help me ?
any idea will be appreciated
_______________
Regards,
Paata
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4105991#4105991
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4105991
18 years, 5 months
[JBossWS] - Returning Complex Type
by burakbayramli
Hi all,
While trying to return a complex type from a Web Service and I am experiencing some problems:
I am on JBoss 4.2.1.GA and jbossws-1.2.1.GA.
My client receives
Exception in thread "main" org.jboss.ws.WSException: Cannot obtain java/xml type mapping for: {http://service.gg.com/}Product
| at org.jboss.ws.metadata.builder.jaxrpc.JAXRPCMetaDataBuilder.processOutputDocElement(JAXRPCMetaDataBuilder.java:778)
| at org.jboss.ws.metadata.builder.jaxrpc.JAXRPCMetaDataBuilder.buildParameterMetaDataDoc(JAXRPCMetaDataBuilder.java:897)
| at org.jboss.ws.metadata.builder.jaxrpc.JAXRPCMetaDataBuilder.setupOperationsFromWSDL(JAXRPCMetaDataBuilder.java:214)
| at org.jboss.ws.metadata.builder.jaxrpc.JAXRPCClientMetaDataBuilder.buildMetaDataInternal(JAXRPCClientMetaDataBuilder.java:216)
| at org.jboss.ws.metadata.builder.jaxrpc.JAXRPCClientMetaDataBuilder.buildMetaData(JAXRPCClientMetaDataBuilder.java:133)
| at org.jboss.ws.metadata.builder.jaxrpc.JAXRPCClientMetaDataBuilder.buildMetaData(JAXRPCClientMetaDataBuilder.java:85)
| at org.jboss.ws.core.jaxrpc.client.ServiceImpl.<init>(ServiceImpl.java:111)
| at org.jboss.ws.core.jaxrpc.client.ServiceFactoryImpl.createService(ServiceFactoryImpl.java:157)
| at org.jboss.ws.core.jaxrpc.client.ServiceFactoryImpl.createService(ServiceFactoryImpl.java:128)
| at com.gg.service.Client.main(Client.java:20)
|
If I comment out the method which returns the complex type, the client code works fine.
Any ideas would be appreciated,
The code is below;
@WebService
| @SOAPBinding(parameterStyle=SOAPBinding.ParameterStyle.BARE)
| public interface ProductDb extends Remote {
|
| @WebMethod String getProductTitle(int id);
|
| @WebMethod Product getProduct();
|
| }
|
@Stateless
| @WebService(endpointInterface="com.gg.service.ProductDb")
| @WebContext(contextRoot="/ggServices")
| public class ProductDbBean implements ProductDb {
|
| @PersistenceContext(unitName="GGLocal")
| EntityManager em;
|
| public String getProductTitle(int id) {
| Product prd = em.find(Product.class, id);
| return prd.getTitle();
| }
|
| public Product getProduct() {
| List<Product> l = em.createQuery("from Product").getResultList();
| return l.get(0);
| }
| }
|
public class Client
| {
| public static void main(String[] args) throws Exception
| {
| URL url = new URL("http://localhost:8080/ggServices/ProductDbBean?wsdl");
| QName qname = new QName("http://service.gg.com/", "ProductDbBeanService");
|
| ServiceFactory factory = ServiceFactory.newInstance();
| Service service = factory.createService(url, qname);
| ProductDb s = (ProductDb) service.getPort(ProductDb.class);
|
| String test = s.getProductTitle(1);
| }
| }
|
WSDL
<definitions name='ProductDbBeanService' targetNamespace='http://service.gg.com/' xmlns='http://schemas.xmlsoap.org/wsdl/' xmlns:soap='http://schemas.xmlsoap.org/wsdl/soap/' xmlns:tns='http://service.gg.com/' xmlns:xsd='http://www.w3.org/2001/XMLSchema'>
| <types>
| <xs:schema targetNamespace='http://service.gg.com/' version='1.0' xmlns:tns='http://service.gg.com/' xmlns:xs='http://www.w3.org/2001/XMLSchema'>
| <xs:element name='Product' type='tns:Product'/>
| <xs:element name='getProductResponse' nillable='true' type='tns:Product'/>
| <xs:element name='getProductTitle' type='xs:int'/>
| <xs:element name='getProductTitleResponse' nillable='true' type='xs:string'/>
| <xs:complexType name='Product'>
| <xs:sequence>
| <xs:element form='qualified' name='id' type='xs:int'/>
| <xs:element form='qualified' name='title' type='xs:string'/>
| </xs:sequence>
| </xs:complexType>
| </xs:schema>
| </types>
| <message name='ProductDb_getProduct'></message>
| <message name='ProductDb_getProductResponse'>
| <part element='tns:getProductResponse' name='getProductResponse'></part>
| </message>
| <message name='ProductDb_getProductTitleResponse'>
| <part element='tns:getProductTitleResponse' name='getProductTitleResponse'></part>
| </message>
| <message name='ProductDb_getProductTitle'>
| <part element='tns:getProductTitle' name='getProductTitle'></part>
| </message>
| <portType name='ProductDb'>
| <operation name='getProduct'>
| <input message='tns:ProductDb_getProduct'></input>
| <output message='tns:ProductDb_getProductResponse'></output>
| </operation>
| <operation name='getProductTitle' parameterOrder='getProductTitle'>
| <input message='tns:ProductDb_getProductTitle'></input>
| <output message='tns:ProductDb_getProductTitleResponse'></output>
| </operation>
| </portType>
| <binding name='ProductDbBinding' type='tns:ProductDb'>
| <soap:binding style='document' transport='http://schemas.xmlsoap.org/soap/http'/>
| <operation name='getProduct'>
| <soap:operation soapAction=''/>
| <input>
| <soap:body use='literal'/>
| </input>
| <output>
| <soap:body use='literal'/>
| </output>
| </operation>
| <operation name='getProductTitle'>
| <soap:operation soapAction=''/>
| <input>
| <soap:body use='literal'/>
| </input>
| <output>
| <soap:body use='literal'/>
| </output>
| </operation>
| </binding>
| <service name='ProductDbBeanService'>
| <port binding='tns:ProductDbBinding' name='ProductDbBeanPort'>
| <soap:address location='http://127.0.0.1:8080/ggServices/ProductDbBean'/>
| </port>
| </service>
| </definitions>
POJO:
@Entity
| @Table(name="urun")
| @XmlAccessorType(XmlAccessType.FIELD)
| @XmlType(name = "Product", namespace="http://service.gg.com/",
| propOrder = { "id", "title"})
| @XmlRootElement(namespace="http://service.gg.com/", name = "Product")
| public class Product implements Serializable {
|
| @Id
| @Column(name="urun_id")
| @XmlElement(namespace="http://service.gg.com/", required = true)
| private Integer id;
|
| @Column(length=60)
| @XmlElement(namespace="http://service.gg.com/", required = true)
| private String title;
|
| public String getTitle() {
| return title;
| }
|
| public void setTitle(String title) {
| this.title = title;
| }
|
| public Integer getId() {
| return id;
| }
|
| public void setId(Integer id) {
| this.id = id;
| }
|
|
|
| }
|
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4105932#4105932
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4105932
18 years, 5 months
[JBossWS] - Help:Cannot obtain endpoint meta data!
by caijc
jboss4.2.2+jdk6
@WebService(name="BookWS",targetNamespace="http://net.cjc.ws",serviceName="BookWSService")
@SOAPBinding(style= SOAPBinding.Style.RPC)
@Stateless
public class BookWS {
@EJB
private AuthorManager am;
@WebMethod
public List getMyBook(String me)
{
return am.queryBooks(me);
}
}
and I also configured web.xml to define this endpoint as a servlet.
While I deploy this war,the following exception is thrown:
ava.lang.NoClassDefFoundError: Could not initialize class com.sun.xml.bind.v2.model.impl.RuntimeModelBuilder
at com.sun.xml.bind.v2.runtime.JAXBContextImpl.getTypeInfoSet(JAXBContextImpl.java:422)...
But I still can see this web service from jbossws;When I click the related link,the browser says it cannot phrase XML.Another exception is thrown on the console:
01:25:36,750 ERROR [RequestHandlerImpl] Error processing web service request
java.lang.IllegalStateException: Cannot obtain endpoint meta data
at org.jboss.wsf.stack.jbws.RequestHandlerImpl.handleWSDLRequest(RequestHandlerImpl.java:520)
Why?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4105892#4105892
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4105892
18 years, 5 months