File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Web Services and the fly likes Issue related to JAX-WS and Maven Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Web Services
Bookmark "Issue related to JAX-WS and Maven" Watch "Issue related to JAX-WS and Maven" New topic
Author

Issue related to JAX-WS and Maven

Claudinei Junior
Greenhorn

Joined: Feb 19, 2011
Posts: 14

Hello,

I'm trying to deploy a JAX-WS webservice using Maven (through Netbeans) on Glassfish, but it's not working.
Apparently, no error occurs when I deploy, but I'm not able to access the services (not even their WSDL) - I always face a 404 error (when trying to access the WSDL) - but I can access any application web page.

My test class is:


A piece of my pom.xml


This piece of the generated WSDL confused me:


Anyone knows what is going on or knows how to solve?

Thanks in advance,
Best Regards
Ivan Krizsan
Ranch Hand

Joined: Oct 04, 2006
Posts: 2198
    
    1
Hi!
First of all, concerning the endpoint address in the WSDL: GlassFish will insert an appropriate endpoint address dynamically, so you need not concern yourself with this.
Second, is the Maven pom-file created entirely by NetBeans?
Best wishes!


My free books and tutorials: http://www.slideshare.net/krizsan
Claudinei Junior
Greenhorn

Joined: Feb 19, 2011
Posts: 14

Hello Ivan,

First of all, thanks for answering me.

First of all, concerning the endpoint address in the WSDL: GlassFish will insert an appropriate endpoint address dynamically, so you need not concern yourself with this.


Great! I didn't know that

Second, is the Maven pom-file created entirely by NetBeans?


Nope. I created the project using maven and edited the pom.xml by myself.

Below, the entirely POM:


The unique tag added automatically by Netbeans is:


Thanks in advance,
Best Regards
Ivan Krizsan
Ranch Hand

Joined: Oct 04, 2006
Posts: 2198
    
    1
Hi!
It looks fine to me.
Another thing you can check is whether the web service artifacts are properly generated.
They are not immediately visible from within NetBeans (NetBeans hides generated web service artifacts), but if you look at the project from the file system you should be able to find the generated classes etc.
Also try to create a deployable WAR-file from the project and examine its contents.
Best wishes!
Claudinei Junior
Greenhorn

Joined: Feb 19, 2011
Posts: 14

Hi Ivan,

I already looked at the file system and (I think) it's ok.

The files into the war are:


The wsdl wasn't included in the war file
Is that normal?

I googled about this problem and I found some people talking about the sun-jaxws.xml.
I'll create this file and test again....

Any more suggestion?

Thanks in advance,
Best Regard
Claudinei Junior
Greenhorn

Joined: Feb 19, 2011
Posts: 14

Oh I forgot to mention:
The libs, sun.xml, web.xml, WEB-INF and META-INF dirs are into the war as well.
Sorry for that

Thanks in advance,
Best regards
Ivan Krizsan
Ranch Hand

Joined: Oct 04, 2006
Posts: 2198
    
    1
Hi!
Jubiraco Junior wrote:
The wsdl wasn't included in the war file
Is that normal?

Yes, that is normal.
The only suggestion I can think of at the moment is to start from scratch and, step by step, work towards the current project (that you have problems with) to see where it goes wrong.
Best wishes!
Claudinei Junior
Greenhorn

Joined: Feb 19, 2011
Posts: 14

Hi,

I created the sun-jaxws.xml file as I said.
When I tried to deploy I got an error message from Glassfish saying that the server dind't support JSR 109, thus the sun-jaxws.xml file would be ignored by the server

The only suggestion I can think of at the moment is to start from scratch and, step by step, work towards the current project (that you have problems with) to see where it goes wrong.


Thanks for the suggestion, Ivan!
I did what you suggested and I got the same problem when I tried to deploy

Does anyone have any idea of what is going on?

I'm considering to start to use Tomcat. I always used Glassfish and up to now I never had problems...

Thanks in advance,
Best Regards
Ivan Krizsan
Ranch Hand

Joined: Oct 04, 2006
Posts: 2198
    
    1
Hi!
Did the deployment problem start right away or in some later step when reproducing the service?
Best wishes!
Claudinei Junior
Greenhorn

Joined: Feb 19, 2011
Posts: 14

Hi!

I already solved the issue

Thanks everyone for help me out!

Best Regards!
Claudinei Junior
Greenhorn

Joined: Feb 19, 2011
Posts: 14

To solve, I did:

I added this dependecy to the pom.xml


Also, I created this profile:


IDK for what is these configurations, but it worked.
(Obs.: a similar configuration is auto-generetad by Netbeans when you create a new Maven project, so I made these configurations based upon Netbeans auto-generated configuration).

Hope this topic and solution be useful for someone else

Thanks and Regards!
Ivan Krizsan
Ranch Hand

Joined: Oct 04, 2006
Posts: 2198
    
    1
Thanks for sharing your solution!
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Issue related to JAX-WS and Maven
 
Similar Threads
Filtering problem using maven-read-properties plugin in pom.xml file
How to change jetty binding port number in maven.
JAX-WS wsgen using Maven2
How to change jetty binding port number in maven.
Strange problem - works on maven glassfish but not on Tomcat