My Ide Intellij is complaining in a class with the following message "Cannot resolve symbol PSQLException". I click on the red code and he shows this popup:

Now, it is strange that asks for that specific dependency. I actually have the following in my pom
<dependency>
<groupId>org.postgresql</groupId>
<artifactId>postgresql</artifactId>
<version>9.4-1206-jdbc42</version>
</dependency>
and even if I replace it with the version requested, the class PSQLException is not recognized.
Suggestion?
The issue was due to IntelliJ 15 In the .iml file I had the following entry
<orderEntry type="library" scope="RUNTIME" name="Maven:
org.postgresql:postgresql:9.4-1206-jdbc42" level="project" />
because the dependency in the pom was having the scope set to runtime. When I had to import the exception, I removed the runtime scope, but that wasn't removed by intellij from the .iml file.
Actually, IntelliJ has very often such an annoying behavior. I don't know why I didn't recognized this early.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With