• Post Reply Bookmark Topic Watch Topic
  • New Topic

Unable to create Axis 2 WEb services in Eclipse using Tomcat

 
Maya sekar
Ranch Hand
Posts: 70
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

Am trying to create a web service using axis 2 version 1.4.1, When I select the service class, right click, select the optio web services--> create web service, i get the usual pop up window but when i click on next it says,

WARNING:

The service class "com.tcee.myapps.WebService" does not comply to one or more requirements of the JAX-RPC 1.1 specification, and may not deploy or function correctly.

I am using eclipse helios and apache v6.0.32.

I know it is not a code error, am unable to resolve it. Help !!!

Thank you in advance
 
Praveen Kumar M K
Ranch Hand
Posts: 256
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Maya,

Can you please post the method signatures of the methods you want to make web services of.

Thanks.
 
Arun Kumar
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You are getting a WARNING. I think you can still continue to create web service.

To resolve the warning, provide more info on com.tcee.myapps.WebService
 
Maya sekar
Ranch Hand
Posts: 70
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
@Arun:

Hi Arun,

Actually, you are right, I can go ahead and try to create my service, but only when i click on 'start server' it says ,

"IWAB0014E Unexpected exception occurred."
Thank you.

@Barney Balboa

Hi Balboa,

This is my service,


public class WebService {

public OMElement getWEbService(int a, int b)
{
OMElement ome = null;
Addition add=new Addition();
add.setA(a);
add.setB(b);
add.setC(add.getA()+add.getB());
ome = XMLGenerator.getXmlDoc(add, "SuccessfulMessage");
return ome;
}
}

Addition is a bean where i have getters and setters and XMLGenerator is a class i use to return the sum as an xml

Thank you
 
Praveen Kumar M K
Ranch Hand
Posts: 256
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey Maya,

OMElement is your problem I think. As part of this JAX-RPC compliance, you cannot send/return a few types of data. This includes types like List, Document etc.

I think your OMElement class internally contains atleast one such member of non-compliant data type.

Here's what I did to just to prove myself the same.

1) I created a class named SomeClass which was the return type of my web service method. This SomeClass had a single int member. The service was created without any warning
2) I added a List<String> member to SomeClass. And voila! Got a warning while creating the service!

Please go through SOAP String and SOAP payload posts. Please see this too - List

To get through this problem, you would have to change you data to acceptable types. E.g. :- List to Array.

Thanks.
 
Maya sekar
Ranch Hand
Posts: 70
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Barney,


Took your advice. Tired a very simple web service that returns a string.
public class HelloWorld {
public String sayHi(String username)
{
return "Hello"+username;
}
}

This time I did not get the warning message. But I do get a pop up window that says,

"IWAB0014E Unexpected exception occurred." and am unable to create the service after that.

Any ideas on how I can fix this problem.

Thank you.
 
Maya sekar
Ranch Hand
Posts: 70
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
UPDATE:


Google says IWAB0014E Exception is an Eclipse Bug. My friend came across the same issue when she was trying to create an axis 2 web serivce. But she resolved it by downloading and installing a new Eclipse exe. I tried the same and it doesn't work for me.

Any suggestion is appreciated.
Thank you
 
Maya sekar
Ranch Hand
Posts: 70
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

Turns out the mistake was mine. Under the service Deployment Configuration I forgot to select Apache Axis2 which turned out to be the cause. Anyways thank you so much Barney for your help. I am able to create services now. But my initial web service


public class WebService {

public OMElement getWEbService(int a, int b)
{
OMElement ome = null;
Addition add=new Addition();
add.setA(a);
add.setB(b);
add.setC(add.getA()+add.getB());
ome = XMLGenerator.getXmlDoc(add, "SuccessfulMessage");
return ome;
}
}



is throwing a new error.



