IntelliJ IDEA does not read user environment variables - intellij-idea

I have a Spring Boot 2.x application that I run within IDEA using the usual Run/Debug Configuration for Spring Boot. This works fine, but now I have to use some environment variables, and I'm placing them in the Environment variables field (from the Configuration tab)...but so far it is not picking up those values:
04-15-2021 11:08:13,233 |- WARN in n.g.e.SimpleDataFetcherExceptionHandler:25 [http-nio-9580-exec-1] - Exception while fetching data (/endpoint) : Could not open JDBC Connection for transaction; nested exception is java.lang.RuntimeException: Driver oracle.jdbc.OracleDriver claims to not accept jdbcUrl, override_value_here
org.springframework.transaction.CannotCreateTransactionException: Could not open JDBC Connection for transaction; nested exception is java.lang.RuntimeException: Driver oracle.jdbc.OracleDriver claims to not accept jdbcUrl, override_value_here
at org.springframework.jdbc.datasource.DataSourceTransactionManager.doBegin(DataSourceTransactionManager.java:309)
at org.springframework.transaction.support.AbstractPlatformTransactionManager.startTransaction(AbstractPlatformTransactionManager.java:400)
at org.springframework.transaction.support.AbstractPlatformTransactionManager.getTransaction(AbstractPlatformTransactionManager.java:373)
at org.springframework.transaction.interceptor.TransactionAspectSupport.createTransactionIfNecessary(TransactionAspectSupport.java:595)
It's basically using the default (useless in purpose) values I have in application.yml:
spring:
...
datasource:
driver-class-name: oracle.jdbc.OracleDriver
password: ${DATASOURCE_PASSWORD:override_value_here}
url: ${DATASOURCE_URL:override_value_here}
username: ${DATASOURCE_USERNAME:override_value_here}
What am I missing in the IDE configuration to make this work? I'm using IntelliJ IDEA 2020.3.3 (Ultimate Edition) with Runtime version: 11.0.10+8-b1145.96 amd64 under Windows 10 10.0.
By the way, this is currently working if I run the application via Gradle because it's integrated with a .env file that holds the values. If there is a way to make IntelliJ IDEA read that file I would really like to know!

Related

Exception while configuring sonarlint plugin with connected mode in eclipse

