Monday, January 21, 2013

Glassfish - Application Server


What is JNDI?
The Java Naming and Directory Interface (JNDI) is a Java API for a directory service that allows Java software clients to discover and look up data and objects via a name. 

File Structure:
/
 - /root
 - /home/glassfish

Commands:
cd ~ -> /root
cd ~glassfish -> /home/glassfish
cd home (and then) cd glassfish -> /home/glassfish


Start/restart/stop-server
[ec2-user@ip-10-195-17-79 ~]$ sudo su -
[root@ip-10-195-17-79 ~]# cd ~glassfish
[root@ip-10-195-17-79 glassfish]# su glassfish
[glassfish@ip-10-195-17-79 ~]$ cd /usr/share/glassfish3/bin
[glassfish@ip-10-195-17-79 bin]$ ls
asadmin  asadmin.bat  pkg  pkg.bat  updatetool  updatetool.bat
[glassfish@ip-10-195-17-79 bin]$ ./asadmin
Use "exit" to exit and "help" for online help.
asadmin> start-domain
Waiting for domain1 to start .....

Or

[ec2-user@ip-10-195-17-79 ~]$ sudo su -
[root@ip-10-195-17-79 ~]#service glassfish start

shut down
[ec2-user@ip-10-195-17-79 ~]$ sudo service glassfish stop  //have to add glassfish as a service first. POdcast 12.


Got a problem that I cannot ping the Postgres DB from Glassfish.
Solution: restart glassfish to load the new-downloaded JDBC.

Creating a Connection Pool to PostgreSQL on Glassfish V3

http://www.hildeberto.com/2010/02/creating-connection-pool-to-postgresql.html


The Java Naming and Directory Interface (JNDI) is a Java API for a directory service that allows Java software clients to discover and look up data and objects via a name.
Application in glassfish can use this Name to access to Database.

No comments:

Post a Comment