Exceptioncom.sun.xml.internal.bind.v2.runtime.IllegalAnnotationsException: 3 counts of IllegalAnnotationExceptions
Class has two properties of the same name "a"
this problem is related to the following location:
at public int com.tcee.myapps.webservice.Addition.getA()
at com.tcee.myapps.webservice.Addition
this problem is related to the following location:
at int com.tcee.myapps.webservice.Addition.a
at com.tcee.myapps.webservice.Addition
Class has two properties of the same name "b"
this problem is related to the following location:
at public int com.tcee.myapps.webservice.Addition.getB()
at com.tcee.myapps.webservice.Addition
this problem is related to the following location:
at int com.tcee.myapps.webservice.Addition.b
at com.tcee.myapps.webservice.Addition
Class has two properties of the same name "c"
this problem is related to the following location:
at public int com.tcee.myapps.webservice.Addition.getC()
at com.tcee.myapps.webservice.Addition
this problem is related to the following location:
at int com.tcee.myapps.webservice.Addition.c
at com.tcee.myapps.webservice.Addition

com.sun.xml.internal.bind.v2.runtime.IllegalAnnotationsException: 3 counts of IllegalAnnotationExceptions
Class has two properties of the same name "a"
this problem is related to the following location:
at public int com.tcee.myapps.webservice.Addition.getA()
at com.tcee.myapps.webservice.Addition
this problem is related to the following location:
at int com.tcee.myapps.webservice.Addition.a
at com.tcee.myapps.webservice.Addition
Class has two properties of the same name "b"
this problem is related to the following location:
at public int com.tcee.myapps.webservice.Addition.getB()
at com.tcee.myapps.webservice.Addition
this problem is related to the following location:
at int com.tcee.myapps.webservice.Addition.b
at com.tcee.myapps.webservice.Addition
Class has two properties of the same name "c"
this problem is related to the following location:
at public int com.tcee.myapps.webservice.Addition.getC()
at com.tcee.myapps.webservice.Addition
this problem is related to the following location:
at int com.tcee.myapps.webservice.Addition.c
at com.tcee.myapps.webservice.Addition

at com.sun.xml.internal.bind.v2.runtime.IllegalAnnotationsException$Builder.check(Unknown Source)
at com.sun.xml.internal.bind.v2.runtime.JAXBContextImpl.getTypeInfoSet(Unknown Source)
at com.sun.xml.internal.bind.v2.runtime.JAXBContextImpl.<init>(Unknown Source)
at com.sun.xml.internal.bind.v2.runtime.JAXBContextImpl$JAXBContextBuilder.build(Unknown Source)
at com.sun.xml.internal.bind.v2.ContextFactory.createContext(Unknown Source)
at com.sun.xml.internal.bind.v2.ContextFactory.createContext(Unknown Source)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at javax.xml.bind.ContextFinder.newInstance(Unknown Source)
at javax.xml.bind.ContextFinder.find(Unknown Source)
at javax.xml.bind.JAXBContext.newInstance(Unknown Source)
at javax.xml.bind.JAXBContext.newInstance(Unknown Source)
at com.tcee.myapps.webservice.XMLGenerator.getXmlDoc(XMLGenerator.java:43)
at com.tcee.myapps.webservice.WebService.getWEbService(WebService.java:16)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.apache.axis2.rpc.receivers.RPCUtil.invokeServiceClass(RPCUtil.java:212)
at org.apache.axis2.rpc.receivers.RPCMessageReceiver.invokeBusinessLogic(RPCMessageReceiver.java:117)
at org.apache.axis2.receivers.AbstractInOutMessageReceiver.invokeBusinessLogic(AbstractInOutMessageReceiver.java:40)
at org.apache.axis2.receivers.AbstractMessageReceiver.receive(AbstractMessageReceiver.java:110)
at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:181)
at org.apache.axis2.transport.http.util.RESTUtil.invokeAxisEngine(RESTUtil.java:144)
at org.apache.axis2.transport.http.util.RESTUtil.processURLRequest(RESTUtil.java:139)
at org.apache.axis2.transport.http.AxisServlet$RestRequestProcessor.processURLRequest(AxisServlet.java:837)
at org.apache.axis2.transport.http.AxisServlet.doGet(AxisServlet.java:273)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:617)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:859)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
at java.lang.Thread.run(Unknown Source)


You think you can help me there?

Thanks again.
 
Praveen Kumar M K
Ranch Hand
Posts: 256
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I've always stayed clear of annotations, so am gonna let the experts take this further now ...Although you might want to have a look at Class has properties of same name

Thanks.
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!