users@glassfish.java.net

Problem with EAR when using CXF to build simple proof of concept web service for Glassfish

From: Rob Tanner <caspersgrin_at_gmail.com>
Date: Tue, 4 Mar 2014 12:02:13 -0800

I’ve written a simple proof of concept (the concept being: have I figured it out yet?) web service in Eclipse. I created a Dynamic Web Project and set the server to GlassFish (I have GlassFish 4 installed in Eclipse) and CXF facet selected. The class file is :

package org.linfield;

import javax.jws.WebMethod;
import javax.jws.WebService;

@WebService
public class HelloVietnam {

        @WebMethod
        public String Hello (String foo) {
                return"Hello Viet Nam " + foo;
        }
}

I highlighted the class file and then from the menu selected New -> Web Service from the drop down menu. In the Web Services window, I selected bottom-up and the Service Implementation org.linfield.HelloVietnam, and then clicked on “Web service runtime: Apache CXF 2.x”. The Service Deployment window already had CFX2.x and Glassfish 4 selected. so I just clicked OK. Then I clicked Finish. After that I see several operation in progress boxes pop up and then finally and error: cannot Deploy HelloVietnamEAR. Below is the display from clicking on Details:

cannot Deploy HelloVietnamEAR
    java.lang.Exception: deploy is failing=Error occurred during deployment: Exception while deploying the app [HelloVietnamEAR] : The lifecycle method [stop] must not throw a checked exception. Related annotation information: annotation [@javax.annotation.PreDestroy()] on annotated element [public void org.apache.activemq.broker.util.CommandAgent.stop() throws java.lang.Exception] of type [METHOD]. Please see server.log for more details.
    at oracle.eclipse.tools.glassfish.GlassfishGenericServerBehaviour.publishDeployedDirectory(GlassfishGenericServerBehaviour.java:505)
    at oracle.eclipse.tools.glassfish.GlassfishV4ServerBehavior.publishModuleForGlassFishV3(GlassfishV4ServerBehavior.java:92)
    at oracle.eclipse.tools.glassfish.GlassfishV4ServerBehavior.publishModule(GlassfishV4ServerBehavior.java:54)
    at org.eclipse.wst.server.core.model.ServerBehaviourDelegate.publishModule(ServerBehaviourDelegate.java:1091)
    at org.eclipse.wst.server.core.model.ServerBehaviourDelegate.publishModules(ServerBehaviourDelegate.java:1183)
    at org.eclipse.wst.server.core.model.ServerBehaviourDelegate.publish(ServerBehaviourDelegate.java:987)
    at org.eclipse.wst.server.core.model.ServerBehaviourDelegate.publish(ServerBehaviourDelegate.java:774)
    at org.eclipse.wst.server.core.internal.Server.publishImpl(Server.java:3153)
    at org.eclipse.wst.server.core.internal.Server$PublishJob.run(Server.java:345)
    at org.eclipse.core.internal.jobs.Worker.run(Worker.java:53)

I did not create the project HelloVietnamEAR but rather it seems to be a by-product of creating the web service. Can anyone explain what’s going on and how/why that EAR project was created?

Thanks,

Rob Tanner,
Linfield College