posted 10 years ago
I had the same problem(I using NetBeans7.4 + glassfish4), and after experiencing painful and trying for some time, I solved this issue in the end.
update file name AffableBean->Server Resources->sun-resources.xml to glassfish-resource.xml, and using the following to replace the content of xml.
the resource-ref is for my local jdbc connector, you may need to change to yours.
<resources>
<jdbc-resource enabled="true" jndi-name="jdbc/affablebean" object-type="user" pool-name="AffableBeanPool">
<description/>
</jdbc-resource>
<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="table" 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="AffableBeanPool" non-transactional-connections="false" ping="false" pool-resize-quantity="2" pooling="true" res-type="javax.sql.DataSource" 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="true">
<property name="URL" value="jdbc:mysql://localhost:3306/affablebean?zeroDateTimeBehavior=convertToNull"/>
<property name="User" value="root"/>
<property name="Password" value="xxxx"/>
</jdbc-connection-pool>
</resources>
Hope it will help.