zengkid / SmartTomcat

The Tomcat plugin for Intellij IDEA
Apache License 2.0
126 stars 55 forks source link

Module not retrieved correctly any more #55

Closed karge-itestra closed 4 years ago

karge-itestra commented 4 years ago

In the latest release, the module is saved in the configuration directly instead of the module name. In the multi-module project we run, the module seems to be null however. Previously, when the module was retrieved by the stored module name, it worked.

karge-itestra commented 4 years ago

The relevant lines of code to retrieve the project in the previous version were

File file = new File(configuration.getDocBase());
VirtualFile fileByIoFile = LocalFileSystem.getInstance().findFileByIoFile(file);
Module module = ModuleUtilCore.findModuleForFile(fileByIoFile, configuration.getProject());
zengkid commented 4 years ago

@karge-itestra could you try to remove exists run/debug setting ?

karge-itestra commented 4 years ago

Will try, thanks for the advice. I have rolled back to 1.7.2 for now, is it possible to write a fix that converts existing configs?

zengkid commented 4 years ago

@karge-itestra in fact, I just refactor the code, the code should be same.

etienne582 commented 4 years ago

Hello, I have the same problem with a multi module spring boot project. To make tomcat start I need to just edit my tomcat config and then it work's ... I also tried to save the configuration as project file but it changes nothing :/

zengkid commented 4 years ago

@etienne582 could you share screenshot and logs?

etienne582 commented 4 years ago

image

This error log view of intellij display the same message : Error running 'Tomcat': The Module Root specified is not a module according to Intellij

I have nothing on the smartTomacat logs.

zengkid commented 4 years ago

@etienne582 Could you share project stuct and SmartTomcat run/debug infomation? maybe deployment directory is incorrect.

yuezk commented 4 years ago

@zengkid Here is an example of this problem, it works well with 3.7.2 but broken with 3.8.0

https://github.com/yuezk/webapp-example-gradle

zengkid commented 4 years ago

@yuezk please choose a SDK for Project! image

yuezk commented 4 years ago

@yuezk please choose a SDK for Project!

image

I'm using 1.8 on my local machine, you can choose yours (e.g., 1.8 or 11) on your machine and test it.

zengkid commented 4 years ago

@yuezk once I choose a SDK, it work fine for me. which version for intellij idea?

btw: you had better remove output config. outputDir = new File(rootDir, '../example-web/src/main/webapp/WEB-INF/classes')

yuezk commented 4 years ago

Wired. Below is the IDEA version.

IntelliJ IDEA 2020.2.2 (Community Edition)
Build #IC-202.7319.50, built on September 15, 2020
Runtime version: 11.0.8+10-b944.31 x86_64
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.
macOS 10.15.6
GC: ParNew, ConcurrentMarkSweep
Memory: 3005M
Cores: 8
Non-Bundled Plugins: IdeaVIM, SnakeYAML plugin, com.alayouni.ansiHighlight, com.intellij.ideolog, Lombook Plugin, com.poratu.idea.plugins.tomcat, training, org.jetbrains.kotlin, zielu.gittoolbox, com.cybrosis.catdea
zengkid commented 4 years ago

@yuezk Could you provide your error message ?

yuezk commented 4 years ago

image

zengkid commented 4 years ago

@yuezk I got the same issue now, the issue caused by re-open the project. for temporary solution, you can remove tomcat run/debug, and then add a new one. or you can manual install latest version plugin in https://github.com/zengkid/SmartTomcat/releases/latest

yuezk commented 4 years ago

@zengkid Yes, it worked with your workaround. Thanks.

etienne582 commented 4 years ago

It's seems ok with the 3.8.1 thx

karge-itestra commented 4 years ago

Thanks for the reporting @etienne582 and @yuezk , and thanks for the fix @zengkid !