数据源的驱动程序类的名称缺失(Netbeans + PostgreSql + Glassfish) [英] The name of the driver class for the datasource is missing (Netbeans+ PostgreSql + Glassfish)

查看:187
本文介绍了数据源的驱动程序类的名称缺失(Netbeans + PostgreSql + Glassfish)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图在Postgres 9.2 db和Glassfish 4服务器上开发一个使用Netbeans 8的EJB应用程序。

在我创建连接池和JDBC资源后glassfish管理面板,我无法添加使用数据源的实体。 Netbeans仍然给我一个错误:


数据源的驱动类的名称缺失
blockquote>

我已经尝试将库添加到项目中。我复制了
C:\程序文件\glassfish-4.0\glassfish\domains中的postgresql-9.2-1002.jdbc4.jar和postgresql-9.2-1002.jdbc3.jar文件\domain1\lib文件夹

屏幕截图: http:/ /imageshack.com/a/img843/6884/w3ko.png



如果我使用之前创建的连接(在NB服务/数据库中)创建实体,它的工作原理,但任何查询后为空的结果集。任何想法?



这里是我创建的连接池: http://imageshack.com/a/img838/8286/bkw8.png



这是我的persistence.xml: p>

 <?xml version =1.0encoding =UTF-8?> 
< persistence version =2.1xmlns =http://xmlns.jcp.org/xml/ns/persistencexmlns:xsi =http://www.w3.org/2001/XMLSchema-实例xsi:schemaLocation =http://xmlns.jcp.org/xml/ns/persistence http://xmlns.jcp.org/xml/ns/persistence/persistence_2_1.xsd\">
< persistence-unit name =Esempio-ejbPUtransaction-type =JTA>
< jta-data-source> try_< / jta-data-source>
< exclude-unlisted-classes> false< / exclude-unlisted-classes>
<属性>
< property name =javax.persistence.schema-generation.database.actionvalue =create/>
< / properties>
< / persistence-unit>
< /余辉>


解决方案

解决:这是一个连接池问题。在glassfish管理面板中创建一个驱动程序我没有更多的问题。


I'm trying to develop an EJB application using Netbeans 8 on a Postgres 9.2 db and Glassfish 4 server.

Once I created connection pool and JDBC resources in the glassfish admin panel, I'm not able to add entities using the datasource. Netbeans still giving me an error:

The name of the driver class for the datasource is missing

I've already tried adding libraries to the project. I copied postgresql-9.2-1002.jdbc4.jar and 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 I create entities using a connection created before(in NB Services/Databases), it works, but result set after any query is empty. Any idea?

Here the connection pool I created: http://imageshack.com/a/img838/8286/bkw8.png

This is my 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>

解决方案

Solved: it was a connection pool issue. Creating a driver one in glassfish admin panel I've got no more problems.

这篇关于数据源的驱动程序类的名称缺失(Netbeans + PostgreSql + Glassfish)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