Glassfish 6 and IntelliJ 2021 - RESTful Webservice
Answered
Hello,
I have a problem running REST Webservices on Glassfish 6. I use JDK 11 - as recommended by eclipse glassfish but can't get it to work.
I tried setting up the project using the Project Wizard for Java EE Applications but I always get following error when deploying the initial project:
[2021-09-18T09:11:19.341+0200] [glassfish 6.2] [SEVERE] [AS-WEB-CORE-00108] [jakarta.enterprise.web.core] [tid: _ThreadID=58 _ThreadName=admin-listener(2)] [timeMillis: 1631949079341] [levelValue: 1000] [[
ContainerBase.addChild: start:
org.apache.catalina.LifecycleException: org.apache.catalina.LifecycleException: java.lang.UnsupportedOperationException
at org.apache.catalina.core.StandardContext.start(StandardContext.java:5596)
at com.sun.enterprise.web.WebModule.start(WebModule.java:510)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:877)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:860)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:644)
at com.sun.enterprise.web.WebContainer.loadWebModule(WebContainer.java:2020)
at com.sun.enterprise.web.WebContainer.loadWebModule(WebContainer.java:1666)
at com.sun.enterprise.web.WebApplication.start(WebApplication.java:82)
at org.glassfish.internal.data.EngineRef.start(EngineRef.java:98)
Versions:
glassfish 6.2.1
JDK 11.0.11
jakarta EE 9
IntelliJ IDEA 2021.2.1 (Ultimate Edition)
I would be glad to get some assistance.
Regards, Gernot
Please sign in to leave a comment.
Hi Gernot,
Could you post the entire text of the error message?
Here is the full Glassfish6 output:
Maybe some issue with compatible version libraries which are used. I created new project woth these libraries (all are default selected) with GF 6.2 and JDK 11:
Have you checked the Glassfish server logs? Can you attach a sample project?
Thanks for your reply. With your settings it works now. I checked the "Full Plattform" checkbox - which didn't work. I think you are right that some library version do not work with each other.
Interesting. I had this same problem. I figured out that in the new project dialog, one should not select the Eclipse Jersey Server in the Implementations section. If so, then this error follows on attempt to deploy.
I am still quite confused about the Dependencies vs. Implementations.
For instance for JSF to work, one has to select both the JSF dependence and Mojarra implementation as far as my experience goes. I believe it is similar with the CDI dependence and Weld implementation.
For JAX-RS though, the Jersey implementation that is supposed to provide JAX-RS server MUST NOT be selected, only the RESTful Web Services dependence.
>I am still quite confused about the Dependencies vs. Implementations.
Please see https://stackoverflow.com/a/69226157/2000323
Thanks, yes. But I would think Glassfish would provide JSF and CDI, yet one has to select the Weld and Mojarra implementations, I believe.