Configuring NetBeans 7.3 JPQL editor? - netbeans

I have a RESTful service that builds and runs fine. However, when I try to use the JPQL editor, it gives the error:
java.lang.Exception: You need to add your persistence provider library either to project classpath or registed as Ant Library within Netbeans
You need to register database connection on Services tab
I'm using EclipseLink 2.4.1 as my persistence library, and I already have a library added in the Ant manager as "EclipseLink 2.4." When that failed, I made a library called "EclipseLink (JPA 2.0)(default)" to match the persistence.xml GUI name for it. I even tried creating a library named "org.eclipse.persistence.jpa.PersistenceProvider. All failed and now I'm stumped.
I have a connection the SQL Server database I'm using and it works fine.
I really am unsure of what I need to do to get this working. The editor seems like it would be a great boon, but there doesn't seem to be much documentation on it, nor questions with problems similar to mine. If anybody can help, that would be great.

Related

How to get eclipse content assist working in XML files

I have started creating the Spring web application where I need to mention the spring classes in the XML configuration files, for ex, the deployment descriptor (web.xml) where I need to mention the DispatcherServlet class of Spring.
What I am looking for is, I want eclipse to show me the list of packages/classes when I type org.springframework..., like we do in the Java editor. I have googled to find out, but no luck. I am sure there would be plugins available. Can any of you please share me on how to fix this?
Since you are working on a spring project, I'd recommend installing the SpringToolSuite (STS). The info page is here: http://spring.io/tools
Since you already have an Eclipse instance that you are working with, you should go with the update sites: http://dist.springsource.com/release/TOOLS/update/e4.4/
(Make sure to use the correct update site for the Eclipse version you are using.)
Not only does STS include all tools for XML editing, but it also includes special tools for editing your Spring application files.

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.

How to View Classpath While Debugging in Eclipse

I'm trying to troubleshoot a GWT-based app I'm writing in Eclipse. It currently uses Spring Framework 3.1.1 and Hibernate 4.1.6 on the back-end side. I'm currently having troubles with the dreaded "javax.validation.ValidationException: Unable to find a default provider" that seems to plague a lot of folks but is caused by different problems. I've tried the various solutions of using different versions of the JSR 303 implementation (e.g. diff. versions of Hibernate Validator) but it doesn't seem to make a difference.
And after debugging, I'm seeing why. Once execution gets to javax.validation.Validation.getValidationProviders():317 (in validation-api-1.0.0.GA), the app (running on an Eclipse internal Jetty server) attempts to read the META-INF/services/javax.validation.spi.ValidationProvider resource from the classpath and comes back empty. I am absolutely certain that the different validator implementations I've put (e.g. hibernate-validator-4.3.0.Final.jar) have that resource and it does contain a value (e.g. org.hibernate.validator.HibernateValidator), but is not appearing to the classloader in question. The way I've included the JAR in the classpath is by adding it to the project's Build Path which seems to add it to the Jetty runtime when I execute the applications.
My question is: Is there a way to view the classpath in Eclipse debug mode visible to a certain classloader? Secondly, does anyone know why the Hibernate Validator's resource is not first and foremost in the classloader that Validation is using?
The webapp classpath is composed by the directory WEB-INF/classes and by all the jars in WEB-INF/lib. If you want a jar to be available at runtime, you must NOT add it to the build path, but to WEB-INF/lib.
Dropping a jar in WebContent/WEB-INF/lib in Eclipse will make it automatically part of the buid path of your webapp, and available at runtime.

JBPM workflow deployment into alfresco error

I'm getting the following error when deploying from JBPM eclipse interface to alfresco. This happens when I select 'classes and resources to include in process archive', like 'src/main/java' etc.
Exception happened while deploying
java.lang.NullPointerException
at org.jbpm.gd.jpdl.util.ProcessDeployer.addClassOrResource(Unknown Source)
It was working perfectly, just stopped working suddenly. Any clues?
Thanks.
You should try not selecting anything in the Java Classes and Resources pane. You should be able to deploy your process definition XML file. If you have Java classes specific to your process definition, just have your build script JAR those up alongside your other Alfresco related Java classes you may have and put those in WEB-INF/lib.

Where to put the User Library for Eclipse-Dali-Hibernate integration?

I am struggling with the configuration of the Eclipse Dali plugin and Hibernate. The version I'm using is as recommended:
Eclipse 3.6.1 (Helios SR1) IDE for Java EE Developers (including Dali 2.3)
JBoss Tools 3.2 (for the Hibernate Tools plugin)
When configuring the Java Persistence properties for my project, I created a user library named "Hibernate JPA" and included the following JARs:
hibernate-distribution-3.6.1.Final\hibernate3.jar
hibernate-distribution-3.6.1.Final\lib\jpa\hibernate-jpa-2.0-api-1.0.0.Final.jar
hibernate-distribution-3.6.1.Final\lib\required\dom4j-1.6.1.jar
hibernate-distribution-3.6.1.Final\lib\required\slf4j-api-1.6.1.jar
hibernate-distribution-3.6.1.Final\lib\required\javassist-3.12.0.GA.jar
hibernate-distribution-3.6.1.Final\lib\required\commons-collections-3.1.jar
hibernate-distribution-3.6.1.Final\lib\required\antlr-2.7.6.jar
hibernate-distribution-3.6.1.Final\lib\required\jta-1.1.jar
As long as the hibernate-distribution-3.6.1.Final folder is outside of my project directory, everything works fine. However, if I put the Hibernate folder into the project directory, I get an error saying "Required class org.hibernate.SessionFactory does not exist in selected libraries":
The error text is wrong, the required class is definitely included in hibernate3.jar, and everything works as expected when I move the JARs outside of my project directory.
I have two questions about that:
I do not understand why the User Library behaves differently depending on whether the JARs are placed inside or outside of my project directory. Could anybody explain what's happening here?
I would like to have my project in SVN, including all the required libraries. Is there any way to configure Dali to accept User Libraries within the project directory?
Thank you very much.
I was having the same problem cos I forgot to add hibernate-jpa-2.0-api-1.0.0.Final.jar.
The only difference is that I'm using 3.5.1-Final cos 3.6.x seems not stable at the moment.
Actually, I'd prefer EclipseLink: everything works fine as a charm. I've wasted many hours with environment configuration :( Last time I've used Hibernate was years ago and looks like troubles to configure still are the same :(