I am trying to install sonar lint plugin in my eclipse and configure it in 'Connected Mode'. The connection to sonarqube server is successful, but when it tries to download plugins from sonarqube server and store it my local storage it throws an exception.
Eclipse version: 2021-03 (4.19.0)
Sonar lint version: 7.5.0.54140
SonarQuber Server version: Developer Edition 9.4
[SYNC] Downloading plugin 'sonar-abap-plugin-3.10.0.3628.jar'
GET 200 http://sonarserverip:9000/api/plugins/download?plugin=abap | response time=40ms
Unable to synchronize local storage for connection 'sonarserverip'
org.sonarsource.sonarlint.core.serverconnection.storage.StorageException: Cannot save plugin sonar-abap-plugin-3.10.0.3628.jar in C:\eclipse\.sonarlint\storage\31302e3134312e392e313333\plugins
at org.sonarsource.sonarlint.core.serverconnection.storage.PluginsStorage.store(PluginsStorage.java:64)
at org.sonarsource.sonarlint.core.serverconnection.PluginsSynchronizer.lambda$downloadPlugin$1(PluginsSynchronizer.java:70)
at org.sonarsource.sonarlint.core.serverapi.plugins.PluginsApi.lambda$getPlugin$4(PluginsApi.java:57)
at org.sonarsource.sonarlint.core.serverapi.ServerApiHelper.lambda$consumeTimed$6(ServerApiHelper.java:251)
at org.sonarsource.sonarlint.core.serverapi.ServerApiHelper.processTimed(ServerApiHelper.java:226)
at org.sonarsource.sonarlint.core.serverapi.ServerApiHelper.consumeTimed(ServerApiHelper.java:250)
at org.sonarsource.sonarlint.core.serverapi.plugins.PluginsApi.getPlugin(PluginsApi.java:55)
at org.sonarsource.sonarlint.core.serverconnection.PluginsSynchronizer.downloadPlugin(PluginsSynchronizer.java:70)
at org.sonarsource.sonarlint.core.serverconnection.PluginsSynchronizer.downloadAll(PluginsSynchronizer.java:64)
at org.sonarsource.sonarlint.core.serverconnection.PluginsSynchronizer.synchronize(PluginsSynchronizer.java:56)
at org.sonarsource.sonarlint.core.serverconnection.LocalStorageSynchronizer.synchronize(LocalStorageSynchronizer.java:60)
at org.sonarsource.sonarlint.core.serverconnection.ServerConnection.sync(ServerConnection.java:131)
at org.sonarsource.sonarlint.core.ConnectedSonarLintEngineImpl.sync(ConnectedSonarLintEngineImpl.java:291)
at org.sonarlint.eclipse.core.internal.engine.connected.ConnectedEngineFacade.sync(ConnectedEngineFacade.java:599)
at org.sonarlint.eclipse.core.internal.engine.connected.ConnectedEngineFacade.lambda$39(ConnectedEngineFacade.java:627)
at org.sonarlint.eclipse.core.internal.engine.connected.ConnectedEngineFacade.doWithEngine(ConnectedEngineFacade.java:208)
at org.sonarlint.eclipse.core.internal.engine.connected.ConnectedEngineFacade.autoSync(ConnectedEngineFacade.java:626)
at org.sonarlint.eclipse.ui.internal.job.PeriodicStoragesSynchronizerJob.run(PeriodicStoragesSynchronizerJob.java:60)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63)
Caused by: java.net.SocketException: Connection reset
at java.base/java.net.SocketInputStream.read(SocketInputStream.java:186)
at java.base/java.net.SocketInputStream.read(SocketInputStream.java:140)
at okio.Okio$2.read(Okio.java:140)
at okio.AsyncTimeout$2.read(AsyncTimeout.java:237)
at okio.RealBufferedSource.read(RealBufferedSource.java:51)
at okhttp3.internal.http1.Http1ExchangeCodec$AbstractSource.read(Http1ExchangeCodec.java:389)
at okhttp3.internal.http1.Http1ExchangeCodec$ChunkedSource.read(Http1ExchangeCodec.java:475)
at okhttp3.internal.connection.Exchange$ResponseBodySource.read(Exchange.java:286)
at okio.RealBufferedSource$1.read(RealBufferedSource.java:447)
at java.base/java.io.InputStream.read(InputStream.java:205)
at org.sonarsource.sonarlint.shaded.org.apache.commons.io.IOUtils.copyLarge(IOUtils.java:1309)
at org.sonarsource.sonarlint.shaded.org.apache.commons.io.IOUtils.copy(IOUtils.java:978)
at org.sonarsource.sonarlint.shaded.org.apache.commons.io.IOUtils.copyLarge(IOUtils.java:1282)
at org.sonarsource.sonarlint.shaded.org.apache.commons.io.IOUtils.copy(IOUtils.java:953)
at org.sonarsource.sonarlint.shaded.org.apache.commons.io.FileUtils.copyToFile(FileUtils.java:1043)
at org.sonarsource.sonarlint.shaded.org.apache.commons.io.FileUtils.copyInputStreamToFile(FileUtils.java:952)
at org.sonarsource.sonarlint.core.serverconnection.storage.PluginsStorage.store(PluginsStorage.java:52)
... 18 more
Any help would be much appreciated. Thanks in advance!

Problems in IntelliJ since version 2022.1 / java.lang.NoClassDefFoundError

