Importing project spring-boot in IntelliJ IDEA error Announcing the arrival of Valued Associate #679: Cesar Manara Planned maintenance scheduled April 23, 2019 at 23:30 UTC (7:30pm US/Eastern) Data science time! April 2019 and salary with experience The Ask Question Wizard is Live!Correct way to add external jars (lib/*.jar) to an IntelliJ IDEA projectIntellij 12 Ultimate is having problems with international charactersHow to configure port for a Spring Boot applicationjava.lang.ClassNotFoundException: com.google.common.base.FunctionJar generated by NetBeans not running although it runs from the IDESpring “hello world” example error: A JNI error has occured & NoClassDefFoundError: org/springframework/beans/factory/ListableBeanFactoryWhy does kafka producer throw java.lang.noclassdeffounderror: kafka-producerClassNotFoundException for Ebean only in IntelliJGetting NoClassDefFoundError on moving the code to OpenshiftError: A JNI error has occurred - SpringBoot - java.lang.NoClassDefFoundError: org/modelmapper/ModelMapper

Where did Ptolemy compare the Earth to the distance of fixed stars?

Why are current probes so expensive?

Why did Bronn offer to be Tyrion Lannister's champion in trial by combat?

One-one communication

Why are two-digit numbers in Jonathan Swift's "Gulliver's Travels" (1726) written in "German style"?

Baking rewards as operations

Are there any irrational/transcendental numbers for which the distribution of decimal digits is not uniform?

Can the Haste spell grant both a Beast Master ranger and their animal companion extra attacks?

Russian equivalents of おしゃれは足元から (Every good outfit starts with the shoes)

How does the body cool itself in a stillsuit?

.bashrc alias for a command with fixed second parameter

Centre cell vertically in tabularx

Understanding piped commands in GNU/Linux

Table formatting with tabularx?

Did pre-Columbian Americans know the spherical shape of the Earth?

New Order #6: Easter Egg

Why does BitLocker not use RSA?

The test team as an enemy of development? And how can this be avoided?

Found this skink in my tomato plant bucket. Is he trapped? Or could he leave if he wanted?

Is this Half-dragon Quaggoth boss monster balanced?

Any stored/leased 737s that could substitute for grounded MAXs?

Should man-made satellites feature an intelligent inverted "cow catcher"?

What did Turing mean when saying that "machines cannot give rise to surprises" is due to a fallacy?

What criticisms of Wittgenstein's philosophy of language have been offered?



Importing project spring-boot in IntelliJ IDEA error



