Java Web 服务 java.lang.ClassCastException: org.apache.cxf.jaxws.ServiceImpl

发布于 2024-08-27 23:35:51 字数 13006 浏览 12 评论 0原文

我正在使用 Maven、CXF 2.2.7、JBoss 4.2.3 和 JRE 1.5 已更新

我有一个 Web 服务,可以通过使用 URL myURL/myService?wsdl 在服务器上看到它

我正在尝试开发一个 Web 应用程序,通过在我的 bean 中调用以下命令来 ping 该 Web 服务:

MyWebService webservice = new MyWebService();

然而,它死了并抛出以下错误,该错误非常模糊:

    java.lang.ClassCastException: org.apache.cxf.jaxws.ServiceImpl
09:25:59,450 ERROR [STDERR]  at javax.xml.ws.Service.<init>(Service.java:81)
09:25:59,450 ERROR [STDERR]  at org.otherservice.webservice.MyWebServiceService.<init>(MyWebService.java:44)
09:25:59,450 ERROR [STDERR]  at net.myservice.beans.MyBean.getMyServiceSoap(MyBean.java:109)
09:25:59,450 ERROR [STDERR]  at net.myservice.beans.MyBean.ack(MyBean.java:240)
09:25:59,450 ERROR [STDERR]  at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
09:25:59,450 ERROR [STDERR]  at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
09:25:59,450 ERROR [STDERR]  at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
09:25:59,450 ERROR [STDERR]  at java.lang.reflect.Method.invoke(Method.java:585)
09:25:59,450 ERROR [STDERR]  at org.apache.el.parser.AstValue.invoke(AstValue.java:131)
09:25:59,450 ERROR [STDERR]  at org.apache.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:276)
09:25:59,450 ERROR [STDERR]  at org.apache.jasper.el.JspMethodExpression.invoke(JspMethodExpression.java:68)
09:25:59,450 ERROR [STDERR]  at javax.faces.component.MethodBindingMethodExpressionAdapter.invoke(MethodBindingMethodExpressionAdapter.java:77)
09:25:59,450 ERROR [STDERR]  at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:95)
09:25:59,450 ERROR [STDERR]  at javax.faces.component.UICommand.broadcast(UICommand.java:383)
09:25:59,450 ERROR [STDERR]  at javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:450)
09:25:59,450 ERROR [STDERR]  at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:759)
09:25:59,450 ERROR [STDERR]  at com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:97)
09:25:59,450 ERROR [STDERR]  at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:266)
09:25:59,450 ERROR [STDERR]  at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:132)
09:25:59,450 ERROR [STDERR]  at javax.faces.webapp.FacesServlet.service(FacesServlet.java:244)
09:25:59,450 ERROR [STDERR]  at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
09:25:59,450 ERROR [STDERR]  at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
09:25:59,450 ERROR [STDERR]  at org.apache.myfaces.webapp.filter.ExtensionsFilter.doFilter(ExtensionsFilter.java:301)
09:25:59,450 ERROR [STDERR]  at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
09:25:59,450 ERROR [STDERR]  at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
09:25:59,450 ERROR [STDERR]  at net.faces.filters.AuthorizationFilter.doFilter(AuthorizationFilter.java:84)
09:25:59,450 ERROR [STDERR]  at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
09:25:59,450 ERROR [STDERR]  at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
09:25:59,450 ERROR [STDERR]  at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
09:25:59,450 ERROR [STDERR]  at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
09:25:59,450 ERROR [STDERR]  at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
09:25:59,450 ERROR [STDERR]  at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
09:25:59,450 ERROR [STDERR]  at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
09:25:59,450 ERROR [STDERR]  at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:182)
09:25:59,450 ERROR [STDERR]  at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
09:25:59,450 ERROR [STDERR]  at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
09:25:59,450 ERROR [STDERR]  at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
09:25:59,450 ERROR [STDERR]  at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:157)
09:25:59,450 ERROR [STDERR]  at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
09:25:59,450 ERROR [STDERR]  at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:262)
09:25:59,450 ERROR [STDERR]  at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
09:25:59,450 ERROR [STDERR]  at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
09:25:59,450 ERROR [STDERR]  at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:446)
09:25:59,450 ERROR [STDERR]  at java.lang.Thread.run(Thread.java:595)

我希望有人以前见过这个异常并可以帮助我。

