users@glassfish.java.net

Re: Glassfish, MySQL and _at_Resource

From: Shalini Muthukrishnan <Shalini.Muthukrishnan_at_Sun.COM>
Date: Mon, 09 Jun 2008 15:38:01 +0530

Hi,

Has this resource "jdbc/__MysqlPool" been created via the administration
console or if you are using an IDE like netbeans,
it got created while application is deployed?
The sun-resources.xml file in the project would have the entries for
creation of this resource and its pool.

Regards
Shalini.

glassfish_at_javadesktop.org wrote:
> Hello.
>
> Creating a simple Servlet to check if my db-connection for mysql is ok.
> I did download the latest Connector from Mysql which is Connector /J 5.1
> Copying the jar:file to the C:\app\glassfish\domains\domain1\lib\ext-directory.
>
> I seem to get a NullPointerException running the below code,
> datasource is never set, it is null .... Do I have to do anything special to get the DI-working ?
> My JAVA_HOME is set to: C:\Program Files\Java\jdk1.6.0_03
>
> public class JDBCSelectServlet extends javax.servlet.http.HttpServlet {
> @Resource(name="jdbc/__MysqlPool")
> private DataSource dataSource;
>
> Hope that you can give me a hand.
>
> reagards, i
> [Message sent by forum member 'invergilius' (invergilius)]
>
> http://forums.java.net/jive/thread.jspa?messageID=279021
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_glassfish.dev.java.net
> For additional commands, e-mail: users-help_at_glassfish.dev.java.net
>
>