The name of the driver class for the datasource is missing (Netbeans+ PostgreSql + Glassfish) -


i'm trying develop ejb application using netbeans 8 on postgres 9.2 db , glassfish 4 server.

once created connection pool , jdbc resources in glassfish admin panel, i'm not able add entities using datasource. netbeans still giving me error:

the name of driver class datasource missing

i've tried adding libraries project. copied postgresql-9.2-1002.jdbc4.jar , postgresql-9.2-1002.jdbc3.jar files in c:\program files\glassfish-4.0\glassfish\domains\domain1\lib folder.

screenshot: http://imageshack.com/a/img843/6884/w3ko.png

if create entities using connection created before(in nb services/databases), works, result set after query empty. idea?

here connection pool created: http://imageshack.com/a/img838/8286/bkw8.png

this persistence.xml:

<?xml version="1.0" encoding="utf-8"?> <persistence version="2.1" xmlns="http://xmlns.jcp.org/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xsi:schemalocation="http://xmlns.jcp.org/xml/ns/persistence http://xmlns.jcp.org/xml/ns/persistence/persistence_2_1.xsd">   <persistence-unit name="esempio-ejbpu" transaction-type="jta">     <jta-data-source>try_</jta-data-source>     <exclude-unlisted-classes>false</exclude-unlisted-classes>     <properties>       <property name="javax.persistence.schema-generation.database.action" value="create"/>     </properties>   </persistence-unit> </persistence> 

apologies being straightforward, believe on specific situation, wrong. should done is:

  • go glassfish server administration panel (link should this: http://localhost:4848/common/index.jsf (under additional properties tab)
    • click on services in netbeans
    • click on server
    • right-click on server name [a pop-up contextual menu appears]
    • click on view domain admin console [note: server must running in order see feature. browser tab automatically launched, if server running. know server running if see greenish arrow pointing right on right of server instance]
  • click on resources
  • click on jdbc
  • click on jdbc connection pools
  • add following properties clicking every time on button add property (after selecting pool name , editing it):

    • driverclass: com.mysql.jdbc.driver
    • url : jdbc:mysql://localhost/your_database_name
    • password : your_password database management system
    • servername : localhost or your_server_name
    • user : root or your_username access database management system
    • databasename : your_database_name
  • set jdbc resources [jdbc/your_pool_name]

  • point specific connection pool setup selecting in drop down box.

save (the button on upper-right corner of internet browser) don't forget jdbc resources connected connection pool. ensure case you. they, jdbc connection pools , jdbc resources, located under jdbc in left pane menu of server administration panel. go whatever doing, , try again. please note works mysql database management systems. might need change driver class url if using dbms. may find additional information on youtube [http://www.youtube.com/].

i believe answer.


Comments

Popular posts from this blog

java - Intellij Synchronizing output directories .. -

git - Initial Commit: "fatal: could not create leading directories of ..." -