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 258415 - Deployment not complete - JDBC Resource and Connection Pool not created
Summary: Deployment not complete - JDBC Resource and Connection Pool not created
Status: RESOLVED DUPLICATE of bug 255304
Alias: None
Product: serverplugins
Classification: Unclassified
Component: GlassFish (show other bugs)
Version: 8.1
Hardware: PC Windows 10 x64
: P2 normal (vote)
Assignee: Petr Hejl
URL: https://netbeans.org/kb/docs/web/mysq...
Keywords:
Depends on:
Blocks:
 
Reported: 2016-03-17 09:56 UTC by robert.uhrik
Modified: 2016-05-17 10:28 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
successful Resources printscreen (29.36 KB, image/jpeg)
2016-03-17 10:00 UTC, robert.uhrik
Details

Note You need to log in before you can comment on or make changes to this bug.
Description robert.uhrik 2016-03-17 09:56:48 UTC
https://netbeans.org/kb/docs/web/mysql-webapp.html

Product Version = NetBeans IDE 8.1 (Build 201510222201)
Operating System = Windows 10 version 10.0 running on amd64
Java; VM; Vendor = 1.8.0_66
Runtime = Java HotSpot(TM) 64-Bit Server VM 25.66-b18

Reproducibility: Happens every time

STEPS:
 Follow instructions to create simple web-app
 On section "Setting up a JDBC data source and connection pool" - part "Deploy application"

ACTUAL:
  no JDBC Resource and Connection Pool are created

EXPECTED:
  should be created...

HOW TO GET IT WORKING:

glassfish-resources.xml should have this content:
--------------------------------------------------

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE resources PUBLIC "-//GlassFish.org//DTD GlassFish Application Server 3.1 Resource Definitions//EN" "http://glassfish.org/dtds/glassfish-resources_1_5.dtd">
<resources>
    <jdbc-connection-pool allow-non-component-callers="false" associate-with-thread="false" connection-creation-retry-attempts="0" connection-creation-retry-interval-in-seconds="10" connection-leak-reclaim="false" connection-leak-timeout-in-seconds="0" connection-validation-method="auto-commit" datasource-classname="com.mysql.jdbc.jdbc2.optional.MysqlDataSource" fail-all-connections="false" idle-timeout-in-seconds="300" is-connection-validation-required="false" is-isolation-level-guaranteed="true" lazy-connection-association="false" lazy-connection-enlistment="false" match-connections="false" max-connection-usage-count="0" max-pool-size="32" max-wait-time-in-millis="60000" name="IfpwafcadPool" non-transactional-connections="false" ping="false" pool-resize-quantity="2" pooling="true" res-type="javax.sql.ConnectionPoolDataSource" statement-cache-size="0" statement-leak-reclaim="false" statement-leak-timeout-in-seconds="0" statement-timeout-in-seconds="-1" steady-pool-size="8" validate-atmost-once-period-in-seconds="0" wrap-jdbc-objects="false">
        <description> Accesses the database that provides data for the IFPWAFCAD application</description>
        <property name="URL" value="jdbc:mysql://localhost:3306/MyNewDatabase?zeroDateTimeBehavior=convertToNull"/>
        <property name="User" value="username"/>
        <property name="Password" value="password"/>
    </jdbc-connection-pool>
    <jdbc-resource enabled="true" jndi-name="jdbc/IFPWAFCAD" object-type="user" pool-name="IfpwafcadPool">
        <description>Accesses the database that provides data for the IFPWAFCAD application</description>
    </jdbc-resource>
</resources>

--------------------------------------------------
and after that You should run CMD and navigate to Glassfish bin folder:
or Shift+Right Mouse Click on bin folder in explorer and select "Open CMD here" or similar:

C:\Program Files\glassfish-4.1.1\bin>

then type "asadmin" and enter

then type "add-resources "d:\WWW\NETBEANS\Projects\IFPWAFCAD\web\WEB-INF\glassfish-resources.xml" and enter

where "d:\WWW\NETBEANS\Projects..." is the path to projects folder from NetBeans IDE

this should be outputed:

JDBC connection pool IfpwafcadPool created successfully.
JDBC resource jdbc/IFPWAFCAD created successfully.
Command add-resources executed successfully.

After this You have JDBC Resource and Connection pool created.

Don't change order of
<jdbc-connection-pool...
<jdbc-resource...

in the XML file, because RESOURCE depends on POOL [or run it two times :-) ]

My system is based on XAMPP (latest) with MySQL DB engine. Hope helps all people like Me. :-
Comment 1 robert.uhrik 2016-03-17 10:00:57 UTC
Created attachment 158904 [details]
successful Resources printscreen
Comment 2 Petr Hejl 2016-05-17 10:28:29 UTC
You can check with ./asadmin list-applications --resources --subcomponents. Otherwise I think it is duplicate of issue #255304.

*** This bug has been marked as a duplicate of bug 255304 ***