0

I am developing an XML based Web Service, but firstly i wanted to see wether a java class would be executed on a server. The server of my choosing was GlassFish 5. After a ride with all the setting i got it runing, now as you can see i stumbled upon this kind of Error

enter image description here

My Code ExampleWs:

package ws;

import javax.jws.WebService;

@WebService
    public class ExampleWs {

        public String getText() {
            return "Some Text";
        }

    }

Now i want to know what can be done in order to solve this Error. I also tried another way of deploying ExampleWs.java -> directly through asadmin with Command Prompt, but there is this error:

enter image description here

1 Answers1

0

To my knowledge you cannot deploy just a class file. You need to create some kind of archive that contains your classes along with some other information (e.g. deployment descriptor that tells the application server what to do with the contained classes).

If you want to create a web application then the kind of archive will most likely be a WAR (web archive).

If you are using Eclipse IDE for JEE Developers you should be able to right-click on your project and from there export it as a WAR.

How to make war file in Eclipse

Christoph John
  • 3,003
  • 2
  • 13
  • 23