0

While creating a PostGIS featuretypes using request method of python or add a layer using geoserver getting error like "Could not list layers for this store, an error occurred retrieving them: Cannot find JNDI data source: java:comp/env/jdbc/postgres".

Context.xml file in tomcat I added this code for creating connection between PostGIS and GeoServer.

  <Resource name="jdbc/postgres"
      auth="Container"
      type="javax.sql.DataSource"
      driverClassName="org.postgresql.Driver"
      url="jdbc:postgresql://localhost:5432/pgigismap"
      username="postgres" password="12345"
      maxActive="20"
      initialSize="0"
      minIdle="0"
      maxIdle="8"
      maxWait="10000"
      timeBetweenEvictionRunsMillis="30000"
      minEvictableIdleTimeMillis="60000"
      testWhileIdle="true"
      validationQuery="SELECT 1"
      maxAge="600000"
      rollbackOnReturn="true"
    />
4
  • 1
    Check the log file to see but it looks like you have not set up jndi correctly
    – Ian Turton
    Nov 7 at 10:39
  • Did you restart Tomcat after editing context.xml? Nov 7 at 14:58
  • Yes I restart Tomcat after editing in context.xml file Nov 8 at 8:15
  • can you please tell me how to setup jndi correctly . @IanTurton Nov 8 at 12:17

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.