<dependency>
        <groupId>junit</groupId>
        <artifactId>junit</artifactId>
        <version>4.6</version>
        <scope>test</scope>
    </dependency>
    <dependency>
        <groupId>org.mortbay.jetty</groupId>
        <artifactId>jetty</artifactId>
        <version>6.1.9</version>
        <scope>test</scope>
    </dependency>
    <dependency>
        <groupId>org.apache.cxf</groupId>
        <artifactId>cxf-rt-frontend-jaxws</artifactId>
        <version>2.2.7</version>
    </dependency>
    <dependency>
        <groupId>org.apache.cxf</groupId>
        <artifactId>cxf-rt-transports-http</artifactId>
        <version>2.2.7</version>
    </dependency>
    <dependency>
        <groupId>org.apache.cxf</groupId>
        <artifactId>cxf-rt-ws-security</artifactId>
        <version>2.2.7</version>
    </dependency>
    <dependency>
        <groupId>org.apache.xmlbeans</groupId>
        <artifactId>xmlbeans</artifactId>
        <version>2.4.0</version>
    </dependency>
    <dependency>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>xmlbeans-maven-plugin</artifactId>
        <version>2.3.3</version>
    </dependency>
    <dependency>
        <groupId>org.slf4j</groupId>
        <artifactId>slf4j-jdk14</artifactId>
        <version>1.5.10</version>
    </dependency>
    <dependency>
        <groupId>org.hibernate</groupId>
        <artifactId>hibernate-core</artifactId>
        <version>3.3.2.GA</version>
    </dependency>
    <dependency>
        <groupId>org.hibernate</groupId>
        <artifactId>hibernate-c3p0</artifactId>
        <version>3.3.2.GA</version>
    </dependency>
    <dependency>
        <groupId>javassist</groupId>
        <artifactId>javassist</artifactId>
        <version>3.8.0.GA</version>
    </dependency>
    <dependency>
        <groupId>hsqldb</groupId>
        <artifactId>hsqldb</artifactId>
        <version>1.8.0.7</version>
    </dependency>
    <dependency>
        <groupId>javax.faces</groupId>
        <artifactId>jsf-api</artifactId>
        <version>1.2_02</version>
        <scope>provided</scope>
    </dependency>
    <dependency>
        <groupId>javax.faces</groupId>
        <artifactId>jsf-impl</artifactId>
        <version>1.2-b19</version>
        <scope>provided</scope>
    </dependency>
    <dependency>
        <groupId>javax.xml</groupId>
        <artifactId>jaxrpc-api</artifactId>
        <version>1.1</version>
    </dependency>
    <dependency>
        <groupId>org.apache.axis</groupId>
        <artifactId>axis</artifactId>
        <version>1.4</version>
    </dependency>
    <dependency>
        <groupId>org.apache.myfaces.tomahawk</groupId>
        <artifactId>tomahawk</artifactId>
        <version>1.1.8</version>
    </dependency>
    <dependency>
        <groupId>commons-discovery</groupId>
        <artifactId>commons-discovery</artifactId>
        <version>20040218.194635</version>
    </dependency>
    <dependency>
        <groupId>net.sf.locale4j</groupId>
        <artifactId>locale4j</artifactId>
        <version>1.1.3</version>
    </dependency>
    <dependency>
        <groupId>javax.mail</groupId>
        <artifactId>mail</artifactId>
        <version>1.4.1</version>
    </dependency>
    <dependency>
        <groupId>javax.activation</groupId>
        <artifactId>activation</artifactId>
        <version>1.1</version>
    </dependency>
    <dependency>
        <groupId>org.mortbay.jetty</groupId>
        <artifactId>jsp-api-2.1</artifactId>
        <version>6.1.9</version>
        <scope>test</scope>
    </dependency>
    <dependency>
        <groupId>com.sun.el</groupId>
        <artifactId>el-ri</artifactId>
        <version>1.0</version>
    </dependency>
    <dependency>
        <groupId>mysql</groupId>
        <artifactId>mysql-connector-java</artifactId>
        <version>5.1.10</version>
    </dependency>
    <dependency>
        <groupId>org.hibernate</groupId>
        <artifactId>hibernate-ehcache</artifactId>
        <version>3.3.2.GA</version>
    </dependency>
    <dependency>
        <groupId>commons-fileupload</groupId>
        <artifactId>commons-fileupload</artifactId>
        <version>1.0</version>
    </dependency>
    <dependency>
        <groupId>opensymphony</groupId>
        <artifactId>quartz-all</artifactId>
        <version>1.6.3</version>
    </dependency>
    <dependency>
        <groupId>de.odysseus.juel</groupId>
        <artifactId>juel</artifactId>
        <version>2.1.0</version>
    </dependency>
    <dependency>
        <groupId>javax.servlet</groupId>
        <artifactId>servlet-api</artifactId>
        <version>2.4</version>
        <scope>provided</scope>
    </dependency>
    <dependency>
        <groupId>javax.servlet.jsp</groupId>
        <artifactId>jsp-api</artifactId>
        <version>2.0</version>
        <scope>provided</scope>
    </dependency>
    <dependency>
        <groupId>javax.servlet</groupId>
        <artifactId>jstl</artifactId>
        <version>1.2</version>
    </dependency>
    <dependency>
        <groupId>taglibs</groupId>
        <artifactId>standard</artifactId>
        <version>1.1.2</version>
    </dependency>
    <dependency>
        <groupId>log4j</groupId>
        <artifactId>log4j</artifactId>
        <version>1.2.15</version>
        <exclusions>
            <exclusion>
                <groupId>javax.mail</groupId>
                <artifactId>mail</artifactId>
            </exclusion>
            <exclusion>
                <groupId>javax.jms</groupId>
                <artifactId>jms</artifactId>
            </exclusion>
            <exclusion>
                <groupId>com.sun.jdmk</groupId>
                <artifactId>jmxtools</artifactId>
            </exclusion>
            <exclusion>
                <groupId>com.sun.jmx</groupId>
                <artifactId>jmxri</artifactId>
            </exclusion>
        </exclusions>
    </dependency>

