HMdeveloper
HMdeveloper

Reputation: 2884

Glassfish does not show my webservices

I have a very simple webservice as follow:

package testSmart;
 import javax.jws.*;

@WebService
 public class Add {

@WebMethod
public int addElem(int i, int j){
    return i+j;
 }
}

Now when I use the following link:

http://localhost:4848/common/index.jsf

But when I open it the Add webservice is not shown in the table:

enter image description here

Just for more explanation I am following the following video which does he same:

youtube

Can anyone tell me what is the problem?

Upvotes: 1

Views: 990

Answers (3)

Python_user
Python_user

Reputation: 1573

I am late by 10 years, but just putting the answer here in case someone comes across this question in the first place:

The answer is documented by @Vifier Lockla in https://stackoverflow.com/a/48241373/4233030 for the question View endpoint in glassfish is not visible when webservices project created using intellij.

Essentially, maven-webapp-archetype uses an older version of web.xml. So, you have just to replace the older content by a more recent one.

Quoting the updated web.xml provided in the answer above:

<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns="http://xmlns.jcp.org/xml/ns/javaee"
    xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee
    http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd"
    id="WebApp_ID" version="3.1">

  <display-name>Archetype Created Web Application</display-name>

</web-app>

Upvotes: 0

Download the Full Profile version of Glassfish and not the web version. Here is the link to download.

Upvotes: 1

Zia
Zia

Reputation: 1011

it seems your classes are not compiling under default build/classes directory.

Do either of the following: Right click on your project > Build Project. or Go to eclipse menu > Project > Build Automatically

Now redeploy your application again. webservices Engine should be visible along with web engine.

go through below link it might help you, https://docs.oracle.com/cd/E19798-01/821-1752/gbixz/index.html

if you have 'Web Profile' version of GlassFish then Download the 'Full Profile' version of glassfish.

Upvotes: 0

Related Questions