This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 233481 - [74cat] Cannot deploy module accessing SQL Server to GlassFish 4.0
Summary: [74cat] Cannot deploy module accessing SQL Server to GlassFish 4.0
Status: RESOLVED FIXED
Alias: None
Product: serverplugins
Classification: Unclassified
Component: GlassFish (show other bugs)
Version: 7.4
Hardware: PC All
: P3 normal (vote)
Assignee: Petr Hejl
URL:
Keywords:
: 243034 245300 250474 (view as bug list)
Depends on:
Blocks:
 
Reported: 2013-07-26 10:37 UTC by muellermi
Modified: 2015-09-15 14:56 UTC (History)
10 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
IDE log (83.28 KB, text/plain)
2013-07-26 10:37 UTC, muellermi
Details
Procedure to reproduce the problem. (5.59 KB, text/plain)
2014-09-24 10:30 UTC, ricg
Details
Glassfish resources file can be stored in both setup and config folders (136.36 KB, patch)
2015-03-17 17:45 UTC, TomasKraus
Details | Diff
test project with app scoped resources (30.47 KB, application/octet-stream)
2015-05-13 12:52 UTC, Petr Hejl
Details

Note You need to log in before you can comment on or make changes to this bug.
Description muellermi 2013-07-26 10:37:12 UTC
Product Version = NetBeans IDE Dev (Build 201307252300)
Operating System = Windows 8 version 6.2 running on amd64
Java; VM; Vendor = 1.7.0_25
Runtime = Java HotSpot(TM) 64-Bit Server VM 23.25-b01

Trying to deploy a module will fail:

SEVERE:   Exception while invoking class org.glassfish.persistence.jpa.JPADeployer prepare method
SEVERE:   Exception while preparing the app
SEVERE:   Exception during lifecycle processing
java.lang.RuntimeException: Invalid resource : jdbc/request__pm
	at com.sun.enterprise.connectors.ConnectorRuntime.lookupDataSourceInDAS(ConnectorRuntime.java:593)
	at com.sun.enterprise.connectors.ConnectorRuntime.lookupPMResource(ConnectorRuntime.java:517)
	at org.glassfish.persistence.common.PersistenceHelper.lookupPMResource(PersistenceHelper.java:63)
	at org.glassfish.persistence.jpa.ProviderContainerContractInfoBase.lookupDataSource(ProviderContainerContractInfoBase.java:71)
	at org.glassfish.persistence.jpa.PersistenceUnitInfoImpl.<init>(PersistenceUnitInfoImpl.java:108)
	at org.glassfish.persistence.jpa.PersistenceUnitLoader.loadPU(PersistenceUnitLoader.java:142)
	at org.glassfish.persistence.jpa.PersistenceUnitLoader.<init>(PersistenceUnitLoader.java:107)
	at org.glassfish.persistence.jpa.JPADeployer$1.visitPUD(JPADeployer.java:223)
	at org.glassfish.persistence.jpa.JPADeployer$PersistenceUnitDescriptorIterator.iteratePUDs(JPADeployer.java:510)
	at org.glassfish.persistence.jpa.JPADeployer.createEMFs(JPADeployer.java:230)
	at org.glassfish.persistence.jpa.JPADeployer.prepare(JPADeployer.java:168)
	at com.sun.enterprise.v3.server.ApplicationLifecycle.prepareModule(ApplicationLifecycle.java:922)
	at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:431)
	at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:219)
	at org.glassfish.deployment.admin.DeployCommand.execute(DeployCommand.java:491)
	at com.sun.enterprise.v3.admin.CommandRunnerImpl$2$1.run(CommandRunnerImpl.java:527)
	at com.sun.enterprise.v3.admin.CommandRunnerImpl$2$1.run(CommandRunnerImpl.java:523)
	at java.security.AccessController.doPrivileged(Native Method)
	at javax.security.auth.Subject.doAs(Subject.java:356)
	at com.sun.enterprise.v3.admin.CommandRunnerImpl$2.execute(CommandRunnerImpl.java:522)
	at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:546)
	at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:1423)
	at com.sun.enterprise.v3.admin.CommandRunnerImpl.access$1500(CommandRunnerImpl.java:108)
	at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1762)
	at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1674)
	at com.sun.enterprise.v3.admin.AdminAdapter.doCommand(AdminAdapter.java:534)
	at com.sun.enterprise.v3.admin.AdminAdapter.onMissingResource(AdminAdapter.java:224)
	at org.glassfish.grizzly.http.server.StaticHttpHandler.service(StaticHttpHandler.java:297)
	at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:246)
	at org.glassfish.grizzly.http.server.HttpHandler.runService(HttpHandler.java:191)
	at org.glassfish.grizzly.http.server.HttpHandler.doHandle(HttpHandler.java:168)
	at org.glassfish.grizzly.http.server.HttpServerFilter.handleRead(HttpServerFilter.java:189)
	at org.glassfish.grizzly.filterchain.ExecutorResolver$9.execute(ExecutorResolver.java:119)
	at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeFilter(DefaultFilterChain.java:288)
	at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeChainPart(DefaultFilterChain.java:206)
	at org.glassfish.grizzly.filterchain.DefaultFilterChain.execute(DefaultFilterChain.java:136)
	at org.glassfish.grizzly.filterchain.DefaultFilterChain.process(DefaultFilterChain.java:114)
	at org.glassfish.grizzly.ProcessorExecutor.execute(ProcessorExecutor.java:77)
	at org.glassfish.grizzly.nio.transport.TCPNIOTransport.fireIOEvent(TCPNIOTransport.java:838)
	at org.glassfish.grizzly.strategies.AbstractIOStrategy.fireIOEvent(AbstractIOStrategy.java:113)
	at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.run0(WorkerThreadIOStrategy.java:115)
	at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.access$100(WorkerThreadIOStrategy.java:55)
	at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy$WorkerThreadRunnable.run(WorkerThreadIOStrategy.java:135)
	at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:564)
	at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.run(AbstractThreadPool.java:544)
	at java.lang.Thread.run(Thread.java:724)
