在 Netbeans 7.0.1 中的 Maven Web 应用程序下从 wsdl 创建 JAX WS Web 服务并将其部署到 Oracle Weblogic 服务器 10.3.5

发布于 2024-12-14 01:12:55 字数 6021 浏览 4 评论 0原文

我正在尝试从 Netbeans 7.0.1 中的 wsdl 创建一个简单的计算器 Web 服务(jax ws),并将其部署在 weblogic servcer 10.3.5 中。 Maven 是我正在使用的构建工具。我做了以下事情: - 创建一个新的 Maven Web 应用程序。 - 从 wsdl 创建新的 Web 服务。 - 构建得很好。 - WAR 部署也成功完成。 我可以看到已部署的 Web 应用程序及其下方的 Web 服务。但是,我的 Web 服务没有端点 url 或 wsdl。简而言之,我想说应用程序是在没有服务的情况下部署的。

这是我的 POM.xml

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

<groupId>com.company</groupId>
<artifactId>CalculatorService</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>war</packaging>

<name>CalculatorService</name>

<properties>
    <endorsed.dir>${project.build.directory}/endorsed</endorsed.dir>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
      <netbeans.hint.deploy.server>WebLogic9</netbeans.hint.deploy.server>
</properties>

<dependencies>
    <dependency>
        <groupId>javax</groupId>
        <artifactId>javaee-web-api</artifactId>
        <version>6.0</version>
        <scope>provided</scope>
    </dependency>

    <dependency>
        <groupId>junit</groupId>
        <artifactId>junit</artifactId>
        <version>4.8.2</version>
        <scope>test</scope>
    </dependency>
</dependencies>

