Using mysqlconnector with an IntelliJ Plugin - mysql

I am hoping you might be able to help me with an issue that I can not manage to find a solution for. I want to build an IntelliJ Plugin that is able to connect to a mysql database. However, adding the mysql connector jar as a library like you would for a simple project does not seem to work and I am out of ways to try it to work. Do you have any suggestions I might try? I thought about the plugin.xml dependencies but I can not seem to find a way to specify the dependency properly. Any hint would be much appreciated.
Here is what I have tried:
In a plugin project, I added the mysql connector as dependency:
dependency setup
I have a DB connection class:
connection class
And another class where I've added my main method and I want to execute an SQL query:
execution result
As seen, I am getting a ClassNotFound exception for the Driver.
If I do the exact same setup, but on a simple Java project, the connection runs with no issues. See below:
dependency setup
result
There is a warning about the deprecated explicit loading of the Diver but this is not the issue. Even iv I remove this, the plugin project still can not find the class.

Actually it seems like the recommended way of declaring dependencies for the Plugins is via Gradle dependencies.
Comment by Jakub here https://www.youtube.com/watch?v=-6D5-xEaYig&lc=UgzA2TPtX_1H2PaL7Q54AaABAg.9Mv96dstxEG9N20UT7YuRQ
I looked up how to declare mysql as gradle dependency and found this: https://www.reddit.com/r/gradle/comments/apme5g/how_to_add_mysqlconnector_to_gradle_build/
So I used
dependencies {
implementation ("mysql:mysql-connector-java:8.0.24")
}
in build.gradle and all works fine now :)
Hope this will help others as well.

Related

Foundation Framework: Unable to Install Any Dependencies, Errors Show Several Deprecated Items

I am new to Foundation. I started working on a project using an older version of Foundation (2018-2019) and I can't seem to install the dependencies I need to run the project locally, such as Gulp and Babel, and several others. For example, here is a screenshot of the errors I've been receiving any time I try to install a dependency.
list of warnings and errors :
This is the first large-scale project I've worked on using many more dependencies than I'm used to. I've seen "Python" listed among the errors but have never used it, so I'm not sure if that should be installed as well.
I tried to install a few different dependencies, some needing Admin privilege and others not. I'm not sure what I'm doing wrong.

Red Folder in intelliJ after running springboot:run

Hi guys im having an issue with my intellij react project, ive already connected to the MySQL DB from intelliJ..
After running springboot:run, it installs all dependencies for the app after all is done i get a target folder thats red and a package-lock.json thats also red what does this mean?
Im new to react so im trying to run this app locally but when i run the project i get this error:
"Error starting ApplicationContext. To display the auto-configuration report re-run your application with 'debug' enabled.
2018-06-22 13:23:20.295 ERROR 6796 --- [ restartedMain] o.s.boot.SpringApplication : Application startup failed"
Project has already been built by previous Dev im just trying to get it ti run locally now.
what could i be doing wrong?
Spring-boot is one of the wonderful thing to get started to fast, it
does many things automatically. At the same time, missing
configuration will lead to this kind of errors.
Please double check application.yaml/.properties and pom.xml for more details.
This error is thrown when dependencies are not resolved correctly and mis-configuration of dependencies.
If it is a Maven project, right click on project folder and do 'Maven -> Re-Import'. It will fetch the missing maven dependencies.
Also, whatever is mentioned as part of the dependencies should have proper configurations. Let's say for example, you're mentioning mysql as dependency and doesn't provide connection/username/password details then this error occurs.
Please provide more details/error-trace log to provide more accurate answer.
Hope it helps!!

How to Set Maven Parameters in OpenShift

I'm completely new to OpenShift and so far ran in hundreds of bugs while trying to create my first application. Now I want to configure Maven to use my own goals. So far I tried:
adding a Jenkins and configuring the Maven Build - the Jenkins didn't take up the changes and finally stopped building altogether
adding a file .openshift/action_hook/pre_build with the content export MAVEN_ARGS="clean package -Popenshift" as explained here
adding a file .openshift/action_hook/build with the content mvn clean package -Popenshift as explained there
Evidently, the documentation is somewhat obsolete... so what is the correct way?
I finally managed to get the Jenkins to build with my goals. The misconception was that it would use the configured Maven goals INSTEAD of the default ones, when it would just use them additionally (he never had to, since the shell script failed). So deleting the script and adding a custom Maven build works.

Integration of Yet Another Forum with the existing and running blog engine

i installed yet another forum code successfully.But when i tried to integrate it with blog engine 2.0 it is giving me error as follows:- Could not load file or assembly 'Autofac.Configuration' or one of its dependencies. This assembly is built by a runtime newer than the currently loaded runtime and cannot be loaded.Can anyone suggest me the solution?
I think that you have choose Clean then you Rebuild your solution's cause Autofac dll sometime Don't get generated. To solve your problem either copy the Autfac.dll from your downloaded files and put them in the bin folder again. I have experienced this problem several times and this solved it.

Glassfish Deploy CommandException Error

I want to deploy my application to glassvish v3 with asadmin deploy command however I get an error:
com.sun.enterprise.admin.cli.CommandException: remote failure: There is no installed container capable of handling this application com.sun.enterprise.deploy.shared.FileArchive#1c2a1c7
What can be the problem?
To me, the problem was coming from the fact that in /domains/domain/applications there was still the application I was trying to deploy again.
Another file access possibility I just ran into:
Service was started as root and the app undeployed/deployed. Then, as the correct limited rights user, undeploy/deploy. On deploy you'll receive this error, as the application files will still exist in he 'domains/yourdomain/applications' directory, and will be owned by root.
+1 to Keeg's comment on the awesome error messages we've all come to expect from Glassfish.
Hey I got the same error.In my case,I'd made a directory named "Web-INF",apparently the name of the folder has to be (mandatory) in upper-case i.e. "WEB-INF".
In short,check for spelling errors.
It solved my issue.So just wanted to share.I'm new to glassfish, so can't really tell you the exact solution.But what worked for me could be a solution for you as well.
Just in case someone else finds this question and the above answer doesn't match your case... Our problem was that the temporary area on the Glassfish server was full. Clearing some space let me redeploy the same application. Thank goodness for excellent error messages.
I had an ear project, where the ear package had different version number configured to maven pom.xml than the rest of the projects it contained. It searched sub-modules from version 1.x and the rest of the project was at 1.y version. I updated every pom to same version and that made the trick.