Caused by: com.sun.appserv.connectors.internal.api.ConnectorRuntimeException: Invalid resource : jdbc/request__pm
	at org.glassfish.jdbcruntime.service.JdbcDataSource.validateResource(JdbcDataSource.java:81)
	at org.glassfish.jdbcruntime.service.JdbcDataSource.setResourceInfo(JdbcDataSource.java:62)
	at org.glassfish.jdbcruntime.JdbcRuntimeExtension.lookupDataSourceInDAS(JdbcRuntimeExtension.java:136)
	at com.sun.enterprise.connectors.ConnectorRuntime.lookupDataSourceInDAS(ConnectorRuntime.java:589)
	... 45 more

java.lang.RuntimeException: Invalid resource : jdbc/request__pm
Is this a generated resource? I have defined a resource "jdbc/request" which is used to access a MS SQL Server.

The problem occurs on a project, which works fine using NB 7.3.1 or older versions. The problem only occurs in the 7.4 dev version (tested with the last 4 versions). Unfortunately I do not more information.
Comment 1 muellermi 2013-07-26 10:37:14 UTC
Created attachment 137856 [details]
IDE log
Comment 2 TomasKraus 2013-07-26 13:11:37 UTC
Targeting to be fixed ASAP.
Comment 3 Kenneth Ganfield 2013-07-29 15:58:49 UTC
Product Version: NetBeans IDE Dev (Build 201307282300)
Java: 1.7.0_10-ea; Java HotSpot(TM) 64-Bit Server VM 23.6-b04
Runtime: Java(TM) SE Runtime Environment 1.7.0_10-ea-b16
System: Mac OS X version 10.8.4 running on x86_64; UTF-8; en_US (nb)

I think I am seeing something similar.
Basically, I have an app that has some jdbc resources defined in glassfish-resources.xml but the resources are not created on the server when I deploy the application from the IDE.

