0

I trying to configure Glassfish 5 with this datasource JNDI name: jdbc/DefaultD

Exception attempting to inject Res-Ref-Env-Property: jdbc/DefaultDB@javax.sql.DataSource@ resolved as: jndi: java:comp/DefaultDataSource@res principal: null@mail: null No Runtime properties Database Vendor : null Create Tables at Deploy : false Delete Tables at Undeploy : false into class com.crm.web.authentication.LoginController: Lookup failed for 'java:comp/env/jdbc/DefaultDB' in SerialContext[myEnv={java.naming.factory.initial=com.sun.enterprise.naming.impl.SerialInitContextFactory, java.naming.factory.state=com.sun.corba.ee.impl.presentation.rmi.JNDIStateFactoryImpl, java.naming.factory.url.pkgs=com.sun.enterprise.naming}

I created datasource pool and and JDBC resource but when I run the wen application I get above error. Is there any solution for this problem?

Peter Penzov
  • 1,126
  • 134
  • 430
  • 808

1 Answers1

0

before creating data source JNDI you need to place the database related Jar file in the glass fish domain lib folder.

ex: if you are creating JNDI for MySQL database in default glass fish domain domain1, then you need to place the "mysql-connector-java-5.1.23-bin.jar" in lib folder. then restart the server then it will work

SivaTeja
  • 378
  • 1
  • 3
  • 16