I am using Maven, CXF 2.2.7, JBoss 4.2.3 and JRE 1.5 Updated

I have a Webservice that I can see on the server by using the URL myURL/myService?wsdl

I am trying to develop a web app to ping that webservice by calling this in my bean:

MyWebService webservice = new MyWebService();

However, it dies and throws the following error, which is very vague:

    java.lang.ClassCastException: org.apache.cxf.jaxws.ServiceImpl
09:25:59,450 ERROR [STDERR]  at javax.xml.ws.Service.<init>(Service.java:81)
09:25:59,450 ERROR [STDERR]  at org.otherservice.webservice.MyWebServiceService.<init>(MyWebService.java:44)
09:25:59,450 ERROR [STDERR]  at net.myservice.beans.MyBean.getMyServiceSoap(MyBean.java:109)
09:25:59,450 ERROR [STDERR]  at net.myservice.beans.MyBean.ack(MyBean.java:240)
09:25:59,450 ERROR [STDERR]  at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
09:25:59,450 ERROR [STDERR]  at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
09:25:59,450 ERROR [STDERR]  at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
09:25:59,450 ERROR [STDERR]  at java.lang.reflect.Method.invoke(Method.java:585)
09:25:59,450 ERROR [STDERR]  at org.apache.el.parser.AstValue.invoke(AstValue.java:131)
09:25:59,450 ERROR [STDERR]  at org.apache.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:276)
09:25:59,450 ERROR [STDERR]  at org.apache.jasper.el.JspMethodExpression.invoke(JspMethodExpression.java:68)
09:25:59,450 ERROR [STDERR]  at javax.faces.component.MethodBindingMethodExpressionAdapter.invoke(MethodBindingMethodExpressionAdapter.java:77)
09:25:59,450 ERROR [STDERR]  at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:95)
09:25:59,450 ERROR [STDERR]  at javax.faces.component.UICommand.broadcast(UICommand.java:383)
09:25:59,450 ERROR [STDERR]  at javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:450)
09:25:59,450 ERROR [STDERR]  at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:759)
09:25:59,450 ERROR [STDERR]  at com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:97)
09:25:59,450 ERROR [STDERR]  at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:266)
09:25:59,450 ERROR [STDERR]  at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:132)
09:25:59,450 ERROR [STDERR]  at javax.faces.webapp.FacesServlet.service(FacesServlet.java:244)
09:25:59,450 ERROR [STDERR]  at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
09:25:59,450 ERROR [STDERR]  at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
09:25:59,450 ERROR [STDERR]  at org.apache.myfaces.webapp.filter.ExtensionsFilter.doFilter(ExtensionsFilter.java:301)
09:25:59,450 ERROR [STDERR]  at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
09:25:59,450 ERROR [STDERR]  at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
09:25:59,450 ERROR [STDERR]  at net.faces.filters.AuthorizationFilter.doFilter(AuthorizationFilter.java:84)
09:25:59,450 ERROR [STDERR]  at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
09:25:59,450 ERROR [STDERR]  at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
09:25:59,450 ERROR [STDERR]  at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
09:25:59,450 ERROR [STDERR]  at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
09:25:59,450 ERROR [STDERR]  at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
09:25:59,450 ERROR [STDERR]  at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
09:25:59,450 ERROR [STDERR]  at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
09:25:59,450 ERROR [STDERR]  at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:182)
09:25:59,450 ERROR [STDERR]  at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
09:25:59,450 ERROR [STDERR]  at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
09:25:59,450 ERROR [STDERR]  at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
09:25:59,450 ERROR [STDERR]  at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:157)
09:25:59,450 ERROR [STDERR]  at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
09:25:59,450 ERROR [STDERR]  at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:262)
09:25:59,450 ERROR [STDERR]  at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
09:25:59,450 ERROR [STDERR]  at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
09:25:59,450 ERROR [STDERR]  at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:446)
09:25:59,450 ERROR [STDERR]  at java.lang.Thread.run(Thread.java:595)

