K. Siva Prasad Reddy
K. Siva Prasad Reddy

Reputation: 12405

How to disable scanning @WebService annotations in JBoss AS 7?

I have web services developed using Spring+ApacheCXF and I need tod eploy them on JBoss AS7. They are being deployed by CXFServlet properly.

But JBoss AS7 also deploying them by scanning @WebService annotations(as expected without Spring Injection).

How to disable scanning @WebService annotations in JBoss AS 7?

PS: I am deploying as a .war file.

PS PS: My current cxf webservices are being deployed properly. But JBoss AS7 also trying to scan @WebService classes and deploying them also(without dependencies injected).I am looking for a way to turn of JBossAS7's scanning for @WebService classes.

Upvotes: 2

Views: 4824

Answers (4)

rsh
rsh

Reputation: 51

This applies for Jboss 6 as well. I tried it on my Jboss 6.2.2. Comment the following in standalone.xml

<!-- <extension module="org.jboss.as.webservices"/> -->

Then comment the below snippet in the same standalone.xml. Note if you are using different profile name or in domain mode you will have to do it at similar places.

<!-- 
    <subsystem xmlns="urn:jboss:domain:webservices:1.2">
        <modify-wsdl-address>true</modify-wsdl-address>
        <wsdl-host>${jboss.bind.address:127.0.0.1}</wsdl-host>
        <endpoint-config name="Standard-Endpoint-Config"/>
        <endpoint-config name="Recording-Endpoint-Config">
            <pre-handler-chain name="recording-handlers" protocol-bindings="##SOAP11_HTTP ##SOAP11_HTTP_MTOM ##SOAP12_HTTP ##SOAP12_HTTP_MTOM">
                <handler name="RecordingHandler" class="org.jboss.ws.common.invocation.RecordingServerHandler"/>
            </pre-handler-chain>
        </endpoint-config>
        <client-config name="Standard-Client-Config"/>
    </subsystem>
     -->

Upvotes: 4

foucrazy
foucrazy

Reputation: 1

I'm using JBoss EAP 6.1 and i solved the same problem excluding the subsystems jaxrs and webservices.

jboss-deployment-structure.xml

    <?xml version="1.0"?>

<jboss-deployment-structure xmlns="urn:jboss:deployment-structure:1.2">
        <deployment>
            <exclude-subsystems>
                <subsystem name="jaxrs" />
                <subsystem name="webservices" />
            </exclude-subsystems>
            <exclusions>
                <module name="javaee.api" />
                <module name="org.apache.log4j" />
            </exclusions>
            <dependencies>
                <module meta-inf="export" name="com.liferay.portal">
                    <imports>
                            <include path="META-INF" />
                    </imports>
                </module>
                <module name="javax.mail.api" />
                <module name="org.jboss.modules" />
            </dependencies>
        </deployment>
</jboss-deployment-structure>

Upvotes: 0

alex
alex

Reputation: 61

I believe you will want to remove this from your standalone.xml

<extension module="org.jboss.as.webservices"/>

and

<subsystem xmlns="urn:jboss:domain:webservices:1.1">
    <modify-wsdl-address>true</modify-wsdl-address>
    <wsdl-host>${jboss.bind.address:127.0.0.1}</wsdl-host>
    <endpoint-config name="Standard-Endpoint-Config"/>
    <endpoint-config name="Recording-Endpoint-Config">
        <pre-handler-chain name="recording-handlers" protocol-bindings="##SOAP11_HTTP ##SOAP11_HTTP_MTOM ##SOAP12_HTTP ##SOAP12_HTTP_MTOM">
        <handler name="RecordingHandler" class="org.jboss.ws.common.invocation.RecordingServerHandler"/>
        </pre-handler-chain>
    </endpoint-config>
</subsystem>

This is what I did to remove the jboss webservices so I could use something else. I'm still in the middle of testing this but it is no longer deploying the services. I assume I will just be able to use spring to deploy. Hope this helps.

Upvotes: 2

hoaz
hoaz

Reputation: 10171

I am using exclude-filter in my application context XML file to exclude web service components from Spring component scan.

<context:component-scan base-package="your.application.base.package">
    <context:exclude-filter type="annotation" expression="org.springframework.stereotype.Controller" />
    <context:exclude-filter type="annotation" expression="javax.jws.WebService" />
</context:component-scan>

At the same time I include them in component scan in CXF context XML.

Upvotes: 1

Related Questions