GWT app and Hibernate under Eclipse - java

I have a GWT app created by GWT wizard under Eclipse. I also created a separate project (called Model) in the workspace where I put Hibernate classes and mapping hbm.xml files. Now I'd like to properly reference this project from my GWT project so that Hibernate configuration can successfuully load classes and mapping files from GWT service. I want to use Hibernate on server side to access database. After I specified that the Model project is referenced by GWT project the classes are visible from GWT service but while running the project GWT cannot see the hbm.xml files. How to properly configure the workspace?
Regards
Dominik

Usually I use the maven to build multimodule applications. To work with GWT I am using gwt-maven plugin. In eclipse I am using m2eclipse plugin. Hope it will help you.
P.S. I can't use more than one hyperlink, but you easy find these plugins by google.

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.

Adding a maven library into Netbeans Web Project

I have a Netbeans Web Project created via Netbeans project creation wizard. The Project is almost complete, being used in testing so not a new one. This is a REST API actually. Anyway now we need to implement JWT into this, so we looked into this famous library - https://github.com/auth0/java-jwt
The problem is that it is totally maven based, can't find a jar file to download and implement. In this case, how can we integrate this into our application?

Hibernate Setup

I always used Hibernate annotations in my old job, but since all our projects were already set up, I never really learned the mechanism behind it.
Could someone please give me a brief outline of how to set everything up, just to get me started?
I am developing in Java using Maven and Oracle 10g Express Edition. My IDE is Eclipse.
I'd recommend starting with the Hibernate tutorial. Basically, you'll need to create a Hibernate configuration file on your classpath (dropping it in src/main/resources works with the default Maven project layout) and then start annotating your data objects. There's a tutorial for Hibernate with XML configuration as well.
The (non-Maven) steps to build a Hibernate project in Eclipse would be:
Step 1: Add the required JARs to setup Hibernate project
Step 2: Add the JARs to the lib folder of your project
Step 3: Additionally, I would suggest you to explore the Hibernate directory structure since you are using it for the first time.
If you need more assistance, I wrote a post on my site http://myjavatrainer.com/setup-hibernate-project/
Hope it will be helpful to you.
Maven is build tool for your projects. Maven is a build tool by Apache, it will help to manage the dependencies better. You will have to install Maven separately and set it up. Read its documentation full and get it setup. Instead of creating a normal Java app or a web app in Eclipse, you will be creating a Maven project.
MAKE SURE YOU ADD A JAR FOR DRIVER CONNECTOR for the type of database you are planning to use through Hibernate.

To create Java project with Spring persistence using Maven?

Is it good idea to create Java project with Spring persistence using Maven?
What maven archetype to use?
AppFuse is seemed to be freezed.
You an use Spring ROO to create a Spring project based on Maven.
The principle of a Maven archetype is to create a skeleton of an application based on some specificities (for example the usage of Spring in your case).
This skeleton will generate the root pom.xml, the basic directories structure (src/main/resources, src/main/java, and so on), as well as some other files, which are specific to the archetype used, such as the applicationContext.xml in the Spring case.
Of course, this is only a skeleton (which is however generally runnable to get some Hello World stuff), so you will have to adapt it to your precise requirements: change the pom.xml content (for example the versions of third libraries), add or remove some configuration files...
Maybe you can give a try to any AppFuse archetype (what do you mean by freezed by the way?), and then remove everything that is not needed in your case.
If you r using Netbeans 6.8 then follow below one
New Project->Maven->Maven PRoject->Default Archetype Catalog-> A simple J2EE Java application
Remove Other unused modules and modify it as per ur requirement...

JIBX MAVEN Problem

I am trying to use JIBX maven plugin in my Spring Web Service project,
My project has diferent layers (API-DAO-SERVICE vsvs..)
these layers are individual projects and has maven dependency each other.
In my WEB project's POM, I add other project as dependencies, and my mapping
classes are all in API project.
Even in my web project's POM includes dependencies of API project I could
not use that class'es in JIBX
BUT IF I put that class'es in WEB project's src/main/java directory there is
NO PROBLEM,
How can I use mapping classes that are other maven dependent projects.
Any help is really appreciated;
Thanks.
Generated sources are supposed to be compiled and packaged in the artifact at the end. The classes should thus be visible from your webapp.
Did you setup the maven-jixb-plugin as shown in Generate Java Sources from Schemas? If not, then maybe update your setup first and try again.
And if you are still facing problems, please show the relevant parts of your POM(s).

Categories

Resources