79624918

Date: 2025-05-16 09:49:45
Score: 1
Natty:
Report link

I've found the problem.

When I debug context.lookup() from

DataSource ds = (DataSource)context.lookup("jdbc/RCVCERMAPB/EnregistrementTracesApplicatives");

I get:

MemoryContext{namesToObjects={default=org.postgresql.Driver::::jdbc:postgresql://172.25.94.30:5432/rspdb3::::rcvcermapb_traceappli}, subContexts={}, env={org.osjava.sj.jndi.shared=true, org.osjava.sj.root=src/main/resources/jndi/, java.naming.factory.initial=org.osjava.sj.MemoryContextFactory, org.osjava.sj.delimiter=/, jndi.syntax.separator=/, jndi.syntax.direction=left_to_right, org.osjava.sj.factory=org.osjava.sj.MemoryContextFactory}, nameParser=org.osjava.sj.jndi.SimpleNameParser@dbd940d, nameInNamespace=jdbc/RCVCERMAPB/EnregistrementTracesApplicatives, nameLock=true}

The datasource has the name default.

So I need to do a
context.lookup("jdbc/RCVCERMAPB/EnregistrementTracesApplicatives/default")
to get it

or define my datasource in jdbc/RCVCERMAPB/EnregistrementTracesApplicatives.properties rather than jdbc/RCVCERMAPB/EnregistrementTracesApplicatives/default.properties

It works fine this way.

Thanks to those who read my question and also to the editting by Mark Rotteveel.

Reasons:
  • Blacklisted phrase (0.5): Thanks
  • Blacklisted phrase (0.5): I need
  • Long answer (-1):
  • Has code block (-0.5):
  • Self-answer (0.5):
  • Low reputation (1):
Posted by: Alain Michel