0

I get java.lang.NoClassDefFoundError: org/apache/cxf/jaxws/JaxWsProxyFactoryBean whenever I try to create:

JaxWsProxyFactoryBean factory = new JaxWsProxyFactoryBean();

do you have any idea what can be the problem here ?

this is my pom.xml

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <groupId>Agency</groupId>
    <artifactId>BusinessLayer</artifactId>
    <version>0.0.1-SNAPSHOT</version>
    <name>BusinessLayer</name>
    <properties>
        <org.slf4j-version>1.5.10</org.slf4j-version>
    </properties>
    <repositories>
        <repository>
            <id>jboss</id>
            <url>http://repository.jboss.org/maven2/</url>
        </repository>
    </repositories>
    <dependencies>
        <!-- CXF -->
        <dependency>
            <groupId>org.apache.cxf</groupId>
            <artifactId>cxf-api</artifactId>
            <version>2.6.2</version>
        </dependency>
        <dependency>
            <groupId>org.apache.cxf</groupId>
            <artifactId>cxf-rt-frontend-jaxws</artifactId>
            <version>2.6.2</version>
        </dependency>
        <dependency>
            <groupId>org.apache.cxf</groupId>
            <artifactId>cxf-rt-transports-http</artifactId>
            <version>2.6.2</version>
        </dependency>


        <dependency>
            <groupId>org.hibernate</groupId>
            <artifactId>hibernate-entitymanager</artifactId>
            <version>4.0.1.Final</version>
        </dependency>
        <dependency>
            <groupId>org.hibernate</groupId>
            <artifactId>hibernate-core</artifactId>
            <version>4.0.1.Final</version>
        </dependency>

        <!-- Logging -->
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-api</artifactId>
            <version>${org.slf4j-version}</version>
        </dependency>
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>jcl-over-slf4j</artifactId>
            <version>${org.slf4j-version}</version>
            <scope>runtime</scope>
        </dependency>
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-log4j12</artifactId>
            <version>${org.slf4j-version}</version>
            <scope>runtime</scope>
        </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>
            <scope>runtime</scope>
        </dependency>
    </dependencies>
    <build>
        <sourceDirectory>src</sourceDirectory>
        <resources>
            <resource>
                <directory>src</directory>
                <excludes>
                    <exclude>**/*.java</exclude>
                </excludes>
            </resource>
        </resources>
        <plugins>
            <plugin>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>2.3.2</version>
                <configuration>
                    <source>1.7</source>
                    <target>1.7</target>
                </configuration>
            </plugin>
        </plugins>
    </build>
</project>
GionJh
  • 2,742
  • 2
  • 29
  • 68
  • Why not using the conventions `src/main/java` etc.? Good reasons against it? How have you started your application? – khmarbaise Jun 21 '15 at 17:15
  • yes application starts but then while trying to use ws-services I get that exception on instantiation. – GionJh Jun 21 '15 at 17:21
  • 1
    Which application server do you use? – soilworker Jun 22 '15 at 11:18
  • 1
    Although it's about Jboss 6 maybe this post is usefull for you: http://stackoverflow.com/questions/17594545/jboss-6-eap-jaxwsproxyfactorybean-noclassdeffounderror – soilworker Jun 22 '15 at 12:51
  • Yes that really helped ! I would like to know what's the purpose of this jboss-deploymen-structure.xml, can you help? – GionJh Jun 23 '15 at 05:58
  • 1
    If you don't have classloading issues you don't need the file, maybe this post can help you understanding: http://stackoverflow.com/questions/14581980/when-and-why-would-i-need-a-jboss-deployment-structure-xml-for-a-spring-applicat – soilworker Jun 23 '15 at 07:51
  • 1
    Thanks,you can make your comments an answer, so that I can accept it ;) – GionJh Jun 23 '15 at 09:15
  • Also if you have time, could you take a look at this: http://stackoverflow.com/questions/30999773/correct-use-of-soap-ws-services – GionJh Jun 23 '15 at 11:51

1 Answers1

1

Although it's about Jboss 6 maybe this post is usefull for you(jboss-deployment-structure.xml): JBoss 6 EAP JaxWsProxyFactoryBean NoClassDefFoundError

If you don't have classloading issues you don't need the file, maybe this post can help you understanding: When and why would I need a jboss-deployment-structure.xml for a Spring application?

Community
  • 1
  • 1
soilworker
  • 1,317
  • 1
  • 15
  • 32