0

Spring Web Application プロジェクトが本番環境にあります。理由が何であれ、クライアントはプロジェクトをmavenで処理したいと考えています。すべてのライブラリ jar ファイルを maven 依存関係に変換しようとしました。アプリケーションはビルドされ、war としてパッケージ化されますが、開発サーバー (ちなみに tomcat であり、運用サーバーも tomcat です) にデプロイすると、次のエラーで失敗します:

    Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name '(inner bean)#2': FactoryBean threw exception on object creation; nested exception is com.sun.xml.ws.model.RuntimeModelerException: runtime modeler error: Wrapper class ws.merchant.service.jaxws.InitializePayment is not found. Have you run APT to generate them?
        at org.springframework.beans.factory.support.FactoryBeanRegistrySupport.doGetObjectFromFactoryBean(FactoryBeanRegistrySupport.java:149)
        at org.springframework.beans.factory.support.FactoryBeanRegistrySupport.getObjectFromFactoryBean(FactoryBeanRegistrySupport.ja

va:109)
    at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveInnerBean(BeanDefinitionValueResolver.java:274)
    ... 57 more
Caused by: com.sun.xml.ws.model.RuntimeModelerException: runtime modeler error: Wrapper class ws.merchant.service.jaxws.InitializePayment is not found. Have you run APT to generate them?

これは、Web サービスを使用する他のプロジェクトで知っているエラーです。このエラーが表示されたら、wsgen を使用してラッパー クラスを作成し、問題の Web サービスに追加します。

編集 ===========================

ここに pom.xml があります

http://maven.apache.org/maven-v4_0_0.xsd">

<modelVersion>4.0.0</modelVersion>
<groupId>com.company.library</groupId>
<artifactId>web app project</artifactId>
<packaging>war</packaging>
<version>1.2.41.0</version>
<name>Maven Webapp</name>

<properties>
    <!--<webXmlPath>env/prod/web.xml</webXmlPath>-->
    <webXmlPath>web/WEB-INF/web.xml</webXmlPath>

    <springFrameworkVersion>3.0.7.RELEASE</springFrameworkVersion>
    <springSecurityVersion>3.1.3.RELEASE</springSecurityVersion>
</properties>

<repositories>
    <repository>
        <id>project.local</id>
        <name>project</name>
        <url>file:${project.basedir}/lib</url>
    </repository>
</repositories>

