How to add eclipseLink to netbeans 12? - netbeans

I want to use JPA in my Maven web application in netbeans 12.
So, I added in the dependencies folder the following:
And now I try to add eclipseLink to my project. So I try to create the persistence.xml file in META-INF, so I get the following where I cannot click finish:
Please any advice to solve this issue.
If I try to create directly the entity I get the same above dialog box.

I think you need to select Database Connection to finish this dialog.

Related

iReport "org/primefaces/model/UploadedFile" error in hibernate connection testing

I'm trying to make a hibernate connection to create some reports, but every time I press Test it appears an error window that says org/primefaces/model/UploadedFile, only that.
My classpath already has a jar of my project and the only place where I have the library from the error is inside an entity on the project.
If switch to another's project jar the connection is successful.
I'm using iReport 5.0.4 and Spring 2.9.1.
I'll appreciate any idea of what could be wrong, thanks in advance.
I couldn't figure out what was the problem, so I commented all references to the library and generated the jar that way.
I did it only because there's no related data to the things I commented.

Eclipse bug: This project has the JPA facet, but no JPA project could be created

After restarting Eclipse, I get the following error in my project:
This project has the JPA facet, but no JPA project could be created. See the error log for more details.
Nothing I've done (clean project, maven update, etc) will get rid of the error. My JPA Content icon remains greyed out.
It looks like this was a resolved bug at Eclipse bugs...but then why am I still getting it? Should I submit a bug report to Eclipse?
This is a configuration problem of the project. To solve this problem go to the project properties, and in the node "project facets" unchecked JPA and apply the changes. Now you can checked JPA and apply again!
For me all the above didnt worked.
So I tried Project Properties>Validate. It solved my problem.
To get rid of this error in Eclipse Luna, I just did a right-click on the project and chose the "Validate" menu item.
Alt+Enter in the project
Go for Project facets
Uncheck JPA and accept
Right click in the project, go for Validate
Alt+Enter in the project
Go for Project facets
Check JPA` and accept
Although this is an old thread, will try to give info that might just help someone.
I assume you have imported a project and it is giving this error.
Step 1 : Check under project properties if jpa is configured.
Step 2 : I have used eclipseLink as the user library for jpa. If you are using eclipse as well, try installing the plugin.
Step 3 : Check the version of jpa under project properties-> project facets... check for any conflicts in version, usually seen for java version and or any supporting libs. You should be able to change the version from facets.
JPA installation and configuration JPA installation and config
Step 4 : once JPA is configured for the project, clean and check. This should work.
I had the same problem and resolved it by installing both apt and jdt connectors for m2e.
Go to Window > Preferences > Maven > Discovery > Open Catalog. Look for m2e-apt and m2e-jdt-compiler. Install and then restart eclipse.
Click right button on your project-->properties-->validation-->uncheck JPA Validation .
That works for me!
Looks like the problem is in some cases caused by a missing JPA implementation in the classpath. After I added a Maven (test scope) dependency, the Eclipse error message disappeared:
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-entitymanager</artifactId>
<version>4.3.1.Final</version>
<scope>test</scope>
</dependency>
I this special case I had a "war" project that has a "persistence.xml" but no JPA code itself. The JPA stuff is in the referenced libraries (JARs).
For me, it was enough to clean the project.
Trying to disable JPA in the facet window caused an Exception.
Like kaushikjain said, validate your project and the error will disappear. This worked like a charm to me.
Right click in your project and Validate.
If you do not want to use JPA,
simply restart your eclipse and clean the project.
I had same problem when I copied JPA Entity to non-JPA project.
It worked for me and I hope it does so for yours :)

JPA Facet cannot be activated in Eclipse

If I try to activate the "JPA Facet" for my Eclipse (Juno) project and point it to a user library containing the JPA libraries (in my case OpenJPA) I get the error:
"The class 'javax.persistence.Entity' is required to be in the selected libraries."
But this class is present there!
"Solution": The JPA libraries were contained in an Eclipse project folder. If I copy it somewhere outside and create another user library with them it works perfectly (although it has exactly the same content as the one before with the libraries located in the Eclipse project!). Seems like an Eclipse bug...
Just create a user library that contains the javax.persistence... JAR in it (It is located in Eclipse/plugins) and add this library at "JPA Implementation"
I'm using Spring Tool Suite (STS). The problem I was facing is that in the default installation the M2E-WTP plugin does not include the Optional component "m2e-wtp - JPA Configurator for WTP".
So I went to Help -> Eclipse Marketplace... and searched "m2e-wtp".
Click on the Installed button and it will become Change. Click on the Change button and select the optional component "m2e-wtp - JPA Configurator for WTP". Apply changes.
This solved for me.

Issue making a Liferay Hook with Eclipse Liferay IDE - getting only empty project

I am using Eclipse Liferay IDE for making a hook to a Liferay native portlet. I mean a porlet that comes with default installation, eg. blogs, content management or similar.
I have done the steps like following:
Select new Liferay Project
Enter project name MyHook
Made configurations (found an SDK directory and Liferay Server instance for Runtime)
Selected Plugin type to Hook
My only option after that was Finish and I ended up having a project with certain structure without any class or properties file inside.
My problem is that I could only get an empty project and don't know how to make the modifications to the files of Liferay because no Liferay originated package names can be found if I make a new class file and try to start typing com.Liferay. or org.Liferay. Because this is a Liferay Hook project, I suppose some Liferay originating tips should normally pop up for my selection, but I didn't see any.
What I am making wrong? What I am missing? Should I know the filenames by myself or is there a trick somewhere to tell the IDE to give me some help?
I use Liferay 6.0 and my IDE version is 6.0.5. At least in my eyes they should match together.
In the IDE you first create a "Liferay Hook Project". This is indeed an empty project. Then you create a Hook, select the Hook project to create it in. You can do the second step manually, but there's a wizard helping you to do this. This might be what you've been missing
I made the same steps again and it worked! Somehow at first time I managed to do a Java project although the project should be interpreted as a Liferay project.
Maybe the IDE is not 100% working always. Whoever knows.

jpa project problem in hibernate console configuration

when i create a jpa project under eclipse, i encoutered the following problem: when i create the a configuration file, i check creat console, next when i specify jpa as type in the main tab of the Console Configuration Wizard, i get the error message in the top of the wizard:
how can i resolve this problem?
I think you should create Persistence unit first check this link http://schuchert.wikispaces.com/JPA+Tutorial+1+-+Persistence+Unit