As of today, when I try to run some of my programs in IntelliJ today, this message was shown:
Executing pre-compile tasks...
Loading Ant configuration...
Running Ant tasks...
Running 'before' tasks
Checking sources
Finished, saving caches…
Module 'Listen' production: java.lang.NoClassDefFoundError: com/intellij/DynamicBundle
Executing post-compile tasks...
Loading Ant configuration...
Running Ant tasks...
Synchronizing output directories...
13.04.22, 14:54 - Build completed with 1 error and 0 warnings in 4 sec, 39 ms
This line is printed in red: Module 'Listen' production: java.lang.NoClassDefFoundError: com/intellij/DynamicBundle
I don't really have too much of an idea where I should look for the problem.
It seems to not have anything to do with the project itself. I already created a new Project and created a Hello World-program, which resulted in the same error.
Remarkably, yesterday my IntelliJ IDEA version was updated to version 2022.1.
Runtime version: 11.0.14.1+1-b2043.25 amd64
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.
I have no idea either whether it has anything to do with the new version either.
I maintain another Project, which uses Scala language. That one is messed up even more:
Cannot process toolwindow sbt
java.lang.AbstractMethodError: Missing implementation of resolved method 'abstract com.intellij.openapi.externalSystem.settings.AbstractExternalSystemSettings getSettings(com.intellij.openapi.project.Project)' of abstract class com.intellij.openapi.externalSystem.service.task.ui.AbstractExternalSystemToolWindowFactory.
at com.intellij.openapi.externalSystem.service.task.ui.AbstractExternalSystemToolWindowFactory.shouldBeAvailable(AbstractExternalSystemToolWindowFactory.java:35)
at com.intellij.toolWindow.ToolWindowSetInitializerKt.beanToTask(ToolWindowSetInitializer.kt:262)
at com.intellij.toolWindow.ToolWindowSetInitializerKt.beanToTask(ToolWindowSetInitializer.kt:248)
at com.intellij.toolWindow.ToolWindowSetInitializerKt.access$beanToTask(ToolWindowSetInitializer.kt:1)
at com.intellij.toolWindow.ToolWindowSetInitializerKt$computeToolWindowBeans$1.accept(ToolWindowSetInitializer.kt:278)
at com.intellij.toolWindow.ToolWindowSetInitializerKt$computeToolWindowBeans$1.accept(ToolWindowSetInitializer.kt)
at com.intellij.openapi.extensions.impl.ExtensionPointImpl.processWithPluginDescriptor(ExtensionPointImpl.java:301)
at com.intellij.toolWindow.ToolWindowSetInitializerKt.computeToolWindowBeans(ToolWindowSetInitializer.kt:274)
at com.intellij.toolWindow.ToolWindowSetInitializer$1.get(ToolWindowSetInitializer.kt:101)
at com.intellij.toolWindow.ToolWindowSetInitializer$1.get(ToolWindowSetInitializer.kt:83)
at java.base/java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1700)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run(Executors.java:668)
at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run(Executors.java:665)
at java.base/java.security.AccessController.doPrivileged(Native Method)
at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1.run(Executors.java:665)
at java.base/java.lang.Thread.run(Thread.java:829)
Any advice?
Best
Stapelüberläufer
I had the same problem after upgrading to Intellij 2022.1
For me, the fix came from Gen's answer. I also had an old Scala plugin, and just removed it as I'm not using it anymore.
If you are looking to upgrade it, go to File -> Settings -> Plugins. From there just hit Upgrade for the plugins you want. After that restart the IDE.
I found that Scala plugin was not updated and updating it to at least version 2022.1.13 fixed it for me.
I upgraded to Intellij 2022.1 and encountered this issue when trying to sync the old gradles projects that used to work for me :
Caused by: java.lang.NoClassDefFoundError: org/gradle/internal/impldep/com/google/common/collect/Lists
Cleaning the caches folder's content (Gradle_HOME/caches) resolved this issue for me
Make sure to also check that the SDK is correctly configured for your project (Java 17 by default) and the Gradle home is well specified in the Settings>Gradle section.
For info, I'm using Java 8 and Gradle 5.5.1 (yes I know :))
Just upgrade the Scala Plugin and its done!
visiting
scala plugin's page
and install it from there worked for me on ultimate version 2022.2.3

Java groups exception JGRP000002 using hotspot jdk6

I am migrating my application from jrockit jdk6 to hotspot jdk6. While building my application using maven, one of my integration test makes the build to hang with below error message:
jgroups.JGroupsCacheManagerPeerProvider,ERROR,Failed to create JGroups Channel, replication will not function. JGroups properties:
${jgroups.cache.config}
java.lang.Exception: JGRP000002: unable to load protocol $ (either with relative - $ - or absolute - org.jgroups.protocols.$ - class name)
at org.jgroups.stack.Configurator.createLayer(Configurator.java:430)
at org.jgroups.stack.Configurator.createProtocols(Configurator.java:397)
Please throw some light!

