reset password
Author Message
pateln04
Posts: 22
Posted 17:02 Oct 03, 2010 |

Whn building the project i get the following exception...

 

Cannot load JDBC driver class 'org.postgresql.Driver'

It is my understanding we do not  need to install Postgresql.  I am doing something wrong.  I also added the driver to the lib folder in the tomcat installation path.  Any advice would help

 

Thanks

cysun
Posts: 2935
Posted 17:13 Oct 03, 2010 |

For this class you should install PostgreSQL on your computer. Although it's not absolutely necessary, it makes development a lot more efficient.

And you need to put the driver in the Tomcat lib folder before you add the server runtime in Eclipse. If you did it after, just remove the server runtime then add it again.

pateln04
Posts: 22
Posted 17:28 Oct 03, 2010 |

I removed the server runtime then added it again.  The program compiles but I get a runtime error

 

An unexpected runtime error has occurred, which is quite unfortunate really. But rest assured. The site administrator has been notified and the problem will be resolved shortly (or so we hope).  Is this a config error in the build.xml or something else.

 

Thanks, Neal

cysun
Posts: 2935
Posted 17:38 Oct 03, 2010 |

Check the log file.

pateln04
Posts: 22
Posted 18:40 Oct 05, 2010 |

Tried putting PostgreSQL on my own machine but no luck.  So now going to use the http://cs3.calstatela.edu/phpmyadmin but I have no privelages to create a database.  I am doing something wrong.

pateln04
Posts: 22
Posted 21:36 Oct 05, 2010 |

