I’m experimenting with Vaadin - trying to get access to a database. Unfortunately, I’ve spent 15 years using Netbeans, and now I have to do this with Eclipse, so I’m in way over my head at the moment… Any pointers here would be appreciated.
I’ve loaded Eclipse and the Vaadin jar file along with eclipselink and its associated jar files and the appFoundation plugin jar file. I started with the Vaadin hello world program and added one line - just to see if I could connect to a database - so my code looks like this:
package com.example.vtest;
import org.vaadin.appfoundation.persistence.facade.FacadeFactory;
import com.vaadin.Application;
import com.vaadin.ui.*;
import com.verisign.common.utils.VRSNLogger;
public class VtestApplication extends Application {
/**
*
*/
private static final long serialVersionUID = 1L;
private static final VRSNLogger Logger = VRSNLogger.getLogger(VtestApplication.class);
@Override
public void init() {
Window mainWindow = new Window("Vtest Application");
Logger.debug("11111"); // The log statement shows up correctly in Tomcat log file...
Label label = new Label("Hello Vaadin user");
mainWindow.addComponent(label);
setMainWindow(mainWindow);
Logger.debug("22222");
try {
FacadeFactory.registerFacade("PUVtest", true); // *** THIS FAILS
} catch (InstantiationException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (IllegalAccessException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}
My persistence.xml file looks like this:
<?xml version="1.0" encoding="UTF-8"?>
org.eclipse.persistence.jpa.PersistenceProvider
com.example.TestPojo
false
When I put the .war file into my Tomcat container and connect to it, the 2 log statements show up in the tomcat log file and then it throws an exception:
javax.servlet.ServletException: javax.persistence.PersistenceException: No Persistence provider for EntityManager named PUVtest
My library directory looks like:
$ pwd
/VTest/WebContent/WEB-INF/lib
$ ls
appfoundation.jar
eclipselink.jar
eclipselink-jpa-modelgen_2.2.0.v20110202-r8913.jar
javax.persistence_1.0.0.jar
javax.persistence_2.0.3.v201010191057.jar
log4j-1.2.14.jar
mysql-connector-java-5.1.10-bin.jar
vaadin-6.5.2.jar
VRSN_Common.jar
So can someone tell me what jar file I need to supply to fix this? And where do I find it? I was under the impression that the javax_persistence… files should handle this. Do I have them in the wrong directory?
Thanks,
nbc