JAX-WS Maven 和 NetBeans

发布于 2024-12-03 06:37:22 字数 4411 浏览 1 评论 0原文

我在 JDK6 中非常成功地使用了 netbeans 7。我需要向我的应用程序添加 JAX-WS webservice[ws] 接口,以使用应用程序中已创建的 EJB 服务。自从我迁移到 maven2 后,我在 glassfish v3.1 上的部署没有遇到任何问题,除了新的 ws 之外,它似乎工作得很好。

以下是我仍然遇到的问题列表:

  • 未部署 WS,未生成 WSDL
  • 问题,无法识别根上下文,并且测试 WS 位于本地主机地址之后。
  • 我无法为 WS 配置安全约束,存在 JACC 错误并且 WS 不可用

我曾经能够使用简单的 web.xml BASIC 身份验证来保护 ws(Ant),但对于 Maven,这不再起作用。我创建了一个测试 Ant 项目,一切正常。

我认为解决方案是在 pom.xml (原型?)中包含正确的构建插件? 我不确定要包含我正在使用的 pom.xml 中的部分代码。

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

<groupId>com</groupId>
<artifactId>at.web.ws</artifactId>
<version>3.4.2</version>
<packaging>war</packaging>

<name>at.web.ws Web App</name>

<properties>
    <endorsed.dir>${project.build.directory}/endorsed</endorsed.dir>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>

<dependencies>
    <dependency>
        <groupId>com.sun.xml.ws</groupId>
        <artifactId>webservices-rt</artifactId>
        <version>2.0-SNAPSHOT</version>
        <scope>provided</scope>
    </dependency>
    <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>true</failOnMissingWebXml>
            </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>
    </plugins>
</build>

<repositories>
    <repository>
        <url>http://download.java.net/maven/2/</url>
        <id>metro</id>
        <layout>default</layout>
        <name>Repository for library Library[metro]</name>
    </repository>
</repositories>

任何建议将不胜感激。提前致谢。

I am using netbeans 7 very successfully with JDK6. I need to add a JAX-WS webservice[ws] interface to my application to consume EJB service already created in the app. Since I moved to maven2 I had no issues with deployments on glassfish v3.1 and it seemed to work all fine apart from the new ws.

here is the list of issues I still have:

  • WS are not deployed and the WSDL are not generated
  • issues with the root context is nt recognised and the test WS is just after the localhost address.
  • I cannot configure security constrain for the WS, there is a JACC error and the WS is not available

I used to be able to secure the ws (Ant) with simple web.xml BASIC auth but with maven this is not working any more. I created a test Ant project and everything is working fine.

I think the solution is in the pom.xml (archetype?) where the correct build plug-ins are included?
I am not sure what code to include part from the pom.xml I am using.

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

....

<groupId>com</groupId>
<artifactId>at.web.ws</artifactId>
<version>3.4.2</version>
<packaging>war</packaging>

<name>at.web.ws Web App</name>

<properties>
    <endorsed.dir>${project.build.directory}/endorsed</endorsed.dir>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>

<dependencies>
    <dependency>
        <groupId>com.sun.xml.ws</groupId>
        <artifactId>webservices-rt</artifactId>
        <version>2.0-SNAPSHOT</version>
        <scope>provided</scope>
    </dependency>
    <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>true</failOnMissingWebXml>
            </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>
    </plugins>
</build>

<repositories>
    <repository>
        <url>http://download.java.net/maven/2/</url>
        <id>metro</id>
        <layout>default</layout>
        <name>Repository for library Library[metro]</name>
    </repository>
</repositories>

any advise will be appreciated. thanks in advance.

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

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

发布评论

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

评论(1

此生挚爱伱 2024-12-10 06:37:22

我回答了我自己的问题:)

我发现了这个令人惊奇的插件,它负责照顾一切并确保它全部部署在ear项目下。

http://el4j.sourceforge.net/plugins/index.html

我希望这会帮助某人
干杯,
G。

I answered my own question :)

I found this amazing plugin that looks after everything and make sure it is all deployed under the ear project.

http://el4j.sourceforge.net/plugins/index.html

I hope this will help someone
Cheers,
G.

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