2

I'm using Eclipse + Glassfish 4.0

When I deploying a simple project, following error appears :

cannot Deploy Testmart 

deploy is failing=Error occurred during deployment: Exception while loading 
the app : java.lang.IllegalStateException: ContainerBase.addChild: start: 
org.apache.catalina.LifecycleException: java.lang.RuntimeException: 
Servlet web service endpoint '' failure. Please see server.log for more details.

EDIT :

ProductCatalog.java Class :

import org.hamed.train.service.ProductServiceImp;

@WebService
public class ProductCatalog {
    ProductServiceImp productService = new ProductServiceImp();
    @WebMethod
    public List<String> getProducts() {
        return productService.getProductCategories();
    }
    public List<String> getProducts(String category) {
        return productService.getProducts(category);
    }
}

system.log content : http://txs.io/B7P

Hamed Kamrava
  • 12,359
  • 34
  • 87
  • 125
  • paste the stack trace from `server.log` – AKS Mar 26 '14 at 09:03
  • What's the servlet code (especially `@WebServlet` annotation) and deployment descriptor? – Silly Freak Mar 26 '14 at 09:11
  • I did not used `@WebServlet` any where! Should I? – Hamed Kamrava Mar 26 '14 at 09:21
  • I was intrigued by the `Servlet web service endpoint '' failure.` that you had a servlet, But I could be wrong of course. Maybe the code you posted is not the one giving you problems, but its hard to know because the string which could help identify the faulty code is empty. `@WebService` has a few properties: http://docs.oracle.com/javaee/6/api/javax/jws/WebService.html Try setting them like `name="a", serviceName="b", ...`, then if a letter appears in the log, you know the annotation was the culprit and which property was missing. – Silly Freak Mar 26 '14 at 09:27
  • Is this a problem with [method overloading in web services](http://stackoverflow.com/a/10320175/2549021)? – AKS Mar 26 '14 at 09:40
  • @SillyFreak@AKS Thank you for reply but the problem does not solved. I'm following [this tutorial video](https://www.youtube.com/watch?v=HLzM92ZnisY) on Youtube. It works fine for training provider but doesn't for me. – Hamed Kamrava Mar 26 '14 at 10:05
  • 1
    the log says `javax.xml.ws.WebServiceException: class org.hamed.train.jaxws.GetProducts do not have a property of the name arg0`, the error seems to be in another class... – Silly Freak Mar 26 '14 at 10:07

4 Answers4

5

According to @Silly Freak's comment, I found the answer.

These two method should not have the same name :

ProductCatalog.java

public List<String> getProducts() {
        return productService.getProductCategories();
    }

public List<String> getProducts(String category) {
        return productService.getProducts(category);
    }

Solution:

I changed first method name to something else and worked like a charm.

Hamed Kamrava
  • 12,359
  • 34
  • 87
  • 125
2

For me the problem was, I missed to include the no arguments constructor or "Product" class. It worked when I included the no argument constructor.

Note: JAXB requires no arg constructor to instantiate the object.

balajivijayan
  • 849
  • 9
  • 11
1

I had this problem, the glassfish was on Linux environment. check your $JAVA_HOME it should be set in to jdk

export JAVA_HOME=/usr/java/jdk1.7.0_55

/opt/glassfish4/glassfish/bin # echo $JAVA_HOME

/usr/java/jdk1.7.0_55

then problem was solved..

Raul Cacacho
  • 267
  • 1
  • 4
  • 15
Ravinath
  • 1,620
  • 1
  • 14
  • 8
0

I also had the same problem with eclipse galileo, and I was sure that it was related to my hibernate mapping, because publishing process started to fail when I made a new mapping to a table using an HBM file, mapping was proper in HBM file but the problem was with my DAO class.

Sample code of my DAO class :-

public class MyDAO
{
     private int id;
     private int name;
     private boolean isActive;

     public int getId() {
        return id;
     }
     public void setId(int id) {
        this.id = id;
     }
     public String getName() {
        return name;
     }
     public void setName(String name) {
        this.name = name;
     }
     public boolean isActive() {
        return isActive;
     }
     public void setActive(boolean isActive) {
        this.isActive = isActive;
     }
}

You can see the getters and setters of boolean variable is different from the other two variables (all the getters and setters were developed by eclipse itself). Now viewing from framework perspective, it will take an attribute name, change its first character to uppercase and attach a get or set as a prefix to invoke the attribute's getter and setter. So in the case of boolean attribute it will go wrong.

So when I changed the existing getters and setters to default form like getIsActive() and setIsActive(), it was published properly.