Announcing the arrival of Valued Associate #679: Cesar Manara
Planned maintenance scheduled April 23, 2019 at 23:30 UTC (7:30pm US/Eastern)
Data science time! April 2019 and salary with experience
The Ask Question Wizard is Live!Correct way to add external jars (lib/*.jar) to an IntelliJ IDEA projectIntellij 12 Ultimate is having problems with international charactersHow to configure port for a Spring Boot applicationjava.lang.ClassNotFoundException: com.google.common.base.FunctionJar generated by NetBeans not running although it runs from the IDESpring “hello world” example error: A JNI error has occured & NoClassDefFoundError: org/springframework/beans/factory/ListableBeanFactoryWhy does kafka producer throw java.lang.noclassdeffounderror: kafka-producerClassNotFoundException for Ebean only in IntelliJGetting NoClassDefFoundError on moving the code to OpenshiftError: A JNI error has occurred - SpringBoot - java.lang.NoClassDefFoundError: org/modelmapper/ModelMapper



.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty height:90px;width:728px;box-sizing:border-box;








0















I'm importing spring-boot web maven project in IntelliJ, My project has worked in Eclipse and STS tool.
I have an error below:



/Library/Java/JavaVirtualMachines/jdk1.8.0_191.jdk/Contents/Home/bin/java "-javaagent:/Applications/IntelliJ IDEA.app/Contents/lib/idea_rt.jar=50562:/Applications/IntelliJ 
Error: A JNI error has occurred, please check your installation and try again
Exception in thread "main" java.lang.NoClassDefFoundError: javax/servlet/Filter
at java.lang.Class.getDeclaredMethods0(Native Method)
at java.lang.Class.privateGetDeclaredMethods(Class.java:2701)
at java.lang.Class.privateGetMethodRecursive(Class.java:3048)
at java.lang.Class.getMethod0(Class.java:3018)
at java.lang.Class.getMethod(Class.java:1784)
at sun.launcher.LauncherHelper.validateMainClass(LauncherHelper.java:544)
at sun.launcher.LauncherHelper.checkAndLoadMain(LauncherHelper.java:526)
Caused by: java.lang.ClassNotFoundException: javax.servlet.Filter
at java.net.URLClassLoader.findClass(URLClassLoader.java:382)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:349)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
... 7 more
Process finished with exit code 1


Please help to resolve it.
Thanks.










share|improve this question
























  • Is it web project? Was this built on eclipse?

    – Atul Dwivedi
    Mar 9 at 1:09











  • Yes. It's worked in eclipse and STS

    – NhutLe
    Mar 9 at 1:12

















0















I'm importing spring-boot web maven project in IntelliJ, My project has worked in Eclipse and STS tool.
I have an error below:



/Library/Java/JavaVirtualMachines/jdk1.8.0_191.jdk/Contents/Home/bin/java "-javaagent:/Applications/IntelliJ IDEA.app/Contents/lib/idea_rt.jar=50562:/Applications/IntelliJ 
Error: A JNI error has occurred, please check your installation and try again
Exception in thread "main" java.lang.NoClassDefFoundError: javax/servlet/Filter
at java.lang.Class.getDeclaredMethods0(Native Method)
at java.lang.Class.privateGetDeclaredMethods(Class.java:2701)
at java.lang.Class.privateGetMethodRecursive(Class.java:3048)
at java.lang.Class.getMethod0(Class.java:3018)
at java.lang.Class.getMethod(Class.java:1784)
at sun.launcher.LauncherHelper.validateMainClass(LauncherHelper.java:544)
at sun.launcher.LauncherHelper.checkAndLoadMain(LauncherHelper.java:526)
Caused by: java.lang.ClassNotFoundException: javax.servlet.Filter
at java.net.URLClassLoader.findClass(URLClassLoader.java:382)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:349)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
... 7 more
Process finished with exit code 1


Please help to resolve it.
Thanks.










share|improve this question
























  • Is it web project? Was this built on eclipse?

    – Atul Dwivedi
    Mar 9 at 1:09











  • Yes. It's worked in eclipse and STS

    – NhutLe
    Mar 9 at 1:12













0












0








0








I'm importing spring-boot web maven project in IntelliJ, My project has worked in Eclipse and STS tool.
I have an error below:



/Library/Java/JavaVirtualMachines/jdk1.8.0_191.jdk/Contents/Home/bin/java "-javaagent:/Applications/IntelliJ IDEA.app/Contents/lib/idea_rt.jar=50562:/Applications/IntelliJ 
Error: A JNI error has occurred, please check your installation and try again
Exception in thread "main" java.lang.NoClassDefFoundError: javax/servlet/Filter
at java.lang.Class.getDeclaredMethods0(Native Method)
at java.lang.Class.privateGetDeclaredMethods(Class.java:2701)
at java.lang.Class.privateGetMethodRecursive(Class.java:3048)
at java.lang.Class.getMethod0(Class.java:3018)
at java.lang.Class.getMethod(Class.java:1784)
at sun.launcher.LauncherHelper.validateMainClass(LauncherHelper.java:544)
at sun.launcher.LauncherHelper.checkAndLoadMain(LauncherHelper.java:526)
Caused by: java.lang.ClassNotFoundException: javax.servlet.Filter
at java.net.URLClassLoader.findClass(URLClassLoader.java:382)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:349)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
... 7 more
Process finished with exit code 1


Please help to resolve it.
Thanks.










share|improve this question
















I'm importing spring-boot web maven project in IntelliJ, My project has worked in Eclipse and STS tool.
I have an error below:



/Library/Java/JavaVirtualMachines/jdk1.8.0_191.jdk/Contents/Home/bin/java "-javaagent:/Applications/IntelliJ IDEA.app/Contents/lib/idea_rt.jar=50562:/Applications/IntelliJ 
Error: A JNI error has occurred, please check your installation and try again
Exception in thread "main" java.lang.NoClassDefFoundError: javax/servlet/Filter
at java.lang.Class.getDeclaredMethods0(Native Method)
at java.lang.Class.privateGetDeclaredMethods(Class.java:2701)
at java.lang.Class.privateGetMethodRecursive(Class.java:3048)
at java.lang.Class.getMethod0(Class.java:3018)
at java.lang.Class.getMethod(Class.java:1784)
at sun.launcher.LauncherHelper.validateMainClass(LauncherHelper.java:544)
at sun.launcher.LauncherHelper.checkAndLoadMain(LauncherHelper.java:526)
Caused by: java.lang.ClassNotFoundException: javax.servlet.Filter
at java.net.URLClassLoader.findClass(URLClassLoader.java:382)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:349)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
... 7 more
Process finished with exit code 1


Please help to resolve it.
Thanks.







spring spring-boot intellij-idea






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Mar 9 at 14:02









Atul Dwivedi

1,0311023




1,0311023










asked Mar 9 at 0:44









NhutLeNhutLe

235




235












  • Is it web project? Was this built on eclipse?

    – Atul Dwivedi
    Mar 9 at 1:09











  • Yes. It's worked in eclipse and STS

    – NhutLe
    Mar 9 at 1:12

















  • Is it web project? Was this built on eclipse?

    – Atul Dwivedi
    Mar 9 at 1:09











  • Yes. It's worked in eclipse and STS

    – NhutLe
    Mar 9 at 1:12
















Is it web project? Was this built on eclipse?

– Atul Dwivedi
Mar 9 at 1:09





Is it web project? Was this built on eclipse?

– Atul Dwivedi
Mar 9 at 1:09













Yes. It's worked in eclipse and STS

– NhutLe
Mar 9 at 1:12





Yes. It's worked in eclipse and STS

– NhutLe
Mar 9 at 1:12












1 Answer
1






active

oldest

votes


















0














This usually happens when you forgot to add Servlet related dependencies in your project, specially when you import a project which was built on Eclipse where you have option to attach server(like Apache Tomcat) in project Build Path.



So in new IDE(in your case IntelliJ) also, you have to do the same, but I suggest add the required dependencies then it will work with all IDEs.



Try adding below dependencies in your project pom.xml:



 <dependency>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
<version>2.5</version>
<scope>provided</scope>
</dependency>

<dependency>
<groupId>javax.servlet</groupId>
<artifactId>jsp-api</artifactId>
<version>2.0</version>
<scope>provided</scope>
</dependency>

<dependency>
<groupId>javax.servlet</groupId>
<artifactId>jstl</artifactId>
<version>1.2</version>
</dependency>


Dependencies version you can change as per project requirement.



Alternatively if project has spring-boot-starter-tomcat dependency then make sure it should scoped as compile like below:



 <dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-tomcat</artifactId>
<scope>compile</scope>
</dependency>





share|improve this answer

























  • I have just added dependencies above and re-build after that run it but I also meet the error.

    – NhutLe
    Mar 9 at 1:20











  • Does pom.xml has spring-boot-starter-tomcat dependency with scope?

    – Atul Dwivedi
    Mar 9 at 1:23











  • Yes. I have added tomcat embedded in pom file.

    – NhutLe
    Mar 9 at 1:37











  • Does this work? See the answer I've edited it.

    – Atul Dwivedi
    Mar 9 at 1:38






  • 1





    Thank again, I will do it.

    – NhutLe
    Mar 9 at 2:13











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
);



);













draft saved

draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55072888%2fimporting-project-spring-boot-in-intellij-idea-error%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









0














This usually happens when you forgot to add Servlet related dependencies in your project, specially when you import a project which was built on Eclipse where you have option to attach server(like Apache Tomcat) in project Build Path.



So in new IDE(in your case IntelliJ) also, you have to do the same, but I suggest add the required dependencies then it will work with all IDEs.



Try adding below dependencies in your project pom.xml:



 <dependency>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
<version>2.5</version>
<scope>provided</scope>
</dependency>

<dependency>
<groupId>javax.servlet</groupId>
<artifactId>jsp-api</artifactId>
<version>2.0</version>
<scope>provided</scope>
</dependency>

<dependency>
<groupId>javax.servlet</groupId>
<artifactId>jstl</artifactId>
<version>1.2</version>
</dependency>


Dependencies version you can change as per project requirement.



Alternatively if project has spring-boot-starter-tomcat dependency then make sure it should scoped as compile like below:



 <dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-tomcat</artifactId>
<scope>compile</scope>
</dependency>





share|improve this answer

























  • I have just added dependencies above and re-build after that run it but I also meet the error.

    – NhutLe
    Mar 9 at 1:20











  • Does pom.xml has spring-boot-starter-tomcat dependency with scope?

    – Atul Dwivedi
    Mar 9 at 1:23











  • Yes. I have added tomcat embedded in pom file.

    – NhutLe
    Mar 9 at 1:37











  • Does this work? See the answer I've edited it.

    – Atul Dwivedi
    Mar 9 at 1:38






  • 1





    Thank again, I will do it.

    – NhutLe
    Mar 9 at 2:13















0














This usually happens when you forgot to add Servlet related dependencies in your project, specially when you import a project which was built on Eclipse where you have option to attach server(like Apache Tomcat) in project Build Path.



So in new IDE(in your case IntelliJ) also, you have to do the same, but I suggest add the required dependencies then it will work with all IDEs.



Try adding below dependencies in your project pom.xml:



 <dependency>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
<version>2.5</version>
<scope>provided</scope>
</dependency>

<dependency>
<groupId>javax.servlet</groupId>
<artifactId>jsp-api</artifactId>
<version>2.0</version>
<scope>provided</scope>
</dependency>

<dependency>
<groupId>javax.servlet</groupId>
<artifactId>jstl</artifactId>
<version>1.2</version>
</dependency>


Dependencies version you can change as per project requirement.



Alternatively if project has spring-boot-starter-tomcat dependency then make sure it should scoped as compile like below:



 <dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-tomcat</artifactId>
<scope>compile</scope>
</dependency>





share|improve this answer

























  • I have just added dependencies above and re-build after that run it but I also meet the error.

    – NhutLe
    Mar 9 at 1:20











  • Does pom.xml has spring-boot-starter-tomcat dependency with scope?

    – Atul Dwivedi
    Mar 9 at 1:23











  • Yes. I have added tomcat embedded in pom file.

    – NhutLe
    Mar 9 at 1:37











  • Does this work? See the answer I've edited it.

    – Atul Dwivedi
    Mar 9 at 1:38






  • 1





    Thank again, I will do it.

    – NhutLe
    Mar 9 at 2:13













0












0








0







This usually happens when you forgot to add Servlet related dependencies in your project, specially when you import a project which was built on Eclipse where you have option to attach server(like Apache Tomcat) in project Build Path.



So in new IDE(in your case IntelliJ) also, you have to do the same, but I suggest add the required dependencies then it will work with all IDEs.



Try adding below dependencies in your project pom.xml:



 <dependency>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
<version>2.5</version>
<scope>provided</scope>
</dependency>

<dependency>
<groupId>javax.servlet</groupId>
<artifactId>jsp-api</artifactId>
<version>2.0</version>
<scope>provided</scope>
</dependency>

<dependency>
<groupId>javax.servlet</groupId>
<artifactId>jstl</artifactId>
<version>1.2</version>
</dependency>


Dependencies version you can change as per project requirement.



Alternatively if project has spring-boot-starter-tomcat dependency then make sure it should scoped as compile like below:



 <dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-tomcat</artifactId>
<scope>compile</scope>
</dependency>





share|improve this answer















This usually happens when you forgot to add Servlet related dependencies in your project, specially when you import a project which was built on Eclipse where you have option to attach server(like Apache Tomcat) in project Build Path.



So in new IDE(in your case IntelliJ) also, you have to do the same, but I suggest add the required dependencies then it will work with all IDEs.



Try adding below dependencies in your project pom.xml:



 <dependency>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
<version>2.5</version>
<scope>provided</scope>
</dependency>

<dependency>
<groupId>javax.servlet</groupId>
<artifactId>jsp-api</artifactId>
<version>2.0</version>
<scope>provided</scope>
</dependency>

<dependency>
<groupId>javax.servlet</groupId>
<artifactId>jstl</artifactId>
<version>1.2</version>
</dependency>


Dependencies version you can change as per project requirement.



Alternatively if project has spring-boot-starter-tomcat dependency then make sure it should scoped as compile like below:



 <dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-tomcat</artifactId>
<scope>compile</scope>
</dependency>






share|improve this answer














share|improve this answer



share|improve this answer








edited Mar 9 at 1:32

























answered Mar 9 at 1:15









Atul DwivediAtul Dwivedi

1,0311023




1,0311023












  • I have just added dependencies above and re-build after that run it but I also meet the error.

    – NhutLe
    Mar 9 at 1:20











  • Does pom.xml has spring-boot-starter-tomcat dependency with scope?

    – Atul Dwivedi
    Mar 9 at 1:23











  • Yes. I have added tomcat embedded in pom file.

    – NhutLe
    Mar 9 at 1:37











  • Does this work? See the answer I've edited it.

    – Atul Dwivedi
    Mar 9 at 1:38






  • 1





    Thank again, I will do it.

    – NhutLe
    Mar 9 at 2:13

















  • I have just added dependencies above and re-build after that run it but I also meet the error.

    – NhutLe
    Mar 9 at 1:20











  • Does pom.xml has spring-boot-starter-tomcat dependency with scope?

    – Atul Dwivedi
    Mar 9 at 1:23











  • Yes. I have added tomcat embedded in pom file.

    – NhutLe
    Mar 9 at 1:37











  • Does this work? See the answer I've edited it.

    – Atul Dwivedi
    Mar 9 at 1:38






  • 1





    Thank again, I will do it.

    – NhutLe
    Mar 9 at 2:13
















I have just added dependencies above and re-build after that run it but I also meet the error.

– NhutLe
Mar 9 at 1:20





I have just added dependencies above and re-build after that run it but I also meet the error.

– NhutLe
Mar 9 at 1:20













Does pom.xml has spring-boot-starter-tomcat dependency with scope?

– Atul Dwivedi
Mar 9 at 1:23





Does pom.xml has spring-boot-starter-tomcat dependency with scope?

– Atul Dwivedi
Mar 9 at 1:23













Yes. I have added tomcat embedded in pom file.

– NhutLe
Mar 9 at 1:37





Yes. I have added tomcat embedded in pom file.

– NhutLe
Mar 9 at 1:37













Does this work? See the answer I've edited it.

– Atul Dwivedi
Mar 9 at 1:38





Does this work? See the answer I've edited it.

– Atul Dwivedi
Mar 9 at 1:38




1




1





Thank again, I will do it.

– NhutLe
Mar 9 at 2:13





Thank again, I will do it.

– NhutLe
Mar 9 at 2:13



















draft saved

draft discarded
















































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.




draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55072888%2fimporting-project-spring-boot-in-intellij-idea-error%23new-answer', 'question_page');

);

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







Popular posts from this blog

1928 у кіно

Захаров Федір Захарович

Ель Греко