AppFoundation/Mysql/Persistence.xml

I think I now have managed to connect to my database using the AppFoundation. But when I try to access a table, I get the following error:

javax.servlet.ServletException: <openjpa-2.1.0-r422266:1071316 fatal user error> org.apache.openjpa.persistence.ArgumentException: A JDBC Driver or DataSource class name must be specified in the ConnectionDriverName property.
com.vaadin.terminal.gwt.server.AbstractApplicationServlet.handleServiceException(AbstractApplicationServlet.java:973)
etc. etc.

I’m using mysql, and I took the persistence.xml file more or less verbatim from the appfoundation wiki example page. Can someone tell me what is missing or what should be changed here?

It is possible my code is incorrect here too - the relevant statements look like:

try {
		FacadeFactory.registerFacade("PUVtest", true);
		Logger.debug("33333");
		vSgname = (Vector<Sgname>) FacadeFactory.getFacade().list(Sgname.class);

It blows up trying to access the Sgname table.

Persistence.xml looks like:

<?xml version="1.0" encoding="UTF-8"?>




org.apache.openjpa.persistence.PersistenceProviderImpl

com.example.vtest.Sgname
false











Thanks very much,

nbc

Do you have the MySQL JDBC drivers in your classpath? If not, you can download the drivers as a jar file
from MySQL homepage
.

I think I have the mysql drivers - it is in the lib directory:

./VTest/WebContent/WEB-INF/lib/mysql-connector-java-5.1.10-bin.jar

I don’t have this anywhere in the source tree. This is the first time I’ve used Eclipse as a development IDE, so it is quite possible I’m not putting things in the right place. I originally put the persistence.xml file under WebContent/META-INF/persistence.xml, and it appears that it needs to be in src/META-INF/persistence.xml. So it is certainly possible that I think I have the drivers but they are in the wrong place…

nbc