2010-10-05 21:33:44,453  INFO HomeController: Username: guest, Role: ROLE_GUEST
2010-10-05 21:33:44,500  WARN JDBCExceptionReporter: SQL Error: 0, SQLState: null
2010-10-05 21:33:44,500 ERROR JDBCExceptionReporter: Cannot create PoolableConnectionFactory (FATAL: password authentication failed for user "cysun")
2010-10-05 21:33:44,500  WARN JDBCExceptionReporter: SQL Error: 0, SQLState: null
2010-10-05 21:33:44,500 ERROR JDBCExceptionReporter: Cannot create PoolableConnectionFactory (FATAL: password authentication failed for user "cysun")
2010-10-05 21:33:44,500 ERROR ExceptionResolver: Exception caused by user guest
2010-10-05 21:33:44,500 ERROR ExceptionResolver: Hibernate operation: Cannot open connection; uncategorized SQLException for SQL [???]; SQL state [null]; error code [0]; Cannot create PoolableConnectionFactory (FATAL: password authentication failed for user "cysun"); nested exception is org.apache.commons.dbcp.SQLNestedException: Cannot create PoolableConnectionFactory (FATAL: password authentication failed for user "cysun")
2010-10-05 21:33:44,500 ERROR ExceptionResolver: org.springframework.jdbc.UncategorizedSQLException: Hibernate operation: Cannot open connection; uncategorized SQLException for SQL [???]; SQL state [null]; error code [0]; Cannot create PoolableConnectionFactory (FATAL: password authentication failed for user "cysun"); nested exception is org.apache.commons.dbcp.SQLNestedException: Cannot create PoolableConnectionFactory (FATAL: password authentication failed for user "cysun")
 at org.springframework.jdbc.support.SQLStateSQLExceptionTranslator.translate(SQLStateSQLExceptionTranslator.java:124)
 at org.springframework.jdbc.support.SQLErrorCodeSQLExceptionTranslator.translate(SQLErrorCodeSQLExceptionTranslator.java:322)
 at org.springframework.orm.hibernate3.HibernateAccessor.convertJdbcAccessException(HibernateAccessor.java:424)
 at org.springframework.orm.hibernate3.HibernateAccessor.convertHibernateAccessException(HibernateAccessor.java:410)
 at org.springframework.orm.hibernate3.HibernateTemplate.doExecute(HibernateTemplate.java:424)
 at org.springframework.orm.hibernate3.HibernateTemplate.executeWithNativeSession(HibernateTemplate.java:374)
 at org.springframework.orm.hibernate3.HibernateTemplate.find(HibernateTemplate.java:917)
 at org.springframework.orm.hibernate3.HibernateTemplate.find(HibernateTemplate.java:913)
 at csns.model.dao.hibernate.NewsDaoImpl.getNews(NewsDaoImpl.java:32)
 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
 at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
 at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
 at java.lang.reflect.Method.invoke(Unknown Source)
 at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:310)
 at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182)
 at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149)
 at org.springframework.security.intercept.method.aopalliance.MethodSecurityInterceptor.invoke(MethodSecurityInterceptor.java:66)
 at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
 at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
 at $Proxy10.getNews(Unknown Source)
 at csns.spring.controller.NewsController.handleRequestInternal(NewsController.java:32)
 at org.springframework.web.servlet.mvc.AbstractController.handleRequest(AbstractController.java:153)
 at org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter.handle(SimpleControllerHandlerAdapter.java:48)
 at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:875)
 at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:809)
 at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:571)
 at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:501)
 at javax.servlet.http.HttpServlet.service(HttpServlet.java:617)
 at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
 at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
 at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
 at org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:359)
 at org.springframework.security.intercept.web.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:109)
 at org.springframework.security.intercept.web.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:83)
 at org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:371)
 at org.springframework.security.ui.ExceptionTranslationFilter.doFilterHttp(ExceptionTranslationFilter.java:101)
 at org.springframework.security.ui.SpringSecurityFilter.doFilter(SpringSecurityFilter.java:53)
 at org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:371)
 at org.springframework.security.providers.anonymous.AnonymousProcessingFilter.doFilterHttp(AnonymousProcessingFilter.java:105)
 at org.springframework.security.ui.SpringSecurityFilter.doFilter(SpringSecurityFilter.java:53)
 at org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:371)
 at org.springframework.security.ui.AbstractProcessingFilter.doFilterHttp(AbstractProcessingFilter.java:268)
 at org.springframework.security.ui.SpringSecurityFilter.doFilter(SpringSecurityFilter.java:53)
 at org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:371)
 at org.springframework.security.context.HttpSessionContextIntegrationFilter.doFilterHttp(HttpSessionContextIntegrationFilter.java:235)
 at org.springframework.security.ui.SpringSecurityFilter.doFilter(SpringSecurityFilter.java:53)
 at org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:371)
 at org.springframework.security.util.FilterChainProxy.doFilter(FilterChainProxy.java:174)
 at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:236)
 at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:167)
 at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
 at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
 at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
 at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
 at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
 at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
 at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
 at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)
 at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:857)
 at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588)
 at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
 at java.lang.Thread.run(Unknown Source)
Caused by: org.apache.commons.dbcp.SQLNestedException: Cannot create PoolableConnectionFactory (FATAL: password authentication failed for user "cysun")
 at org.apache.commons.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:1225)
 at org.apache.commons.dbcp.BasicDataSource.getConnection(BasicDataSource.java:880)
 at org.springframework.orm.hibernate3.LocalDataSourceConnectionProvider.getConnection(LocalDataSourceConnectionProvider.java:82)
 at org.hibernate.jdbc.ConnectionManager.openConnection(ConnectionManager.java:423)
 at org.hibernate.jdbc.ConnectionManager.getConnection(ConnectionManager.java:144)
 at org.hibernate.jdbc.AbstractBatcher.prepareQueryStatement(AbstractBatcher.java:139)
 at org.hibernate.loader.Loader.prepareQueryStatement(Loader.java:1547)
 at org.hibernate.loader.Loader.doQuery(Loader.java:673)
 at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:236)
 at org.hibernate.loader.Loader.doList(Loader.java:2213)
 at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2104)
 at org.hibernate.loader.Loader.list(Loader.java:2099)
 at org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:378)
 at org.hibernate.hql.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:338)
 at org.hibernate.engine.query.HQLQueryPlan.performList(HQLQueryPlan.java:172)
 at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1121)
 at org.hibernate.impl.QueryImpl.list(QueryImpl.java:79)
 at org.springframework.orm.hibernate3.HibernateTemplate$30.doInHibernate(HibernateTemplate.java:926)
 at org.springframework.orm.hibernate3.HibernateTemplate.doExecute(HibernateTemplate.java:419)
 ... 57 more
