Axis WSDL2Java 生成的代码:快速连续执行请求时出现服务器错误

发布于 2024-10-12 03:06:26 字数 2573 浏览 5 评论 0原文

我已获得第 3 方 wsdl 和部署描述符等,用于 Axis Web 服务的自定义加密。我使用 WSDL2Java 生成 java 类,在某种程度上,一切都运行得很好。当我每隔几分钟调用这些方法时,它们会正常工作并返回有效数据。但是当我快速连续地调用它们(因为我需要)时,我得到一个普通的旧服务器错误(如下)。

如果我输出 axisFault 故障代码和详细信息,我会得到以下信息:-

类 org.apache.axis.AxisFault 故障代码 = {http://xml.apache.org/axis/}服务器 故障原因 = 服务器错误 故障字符串 = 服务器错误 故障详细信息 = [Lorg.w3c.dom.Element;@2d4ba772 [服务器错误 在 org.apache.axis.handlers.soap.SOAPService.invoke(SOAPService.java:473) 在 org.apache.axis.server.AxisServer.invoke(AxisServer.java:281) 在 org.apache.axis.transport.http.AxisServlet.doPost(AxisServlet.java:699) 在 javax.servlet.http.HttpServlet.service(HttpServlet.java:637) 在 org.apache.axis.transport.http.AxisServletBase.service(AxisServletBase.java:327) 在 javax.servlet.http.HttpServlet.service(HttpServlet.java:717) 在 org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290) 在 org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) 在 org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96) 在 org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) 在 org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) 在org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230) 在org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175) 在 org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:182) 在 org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84) 在 org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128) 在 org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:104) 在 org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) 在 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) , 第三方主机名

有人可以帮忙吗?我束手无策..这可能是时间/缓存问题吗?也许是 WSDL2JAVA 工具创建的 createCall() 方法中的缓存值之一?

I have been provided with a 3rd party wsdl and a deployment descriptor etc for custom encryption for an Axis web service. I used WSDL2Java to generate the java classes and it all works pretty well... up to a point. When I invoke the methods several minutes apart they work correctly and return valid data. but when I invoke them (as I need to) in quick succession I get a plain old Server Error (below).

If I ouptut the axisFault fault codes and details I get the following:-

class org.apache.axis.AxisFault
Fault Code = {http://xml.apache.org/axis/}Server
Fault Reason = Server Error
Fault String = Server Error
Fault Details = [Lorg.w3c.dom.Element;@2d4ba772
[Server Error
at org.apache.axis.handlers.soap.SOAPService.invoke(SOAPService.java:473)
at org.apache.axis.server.AxisServer.invoke(AxisServer.java:281)
at org.apache.axis.transport.http.AxisServlet.doPost(AxisServlet.java:699)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
at org.apache.axis.transport.http.AxisServletBase.service(AxisServletBase.java:327)
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.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:182)
at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:104)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:241)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:580)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
at java.lang.Thread.run(Thread.java:595)

, 3rdpartyhostname

Can anyone please help? I'm at my wits end.. Could it be a timing / caching issue? Perhaps one of the cache values in the createCall() method that the WSDL2JAVA tool creates?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

执笔绘流年 2024-10-19 03:06:26

以下是我如何使用 ant 构建脚本生成轴客户端:

<java classname="org.apache.axis.wsdl.WSDL2Java" fork="true" failonerror="true" classpathref="classpath.path">
    <arg value="-v"/>
    <arg value="-o"/>
    <arg file="tmp/src"/>
    <arg value="-p"/>
    <arg value="com.your.package"/>
    <arg value="${server.url}/${servicename}?wsdl"/>
</java>

也许您正在使用奇怪的参数组合?你检查过那些吗?据我所知,上面是针对轴 1.4 的。

你用的是2.0还是1.4哪个版本?我知道我花了相当长的时间才在 2.0 中做到这一点。以下是它与 mvn 的配合方式:

<plugin>
    <groupId>org.codehaus.mojo</groupId>
    <artifactId>axistools-maven-plugin</artifactId>
    <version>1.3</version>
    <configuration>
        <outputDirectory>${project.build.directory}/generated/main/java</outputDirectory>
        <urls>
            <url>http://yourserver:yourport/YourService?wsdl</url>
        </urls>
        <packageSpace>com.your.package</packageSpace>
        <serverSide>false</serverSide>
        <subPackageByFileName>false</subPackageByFileName>
        <wrapArrays>false</wrapArrays>
    </configuration>
    <executions>
        <execution>
            <goals>
                <goal>wsdl2java</goal>
            </goals>
        </execution>
    </executions>
</plugin>

我希望这有助于阐明这个问题或进一步的想法。

您可能还想检查您部署的东西是否正常工作。这可能根本不是客户一代的问题。毕竟它说服务器错误。检查服务器上的日志文件中的堆栈跟踪,也许那里有线索。

Here's how I generate an axis client with an ant build script:

<java classname="org.apache.axis.wsdl.WSDL2Java" fork="true" failonerror="true" classpathref="classpath.path">
    <arg value="-v"/>
    <arg value="-o"/>
    <arg file="tmp/src"/>
    <arg value="-p"/>
    <arg value="com.your.package"/>
    <arg value="${server.url}/${servicename}?wsdl"/>
</java>

Maybe you are using a weird combination of parameters? Have your checked on those? The above is for axis 1.4 as far as I remember.

What version are you using 2.0 or 1.4? I know it took me quite some time to get this right for 2.0. Here's how it works with mvn:

<plugin>
    <groupId>org.codehaus.mojo</groupId>
    <artifactId>axistools-maven-plugin</artifactId>
    <version>1.3</version>
    <configuration>
        <outputDirectory>${project.build.directory}/generated/main/java</outputDirectory>
        <urls>
            <url>http://yourserver:yourport/YourService?wsdl</url>
        </urls>
        <packageSpace>com.your.package</packageSpace>
        <serverSide>false</serverSide>
        <subPackageByFileName>false</subPackageByFileName>
        <wrapArrays>false</wrapArrays>
    </configuration>
    <executions>
        <execution>
            <goals>
                <goal>wsdl2java</goal>
            </goals>
        </execution>
    </executions>
</plugin>

I hope this helps shed some light or further ideas on the issue.

You might also want to check if the stuff you deployed is working right. This might not be an issue of the client generation at all. After all it says server error. Check the logfiles on the server for stacktraces maybe there is a clue there.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文