1

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.

Nipen
  • 11
  • 1
  • 4

1 Answers1

0

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"