quick note on basic portal installation

[email protected] Tue, 19 Nov 2002 18:08:21 +0000 (UTC)
Newsgroups gmane.comp.web.mvc.devel
Organization Basebeans.com
Message-ID <Pine.LNX.4.44.0211191258040.24894-100000__13443.2382802062$1037735382@haroon.sis.utoronto.ca>
Hi there,To: [email protected]

Just a quick note about the installation of basic portal. To give you some background, I have just started tinkering with MVC and recently installed basic portal to get some more experience. Nothing like a working example. Kudos to Vic and the rest of the contributors. Greatly appreciated.To: [email protected]

My note is related to the postgres installation actually. Initial symptom was that upon entry I was getting a "[Exception in:/do/contentLstModule] null" displayed. Upon further investigation I found out that my tomcat/logs/catalina.out had the following exception:To: [email protected]

DEBUG [Thread-5] (BasicDAOImpl.java:98) - URL:jdbc:postgresql:net//localhost:5432/basicportalDEBUG [Thread-5] (BasicDAOImpl.java:99) - User:xxxxxxDEBUG [Thread-5] (BasicDAOImpl.java:100) - password:xxxxxxDEBUG [Thread-5] (BasicDAOImpl.java:101) - driver:org.sourceforge.jxdbcon.JXDBConDriverBBug ***java.lang.RuntimeException: An I/O error occured: java.net.ConnectException: Connection refusedTo: [email protected]

End result was that postgres was not setup to accept TCP/IP connections. My Linux system is Gentoo and the default install doesn't allow TCP/IP connection and you have to manually enable it. To enable it, you have to make sure that the startup options includes a "-i" option. (For your Linux system, you could look in /etc/init.d/postgres if that's where you start the db from. In my case all options are separate from init scripts in /etc/conf.d/postgres)To: [email protected]

On another note, here's some code to test your connection to the postgres database.To: [email protected]

import java.sql.*;To: [email protected]

public class postgres {    public static void main(String[] args) {        System.out.println("trying...");        try {            String url = new                String("jdbc:postgresql:net//localhost:5432/basicportal");            String usr = new String("xxxxxx");            String pwd = new String("xxxxxx"); //postgres usr/password            System.out.println("finding driver...");            Class.forName("org.sourceforge.jxdbcon.JXDBConDriver");            System.out.println("creating driverManager...");            Connection db = DriverManager.getConnection(url,usr,pwd);            System.out.println("creating statement...");            Statement st = db.createStatement();            System.out.println("executing query...");            ResultSet rs = st.executeQuery("select * from base_content");            System.out.println("looping data...");            while(rs.next()) {                System.out.print("Column 1 returned ");                System.out.println(rs.g
 
 etString(1));            }            System.out.println("loop finished, closing connection");            rs.close();            st.close();        }        catch( Exception e) {            System.out.println("Exception encountered: " + e);        }    }}To: [email protected]

Regards,--Haroon Rafique<[email protected]>To: [email protected]

_______________________________________________
MVC-Programmers mailing list
[email protected]
http://www.netbean.net/mailman/listinfo/mvc-programmers

To unsubscribe from this group, send an email to:
[email protected]

 

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/