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.
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. :-
Created attachment 158904 [details] successful Resources printscreen
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 ***