Error when trying to integrate JavaFX with Hibernate - java

I'm trying to integrate javaFX with Hibernate using Maven on Intellij. When I first created a Hibernate project, and added some JavaFX dependencies to it. I ran and
Error: JavaFX runtime components are missing, and are required to run this application
Then I decided to add "module-info.java" file to the project, this happened as described below . I already tried to trace to the end of this error on the right this time, tried every possible solutions... and finally it was just a dead end for me. So I has been wondering if I did anything wrong?
Error happened after module-info.java added:
Caused by: java.lang.NoClassDefFoundError: net/bytebuddy/NamingStrategy$SuffixingRandom$BaseNameResolver
at org.hibernate.orm.core#5.4.18.Final/org.hibernate.cfg.Environment.buildBytecodeProvider(Environment.java:345)
at org.hibernate.orm.core#5.4.18.Final/org.hibernate.cfg.Environment.buildBytecodeProvider(Environment.java:337)
at org.hibernate.orm.core#5.4.18.Final/org.hibernate.cfg.Environment.<clinit>(Environment.java:230)
at org.hibernate.orm.core#5.4.18.Final/org.hibernate.boot.registry.StandardServiceRegistryBuilder.<init>(StandardServiceRegistryBuilder.java:141)
at org.hibernate.orm.core#5.4.18.Final/org.hibernate.boot.registry.StandardServiceRegistryBuilder.<init>(StandardServiceRegistryBuilder.java:96)
at org.hibernate.orm.core#5.4.18.Final/org.hibernate.cfg.Configuration.reset(Configuration.java:158)
at org.hibernate.orm.core#5.4.18.Final/org.hibernate.cfg.Configuration.<init>(Configuration.java:124)
at org.hibernate.orm.core#5.4.18.Final/org.hibernate.cfg.Configuration.<init>(Configuration.java:118)
at myModule/controller.LoginController.login(LoginController.java:44)
... 58 more
Edited: I'm exploring, reading some projects on Github and find it may relevant to module in Java 9? I see they separate their code into modules and in each module it like... independent maven projects with its own pom.xml file, one has only javafx dependency; another has only hibernate dependency.
Here is the project I'm reading

Related

VS Code not able to resolve Springframework Data Redis related dependencies, however, project builds completely fine in Eclipse

I am using VS Code to compile and debug my Spring Boot Java project with help of Gradle. I recently added Redis dependency to my project. The project compiles in Eclipse, but throws error in VS Code.
I'm not sure this answer becomes helpful to you or not but,
Normally VS code is not comes with default configurational setting of spring boot.
Spring boot project not able to run without dependencies.
So Because of your project not able to find relevant dependencies so it is generate this errors.
It solved using download plugin of vscode-spring-initializer and / or others.
If you need more detail then,
Try recognize your spring boot project in different IDE like IntelliJ or Eclipes. You see that there is some extra files are there like following,
External Libraries - which handle by maven kind of tool for load dependency.
.iml file in intellij : File which handle development module(contain plugins, module and other details).
This files are not existing there so that it generate issue.(That are different based on IDE)
If you have recently modified the pom.xml or build.gradle config file, you need right click on pom.xml or build.gradle file and then run the menu "Update project configuration" to force the language server to update the project configuration/classpath. Otherwise, the java language server cannot recognize the newly added dependency.

Getting Error java.util.zip.ZipException: duplicate entry: classes/META-INF/MANIFEST.MF When Deploying Application using JMod Plugin

Im using OpenJDK9 and created a parent child structure to deploy the app using JLink and JMod.
I follow the jigsaw example on Internet to create my structure of App. Before I was getting path must be directory when using JMod 3.0.0-alpha-1, then i find its a bug in Plugin, 3.0.0-alpha-2-SNAPSHOT was not available yet so i build it, the path errors gone but I'm getting new error.
These error cause by the dependencies i have added in POM file, If i comment the dependencies the project build successfully, but i want to build the project with these dependencies.
Caused by: java.util.zip.ZipException: duplicate entry: classes/META-INF/MANIFEST.MF
I have uploaded the project on git also Sample Project on GitHub
This is caused because one or more of your dependency have ZipException class. it a conflict in class import. You should try removing all the imports and adding it one by one.
You get this error because you have one or more similar classes on your classpath. These classes come from dependencies defined in the pom.xml file.
Suggested solution:
First, use this plugin to check duplications in your classpath.
Then remove unnecessary dependencies from your pom.xml OR exclude classes or jar files. This documentation can help you.
Hope that this will help you.

Maven Build Error - Firefly Plugin - No plugin found

I have tried several methods to resolve this issue.
I am trying to install the Vaadin Starter App "Bakery"
Version using : Java, Shiro, Vaadin Platforms.
Error on build failure:
No plugin found for prefix 'firefly' in the current project and in the plugin groups
I've tried methods listed [here][1]
and another post by deleting my .m2/resources and letting it repopulate. and also a mvn clean install, but I keep getting same error messages.
Here is a [link][1] to the error messages:
Above the plugin error are some type of fetch cant get meta data messages.
I'm thinking it needs a different version of a plugin, needs pom file or settings file edited, but just have not found solution yet.
No plugin found for prefix 'firefly' in the current project and in the plugin groups
I believe it was with the plugin causing a problem. I went to this link, found the file, over-wrote the existing file with the one at the link, did a rebuild and it worked.
Maven-compiler-plugin

java.lang.ClassNotFoundException: org.jfree.chart.plot.PlotOrientation

I have a problem when I try to run my project
The exception is :
java.lang.ClassNotFoundException: org.jfree.chart.plot.PlotOrientation
I have added these libs to my project and to my classpath
commons-beanutils-1.8.0
commons-collections-2.1.1
commons-digester-1.7
commons-javaflow-20060411
commons-logging-1.0.4
groovy-all-1.8.6
iText-2.1.7
jasperreports-5.2.0
jcommon-1.0.17
jfreechart-1.0.13
I follow some solution to this website but I still have the Exception...
I have this problem since 2 days and I never get solutions and now I really need help.
Thanks!!!
If you're using a dependency manager (Maven, SBT, Ivy, Gradle, etc.) copy and paste the respective snippet above into your project file. If you're using a dependency manager, that's all there is to resolving this exception.
https://repo1.maven.org/maven2/info/novatec/testit/livingdoc-confluence5-plugin/1.1.2/livingdoc-confluence5-plugin-1.1.2.jar
All of the following jars/dependencies, contain a class with the same name as your missing class. Add the correct jar/dependency (preferably the one relevant to your project), to the classpath of your project, and you should no longer receive the error.
You can download the JAR directly, or configure a build tool to do your dependency management for you. (e.g. ivy+ant, gradle, maven, etc)
Additionally, this link provides instructions on manually adding a JAR to your classpath.
Ask if you need more help with this.

when importing project from eclipse to intelliJ

I have a multi-module project in Eclipse, which works fine.
Now I want to work with IntelliJ (I have 12.1), so I imported project to IntelliJ, and have configured below things in it:
All modules
configured all lib (.jar) files with each project where I need (by adding lib)
have configured module dependencies
have configured tomcat7 with them, and added it in dependency of module too
Everything looks OK, but when I run the project it shows:
Caused by: java.lang.NoClassDefFoundError: org/xx/yyy/zzzz
Although org.xx.yyy.zzzz class exist in model module, which is already added to web module (my project has 2 modules web and model), and also scope of dependency is set to provided.
What should I try to resolve this problem? Help me if I am missing something.
Finally I got the answer.
I kept the scope to provided, and Added model module to artifacts and it worked. :)

Categories

Resources