Sonar for Eclipse: unable to run local analysis

I have successfully installed sonar plug-in for eclipse, however when I try to 'Run Local Analysis' for sonar, eclipse gives an error saying:
An internal error occurred during: "Sonar Analysis".
Unable to create markers
and console for Sonar has following info printed:
Usage: javaw [-options] class [args...]
(to execute a class)
or javaw [-jar] [-options] jarfile [args...]
(to execute a jar file)
where options include:
-cp -classpath
set search path for application classes and resources
-D=
set a system property
-verbose[:class|gc|jni]
enable verbose output
-version print product version
-version:
require the specified version to run
-showversion print product version and continue
-jre-restrict-search | -no-jre-restrict-search
include/exclude user private JREs in the version search
-agentlib:[=]
load native agent library , e.g. -agentlib:hprof
see also, -agentlib:jdwp=help and -agentlib:hprof=help
-agentpath:[=]
load native agent library by full pathname
-javaagent:[=]
load Java programming language agent, see java.lang.instrument
-? -help print this help message
-X print help on non-standard options
-splash: show splash screen with specified image
-ea[:...|:]
-enableassertions[:...|:]
enable assertions
-da[:...|:]
-disableassertions[:...|:]
disable assertions
-esa | -enablesystemassertions
enable system assertions
-dsa | -disablesystemassertions
disable system assertions
Plz help with how to proceed for Local analysis in eclipse.
[Update: Version Details]
Eclipse: Indigo (3.7.1)
Sonar Plug-in: 3.0.0
Sonar(Server): 3.4.1
Sonar Web Service Client: 3.4.0
Java: 1.4.1 ('Java EE IDE' property in Eclipse Features)
Local Java Installation: 1.6

cannot find EJB reference while deploying ADF Fusion Webapp into oracle weblogic server

I created a Fusion Webapplication project with Oracle jdeveloper 11g (11.1.5 but the same problem occours with the 11.2.1 version). Then I created a jsf page and I deployed the project to an external weblogic server (WL 10.3) with the ADF runtime support and evrithing where working.
Then I created the POJOs object (to the model project, because I have 2 proj: Model and ViewController for the web pages and backing beans) from the DB tables and a session bean who provides queries methods. After that (and so far everything it's ok) I added an ADF Data Control bound to the session bean and then I bound (via editor) one of these methods into the jsf page using an ADF table.
If I run the project using the run button everything work, but if I deploy it into both the external deployment WL server and in the internal one I get the following error
[05:30:04 PM] [Deployer:149193]Operation 'deploy' on application 'Prova_application1' has failed on 'AdminServer'
[05:30:04 PM] [Deployer:149034]An exception occurred for task [Deployer:149026]deploy application Prova_application1 on AdminServer.: Could not setup environment.
[05:30:04 PM] Weblogic Server Exception: weblogic.application.ModuleException: Could not setup environment
[05:30:04 PM] Caused by: weblogic.deployment.EnvironmentException: [J2EE:160167]The module Prova-ViewController-context-root in application Prova_application1 uses ejb-links but no EJB modules were found for this application.
[05:30:04 PM] See server logs or server console for more details.
[05:30:04 PM] weblogic.application.ModuleException: Could not setup environment
[05:30:04 PM] #### Deployment incomplete. ####
[05:30:04 PM] Remote deployment failed
but there is such refernce into the web.xml and I bound the Model project into the deployment descriptor. I red every post in the web but I still can't face the problem.
The web.xml in the ViewController project contains the EJB reference (automatically created from jdeveloper) and I bound everithing the Model project but it still doesn't work.
In JDeveloper IDE
you need to set ejb-jar.xml path.
- Right click on your project
- Choose Project Properties
- Go to EJB Module
- Set EJB Version (For example: "2.1")
- Set ejb-jar.xml path (For example: "..\src\META-INF\ejb-jar.xml")
I hope it works..