I can create the resources manually and ping the db using the Server Console.
Comment 4 Kenneth Ganfield 2013-07-30 15:54:26 UTC
maybe more related to(In reply to comment #3)
> Product Version: NetBeans IDE Dev (Build 201307282300)
> Java: 1.7.0_10-ea; Java HotSpot(TM) 64-Bit Server VM 23.6-b04
> Runtime: Java(TM) SE Runtime Environment 1.7.0_10-ea-b16
> System: Mac OS X version 10.8.4 running on x86_64; UTF-8; en_US (nb)
> 
> I think I am seeing something similar.
> Basically, I have an app that has some jdbc resources defined in
> glassfish-resources.xml but the resources are not created on the server when I
> deploy the application from the IDE.
> 
> I can create the resources manually and ping the db using the Server Console.

maybe more related to 
#230671
Comment 5 Kenneth Ganfield 2013-07-30 17:48:07 UTC
(In reply to comment #4)
> maybe more related to(In reply to comment #3)
> > Product Version: NetBeans IDE Dev (Build 201307282300)
> > Java: 1.7.0_10-ea; Java HotSpot(TM) 64-Bit Server VM 23.6-b04
> > Runtime: Java(TM) SE Runtime Environment 1.7.0_10-ea-b16
> > System: Mac OS X version 10.8.4 running on x86_64; UTF-8; en_US (nb)
> > 
> > I think I am seeing something similar.
> > Basically, I have an app that has some jdbc resources defined in
> > glassfish-resources.xml but the resources are not created on the server when I
> > deploy the application from the IDE.
> > 
> > I can create the resources manually and ping the db using the Server Console.
> 
> maybe more related to 
> #230671


I created a new issue for the resources not created on deploy:
#233679
Comment 6 TomasKraus 2013-08-02 12:47:13 UTC
Checked into web-main:
----------------------
changeset:   260167:a24634e3db3f
commit message:
#233679 - JDBC resources not created when app deployed to GF4
#233481 - [74cat] Cannot deploy module accessing SQL Server to GlassFish 4.0

I will not mark this as Bug# 233679 duplicate because ?I would like to get this issue verified too. I'm not 100% sure.
Comment 7 TomasKraus 2013-08-02 13:41:19 UTC
Fix is pushed, closing this bug.
Comment 8 Quality Engineering 2013-08-03 02:09:23 UTC
Integrated into 'main-silver', will be available in build *201308022300* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/a24634e3db3f
User: Tomas Kraus <TomasKraus@netbeans.org>
Log: #233679 - JDBC resources not created when app deployed to GF4
#233481 - [74cat] Cannot deploy module accessing SQL Server to GlassFish 4.0
Comment 9 muellermi 2013-08-05 06:31:42 UTC
ok. Thanks
Comment 10 ricg 2014-09-24 10:30:12 UTC
Created attachment 149489 [details]
Procedure to reproduce the problem.
Comment 11 ricg 2014-09-24 10:34:04 UTC
A part of my comment doesn't appear: I think that the bug is not solved because I have just had the same problem with NetBeans 8.0.1, GlassFish 4.1 and Java DB (not MySQL).

(In reply to ricg from comment #10)
> Created attachment 149489 [details]
> Procedure to reproduce the problem.
Comment 12 ricg 2014-09-26 06:40:33 UTC
The cause of the problem: glassfish-resources.xml is not included by NetBeans in the WAR file.
Comment 13 ricg 2014-09-27 05:43:33 UTC
The problem is that the target "-add-resources" is never executed. 

This target is used by the target -deploy-ant which is used itself by the target run-deploy.

run-deploy depends of a lot of targets and one of these targets executed before "-add-resources", "-run-deploy-nb", uses "nbdeploy" that throws an error when it is executed. The error message is not clear and I can't guess why there is a problem.

The code (in the file build-impl.xml):
<target if="netbeans.home" name="-run-deploy-nb">
   <nbdeploy clientUrlPart="${client.urlPart}" debugmode="false" forceRedeploy="${forceRedeploy}"/>
</target>
Comment 14 ricg 2014-09-28 09:10:30 UTC
If I use "add-resources a/b/c/glassfish-resources.xml" of asadmin (of GlassFish), it works: the resources declared in glassfish-resources.xml are added in GlassFish.

In NetBeans, if I add glassfish-resources.xml under META-INF in the WAR file by tweaking build.xml, it does not work: when I deploy the project I get the same error as when glassfish-resources.xml.

If I deploy the WAR file (the one which contains glassfish-resources.xml under META-INF) from the administration console of GlassFish, I still get the same error.

Is it a bug of NetBeans or a bug of GlassFish? I don't know what to think... I incline rather towards GlassFish but I am not sure.
Comment 15 imolero 2014-10-29 22:56:39 UTC
Hi, I hace the same problem with NetBeans 8.0.1 un windows 7, I was using this with out troubles before NetBeans 7.4 but since 7.4 I still have the same trouble.
There is any chance to help you?
Comment 16 Antonin Nebuzelsky 2015-02-20 15:41:59 UTC
*** Bug 250474 has been marked as a duplicate of this bug. ***
Comment 17 Petr Hejl 2015-03-10 15:23:35 UTC
*** Bug 243034 has been marked as a duplicate of this bug. ***
Comment 18 TomasKraus 2015-03-12 11:21:36 UTC
First we have know how this should work properly. Here ia a link to GF JDBC code owner's blog where weverthing is described:
https://blogs.oracle.com/JagadishPrasath/entry/application_scoped_resources_in_glassfish

Second I tested this with full EE application (having .war and ejb.jar packaged in .ear archive). It works fine when deployment is done from NetBeans, because GF plugin takes care of adding glassfish-resources.xml content to GF.
But yes, built archives do not contain glassfish-resources.xml.
This file is not present even in build/classes/META-INF of ejb project (source for archiving) where it should be.

I would blame ant build script which shall copy glassfish-resources.xml there during build phase.
Comment 19 TomasKraus 2015-03-17 17:45:02 UTC
Created attachment 152680 [details]
Glassfish resources file can be stored in both setup and config folders
Comment 20 TomasKraus 2015-03-18 10:06:31 UTC
Pushed into web-main:
---------------------
changeset:   284675:d075b556b189
user:        Tomas Kraus <TomasKraus@netbeans.org>
date:        Tue Mar 17 16:39:16 2015 +0100
summary:     #233481 - Glassfish resources file can be stored in both setup and config folders.
URL:         hg.netbeans.org/web-main/rev/d075b556b189

This allows at least workarount - let NetBeans create glassfish-resources.xml in project setup folder, but be able to move it into config folder where it's still recognized and used.
Comment 21 TomasKraus 2015-03-18 11:48:58 UTC
Pushed into web-main:
---------------------
changeset:   285033:b22d9a2d6798
user:        Tomas Kraus <TomasKraus@netbeans.org>
date:        Wed Mar 18 12:47:08 2015 +0100
summary:     #233481 - GlassFish modules version update.
URL:         http://hg.netbeans.org/web-main/rev/b22d9a2d6798
Comment 22 TomasKraus 2015-03-18 13:57:50 UTC
Pushed into web-main:
---------------------
changeset:   285037:bee6ba4169c5
user:        Tomas Kraus <TomasKraus@netbeans.org>
date:        Wed Mar 18 14:54:29 2015 +0100
summary:     #233481 - Module version update.
URL:         http://hg.netbeans.org/web-main/rev/bee6ba4169c5
Comment 23 Quality Engineering 2015-03-19 03:36:05 UTC
Integrated into 'main-silver', will be available in build *201503190001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/d075b556b189
User: Tomas Kraus <TomasKraus@netbeans.org>
Log: #233481 - Glassfish resources file can be stored in both setup and config folders.
Comment 24 TomasKraus 2015-03-20 14:33:18 UTC
Pushed into web-main:
---------------------
changeset:   285078:5040fcd5a1fa
user:        Tomas Kraus <TomasKraus@netbeans.org>
date:        Fri Mar 20 15:07:54 2015 +0100
summary:     #233481 - Resources wizard modified to create new files in config directory.
URL:         http://hg.netbeans.org/web-main/rev/5040fcd5a1fa

It should be OK now.
Comment 25 TomasKraus 2015-03-20 14:55:49 UTC
There was NPE during my local testing, so pushing one more simple fix into web-main:
--------------------------------------------------------------------------
changeset:   285167:7566e39df8bc
tag:         tip
user:        Tomas Kraus <TomasKraus@netbeans.org>
date:        Fri Mar 20 15:53:02 2015 +0100
summary:     #233481 - Fixed NPE.
URL:         http://hg.netbeans.org/web-main/rev/7566e39df8bc

Both wizards (create resources and persistence unit) now put new files into proper directories for GF 3.1 and later.
Closing this bug.
Comment 26 Quality Engineering 2015-03-21 07:56:29 UTC
Integrated into 'main-silver', will be available in build *201503210001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/5040fcd5a1fa
User: Tomas Kraus <TomasKraus@netbeans.org>
Log: #233481 - Resources wizard modified to create new files in config directory.
          Did some additional code cleanup in modified classes.
Comment 27 Quality Engineering 2015-03-24 03:33:22 UTC
Integrated into 'main-silver', will be available in build *201503240001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/7566e39df8bc
User: Tomas Kraus <TomasKraus@netbeans.org>
Log: #233481 - Fixed NPE.
Comment 28 ricg 2015-05-07 13:18:41 UTC
I have just used the nightly build "Product Version: NetBeans IDE Dev (*Build 201505040001*)" and I still have had the same problem. I believed have understood in your message that the problem had been solved in this version but it seems it is not the case.

I have created a Maven Enterprise project (following https://netbeans.org/kb/docs/javaee/maven-entapp.html with a new datasource "jdbc/test" with the database named "testmaven" (JavaDB database) at the step "Creating the Persistence Unit") and when I run the application I receive the error message com.sun.appserv.connectors.internal.api.ConnectorRuntimeException: Invalid resource : jdbc/test__pm while the definition of test is in the file glassfish-resources.xml.

If I replace jdbc/test by jdbc/sample (defined in GlassFish), all works well.
Comment 29 amlesas 2015-05-08 20:27:49 UTC
Hi,
I teach Web services to the students and I confirm that getting the NetBeans IDE updated, this is not possible to work because the database resource connection is not working at deploying the project.
A workaround is not applicable in industrial projects, I did not try the workaround, but I cannot teach this framework if it does not work. Thank you to help in students projects that end next week (on May, 13 2015).
Best regards,
Anne-Marie Lesas
Comment 30 david.chaves 2015-05-08 20:40:27 UTC
I can confirm that the build 201503190001 Works without this bug (I had successfully deployed projects with this versión) have you tried to download this versión?
Comment 31 ricg 2015-05-09 09:24:55 UTC
(In reply to david.chaves from comment #30)
> I can confirm that the build 201503190001 Works without this bug (I had
> successfully deployed projects with this versión) have you tried to download
> this versión?

The version I use (Build 201505040001) for this test is latter than build 201503190001, so the bug should have been fixed. I have just tried again the same Enterprise application without Maven and I have had the same error (java.lang.RuntimeException: Invalid resource : jdbc/test2__pm); I have created a new Persistence Unit named jdbc/test2.

I noticed that glassfish-resources.xml was now put under META-INF (src/conf/META-INF) by the NetBeans wizard that creates the persistence unit. In the dist entry glassfish-resources.xml is put into the entry META-INF.META-INF (is it normal?) of the jar.
Comment 32 PavelInNetbeans 2015-05-09 10:30:11 UTC
Hi all,

I had the same error messages as you people with Glassfish 4.1, Netbeans 8.0.2, mysql 5.5.41 on Ubuntu server 14.04.

The following sequence of steps worked for me:

 - Create a webapplication in Netbeans with JSF, 
   add Entity class and JSF request bean to do a simple insert
   into an existing mysql database. During this process,
   I have created a new JDBC connection pool to my existing
   database on the server and JDBC resource.
   Almost all smooth and automatic, no glitches.

 - Build OK, but deploy: no-no, connection refused
  
 - Needed to fix my.cnf in /etc/mysql/ on the server to contain
   line: 
     bind-address    = 0.0.0.0
   under:
     [mysqld]

 - Deploy again: no-no, server log says: invalid resource myJDBCresource__pm
   
 - OK,
    1. manually created JDBC pool jdbc/myjdbcpool from Glassfish admin console through web browser
    2. manually created JDBC resource jdbc/myresource__pm bound to that pool
   
 - Deploy again: no-no, server log says: invalid resource jdbc/myresource__nontx

 - OK,
    3. manually created JDBC resrouce jdbc/myresource__nontx bound to the same pool

 - Deploy again: and it works, finally.

So the bug is that Glassfish or Netbeans does not create the "__pm" resource on deploy properly. I tried moving the config files everywhere around with no effect, but manual create in Glassfish console did the job, so the config files were clearly taken from where they originally were placed by Netbeans (I removed all the moved around copies)
 
Agree with Anne-Marie that it is kind of "fun" to see "reference implementation" behave this way, but thanks for the hints!

Pavel.
Comment 33 Petr Hejl 2015-05-11 11:50:38 UTC
I believe the issue is:
When application scoped resources is being used (glassfish-resources.xml being bundled into the archive, not deployed separately) one has to use "java:app/" prefix for the JNDI name of the datasource. Thus in the persistence.xml, there should be for example java:app/jdbc/test. Can you confirm this?
Comment 34 PavelInNetbeans 2015-05-12 08:36:18 UTC
Petr: not sure what you mean and if the question was for me. 
Now I have done the following steps from scratch:

1. on a server, from mysql console entered the following:

mysql> create database glassfish charset utf8 collate utf8_slovak_ci;
mysql> GRANT ALL ON glassfish.* TO 'glassfish'@'localhost' identified by mysql> GRANT ALL ON glassfish.* TO 'glassfish'@'%' identified by 'heslo';

mysql> create table glassfish (id int primary key auto_increment, label varchar(100), property varchar(100));

2. created a simple web application in NetbeansEE, added new Persistence
    Unit and new connection to this database called jdbc/glassdb,
    all connections worked from Glassfish ok

3. automatically added Entity from table - Glassfish correctly connected
   to database and retrieved the structure of the table

4. added the jsf managed request-scope bean and implemented an insert() method addressed from the webapplication

The resulting Netbeans project is here: 

http://kempelen.ii.fmph.uniba.sk/dbreport/GlassDB_first_version_that_glassfish_refuses.zip

Attempt to deploy this project on the Glassfish server resulted in the
following log:

http://kempelen.ii.fmph.uniba.sk/dbreport/serverlog_after_first_deploy_that_glassfish_refuses.txt

Based on your hint, I modified persistence.xml and replaced
jdbc/glassdb
with
java:app/jdbc/glassdb

Attempt to deploy ended up the same:
  http://kempelen.ii.fmph.uniba.sk/dbreport/serverlog_with_modifed_persistence.xml.txt

Then I modified also the file glassfish-resources.xml, where 
jdbc/glassdb
was replaced for
java:app/jdbc/glassdb

but the same outcome:
http://kempelen.ii.fmph.uniba.sk/dbreport/serverlog_with_modified_glassfish-resources.xml.txt

Of course, manually adding the jdbc pool and resource on the server through admin console will fix it, but I guess that is not how the things should work.

Any other hints?
Comment 35 Petr Hejl 2015-05-12 08:47:48 UTC
(In reply to PavelInNetbeans from comment #34)
> Petr: not sure what you mean and if the question was for me. 
> Now I have done the following steps from scratch:
> 
> 1. on a server, from mysql console entered the following:
> 
> mysql> create database glassfish charset utf8 collate utf8_slovak_ci;
> mysql> GRANT ALL ON glassfish.* TO 'glassfish'@'localhost' identified by
> mysql> GRANT ALL ON glassfish.* TO 'glassfish'@'%' identified by 'heslo';
> 
> mysql> create table glassfish (id int primary key auto_increment, label
> varchar(100), property varchar(100));
> 
> 2. created a simple web application in NetbeansEE, added new Persistence
>     Unit and new connection to this database called jdbc/glassdb,
>     all connections worked from Glassfish ok
> 
> 3. automatically added Entity from table - Glassfish correctly connected
>    to database and retrieved the structure of the table
> 
> 4. added the jsf managed request-scope bean and implemented an insert()
> method addressed from the webapplication
> 
> The resulting Netbeans project is here: 
> 
> http://kempelen.ii.fmph.uniba.sk/dbreport/
> GlassDB_first_version_that_glassfish_refuses.zip
> 
> Attempt to deploy this project on the Glassfish server resulted in the
> following log:
> 
> http://kempelen.ii.fmph.uniba.sk/dbreport/
> serverlog_after_first_deploy_that_glassfish_refuses.txt
> 
> Based on your hint, I modified persistence.xml and replaced
> jdbc/glassdb
> with
> java:app/jdbc/glassdb
> 
> Attempt to deploy ended up the same:
>  
> http://kempelen.ii.fmph.uniba.sk/dbreport/serverlog_with_modifed_persistence.
> xml.txt
> 
> Then I modified also the file glassfish-resources.xml, where 
> jdbc/glassdb
> was replaced for
> java:app/jdbc/glassdb
> 
> but the same outcome:
> http://kempelen.ii.fmph.uniba.sk/dbreport/serverlog_with_modified_glassfish-
> resources.xml.txt
> 
> Of course, manually adding the jdbc pool and resource on the server through
> admin console will fix it, but I guess that is not how the things should
> work.
> 
> Any other hints?

I'll try that I have tested the test case in comment #28. BTW I believe it won't work in your step 2 theoretically. The persistence unit was not used so it wont fail, but I believe step 3 and 4 does not really change anything except actually using the DS.
Comment 36 PavelInNetbeans 2015-05-12 08:52:40 UTC
Thanks. The same behavior as in comment #28 has been fixed at my setup by manually creating that whatever__pm resource and then also the whatever__nontx resource from Glassfish admin console. Somehow Netbeans fails to create these on deploy automatically.
Comment 37 Petr Hejl 2015-05-12 08:56:09 UTC
(In reply to PavelInNetbeans from comment #36)
> Thanks. The same behavior as in comment #28 has been fixed at my setup by
> manually creating that whatever__pm resource and then also the
> whatever__nontx resource from Glassfish admin console. Somehow Netbeans
> fails to create these on deploy automatically.

Well, I believe it is a problem of application scoped resources created by NB being prefixed by java:app/. If you are interested see:
http://docs.oracle.com/cd/E18930_01/html/821-2417/giydj.html
http://blog.pinateknoloji.com/glassfishapplication-scoped-resources
Comment 38 PavelInNetbeans 2015-05-12 09:08:32 UTC
Interesting. Based on the second link I modified also the pool name as follows

pool-name="java:app/mysql_glassfish_glassfishPool"

in glassfish-resources.xml file, but still getting the same outcome.
Comment 39 Petr Hejl 2015-05-12 10:14:10 UTC
*** Bug 245300 has been marked as a duplicate of this bug. ***
Comment 40 Petr Hejl 2015-05-12 10:46:41 UTC
(In reply to PavelInNetbeans from comment #38)
> Interesting. Based on the second link I modified also the pool name as
> follows
> 
> pool-name="java:app/mysql_glassfish_glassfishPool"
> 
> in glassfish-resources.xml file, but still getting the same outcome.

What server version and IDE version do you use?
Comment 41 Petr Hejl 2015-05-12 10:54:40 UTC
(In reply to Petr Hejl from comment #40)
> (In reply to PavelInNetbeans from comment #38)
> > Interesting. Based on the second link I modified also the pool name as
> > follows
> > 
> > pool-name="java:app/mysql_glassfish_glassfishPool"
> > 
> > in glassfish-resources.xml file, but still getting the same outcome.
> 
> What server version and IDE version do you use?

Ok now I see it in your previous post. Can you try the dev build? Your project works ok for me as it actually does not use the app scoped resources. It really might be a bug in resource deployment which has been fixed recently. Thanks in advance.
Comment 42 Petr Hejl 2015-05-12 11:02:02 UTC
Fixed in web-main 547e9ea5d5dc. Please verify.
Comment 43 ricg 2015-05-12 11:53:17 UTC
What is the meaning of "Fixed in web-main 547e9ea5d5dc"? The last dev version is 201505120001.
As i said the bug was not fixed in the version 201505040001.
Comment 44 Petr Hejl 2015-05-12 12:45:57 UTC
(In reply to ricg from comment #43)
> What is the meaning of "Fixed in web-main 547e9ea5d5dc"? The last dev
> version is 201505120001.

Mercurial repository and revision.
Comment 45 ricg 2015-05-12 12:59:33 UTC
Thanks Petr Hejl. So the fix is not yet included in the dev builds we can download from the Web site of NetBeans?
Comment 46 Petr Hejl 2015-05-12 13:19:13 UTC
(In reply to ricg from comment #45)
> Thanks Petr Hejl. So the fix is not yet included in the dev builds we can
> download from the Web site of NetBeans?

The message about integration to the daily build should appear here in a day or so. Let me know whether the fix works for you.
Comment 47 PavelInNetbeans 2015-05-12 19:14:30 UTC
Reply to Petr comment #41:

 - uninstalled Netbeans from my win7 machine
 - downloaded and installed latest dev version (build 201505120001) of Netbeans
 - added my remote Glassfish server to this new installation, and updated the
   properties of the project
 - clean&build ok
 - deploy - same outcome
 - removed those java:app/ strings from the xml config files
 - clean&build
 - deploy - same outcome 
    (java.lang.RuntimeException: Invalid resource : jdbc/glassdb__pm)

do I have to reinstall also the Glassfish 4.1 on the Linux server
(it is build13, 32bit)
Comment 48 Petr Hejl 2015-05-12 20:32:30 UTC
(In reply to PavelInNetbeans from comment #47)
> Reply to Petr comment #41:
> 
>  - uninstalled Netbeans from my win7 machine
>  - downloaded and installed latest dev version (build 201505120001) of
> Netbeans
>  - added my remote Glassfish server to this new installation, and updated the
>    properties of the project
>  - clean&build ok
>  - deploy - same outcome
>  - removed those java:app/ strings from the xml config files
>  - clean&build
>  - deploy - same outcome 
>     (java.lang.RuntimeException: Invalid resource : jdbc/glassdb__pm)
> 
> do I have to reinstall also the Glassfish 4.1 on the Linux server
> (it is build13, 32bit)

Ok, I believe the key part may be the _remote_ instance. Can you test your project with local GF? Your project worked perfectly in such setup for me....
Comment 49 PavelInNetbeans 2015-05-12 20:39:01 UTC
That is a bit strange, because it does the same thing also on the local Glassfish 4.1. that was bundled with the Netbeans that I have downloaded.
I downloaded the full version of Netbeans.

The server log when I select the local glassfish server is here:

http://kempelen.ii.fmph.uniba.sk/dbreport/local_glassfish_server_log.txt
Comment 50 Petr Hejl 2015-05-12 20:58:17 UTC
(In reply to PavelInNetbeans from comment #49)
> That is a bit strange, because it does the same thing also on the local
> Glassfish 4.1. that was bundled with the Netbeans that I have downloaded.
> I downloaded the full version of Netbeans.
> 
> The server log when I select the local glassfish server is here:
> 
> http://kempelen.ii.fmph.uniba.sk/dbreport/local_glassfish_server_log.txt

Believe me or not, it really worked for me. I'll try your project on Windows. Would be great if you could test your setup from scratch in daily build (creating the project in that build) with fresh GF.
Comment 51 PavelInNetbeans 2015-05-12 21:17:53 UTC
of course I trust what you say, that is why it is strange.
I did what you suggested, and here is the new server log:

http://kempelen.ii.fmph.uniba.sk/dbreport/local_glassfish_server_log_created_with_new_Netbeans.txt

and the project:

http://kempelen.ii.fmph.uniba.sk/dbreport/GlassDB2.zip

at least now we know we do not have to reinstall the Linux server to try to tackle the issue.
Comment 52 Quality Engineering 2015-05-13 02:55:06 UTC
Integrated into 'main-silver', will be available in build *201505130001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/547e9ea5d5dc
User: Petr Hejl <phejl@netbeans.org>
Log: #233481 - [74cat] Cannot deploy module accessing SQL Server to GlassFish 4.0
Comment 53 Petr Hejl 2015-05-13 12:45:30 UTC
PavelInNetbeans can you test with 201505130001 dev build? I've just realized that you were testing with 8.0 where there was a bug possibly fixed by Tomas and later you have tested the dev build yet without my fix for app scoped resources.

I've just tested your scenarion from scratch including creation of mysqldb and everything worked perfectly with 201505130001 dev build.
Comment 54 Petr Hejl 2015-05-13 12:50:43 UTC
I have also tested the old setup without application scoped resources (glassfish-resources.xml in setup folder, presistence unit without java:app/ prefix) and it worked for me as well. Using dev build and local GF 4.1.
Comment 55 Petr Hejl 2015-05-13 12:52:00 UTC
Created attachment 153630 [details]
test project with app scoped resources

My test setup for reference.
Comment 56 PavelInNetbeans 2015-05-13 14:17:57 UTC
Have you tried on Windows?
Comment 57 Javi12 2015-05-13 18:06:18 UTC
Product Version: NetBeans IDE 8.0.2 (Build 201411181905)
Updates: NetBeans IDE is updated to version NetBeans 8.0.2 Patch 1
Java: 1.8.0_45; Java HotSpot(TM) 64-Bit Server VM 25.45-b02
Runtime: Java(TM) SE Runtime Environment 1.8.0_45-b14
System: Mac OS X version 10.10.3 running on x86_64; UTF-8; en_US (nb)
GlassFish Server 4.1

Same issue with a wizard generated Web Application + RESTsful Web Services from Database.

As explained in http://docs.oracle.com/cd/E18930_01/html/821-2417/giydj.html
I know this doc is about GF 3.1 but seems to apply to 4.1:

Deployment Descriptor. An application-scoped resource is defined in the glassfish-resources.xml deployment descriptor file. This file is placed in the META-INF directory of the module or application archive. For web applications or modules, this file is placed in the WEB-INF directory.

According to this description, I moved manually the glassfish-resources.xml from setup/ directory to web/WEB-INF

Then, the solution can be 1) The wizard RESTsful Web Services from Database detects it is working on a Web Application and places the glassfish-resources.xml in web/WEB-INF folder or 2) the deployment task takes care of this.
Comment 58 PavelInNetbeans 2015-05-13 19:57:21 UTC
Downloaded Netbeans version from today (may13) and did the following:

1. deploying the project created yesterday on remote server:
Exception while preparing the app : Invalid resource : jdbc/dbglass__pm

2. deploying at local Glassfish: same outcome.

BTW. I get the following warning during build, not sure what this means:

warning: Supported source version 'RELEASE_6' from annotation processor 'org.eclipse.persistence.internal.jpa.modelgen.CanonicalModelProcessor' less than -source '1.8'

3. Trying with your linked project:

It works, deploy OK!!!

4. Looking at the differences between the projects, and here it is:

The "java:app/" prefix should only appear in persistence.xml.
The same identifiers "jdbc/glassDB" should not be prefixed with
"java:app/" in the attributes "jndi-name" and "pool-name" in 
the tag jdbc-resource in file glassfish-resources.xml. 

5. making this only change also in my project from yesterday:

Yes, it works, deploy OK! 
(then I get some transaction error when running, but
that is something completely different I suppose, not related, not bug).

Thanks for the help!. 

I should also try 
1. if project created in this may13 version of Netbeans will behave ok automatically without manual edit of persistence.xml and
2. if this manual change will fix the issue also in usual Netbeans, 
older than from today.

Will report here later.
Comment 59 PavelInNetbeans 2015-05-13 20:13:59 UTC
Answer to question #1 from previous post:

yes, doing exactly the same steps in Netbeans version from May 13 as was done in version from May 12 results in different outcome:

version May 12: deploy unsuccessful, Exception in server log
version May 13: deploy OK, application launched

thanks.
Comment 60 Petr Hejl 2015-05-13 20:45:45 UTC
(In reply to Javi12 from comment #57)
> Then, the solution can be 1) The wizard RESTsful Web Services from Database
> detects it is working on a Web Application and places the
> glassfish-resources.xml in web/WEB-INF folder or 2) the deployment task
> takes care of this.
Both cases are implemented though there were bugs obviously. Please test with the latest build.
Comment 61 Petr Hejl 2015-05-13 21:08:40 UTC
(In reply to PavelInNetbeans from comment #58)
> 4. Looking at the differences between the projects, and here it is:
> 
> The "java:app/" prefix should only appear in persistence.xml.
> The same identifiers "jdbc/glassDB" should not be prefixed with
> "java:app/" in the attributes "jndi-name" and "pool-name" in 
> the tag jdbc-resource in file glassfish-resources.xml. 
> 
Thanks a lot for all your testing! However I'm bit confused. In case the resources are app scoped (in WEB-INF) the java:app/ prefix in glassfish-resources.xml is optional and harmless - if it is not there GF prefixes it automatically. I've just tested that and it works with resource jndi name and pool name prefixed or not prefixed. The only case where it does not work for me is when there is unprefixed resource name in persistence.xml. Can you share the project from yesterday you refer to? Thanks a lot.
Comment 62 PavelInNetbeans 2015-05-13 21:30:04 UTC
...and for completeness, the answer to question 2 from comment#58:

- no, with the currently officially available Netbeans 8.0.2,
  prepending the jta-data-source in persistence.xml with java:app/ results in:
   
     Exception while preparing the app : Invalid resource : { ResourceInfo : (jndiName=java:app/jdbc/glassdb4__pm), (applicationName=glassdb4) }

Thus the only workaround that worked for me for the officially released Netbeans is in comment#32.

Hoping for a new official release soon as this has serious impact on using ORM for many JavaEE learners. In fact, we were stuck on this for several months. Have a nice day.
Comment 63 PavelInNetbeans 2015-05-13 21:47:52 UTC
(In reply to Petr Hejl from comment #61)
> (In reply to PavelInNetbeans from comment #58)
> > 4. Looking at the differences between the projects, and here it is:
> > 
> > The "java:app/" prefix should only appear in persistence.xml.
> > The same identifiers "jdbc/glassDB" should not be prefixed with
> > "java:app/" in the attributes "jndi-name" and "pool-name" in 
> > the tag jdbc-resource in file glassfish-resources.xml. 
> > 
> Thanks a lot for all your testing! However I'm bit confused. In case the
> resources are app scoped (in WEB-INF) the java:app/ prefix in
> glassfish-resources.xml is optional and harmless - if it is not there GF
> prefixes it automatically. I've just tested that and it works with resource
> jndi name and pool name prefixed or not prefixed. The only case where it
> does not work for me is when there is unprefixed resource name in
> persistence.xml. Can you share the project from yesterday you refer to?
> Thanks a lot.

You are right, that's really funny, but when I ran the old project after install of May13 version, it could not deploy, I editted based on the difference I found, and then it did deploy in May13 version. 

Obviously, I did rebuild the project in point 1 and 2 in comment#58, and really the only change I made was as mentioned, but now putting it back still leads to a running project. 

I suppose the rebuild in step 1 and 2 did not rebuild everything until there was a modification in that source xml file (?).

Not sure what happened, but I confirm: yes when the prefix "java:app/" is in glassfish-resources.xml in front of both the jndi resource and pool, it  deploys and runs ok. So this falsifies the inductive conclusions made in pt.4 of comment#58, thanks.
Comment 64 PavelInNetbeans 2015-05-13 21:59:44 UTC
And a final note on pt.5 in comment#58 about that transaction problem: it was only due to the missing name="glassfish" (capitalization difference!) in @Table annotation.
In fact this is also a sort of bug, because that annotation was done through wizzard (Entity class from database), so the wizzard should have noticed the capitalization difference in the table name and should have added the name="glassfish" attribute to the @Table association (it only made 
@Table(catalog = "glassfish", schema = "")
which was not sufficient, and there was an error in server.log that table named GLASSFISH was not found. But that is all another story, and after all one should not expect too much from a wizzard. 

So all in all, if I understand of what happened in the fix: 
There were two problems:
1. wizzard placing the glassfish-resources.xml in a different folder 
2. missing java:app/ in persistence.xml
Many thanks for fixing it.
Comment 65 Petr Hejl 2015-05-15 07:49:16 UTC
(In reply to PavelInNetbeans from comment #64)
> And a final note on pt.5 in comment#58 about that transaction problem: it
> was only due to the missing name="glassfish" (capitalization difference!) in
> @Table annotation.
> In fact this is also a sort of bug, because that annotation was done through
> wizzard (Entity class from database), so the wizzard should have noticed the
> capitalization difference in the table name and should have added the
> name="glassfish" attribute to the @Table association (it only made 
> @Table(catalog = "glassfish", schema = "")
> which was not sufficient, and there was an error in server.log that table
> named GLASSFISH was not found. But that is all another story, and after all
> one should not expect too much from a wizzard.
I believe I saw this already reported but IIRC it was not really easy to fix.

> 
> So all in all, if I understand of what happened in the fix: 
> There were two problems:
> 1. wizzard placing the glassfish-resources.xml in a different folder 
> 2. missing java:app/ in persistence.xml
> Many thanks for fixing it.
I'm glad it works now. Thanks for your help. Closing as fixed. Others please verify as well.
Comment 66 amlesas 2015-05-18 13:19:48 UTC
Hi,
Unfortunately, the last built loaded on may 12, 2015 was not working yet :(
I have 25 students not convinced about Nebtbeans and they choose another way (not so easy and not professional as well) but it was a good way to identify students who are enough invested to understand the underlying technology.
Hopping next time, I will be able to propose Netbeans as IDE.
Many thanks for your work.
Regards,
Anne-Marie
Comment 67 ricg 2015-05-20 21:18:20 UTC
Anne-Marie, can you try the 13 May version (see comment 59)?
Comment 68 Quality Engineering 2015-05-21 03:16:57 UTC
Integrated into 'main-silver', will be available in build *201505210001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/abcbf6ca434c
User: Petr Hejl <phejl@netbeans.org>
Log: #233481 - [74cat] Cannot deploy module accessing SQL Server to GlassFish 4.0
Comment 69 ricg 2015-06-03 06:24:39 UTC
I have just tried and it is better but not perfect.

If I reproduce the procedure written in the attachment "Procedure to reproduce the problem", the jndi-name used in glassfish-resources.xml and persistence.xml (both generated automatically by NetBeans) is prefixed with **java:module** and I receive this error message when I deploy the project : 
org.glassfish.deployment.common.DeploymentException: Failue while processing glassfish-resources.xml(s) in the archive  -- Resource [ java:module/jdbc/TestBugResource-glassfish ] is not allowed to specify the scope [ java:module/ ]. Acceptable scope for this resource is [ java:app/ ]
	at org.glassfish.resources.admin.cli.ResourcesXMLParser.getScopedName(ResourcesXMLParser.java:529)
...

No error during the deployment if I replace java:module by java:app in both files.
Comment 70 Petr Hejl 2015-06-03 08:02:12 UTC
(In reply to ricg from comment #69)
> I have just tried and it is better but not perfect.
> 
> If I reproduce the procedure written in the attachment "Procedure to
> reproduce the problem", the jndi-name used in glassfish-resources.xml and
> persistence.xml (both generated automatically by NetBeans) is prefixed with
> **java:module** and I receive this error message when I deploy the project : 
> org.glassfish.deployment.common.DeploymentException: Failue while processing
> glassfish-resources.xml(s) in the archive  -- Resource [
> java:module/jdbc/TestBugResource-glassfish ] is not allowed to specify the
> scope [ java:module/ ]. Acceptable scope for this resource is [ java:app/ ]
> 	at
> org.glassfish.resources.admin.cli.ResourcesXMLParser.
> getScopedName(ResourcesXMLParser.java:529)
> ...
> 
> No error during the deployment if I replace java:module by java:app in both
> files.

Do you use EAR or WAR/JAR? The trouble is that if it is not prefixed it is being resolved on deployment depending whether it is module inside EAR or standalone app. I guess we will need some user interaction regarding JNDI namespaces.
Comment 71 ricg 2015-06-03 10:16:00 UTC
I created a Web project.

And if you prefixed by java:app (instead of java:module), are there cases where it does not work?
Comment 72 Petr Hejl 2015-06-03 10:35:28 UTC
(In reply to ricg from comment #71)
> I created a Web project.
> 
> And if you prefixed by java:app (instead of java:module), are there cases
> where it does not work?

Unfortunately yes. The web project inside EAR can't define java:app scoped resources.
Comment 73 Petr Hejl 2015-06-03 11:49:56 UTC
Ok, while the GF doc is not clear about that it works this way:
- If module is part of the EAR it can define resource in java:module and must not define resource in java:app
- If module is standalone it can define resource in java:app and must not define resource in java:module.

The trouble is IDE does not know it as the user may deploy the module as part of the EAR or standalone.
Comment 74 Petr Hejl 2015-06-03 14:46:40 UTC
I have changed the default to java:app for now as usage of standalone module is much more common - web-main c7a0ea4b4c46.
Comment 75 Quality Engineering 2015-06-04 02:31:52 UTC
Integrated into 'main-silver', will be available in build *201506040001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/c7a0ea4b4c46
User: Petr Hejl <phejl@netbeans.org>
Log: #233481 - [74cat] Cannot deploy module accessing SQL Server to GlassFish 4.0
Comment 76 Petr Hejl 2015-06-10 13:14:01 UTC
I have improved heuristic of determining the default namespace - web-main cc705aac08b7.
Comment 77 Quality Engineering 2015-06-11 02:40:06 UTC
Integrated into 'main-silver', will be available in build *201506110001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/cc705aac08b7
User: Petr Hejl <phejl@netbeans.org>
Log: #233481 - [74cat] Cannot deploy module accessing SQL Server to GlassFish 4.0
Comment 78 Petr Hejl 2015-06-11 09:53:26 UTC
One more improvement b3944dddef3d.
Comment 79 Petr Hejl 2015-06-11 14:38:01 UTC
Hopefully good enough fix - web-main fe7bd1e23fec.
Comment 80 Quality Engineering 2015-06-12 20:35:52 UTC
Integrated into 'main-silver', will be available in build *201506121907* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/b3944dddef3d
User: Petr Hejl <phejl@netbeans.org>
Log: #233481 - [74cat] Cannot deploy module accessing SQL Server to GlassFish 4.0
Comment 81 manikantannaren 2015-09-15 04:38:09 UTC
I believe it is not fixed. I faced the same problem when following this tutorial steps. https://netbeans.org/kb/docs/web/mysql-webapp.html


After step 7 in section Preparing Communication between the Application and Database where we check the resources tree in Glassfish, I don't see the web application defined data source and connection pool.

I then use teh asadmin to deploy those resources and then I could see the resources.
Comment 82 manikantannaren 2015-09-15 04:39:19 UTC
Sorry forgot to add environment details
Product Version: NetBeans IDE Dev (Build 201509140002)
Java: 1.8.0_60-ea; Java HotSpot(TM) 64-Bit Server VM 25.60-b23
Runtime: Java(TM) SE Runtime Environment 1.8.0_60-ea-b25
System: Mac OS X version 10.10.5 running on x86_64; UTF-8; en_US (nb)
Comment 83 Petr Hejl 2015-09-15 14:56:19 UTC
(In reply to manikantannaren from comment #81)
> I believe it is not fixed. I faced the same problem when following this
> tutorial steps. https://netbeans.org/kb/docs/web/mysql-webapp.html
> 
> 
> After step 7 in section Preparing Communication between the Application and
> Database where we check the resources tree in Glassfish, I don't see the web
> application defined data source and connection pool.

These are now application scoped (placed in WEB-INF) and thus not visible in the tree although they are deployed successfully. I filed issue #255304.