Generating web service client in netbeans in web application using maven - web-services

I have a web application which has web services clients. When I right click on the client in netbeans I get option to edit web service attribute like below.
When I add maven to the same application, I do not get -wsimport options tab while editing the web service attributes. See following image.
Everything else is same in the application with just the maven used for dependency management in later application.
Please help.

The WSIMPORT is inside the Maven plugin named jaxws-maven-plugin. You may be noticed that the Netbeans automatically add it as a build plugin at your project POM file.
It can be configured in the Maven way as the following example: -
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>jaxws-maven-plugin</artifactId>
<version>1.12</version>
<executions>
<execution>
<goals>
<goal>wsimport</goal>
</goals>
<configuration>
<wsdlUrls>
<wsdlUrl>http://MY_DOMAIN/MY_SERVICE?wsdl</wsdlUrl>
</wsdlUrls>
<packageName>com.my.package.ws</packageName>
</configuration>
<phase>generate-sources</phase>
</execution>
</executions>
<dependencies>
<dependency>
<groupId>com.sun.xml.ws</groupId>
<artifactId>jaxws-tools</artifactId>
<version>2.2.5</version>
</dependency>
</dependencies>
<configuration>
<verbose>true</verbose>
<sourceDestDir>${basedir}/src/main/java</sourceDestDir>
</configuration>
</plugin>
You may see further information about the jaxws:wsimport and some usage example.
I hope this may help.
Regards,
Charlee Ch.

Related

Unable to deploy Spring Boot application to Elastic Beanstalk

So I've uploaded my Jar file created with the pom file below using maven and I'm having the errors in the logs and can't figure out what the problem is. The Spring Boot both builds and runs fine locally but won't work when trying to deploy.
The logs give me this error
Exception in thread "main" java.lang.NoClassDefFoundError: org/springframework/boot/SpringApplication
and my build in my pom file is
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
I've tried loads of different things but am coming at a loss. Any help would be appreciated.

Maven Jetty Plugin - Disable Http Trace

