[JBossWS] - JAX-RPC Web Services - Class is not a servlet error - How to
by srkpriv
Can anyone help me resolve this 'Class is not a servlet' issue that I am facing. I am running this in JBoss App Server 4.2.1.GA and I have the Webservices.xml, mapping.xml, wsdl and web.xml available in the respective directories?
Do I have to do any further config changes or something to make this work?
javax.servlet.ServletException: Class com.erp.core.ws.hello.HelloServlet is not a Servlet
org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:179)
org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:104)
org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:157)
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:241)
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:580)
org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
java.lang.Thread.run(Thread.java:595)
root cause
java.lang.ClassCastException: com.erp.core.ws.hello.HelloServlet
Please let me know.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4103770#4103770
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4103770
18 years, 5 months
[JBossWS] - Returning lists on jbossws-1.2.1.GA
by burakbayramli
Hi all,
How can we return lists using @WebMethod, @WebService annotations
I have used the following code but I received the error below:
Exception in thread "main" org.jboss.ws.WSException: Cannot obtain java type mapping for: {http://service.gg.com/}arrayList
| at org.jboss.ws.metadata.builder.jaxrpc.JAXRPCMetaDataBuilder.buildOutputParameter(JAXRPCMetaDataBuilder.java:346)
| at org.jboss.ws.metadata.builder.jaxrpc.JAXRPCMetaDataBuilder.buildParameterMetaDataRpc(JAXRPCMetaDataBuilder.java:592)
| at org.jboss.ws.metadata.builder.jaxrpc.JAXRPCMetaDataBuilder.setupOperationsFromWSDL(JAXRPCMetaDataBuilder.java:210)
| 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:21)
|
Code:
| @WebService
| @SOAPBinding(style=Style.RPC)
| public interface ProductDb extends Remote {
|
| @WebMethod ArrayList<Product> getProducts();
|
| }
|
| @Stateless
| @WebService(endpointInterface="com.gg.service.ProductDb")
| @WebContext(contextRoot="/ggServices")
| public class ProductDbBean {
|
| @PersistenceContext(unitName="GGLocal")
| EntityManager em;
|
| public ArrayList<Product> getProducts() {
| List<Product> l = em.createQuery("from Product").getResultList();
| ArrayList<Product> list = new ArrayList<Product>();
| for (Product p : l) {
| list.add(p);
| }
| return list;
| }
|
|
| }
|
|
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);
|
| ArrayList<Product> list = s.getProducts();
|
| }
|
Thanks in advance,
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4103714#4103714
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4103714
18 years, 5 months