<dependencies>

    <dependency>
        <groupId>javax.mail</groupId>
        <artifactId>mail</artifactId>
        <version>1.4</version>
    </dependency>

    <dependency>
        <groupId>org.apache.velocity</groupId>
        <artifactId>velocity</artifactId>
        <version>1.7</version>
    </dependency>

    <dependency>
        <groupId>org.aspectj</groupId>
        <artifactId>aspectjweaver</artifactId>
        <version>1.6.8</version>
    </dependency>

    <dependency>
        <groupId>commons-fileupload</groupId>
        <artifactId>commons-fileupload</artifactId>
        <version>1.3</version>
    </dependency>

    <dependency>
        <groupId>commons-codec</groupId>
        <artifactId>commons-codec</artifactId>
        <version>1.5</version>
    </dependency>


    <dependency>
        <groupId>commons-io</groupId>
        <artifactId>commons-io</artifactId>
        <version>2.4</version>
    </dependency>

    <dependency>
        <groupId>commons-net</groupId>
        <artifactId>commons-net</artifactId>
        <version>3.2</version>
    </dependency>

    <dependency>
        <groupId>com.google.code.gson</groupId>
        <artifactId>gson</artifactId>
        <version>2.0</version>
    </dependency>

    <dependency>
        <groupId>org.apache.httpcomponents</groupId>
        <artifactId>httpclient</artifactId>
        <version>4.1.2</version>
    </dependency>

    <dependency>
        <groupId>org.codehaus.jackson</groupId>
        <artifactId>jackson-core-asl</artifactId>
        <version>1.9.3</version>
    </dependency>

    <dependency>
        <groupId>org.codehaus.jackson</groupId>
        <artifactId>jackson-mapper-asl</artifactId>
        <version>1.9.3</version>
    </dependency>

    <dependency>
        <groupId>javax.servlet</groupId>
        <artifactId>jstl</artifactId>
        <version>1.2</version>
    </dependency>

    <dependency>
        <groupId>net.sourceforge.pjl-comp-filter</groupId>
        <artifactId>pjl-comp-filter</artifactId>
        <version>1.7</version>
    </dependency>

    <dependency>
        <groupId>taglibs</groupId>
        <artifactId>standard</artifactId>
        <version>1.1.2</version>
    </dependency>

    <dependency>
        <groupId>javax.servlet</groupId>
        <artifactId>servlet-api</artifactId>
        <version>2.5</version>
        <scope>provided</scope>
    </dependency>

    <dependency>
        <groupId>com.company.library</groupId>
        <artifactId>jprov</artifactId>
        <version>1.0</version>
        <scope>provided</scope>
    </dependency>

    <dependency>
        <groupId>com.company.library</groupId>
        <artifactId>transfer</artifactId>
        <version>1.0</version>
        <scope>compile</scope>
    </dependency>

    <dependency>
        <groupId>nl.captcha</groupId>
        <artifactId>simplecaptcha</artifactId>
        <version>1.1.1</version>
        <scope>compile</scope>
    </dependency>

    <dependency>
        <groupId>org.apache.xbean</groupId>
        <artifactId>xbean-spring</artifactId>
        <version>3.6</version>
    </dependency>

    <dependency>
        <groupId>com.thoughtworks.xstream</groupId>
        <artifactId>xstream</artifactId>
        <version>1.4.2</version>
    </dependency>


    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-webmvc</artifactId>
        <version>${springFrameworkVersion}</version>
    </dependency>

    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-aop</artifactId>
        <version>${springFrameworkVersion}</version>
    </dependency>

    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-web</artifactId>
        <version>${springFrameworkVersion}</version>
    </dependency>

    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-context-support</artifactId>
        <version>${springFrameworkVersion}</version>
    </dependency>

    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-beans</artifactId>
        <version>${springFrameworkVersion}</version>
    </dependency>

    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-context</artifactId>
        <version>${springFrameworkVersion}</version>
    </dependency>

    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-core</artifactId>
        <version>${springFrameworkVersion}</version>
    </dependency>

    <dependency>
        <groupId>org.springframework.security</groupId>
        <artifactId>spring-security-core</artifactId>
        <version>${springSecurityVersion}</version>
    </dependency>

    <dependency>
        <groupId>org.springframework.security</groupId>
        <artifactId>spring-security-config</artifactId>
        <version>${springSecurityVersion}</version>
    </dependency>

    <dependency>
        <groupId>org.springframework.security</groupId>
        <artifactId>spring-security-web</artifactId>
        <version>${springSecurityVersion}</version>
    </dependency>

    <dependency>
        <groupId>com.google.code.maven-play-plugin.org.playframework</groupId>
        <artifactId>jj-simplecaptcha</artifactId>
        <version>1.1</version>
    </dependency>

    <dependency>
        <groupId>com.sun.xml.bind</groupId>
        <artifactId>jaxb-impl</artifactId>
        <version>2.2.7</version>
    </dependency>


    <dependency>
        <groupId>org.jvnet.jax-ws-commons.spring</groupId>
        <artifactId>jaxws-spring</artifactId>
        <version>1.8</version>

        <exclusions>
            <exclusion>
                <groupId>org.springframework</groupId>
                <artifactId>*</artifactId>
            </exclusion>
            <exclusion>
                <groupId>com.sun.xml.bind</groupId>
                <artifactId>jaxb-impl</artifactId>
            </exclusion>
        </exclusions>
    </dependency>

    <dependency>
        <groupId>log4j</groupId>
        <artifactId>log4j</artifactId>
        <version>1.2.15</version>
        <exclusions>
            <exclusion>
                <groupId>com.sun.jmx</groupId>
                <artifactId>jmxri</artifactId>
            </exclusion>
            <exclusion>
                <groupId>com.sun.jdmk</groupId>
                <artifactId>jmxtools</artifactId>
            </exclusion>
            <exclusion>
                <groupId>javax.jms</groupId>
                <artifactId>jms</artifactId>
            </exclusion>
        </exclusions>
    </dependency>

</dependencies>

<build>
    <directory>dist-prod</directory>
    <outputDirectory>build</outputDirectory>
    <sourceDirectory>src</sourceDirectory>

    <plugins>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-war-plugin</artifactId>
            <version>2.3</version>
            <configuration>
                <webResources>
                    <resource>
                        <directory>web</directory>
                    </resource>
                </webResources>
                <webappDirectory>web_maven</webappDirectory>
                <webXml>${webXmlPath}</webXml>
            </configuration>
        </plugin>

        <plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>jaxws-maven-plugin</artifactId>
            <configuration>
                <sei>some.web.service.class</sei>
                <keep>true</keep>

            </configuration>
        </plugin>
    </plugins>


</build>

しかし、問題は、Ant でデプロイするときにこの問題が発生しないことです。Web サービスを問題なく使用できました。

Spring サービスを Web サービスとして公開するために jaxws-spring.jar を使用しています。ここに他の依存関係がありませんか?私はこの Ant から Maven への変換に 3 日間取り組んできました。他のヒントも歓迎します。

4

1 に答える 1