I am hoping someone has seen this exception before and can help me.

<dependency>
        <groupId>junit</groupId>
        <artifactId>junit</artifactId>
        <version>4.6</version>
        <scope>test</scope>
    </dependency>
    <dependency>
        <groupId>org.mortbay.jetty</groupId>
        <artifactId>jetty</artifactId>
        <version>6.1.9</version>
        <scope>test</scope>
    </dependency>
    <dependency>
        <groupId>org.apache.cxf</groupId>
        <artifactId>cxf-rt-frontend-jaxws</artifactId>
        <version>2.2.7</version>
    </dependency>
    <dependency>
        <groupId>org.apache.cxf</groupId>
        <artifactId>cxf-rt-transports-http</artifactId>
        <version>2.2.7</version>
    </dependency>
    <dependency>
        <groupId>org.apache.cxf</groupId>
        <artifactId>cxf-rt-ws-security</artifactId>
        <version>2.2.7</version>
    </dependency>
    <dependency>
        <groupId>org.apache.xmlbeans</groupId>
        <artifactId>xmlbeans</artifactId>
        <version>2.4.0</version>
    </dependency>
    <dependency>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>xmlbeans-maven-plugin</artifactId>
        <version>2.3.3</version>
    </dependency>
    <dependency>
        <groupId>org.slf4j</groupId>
        <artifactId>slf4j-jdk14</artifactId>
        <version>1.5.10</version>
    </dependency>
    <dependency>
        <groupId>org.hibernate</groupId>
        <artifactId>hibernate-core</artifactId>
        <version>3.3.2.GA</version>
    </dependency>
    <dependency>
        <groupId>org.hibernate</groupId>
        <artifactId>hibernate-c3p0</artifactId>
        <version>3.3.2.GA</version>
    </dependency>
    <dependency>
        <groupId>javassist</groupId>
        <artifactId>javassist</artifactId>
        <version>3.8.0.GA</version>
    </dependency>
    <dependency>
        <groupId>hsqldb</groupId>
        <artifactId>hsqldb</artifactId>
        <version>1.8.0.7</version>
    </dependency>
    <dependency>
        <groupId>javax.faces</groupId>
        <artifactId>jsf-api</artifactId>
        <version>1.2_02</version>
        <scope>provided</scope>
    </dependency>
    <dependency>
        <groupId>javax.faces</groupId>
        <artifactId>jsf-impl</artifactId>
        <version>1.2-b19</version>
        <scope>provided</scope>
    </dependency>
    <dependency>
        <groupId>javax.xml</groupId>
        <artifactId>jaxrpc-api</artifactId>
        <version>1.1</version>
    </dependency>
    <dependency>
        <groupId>org.apache.axis</groupId>
        <artifactId>axis</artifactId>
        <version>1.4</version>
    </dependency>
    <dependency>
        <groupId>org.apache.myfaces.tomahawk</groupId>
        <artifactId>tomahawk</artifactId>
        <version>1.1.8</version>
    </dependency>
    <dependency>
        <groupId>commons-discovery</groupId>
        <artifactId>commons-discovery</artifactId>
        <version>20040218.194635</version>
    </dependency>
    <dependency>
        <groupId>net.sf.locale4j</groupId>
        <artifactId>locale4j</artifactId>
        <version>1.1.3</version>
    </dependency>
    <dependency>
        <groupId>javax.mail</groupId>
        <artifactId>mail</artifactId>
        <version>1.4.1</version>
    </dependency>
    <dependency>
        <groupId>javax.activation</groupId>
        <artifactId>activation</artifactId>
        <version>1.1</version>
    </dependency>
    <dependency>
        <groupId>org.mortbay.jetty</groupId>
        <artifactId>jsp-api-2.1</artifactId>
        <version>6.1.9</version>
        <scope>test</scope>
    </dependency>
    <dependency>
        <groupId>com.sun.el</groupId>
        <artifactId>el-ri</artifactId>
        <version>1.0</version>
    </dependency>
    <dependency>
        <groupId>mysql</groupId>
        <artifactId>mysql-connector-java</artifactId>
        <version>5.1.10</version>
    </dependency>
    <dependency>
        <groupId>org.hibernate</groupId>
        <artifactId>hibernate-ehcache</artifactId>
        <version>3.3.2.GA</version>
    </dependency>
    <dependency>
        <groupId>commons-fileupload</groupId>
        <artifactId>commons-fileupload</artifactId>
        <version>1.0</version>
    </dependency>
    <dependency>
        <groupId>opensymphony</groupId>
        <artifactId>quartz-all</artifactId>
        <version>1.6.3</version>
    </dependency>
    <dependency>
        <groupId>de.odysseus.juel</groupId>
        <artifactId>juel</artifactId>
        <version>2.1.0</version>
    </dependency>
    <dependency>
        <groupId>javax.servlet</groupId>
        <artifactId>servlet-api</artifactId>
        <version>2.4</version>
        <scope>provided</scope>
    </dependency>
    <dependency>
        <groupId>javax.servlet.jsp</groupId>
        <artifactId>jsp-api</artifactId>
        <version>2.0</version>
        <scope>provided</scope>
    </dependency>
    <dependency>
        <groupId>javax.servlet</groupId>
        <artifactId>jstl</artifactId>
        <version>1.2</version>
    </dependency>
    <dependency>
        <groupId>taglibs</groupId>
        <artifactId>standard</artifactId>
        <version>1.1.2</version>
    </dependency>
    <dependency>
        <groupId>log4j</groupId>
        <artifactId>log4j</artifactId>
        <version>1.2.15</version>
        <exclusions>
            <exclusion>
                <groupId>javax.mail</groupId>
                <artifactId>mail</artifactId>
            </exclusion>
            <exclusion>
                <groupId>javax.jms</groupId>
                <artifactId>jms</artifactId>
            </exclusion>
            <exclusion>
                <groupId>com.sun.jdmk</groupId>
                <artifactId>jmxtools</artifactId>
            </exclusion>
            <exclusion>
                <groupId>com.sun.jmx</groupId>
                <artifactId>jmxri</artifactId>
            </exclusion>
        </exclusions>
    </dependency>

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

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