I have a maven project with a web.xml and run it using mvn jetty:run
How can I disable the http-tracing?
Edit: I looked here but I was unable to identify the relevant tags...
This is the relevant plugin:
<plugin>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-maven-plugin</artifactId>
<version>9.2.11.v20150529</version>
<configuration>
<jettyXml>src/jetty.xml</jettyXml>
</configuration>
</plugin>
Two things.
Jetty 9.2 is EOL (End of Life) - consider upgrading to something supported and stable (such as the recently released 9.4.14.v20181114)
The TRACE method in HTTP is disabled by default (via the webdefaults.xml descriptor).
The only way you can use TRACE is to both intentionally configure your webapp to use a custom default descriptor without this constraint (which your <configuration> section doesn't do), and have a Servlet that implements doTrace() or service() methods to support the TRACE method.

Writing a custom feature

We would like to write our own custom extension (feature) for wso2 carbon. Is there some documentation for authoring features?
We did manage to just "hack" our way into writing a custom feature. But how do we host it? It seems Carbon is looking at some very specific repository descriptors - artifacts.jar and content.jar
How can we generate these descriptors without tying into the Carbon build. Is there some documentation describing how to setup a third party feature repository?
Creating-your-own-wso2-carbon-components webinar discusses creating carbon components, and a feature for those components. It covers quite a lot of basics, and best practices as well.
To host the created features you have written, you need to generate a p2-repository from those features. p2-repo concept comes from the underline Eclipse equinox project that WSO2 products use.
WSO2 have written its own maven plugin called carbon-p2-plugin that helps to generate a p2-repo. Here's how you can do that. Simply create a new maven project (packaging: pom), and then set the features you want to publish under the carbon-p2-plugin plugin configuration. Following is a sample pom.xml that you can use. This was copied from the p2-repo generation pom.xml of carbon 4.1.0, and I simplified it.
I have tested this pom file, it worked for me. There are two sample feature definitions. Replace those featureArtifactDef with your own feature definitions. The format is $groupId:$artifactId:$version.
When you build this via maven, maven creates the target/p2-repo directory. This contains the p2-repository which contains the complete p2-repo including artifacts.jar and content.jar. You can just use this folder to install features, or you can host it somewhere. There're no special requirements on hosting.
<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/maven-v4_0_0.xsd">
<parent>
<groupId>org.wso2.carbon</groupId>
<artifactId>carbon-features</artifactId>
<version>4.1.0</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>mysample-feature-repository</artifactId>
<version>4.1.0</version>
<packaging>pom</packaging>
<name>WSO2 Carbon - Feature Repository</name>
<build>
<plugins>
<plugin>
<groupId>org.wso2.maven</groupId>
<artifactId>carbon-p2-plugin</artifactId>
<version>1.5.2</version>
<executions>
<execution>
<id>2-p2-repo-generation</id>
<phase>package</phase>
<goals>
<goal>p2-repo-gen</goal>
</goals>
<configuration>
<p2AgentLocation>${basedir}/target/p2-agent</p2AgentLocation>
<metadataRepository>file:${basedir}/target/p2-repo</metadataRepository>
<artifactRepository>file:${basedir}/target/p2-repo</artifactRepository>
<publishArtifacts>true</publishArtifacts>
<publishArtifactRepository>true</publishArtifactRepository>
<featureArtifacts>
<!-- change the featureArtifactDef to match your needs -->
<featureArtifactDef>
org.wso2.carbon:org.wso2.carbon.service.mgt.feature:4.1.0
</featureArtifactDef>
<featureArtifactDef>
org.wso2.carbon:org.wso2.carbon.registry.core.feature:4.1.0
</featureArtifactDef>
</featureArtifacts>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>

How do I set a dependency on Spring Web Services in my POM.xml

I get this on a lot of Maven dependencies, though current source of pain is Spring.
I'll set a Spring version and include it like so:
<spring-version>3.0.0.RELEASE</spring-version>
<!-- Spring framework -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-core</artifactId>
<version>${spring-version}</version>
</dependency>
Which works as expected.
I am however having problems setting my dependency on spring-ws-core for web services. The latest I can find in any repo is 2.0.0-M1.
http://mvnrepository.com/artifact/org.springframework.ws/spring-ws-core
Any clues on what I need to include in my maven POM to get Spring 3 web services to work :)
Well, 2.0.0-M1 is simply the latest version of spring-ws-core.
<dependency>
<groupId>org.springframework.ws</groupId>
<artifactId>spring-ws-core</artifactId>
<version>2.0.0-M1</version>
</dependency>
And actually, the current stable version is 1.5.9.
<dependency>
<groupId>org.springframework.ws</groupId>
<artifactId>spring-ws-core</artifactId>
<version>1.5.9</version>
</dependency>
Okay,
don't know too much about maven. But spring source have a repository which has maven access at:-
http://www.springsource.com/repository/app/bundle/version/detail?name=org.springframework.web&version=3.0.2.RELEASE
Looks like the maven stuff is
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-web</artifactId>
<version>3.0.2.RELEASE</version>
</dependency>
But, again, i use ivy not maven!
Edit:
Oh and instructions for adding maven repository stuff are in the faq at http://www.springsource.com/repository/app/faq#q8.

Has anyone successfully run integration tests with Jboss embedded, Seam and Maven?

Have been trying to get integration testing working with my seam project and the Jboss embedded container but am not having much success. Have been doing a lot of reading and have been trying what is mentioned in this JIRA but am not having any luck.
Amy currently just trying to get the 'testproject-master-JBSEAM-2371.zip' project working but am getting the following exception
ERROR [org.jboss.embedded.DeploymentScanner] Failed to deploy
org.jboss.deployers.spi.DeploymentException: No deployer recognised the structure of vfsfile:/Users/aaron/Development/eclipse_workspaces/workspace_pink/testproject-web/target/test-classes/conf/jboss-service.xml
at org.jboss.deployers.vfs.plugins.structure.VFSStructuralDeployersImpl.determineStructure(VFSStructuralDeployersImpl.java:219)
at org.jboss.deployers.structure.spi.helpers.AbstractStructuralDeployers.determineStructure(AbstractStructuralDeployers.java:77)
Has oneone had any luck with getting the Seam integration tests working using maven and NOT a seam-gen project?
I gave up on the embedded JBoss and switched with using the Maven JBoss Plugin to deploy to a JBoss instance started as a separate process. Not ideal but there were to many conflicts with our code and Maven to get around. Is there a reason you need the embedded version?
You should be able to do something like this to deploy to JBoss in the pre-integration test phase so the integration test could run against. You would still have to launch jboss before maven. Not ideal, but this is working for me.
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>jboss-maven-plugin</artifactId>
<executions>
<execution>
<phase>pre-integration-test</phase>
<goals>
<goal>deploy</goal>
</goals>
<configuration>
<jbossHome>/opt/JBoss/current</jbossHome>
<port>8080</port>
</configuration>
</execution>
</executions>
</plugin>