I saw this and other similar questions before and their solution didn't solve my problem because Glassfish 5 had a lot of changes.
I'm running a soap web service and getting this error:
java.lang.IllegalStateException: The lifecycle method [finalizeConfig] must not throw a checked exception. Related annotation information: annotation [@javax.annotation.PostConstruct()] on annotated element [public void org.apache.cxf.transport.http_jetty.spring.JettyHTTPServerEngineBeanDefinitionParser$SpringJettyHTTPServerEngine.finalizeConfig() throws java.security.GeneralSecurityException,java.io.IOException] of type [METHOD]
at com.sun.enterprise.deployment.archivist.Archivist.readAnnotations(Archivist.java:503)
at com.sun.enterprise.deployment.archivist.Archivist.readAnnotations(Archivist.java:423)
at org.glassfish.web.deployment.archivist.WebArchivist.postAnnotationProcess(WebArchivist.java:317)
at org.glassfish.web.deployment.archivist.WebArchivist.postAnnotationProcess(WebArchivist.java:68)
at com.sun.enterprise.deployment.archivist.Archivist.readRestDeploymentDescriptors(Archivist.java:397)
at com.sun.enterprise.deployment.archivist.Archivist.readDeploymentDescriptors(Archivist.java:372)
at com.sun.enterprise.deployment.archivist.Archivist.open(Archivist.java:247)
at com.sun.enterprise.deployment.archivist.Archivist.open(Archivist.java:256)
at com.sun.enterprise.deployment.archivist.Archivist.open(Archivist.java:217)
at com.sun.enterprise.deployment.archivist.ApplicationFactory.openArchive(ApplicationFactory.java:137)
at org.glassfish.javaee.core.deployment.DolProvider.processDOL(DolProvider.java:183)
at org.glassfish.javaee.core.deployment.DolProvider.load(DolProvider.java:207)
at org.glassfish.javaee.core.deployment.DolProvider.load(DolProvider.java:73)
at com.sun.enterprise.v3.server.ApplicationLifecycle.loadDeployer(ApplicationLifecycle.java:857)
at com.sun.enterprise.v3.server.ApplicationLifecycle.setupContainerInfos(ApplicationLifecycle.java:797)
at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:354)
at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:195)
...
I'm using Glassfish 5.1.0 and using Apache cxf 3.3.5 and my IDE is Eclipse EE Version: 2019-12 (4.14.0)
I downloaded Apache CXF binary distribution and added in to eclipse CXF runtime.
This is my web service class:
package com.web.service;
import javax.jws.WebMethod;
import javax.jws.WebService;
@WebService(targetNamespace = "localhost:8080")
public class Service {
@WebMethod public String greet(String name) {
return "Hi," + name;
}
}