发布评论

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

评论(2

坏尐絯℡ 2024-09-03 23:35:51

我使用以下代码解决了这个 JBoss 类加载器问题:

import javax.xml.ws.Service;
import javax.xml.ws.soap.SOAPFaultException;
import javax.xml.ws.spi.ServiceDelegate;
import org.apache.cxf.Bus;
import org.apache.cxf.BusFactory;
import org.apache.cxf.jaxws.ServiceImpl;

Bus bus = BusFactory.newInstance().createBus();
ServiceDelegate service = new ServiceImpl(bus, url, portName, null);
Dispatch<Source> dispatch = service.createDispatch(portName, Source.class, Service.Mode.MESSAGE);

I've worked around this JBoss classloader issue by using the following code:

import javax.xml.ws.Service;
import javax.xml.ws.soap.SOAPFaultException;
import javax.xml.ws.spi.ServiceDelegate;
import org.apache.cxf.Bus;
import org.apache.cxf.BusFactory;
import org.apache.cxf.jaxws.ServiceImpl;

Bus bus = BusFactory.newInstance().createBus();
ServiceDelegate service = new ServiceImpl(bus, url, portName, null);
Dispatch<Source> dispatch = service.createDispatch(portName, Source.class, Service.Mode.MESSAGE);
塔塔猫 2024-09-03 23:35:51

这很可能是一个类加载器问题,其中多个类加载器正在加载 jaxws api 类。我的主要想法是检查任何 jaxws-api jar 的类加载器、战争和认可区域等,并确保它只在一个地方找到。

This is most likely a classloader issue where multiple classloaders are loading the jaxws api classes. My main thought would be to check the classloaders and wars and endorsed areas and such for any of the jaxws-api jars and make sure it's only found in one place.

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