我正在尝试从Amazon WSDl创建自己的服务。从wsdl到wsdl 2.0到Java的步骤很好。即使是ant也可以毫无错误地编译服务。将服务上载到Axis2后,将显示所有操作。但是如果我尝试调用一个操作,我总是会得到NullpointerException。
以下是详细信息:
Glassfish 3.1.2 with axis2 1.6.2 on Windows 7 64-Bit, Java 1.7.0_25 JDK
POST /axis2/services/SimpleQueueService/CreateQueue HTTP/1.1
Host: localhost:8080
X-Amz-Date: 20130715T220823Z
User-Agent: aws-sdk-java/1.4.7 Windows_7/6.1 Java_HotSpot(TM)_64-Bit_Server_VM/23.25-b01
Content-Type: application/x-www-form-urlencoded
Content-Length: 17
Proxy-Connection: Keep-Alive
QueueName=MyQueue
答案总是内部服务器错误,并在glassfish“server.log”中出现以下错误:
[#|2013-07-17T16:38:28.060+0200|WARNING|glassfish3.1.2|javax.enterprise.system.container.web.com.sun.enterprise.web|_ThreadID=201;_ThreadName=Thread-2;|StandardWrapperValve[AxisServlet]: PWC1406: Servlet.service() for servlet AxisServlet threw exception
java.lang.NullPointerException
at org.apache.axis2.builder.BuilderUtil.buildsoapMessage(BuilderUtil.java:142)
at org.apache.axis2.builder.XFormURLEncodedBuilder.processDocument(XFormURLEncodedBuilder.java:118)
at org.apache.axis2.transport.TransportUtils.createDocumentElement(TransportUtils.java:179)
at org.apache.axis2.transport.TransportUtils.createSOAPMessage(TransportUtils.java:145)
at org.apache.axis2.transport.http.util.RESTUtil.processXMLRequest(RESTUtil.java:65)
at org.apache.axis2.transport.http.AxisServlet$RestRequestProcessor.processXMLRequest(AxisServlet.java:826)
at org.apache.axis2.transport.http.AxisServlet.doPost(AxisServlet.java:227)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:688)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:770)
at org.apache.catalina.core.StandardWrapper.service(StandardWrapper.java:1550)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:281)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:655)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:595)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:161)
at org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:331)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:231)
at com.sun.enterprise.v3.services.impl.ContainerMapper$AdapterCallable.call(ContainerMapper.java:317)
at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:195)
at com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:860)
at com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:757)
at com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:1056)
at com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:229)
at com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:137)
at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:104)
at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:90)
at com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:79)
at com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:54)
at com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:59)
at com.sun.grizzly.ContextTask.run(ContextTask.java:71)
at com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:532)
at com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:513)
at java.lang.Thread.run(Thread.java:724)
|#]
我尝试编译最后一个axis2-snapshot,但是glassfish不接受它。 (例外...)
有人能给我一些提示吗?
答案 0 :(得分:0)
似乎SQS WSDL上的所有远程调用都将text / xml作为输入,而不是application / x-www-url-encoded。假设我正在查看与您相同的WSDL。
http://sqs.us-east-1.amazonaws.com/doc/2012-11-05/QueueService.wsdl
答案 1 :(得分:0)
在我们的示例中,由于部署中缺少了jar,因此它抛出了相同的异常。
axis
jaxrpc
saaj
wsdl4j-1.5.1
commons-discovery-0.2
我们正在使用轴1.4