ClassNotFoundException on ServletContainer when configuring Jersey in Intellij
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ height:90px;width:728px;box-sizing:border-box;
}
When trying to configure jax rs in intellij I get this error:
java.lang.ClassNotFoundException: org.glassfish.jersey.servlet.ServletContainer
at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1945)
My webconfig looks like this:
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns="http://xmlns.jcp.org/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_4_0.xsd"
version="4.0">
<servlet>
<servlet-name>Rest</servlet-name>
<servlet-class>org.glassfish.jersey.servlet.ServletContainer</servlet-class>
<init-param>
<param-name>jersey.config.server.provider.packages</param-name>
<param-value>com.umbrella.server.api</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>Rest</servlet-name>
<url-pattern>/api/*</url-pattern>
</servlet-mapping>
</web-app>
I manually downloaded the entire jersey pack from the official jersey website. Which should contain all the dependencies.
The weird thing is that whenever I create a class that derives from the ServletContainer it doesn't give any errors.
java intellij-idea jax-rs jersey-2.0
|
show 2 more comments
When trying to configure jax rs in intellij I get this error:
java.lang.ClassNotFoundException: org.glassfish.jersey.servlet.ServletContainer
at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1945)
My webconfig looks like this:
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns="http://xmlns.jcp.org/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_4_0.xsd"
version="4.0">
<servlet>
<servlet-name>Rest</servlet-name>
<servlet-class>org.glassfish.jersey.servlet.ServletContainer</servlet-class>
<init-param>
<param-name>jersey.config.server.provider.packages</param-name>
<param-value>com.umbrella.server.api</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>Rest</servlet-name>
<url-pattern>/api/*</url-pattern>
</servlet-mapping>
</web-app>
I manually downloaded the entire jersey pack from the official jersey website. Which should contain all the dependencies.
The weird thing is that whenever I create a class that derives from the ServletContainer it doesn't give any errors.
java intellij-idea jax-rs jersey-2.0
1
You don't use Maven, do you?
– user10639668
Nov 24 '18 at 10:17
No, I didn't use Maven.
– Jan-Wiebe
Nov 24 '18 at 10:18
What Jersey version have you downloaded?
– user10639668
Nov 24 '18 at 10:23
I downloaded Jersey 2.27, that implements JAX-RS 2.1 API API
– Jan-Wiebe
Nov 24 '18 at 10:24
Where did you put the jar files?
– user10639668
Nov 24 '18 at 10:29
|
show 2 more comments
When trying to configure jax rs in intellij I get this error:
java.lang.ClassNotFoundException: org.glassfish.jersey.servlet.ServletContainer
at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1945)
My webconfig looks like this:
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns="http://xmlns.jcp.org/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_4_0.xsd"
version="4.0">
<servlet>
<servlet-name>Rest</servlet-name>
<servlet-class>org.glassfish.jersey.servlet.ServletContainer</servlet-class>
<init-param>
<param-name>jersey.config.server.provider.packages</param-name>
<param-value>com.umbrella.server.api</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>Rest</servlet-name>
<url-pattern>/api/*</url-pattern>
</servlet-mapping>
</web-app>
I manually downloaded the entire jersey pack from the official jersey website. Which should contain all the dependencies.
The weird thing is that whenever I create a class that derives from the ServletContainer it doesn't give any errors.
java intellij-idea jax-rs jersey-2.0
When trying to configure jax rs in intellij I get this error:
java.lang.ClassNotFoundException: org.glassfish.jersey.servlet.ServletContainer
at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1945)
My webconfig looks like this:
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns="http://xmlns.jcp.org/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_4_0.xsd"
version="4.0">
<servlet>
<servlet-name>Rest</servlet-name>
<servlet-class>org.glassfish.jersey.servlet.ServletContainer</servlet-class>
<init-param>
<param-name>jersey.config.server.provider.packages</param-name>
<param-value>com.umbrella.server.api</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>Rest</servlet-name>
<url-pattern>/api/*</url-pattern>
</servlet-mapping>
</web-app>
I manually downloaded the entire jersey pack from the official jersey website. Which should contain all the dependencies.
The weird thing is that whenever I create a class that derives from the ServletContainer it doesn't give any errors.
java intellij-idea jax-rs jersey-2.0
java intellij-idea jax-rs jersey-2.0
asked Nov 24 '18 at 10:10
Jan-WiebeJan-Wiebe
36210
36210
1
You don't use Maven, do you?
– user10639668
Nov 24 '18 at 10:17
No, I didn't use Maven.
– Jan-Wiebe
Nov 24 '18 at 10:18
What Jersey version have you downloaded?
– user10639668
Nov 24 '18 at 10:23
I downloaded Jersey 2.27, that implements JAX-RS 2.1 API API
– Jan-Wiebe
Nov 24 '18 at 10:24
Where did you put the jar files?
– user10639668
Nov 24 '18 at 10:29
|
show 2 more comments
1
You don't use Maven, do you?
– user10639668
Nov 24 '18 at 10:17
No, I didn't use Maven.
– Jan-Wiebe
Nov 24 '18 at 10:18
What Jersey version have you downloaded?
– user10639668
Nov 24 '18 at 10:23
I downloaded Jersey 2.27, that implements JAX-RS 2.1 API API
– Jan-Wiebe
Nov 24 '18 at 10:24
Where did you put the jar files?
– user10639668
Nov 24 '18 at 10:29
1
1
You don't use Maven, do you?
– user10639668
Nov 24 '18 at 10:17
You don't use Maven, do you?
– user10639668
Nov 24 '18 at 10:17
No, I didn't use Maven.
– Jan-Wiebe
Nov 24 '18 at 10:18
No, I didn't use Maven.
– Jan-Wiebe
Nov 24 '18 at 10:18
What Jersey version have you downloaded?
– user10639668
Nov 24 '18 at 10:23
What Jersey version have you downloaded?
– user10639668
Nov 24 '18 at 10:23
I downloaded Jersey 2.27, that implements JAX-RS 2.1 API API
– Jan-Wiebe
Nov 24 '18 at 10:24
I downloaded Jersey 2.27, that implements JAX-RS 2.1 API API
– Jan-Wiebe
Nov 24 '18 at 10:24
Where did you put the jar files?
– user10639668
Nov 24 '18 at 10:29
Where did you put the jar files?
– user10639668
Nov 24 '18 at 10:29
|
show 2 more comments
1 Answer
1
active
oldest
votes
I found the anwser with the help of Eugen Covaci.
In the Intellij project settings there is a tab called problems. When clicking solve on the problems listed there it started working again.
Another issue was that the jar files were located in web/WEB_INF/libs/api instead of the correct folder (web/WEB_INF/lib)
add a comment |
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53457112%2fclassnotfoundexception-on-servletcontainer-when-configuring-jersey-in-intellij%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
I found the anwser with the help of Eugen Covaci.
In the Intellij project settings there is a tab called problems. When clicking solve on the problems listed there it started working again.
Another issue was that the jar files were located in web/WEB_INF/libs/api instead of the correct folder (web/WEB_INF/lib)
add a comment |
I found the anwser with the help of Eugen Covaci.
In the Intellij project settings there is a tab called problems. When clicking solve on the problems listed there it started working again.
Another issue was that the jar files were located in web/WEB_INF/libs/api instead of the correct folder (web/WEB_INF/lib)
add a comment |
I found the anwser with the help of Eugen Covaci.
In the Intellij project settings there is a tab called problems. When clicking solve on the problems listed there it started working again.
Another issue was that the jar files were located in web/WEB_INF/libs/api instead of the correct folder (web/WEB_INF/lib)
I found the anwser with the help of Eugen Covaci.
In the Intellij project settings there is a tab called problems. When clicking solve on the problems listed there it started working again.
Another issue was that the jar files were located in web/WEB_INF/libs/api instead of the correct folder (web/WEB_INF/lib)
answered Nov 26 '18 at 18:48
Jan-WiebeJan-Wiebe
36210
36210
add a comment |
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53457112%2fclassnotfoundexception-on-servletcontainer-when-configuring-jersey-in-intellij%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
1
You don't use Maven, do you?
– user10639668
Nov 24 '18 at 10:17
No, I didn't use Maven.
– Jan-Wiebe
Nov 24 '18 at 10:18
What Jersey version have you downloaded?
– user10639668
Nov 24 '18 at 10:23
I downloaded Jersey 2.27, that implements JAX-RS 2.1 API API
– Jan-Wiebe
Nov 24 '18 at 10:24
Where did you put the jar files?
– user10639668
Nov 24 '18 at 10:29