是否在NetBeans 8.0.1中忽略了glassfish-resources.xml? [英] glassfish-resources.xml ignored with NetBeans 8.0.1?
问题描述
我刚刚将NetBeans 8.0.1和GlassFish 4.1用于2个旧项目,这些项目与NetBeans 8.0和GlassFish 4.0很好地兼容.
I have just used NetBeans 8.0.1 and GlassFish 4.1 for 2 old projects which worked well with NetBeans 8.0 and GlassFish 4.0.
现在(使用NetBeans 8.0.1)在项目部署期间出现错误"tInvalid资源:jdbc/nameOfTheSource__pm".
Now (with NetBeans 8.0.1) I get an error "tInvalid resource : jdbc/nameOfTheSource__pm" during the deployment of the projects.
JDBCfish和连接池由glassfish-resources.xml定义(当我使用选项"Create Persistent Unit"和"New Data Source"定义新实体时,由NetBeans生成).
The JDBC resource and the connection pool are defined by glassfish-resources.xml (generated by NetBeans when I defined a new entity with the option "Create Persistent Unit" and "New Data Source").
如果我通过asadmin的add-resource命令直接使用glassfish-resources,则在服务器上,所有命令都可以正常工作:创建了连接池和JDBC资源.因此,问题并非出自此文件.
If I use directly glassfish-resources by the command add-resource of asadmin, on the server, all is working: the connection pool and the JDBC resources are created. So the problem does not come from this file.
好像在部署期间忽略了glassfish-resources.xml.
It is as if glassfish-resources.xml were ignored during the deployment.
有人有同样的问题(并有解释)吗?
Did someone had the same problem (and have an explanation)?
我的环境: NetBeans 8.0.1, GlassFish 4.1, Java DB 10.10.1.2-(1495037)(来自Java 8.0).
My environment: NetBeans 8.0.1, GlassFish 4.1, Java DB 10.10.1.2 - (1495037) (from Java 8.0).
相关问题:部署过程中如何使用glassfish资源?它不包含在EAR或WAR文件中.
Related question : how glassfish-resources is used during the deployment? It is not included in the EAR or WAR files.
预先感谢您的帮助.
推荐答案
It is a bug of GlassFish: https://netbeans.org/bugzilla/show_bug.cgi?id=243034
我通过@DatasourceDefinition在应用程序中定义我的数据源,而不是使用glassfish-resources.xml,但这只是一种解决方法,仅适用于数据源,而不适用于其他类型的资源.
I define my datasource in the application by @DatasourceDefinition instead of using glassfish-resources.xml but it is a workaround just for a datasource, not for other types of resources.
这篇关于是否在NetBeans 8.0.1中忽略了glassfish-resources.xml?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!