Hi,
This kind of exception mostly happens, if the related datasource could not be
found.
TomEE auto-creates default resources baed on in memory databases (and if no
schema is present, this is the typical exception which happens).
You can try to use the following JNDI schema:
java:openejb/Resource/<id-of-datasource>
With a declaration like
<Resource id="myds" type="javax.sql.DataSource">
JtaManaged = true
//properties here
</Resource>
Gruß
Richard
> Am 02.06.2024 um 00:13 schrieb Fernando <[email protected]>:
>
> Hi,
> I am trying to migrate an small application from payara community 5 to
> Apache Tomee Plume 8.
> I am working with Java 8 and postgresql 14 on windows and I am getting this
> error message when I try to launch the application:
>
>
>
> *javax.ejb.EJBException: The bean encountered a non-application exception;
> nested exception is: javax.persistence.PersistenceException: Exception
> [EclipseLink-4002] (Eclipse Persistence Services -
> 2.7.13.v20230724-7ffb888abf):
> org.eclipse.persistence.exceptions.DatabaseExceptionInternal Exception:
> java.sql.SQLSyntaxErrorException: usuario no tiene privilegios suficientes
> o objeto no encontrado: CUENTAS in statement [SELECT ID, NOMBRE, TIPO FROM
> cuentas ORDER BY NOMBRE]*
>
> I am understand that said that the user have not enough privilege, but I the
> user and password are correct!
> In file context.xml under the META-INF of my project I set this:
>
>
>
>
>
>
>
>
>
>
>
>
>
> *<Context path="/GastosJSP"> <Resource auth="Container"
> driverClassName="org.postgresql.Driver" maxIdle="10"
> maxTotal="20" maxWaitMillis="-1" name="jdbc/gastos"
> password="unacontrasena" type="javax.sql.DataSource"
> url="jdbc:postgresql://localhost:5432/GastosJ"
> username="operador"/></Context>*
>
> and in persistence.xml I have this configuration:
>
>
>
>
>
>
> *<persistence version="2.1" xmlns="http://xmlns.jcp.org/xml/ns/persistence
> <http://xmlns.jcp.org/xml/ns/persistence>"
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance
> <http://www.w3.org/2001/XMLSchema-instance>"
> xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/persistence
> <http://xmlns.jcp.org/xml/ns/persistence>
> http://xmlns.jcp.org/xml/ns/persistence/persistence_2_1.xsd
> <http://xmlns.jcp.org/xml/ns/persistence/persistence_2_1.xsd>">
> <persistence-unit name="GastosPU" transaction-type="JTA">
> <provider>org.eclipse.persistence.jpa.PersistenceProvider</provider>
> <jta-data-source>jdbc/gastos</jta-data-source>
> </persistence-unit></persistence>*
>
> Finally in Dao Class, where I have the error showed up, I have:
>
>
>
>
>
>
> *@Statelesspublic class CuentaDaoImp implements CuentaDao {
> @PersistenceContext(unitName = "GastosPU") private EntityManager em;*
>
> Maybe I am not understanding something.... i am a little lost.....someone
> could give me a hand?
> Thanks in advance!
>
> Fernando