[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Newsgroup Home]
[News.eclipse.technology.eclipselink] Re: NPE while using EclipseLink

Hi James,

thank you for your reply, the server was down. Now the link should work 
again.

I actually do set user and password to "".

Here is the persistence.xml (links should work also again, the whole example 
can be found there):

?xml version="1.0" encoding="UTF-8"?>
<persistence version="1.0"
	xmlns="http://java.sun.com/xml/ns/persistence";
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
	xsi:schemaLocation="http://java.sun.com/xml/ns/persistence 
http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd";>
	<persistence-unit name="people">

		<provider>org.eclipse.persistence.jpa.PersistenceProvider</provider>

		<class>datamodel.impl.Family</class>
		<class>datamodel.impl.Person</class>
		<class>datamodel.impl.Job</class>
		<properties>
			<property name="eclipselink.jdbc.driver" 
value="org.apache.derby.jdbc.EmbeddedDriver" />
			<property name="eclipselink.jdbc.url" 
value="jdbc:derby:C:/DerbyDatabases/hellojpa-database8;create=true" />
			<!-- I work in this example without user / password.-->
			<property name="eclipselink.jdbc.user" value="" />
			<property name="eclipselink.jdbc.password" value="" />



			<!-- EclipseLink should create the database schema automatically -->

			<property name="eclipselink.ddl-generation" 
value="drop-and-create-tables" />
			<property name="eclipselink.ddl-generation.output-mode" value="database" 
/>
		</properties>

	</persistence-unit>
</persistence>
Best regards, Lars


"James" <jamesssss@xxxxxxxxx> wrote in message 
news:976181ecbe1d975fd59b80acf395ad68$1@xxxxxxxxxxxxxxxxxx
> Your link to your persistence XML does not work, perhaps include it.
>
> The null pointer is occuring in your JDBC driver (Derby) not EclipseLink. 
> The error is occuring on connect, so my guess would be you did not set a 
> user name or password.  You must set a user name and password.  JPA does 
> not have standard properties for these in the persistence.xml, for 
> EclipseLink they are "eclipselink.jdbc.user", "eclipselink.jdbc.password".
>