<build>
    <plugins>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-compiler-plugin</artifactId>
            <version>2.3.2</version>
            <configuration>
                <source>1.6</source>
                <target>1.6</target>
                <compilerArguments>
                    <endorseddirs>${endorsed.dir}</endorseddirs>
                </compilerArguments>
            </configuration>
        </plugin>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-war-plugin</artifactId>
            <version>2.1.1</version>
            <configuration>
                <failOnMissingWebXml>false</failOnMissingWebXml>
                <webResources>
                    <resource>
                        <directory>src</directory>
                        <targetPath>WEB-INF</targetPath>
                        <includes>
                            <include>jax-ws-catalog.xml</include>
                            <include>wsdl/**</include>
                        </includes>
                    </resource>
                </webResources>
            </configuration>
        </plugin>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-dependency-plugin</artifactId>
            <version>2.1</version>
            <executions>
                <execution>
                    <phase>validate</phase>
                    <goals>
                        <goal>copy</goal>
                    </goals>
                    <configuration>
                        <outputDirectory>${endorsed.dir}</outputDirectory>
                        <silent>true</silent>
                        <artifactItems>
                            <artifactItem>
                                <groupId>javax</groupId>
                                <artifactId>javaee-endorsed-api</artifactId>
                                <version>6.0</version>
                                <type>jar</type>
                            </artifactItem>
                        </artifactItems>
                    </configuration>
                </execution>
            </executions>
        </plugin>
        <plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>jaxws-maven-plugin</artifactId>
            <version>1.10</version>
            <executions>
                <execution>
                    <goals>
                        <goal>wsimport</goal>
                    </goals>
                    <configuration>
                        <wsdlFiles>
                            <wsdlFile>CalculatorSerivce.wsdl</wsdlFile>
                        </wsdlFiles>
                        <staleFile>${project.build.directory}/jaxws/stale/CalculatorSerivce.stale</staleFile>
                    </configuration>
                    <id>wsimport-generate-CalculatorSerivce</id>
                    <phase>generate-sources</phase>
                </execution>
            </executions>
            <dependencies>
                <dependency>
                    <groupId>javax.xml</groupId>
                    <artifactId>webservices-api</artifactId>
                    <version>1.4</version>
                </dependency>
            </dependencies>
            <configuration>
                <sourceDestDir>${project.build.directory}/generated-sources/jaxws-wsimport</sourceDestDir>
                <xnocompile>true</xnocompile>
                <verbose>true</verbose>
                <extension>true</extension>
                <catalog>${basedir}/src/jax-ws-catalog.xml</catalog>
            </configuration>
        </plugin>
    </plugins>
</build>

我的 POM 文件中是否缺少某些内容,导致 Web 服务无法正确部署?请帮忙。

I am trying to create a simple calculator web service (jax ws) from wsdl in Netbeans 7.0.1 and deploying it in weblogic servcer 10.3.5. Maven is the build tool I am using. I did the following:
- Create a new Maven Web application.
- Create a new web service from wsdl.
- It builds fine.
- WAR deploy completes successfully too.
I can see the web app deployed and a web service under it. However, my web service has no endpoint url or wsdl. In short, I would say app is deployed without the service.

Here's my POM.xml

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

<groupId>com.company</groupId>
<artifactId>CalculatorService</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>war</packaging>

<name>CalculatorService</name>

<properties>
    <endorsed.dir>${project.build.directory}/endorsed</endorsed.dir>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
      <netbeans.hint.deploy.server>WebLogic9</netbeans.hint.deploy.server>
</properties>

<dependencies>
    <dependency>
        <groupId>javax</groupId>
        <artifactId>javaee-web-api</artifactId>
        <version>6.0</version>
        <scope>provided</scope>
    </dependency>

    <dependency>
        <groupId>junit</groupId>
        <artifactId>junit</artifactId>
        <version>4.8.2</version>
        <scope>test</scope>
    </dependency>
</dependencies>

<build>
    <plugins>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-compiler-plugin</artifactId>
            <version>2.3.2</version>
            <configuration>
                <source>1.6</source>
                <target>1.6</target>
                <compilerArguments>
                    <endorseddirs>${endorsed.dir}</endorseddirs>
                </compilerArguments>
            </configuration>
        </plugin>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-war-plugin</artifactId>
            <version>2.1.1</version>
            <configuration>
                <failOnMissingWebXml>false</failOnMissingWebXml>
                <webResources>
                    <resource>
                        <directory>src</directory>
                        <targetPath>WEB-INF</targetPath>
                        <includes>
                            <include>jax-ws-catalog.xml</include>
                            <include>wsdl/**</include>
                        </includes>
                    </resource>
                </webResources>
            </configuration>
        </plugin>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-dependency-plugin</artifactId>
            <version>2.1</version>
            <executions>
                <execution>
                    <phase>validate</phase>
                    <goals>
                        <goal>copy</goal>
                    </goals>
                    <configuration>
                        <outputDirectory>${endorsed.dir}</outputDirectory>
                        <silent>true</silent>
                        <artifactItems>
                            <artifactItem>
                                <groupId>javax</groupId>
                                <artifactId>javaee-endorsed-api</artifactId>
                                <version>6.0</version>
                                <type>jar</type>
                            </artifactItem>
                        </artifactItems>
                    </configuration>
                </execution>
            </executions>
        </plugin>
        <plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>jaxws-maven-plugin</artifactId>
            <version>1.10</version>
            <executions>
                <execution>
                    <goals>
                        <goal>wsimport</goal>
                    </goals>
                    <configuration>
                        <wsdlFiles>
                            <wsdlFile>CalculatorSerivce.wsdl</wsdlFile>
                        </wsdlFiles>
                        <staleFile>${project.build.directory}/jaxws/stale/CalculatorSerivce.stale</staleFile>
                    </configuration>
                    <id>wsimport-generate-CalculatorSerivce</id>
                    <phase>generate-sources</phase>
                </execution>
            </executions>
            <dependencies>
                <dependency>
                    <groupId>javax.xml</groupId>
                    <artifactId>webservices-api</artifactId>
                    <version>1.4</version>
                </dependency>
            </dependencies>
            <configuration>
                <sourceDestDir>${project.build.directory}/generated-sources/jaxws-wsimport</sourceDestDir>
                <xnocompile>true</xnocompile>
                <verbose>true</verbose>
                <extension>true</extension>
                <catalog>${basedir}/src/jax-ws-catalog.xml</catalog>
            </configuration>
        </plugin>
    </plugins>
</build>

Am I missing something in my POM file that's causing the web service not to be deployed correctly? Please help.

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

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

发布评论

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

评论(1

撩发小公举 2024-12-21 01:12:55

我在向 Glassfish 服务器部署战争时遇到了同样的问题。事实证明,我使用了错误的 Glassfish 版本,它必须是“Java EE Full Platform”才能工作,而不是“Java EE Web Profile”

I had the same problem deploying a war to a Glassfish server. It turns out that i was using wrong Glassfish version , it have to be the "Java EE Full Platform" to work, and not "Java EE Web Profile"

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