Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Issue related to JAX-WS and Maven

 
Claudinei Junior
Greenhorn
Posts: 14
Java Netbeans IDE Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 2198
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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!
 
Claudinei Junior
Greenhorn
Posts: 14
Java Netbeans IDE Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 2198
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 14
Java Netbeans IDE Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 14
Java Netbeans IDE Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 2198
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 14
Java Netbeans IDE Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 2198
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi!
Did the deployment problem start right away or in some later step when reproducing the service?
Best wishes!
 
Claudinei Junior
Greenhorn
Posts: 14
Java Netbeans IDE Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi!

I already solved the issue

Thanks everyone for help me out!

Best Regards!
 
Claudinei Junior
Greenhorn
Posts: 14
Java Netbeans IDE Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 2198
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for sharing your solution!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic