Hi Kean,
setting the maven artifact scope to provided
resolved the problem.
Thanks!


El lun, 3 jun 2024 a la(s) 6:32 p.m., Kean Erickson (kean.erick...@gmail.com)
escribió:

> Hi Fernando,
>
> Please try grabbing that postgres client driver jar from the website, place
> the jar in tomee's /lib folder and then set the maven artifact to scope:
> provided. See if that fixes the classnotfound problem
>
>
> https://jdbc.postgresql.org/
>
> On Mon, Jun 3, 2024, 2:05 PM Fernando <fernandoagu...@gmail.com> wrote:
>
> > Hi Richard thanks for your response,
> > I added this configuration in tomee.xml...(seems that using a other file
> > doesn't work), but that continue not working....now I have a new error
> > message:
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> > *[EL Info]: 2024-06-03
> > 17:48:42.683--ServerSession(1020643364)--EclipseLink, version: Eclipse
> > Persistence Services - 2.7.13.v20230724-7ffb888abf[EL Severe]: 2024-06-03
> > 17:48:42.683--ServerSession(1020643364)--java.lang.NoClassDefFoundError:
> > org/postgresql/jdbc/PgDatabaseMetaData at
> > org.postgresql.jdbc.PgConnection.getMetaData(PgConnection.java:1427) at
> > sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at
> >
> >
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
> > at
> >
> >
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> > at java.lang.reflect.Method.invoke(Method.java:498) at
> >
> >
> org.apache.tomcat.jdbc.pool.ProxyConnection.invoke(ProxyConnection.java:131)
> > at
> >
> >
> org.apache.tomcat.jdbc.pool.JdbcInterceptor.invoke(JdbcInterceptor.java:107)
> > at
> >
> >
> org.apache.tomcat.jdbc.pool.interceptor.AbstractCreateStatementInterceptor.invoke(AbstractCreateStatementInterceptor.java:74)
> > at
> >
> >
> org.apache.tomcat.jdbc.pool.JdbcInterceptor.invoke(JdbcInterceptor.java:107)
> > at
> >
> >
> org.apache.tomcat.jdbc.pool.DisposableConnectionFacade.invoke(DisposableConnectionFacade.java:81)
> > at com.sun.proxy.$Proxy125.getMetaData(Unknown Source) at
> >
> >
> org.eclipse.persistence.internal.sessions.DatabaseSessionImpl.setOrDetectDatasource(DatabaseSessionImpl.java:227)
> > at
> >
> >
> org.eclipse.persistence.internal.sessions.DatabaseSessionImpl.loginAndDetectDatasource(DatabaseSessionImpl.java:810)
> > at
> >
> >
> org.eclipse.persistence.internal.jpa.EntityManagerFactoryProvider.login(EntityManagerFactoryProvider.java:261)
> > at
> >
> >
> org.eclipse.persistence.internal.jpa.EntityManagerSetupImpl.deploy(EntityManagerSetupImpl.java:771)
> > at
> >
> >
> org.eclipse.persistence.internal.jpa.EntityManagerFactoryDelegate.getAbstractSession(EntityManagerFactoryDelegate.java:222)
> > at
> >
> >
> org.eclipse.persistence.internal.jpa.EntityManagerFactoryDelegate.createEntityManagerImpl(EntityManagerFactoryDelegate.java:330)
> > at
> >
> >
> org.eclipse.persistence.internal.jpa.EntityManagerFactoryImpl.createEntityManagerImpl(EntityManagerFactoryImpl.java:350)
> > at
> >
> >
> org.eclipse.persistence.internal.jpa.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:331)
> > at
> >
> >
> org.apache.openejb.assembler.classic.ReloadableEntityManagerFactory.createEntityManager(ReloadableEntityManagerFactory.java:208)
> > at
> >
> >
> org.apache.openejb.persistence.JtaEntityManagerRegistry.getEntityManager(JtaEntityManagerRegistry.java:125)
> > at
> >
> >
> org.apache.openejb.persistence.JtaEntityManager.getEntityManager(JtaEntityManager.java:145)03-Jun-2024
> > 17:48:42.945 GRAVE [http-nio-8080-exec-12]
> >
> >
> org.apache.openejb.core.transaction.EjbTransactionUtil.handleSystemException
> > EjbTransactionUtil.handleSystemException: java.lang.NoClassDefFoundError:
> > org/postgresql/jdbc/PgDatabaseMetaData
> > javax.persistence.PersistenceException: java.lang.NoClassDefFoundError:
> > org/postgresql/jdbc/PgDatabaseMetaData at
> >
> >
> org.eclipse.persistence.internal.jpa.EntityManagerSetupImpl.deploy(EntityManagerSetupImpl.java:854)
> > at
> >
> >
> org.apache.openejb.persistence.JtaEntityManager.proxyIfNoTx(JtaEntityManager.java:375)
> > at
> >
> >
> org.eclipse.persistence.internal.jpa.EntityManagerFactoryDelegate.getAbstractSession(EntityManagerFactoryDelegate.java:222)
> > at
> >
> >
> org.apache.openejb.persistence.JtaEntityManager.createQuery(JtaEntityManager.java:329)
> > at
> >
> >
> org.eclipse.persistence.internal.jpa.EntityManagerFactoryDelegate.createEntityManagerImpl(EntityManagerFactoryDelegate.java:330)*
> >
> >
> > In my pom.xml I have this driver version,
> >        <dependency>
> >             <groupId>org.postgresql</groupId>
> >             <artifactId>postgresql</artifactId>
> >              <version>42.7.3</version>
> >         </dependency>
> >
> > And obviously I have the same version of driver in lib folder of apache
> > tomee.
> >
> > Anything else that may be missing to configure?
> >
> > El lun, 3 jun 2024 a la(s) 5:51 a.m., Richard Zowalla (r...@apache.org)
> > escribió:
> >
> > > 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 <fernandoagu...@gmail.com>:
> > > >
> > > > 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
> > >
> > >
> >
>

Reply via email to