Caused by: org.postgresql.util.PSQLException: FATAL: password authentication failed for user "cysun"
 at org.postgresql.core.v3.ConnectionFactoryImpl.doAuthentication(ConnectionFactoryImpl.java:291)
 at org.postgresql.core.v3.ConnectionFactoryImpl.openConnectionImpl(ConnectionFactoryImpl.java:108)
 at org.postgresql.core.ConnectionFactory.openConnection(ConnectionFactory.java:66)
 at org.postgresql.jdbc2.AbstractJdbc2Connection.<init>(AbstractJdbc2Connection.java:125)
 at org.postgresql.jdbc3.AbstractJdbc3Connection.<init>(AbstractJdbc3Connection.java:30)
 at org.postgresql.jdbc3.Jdbc3Connection.<init>(Jdbc3Connection.java:24)
 at org.postgresql.Driver.makeConnection(Driver.java:393)
 at org.postgresql.Driver.connect(Driver.java:267)
 at org.apache.commons.dbcp.DriverConnectionFactory.createConnection(DriverConnectionFactory.java:38)
 at org.apache.commons.dbcp.PoolableConnectionFactory.makeObject(PoolableConnectionFactory.java:294)
 at org.apache.commons.dbcp.BasicDataSource.validateConnectionFactory(BasicDataSource.java:1247)
 at org.apache.commons.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:1221)
 ... 75 more

Last edited by pateln04 at 21:37 Oct 05, 2010.
cysun
Posts: 2935
Posted 23:09 Oct 05, 2010 |
pateln04 wrote:

Tried putting PostgreSQL on my own machine but no luck.  So now going to use the http://cs3.calstatela.edu/phpmyadmin but I have no privelages to create a database.  I am doing something wrong.

You are not supposed to create new databases on CS3. Each CS3 account already has a database associated with it. The database name is the same as the account name. You need to use that database.

pateln04
Posts: 22
Posted 10:54 Oct 06, 2010 |

So I went back to installing the db on my local machine.  I removed the ant builder and created another one once i changed the build.xml to reflect my username and password.  I also removed the tomcat server then placed the postgres driver in the lib folder of tomcat.  Ran my program which loads to the index page with The runtime error message appears.  Checked the log and still Cannot load JDBC driver class 'org.postgresql.Driver'.  The driver I downloaded is postgresql-8.4-702.jdbc3.  Is this the right version or do I need another one (or does it even matter).  I am running tomcat-6.0.28.  I am attaching my logs

Attachments:
cysun
Posts: 2935
Posted 12:26 Oct 06, 2010 |
pateln04 wrote:

So I went back to installing the db on my local machine.  I removed the ant builder and created another one once i changed the build.xml to reflect my username and password.  I also removed the tomcat server then placed the postgres driver in the lib folder of tomcat.  Ran my program which loads to the index page with The runtime error message appears.  Checked the log and still Cannot load JDBC driver class 'org.postgresql.Driver'.  The driver I downloaded is postgresql-8.4-702.jdbc3.  Is this the right version or do I need another one (or does it even matter).  I am running tomcat-6.0.28.  I am attaching my logs

The jar file should be OK. If you added the tomcat server runtime in Eclipse after you placed the jar file in the tomcat lib folder, it should work.

If it's on a laptop, you can bring it to my office hours and I'll have a look.