reset password
Author Message
hibbol
Posts: 20
Posted 17:00 Oct 21, 2010 |

I'm working on creating a new target on build.xml. When I run filetest ant, I have an error, which looks like this,

 

filetest:
     [java] java.lang.NoClassDefFoundError: csns/test/FileTest
     [java] Caused by: java.lang.ClassNotFoundException: csns.test.FileTest
     [java]     at java.net.URLClassLoader$1.run(Unknown Source)
     [java]     at java.security.AccessController.doPrivileged(Native Method)
     [java]     at java.net.URLClassLoader.findClass(Unknown Source)
     [java]     at java.lang.ClassLoader.loadClass(Unknown Source)
     [java]     at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
     [java]     at java.lang.ClassLoader.loadClass(Unknown Source)
     [java] Could not find the main class: csns.test.FileTest.  Program will exit.
     [java] Exception in thread "main"
     [java] Java Result: 1

 

It seems like it works fine with compile, but when I run the class file, it doesn't work. Please give me some clue to solve.


Thanks.

HuanXue
Posts: 34
Posted 17:02 Oct 21, 2010 |

Maybe you haven't modify build.xml, or doesn't create the property path correctly?

hibbol
Posts: 20
Posted 17:26 Oct 21, 2010 |

I'm creating another target called "filetest" to run FileTest.java file on build.xml.

cysun
Posts: 2935
Posted 19:11 Oct 21, 2010 |

If the error message says it cannot find the class, it means the class is not in classpath, and you need to add it to the classpath.

hibbol
Posts: 20
Posted 22:26 Oct 21, 2010 |

Do I need to add also Jar files to make it work? I added the class path, but I got another error,


[java] java.lang.NoClassDefFoundError: org/springframework/core/io/Resource
     [java] Caused by: java.lang.ClassNotFoundException: org.springframework.core.io.Resource
     [java]     at java.net.URLClassLoader$1.run(Unknown Source)
     [java]     at java.security.AccessController.doPrivileged(Native Method)
     [java]     at java.net.URLClassLoader.findClass(Unknown Source)
     [java]     at java.lang.ClassLoader.loadClass(Unknown Source)
     [java]     at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
     [java]     at java.lang.ClassLoader.loadClass(Unknown Source)
     [java] Could not find the main class: csns.test.FileTest.  Program will exit.
     [java] Exception in thread "main"
     [java] Java Result: 1

 

It doesn't find  "import org.springframework.core.io.ClassPathResource;" I disabled that import on FileTest.java and it worked.

How can I get the path of that on build.xml?

Last edited by hibbol at 22:34 Oct 21, 2010.
cysun
Posts: 2935
Posted 08:09 Oct 22, 2010 |
hibbol wrote:

Do I need to add also Jar files to make it work? I added the class path, but I got another error,


[java] java.lang.NoClassDefFoundError: org/springframework/core/io/Resource
     [java] Caused by: java.lang.ClassNotFoundException: org.springframework.core.io.Resource
     [java]     at java.net.URLClassLoader$1.run(Unknown Source)
     [java]     at java.security.AccessController.doPrivileged(Native Method)
     [java]     at java.net.URLClassLoader.findClass(Unknown Source)
     [java]     at java.lang.ClassLoader.loadClass(Unknown Source)
     [java]     at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
     [java]     at java.lang.ClassLoader.loadClass(Unknown Source)
     [java] Could not find the main class: csns.test.FileTest.  Program will exit.
     [java] Exception in thread "main"
     [java] Java Result: 1

 

It doesn't find  "import org.springframework.core.io.ClassPathResource;" I disabled that import on FileTest.java and it worked.

How can I get the path of that on build.xml?

There are actually two questions here:

1. Where is the jar file that contains the library?

2. How do I add jar files to the classpath of an Ant <java> task.

The answer to 1 is WEB-INF/lib, and the answer to 2 is Ant documentation.

hibbol
Posts: 20
Posted 13:49 Oct 22, 2010 |

I added jar files to the classpath of an Ant task. I got another errors and I fixed them. However, at the end, I got the same error again.

  [jar] Building jar: C:\workspace\csns\build\classes\FileTest.jar
     [java] java.lang.NoClassDefFoundError: org/springframework/core/io/Resource
     [java] Caused by: java.lang.ClassNotFoundException: org.springframework.core.io.Resource
     [java]     at java.net.URLClassLoader$1.run(Unknown Source)
     [java]     at java.security.AccessController.doPrivileged(Native Method)
     [java]     at java.net.URLClassLoader.findClass(Unknown Source)
     [java]     at java.lang.ClassLoader.loadClass(Unknown Source)
     [java]     at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
     [java]     at java.lang.ClassLoader.loadClass(Unknown Source)
     [java] Could not find the main class: csns.test.FileTest. Program will exit.
     [java] Exception in thread "main"
     [java] Java Result: 1

 

I still don't know why and what I missed.

Last edited by hibbol at 13:50 Oct 22, 2010.
hibbol
Posts: 20
Posted 01:23 Oct 23, 2010 |

Here is errors I've got so far. Please look at it and tell me what is wrong. I wonder  if it's postgresql driver connection problem or my code I implemented.

 

[java] Cannot load JDBC driver class 'org.postgresql.Driver'
     [java] java.lang.ClassNotFoundException: org.postgresql.Driver
     [java]     at org.apache.tools.ant.AntClassLoader.findClassInComponents(AntClassLoader.java:1400)
     [java]     at org.apache.tools.ant.AntClassLoader.findClass(AntClassLoader.java:1341)
     [java]     at org.apache.tools.ant.AntClassLoader.loadClass(AntClassLoader.java:1094)
     [java]     at java.lang.ClassLoader.loadClass(Unknown Source)
     [java]     at java.lang.Class.forName0(Native Method)
     [java]     at java.lang.Class.forName(Unknown Source)
     [java]     at org.apache.commons.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:1130)
     [java]     at org.apache.commons.dbcp.BasicDataSource.getConnection(BasicDataSource.java:880)
     [java]     at org.springframework.orm.hibernate3.LocalDataSourceConnectionProvider.getConnection(LocalDataSourceConnectionProvider.java:82)
     [java]     at org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:84)
     [java]     at org.hibernate.cfg.Configuration.buildSettings(Configuration.java:2073)
     [java]     at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1298)
     [java]     at org.springframework.orm.hibernate3.LocalSessionFactoryBean.newSessionFactory(LocalSessionFactoryBean.java:814)
     [java]     at org.springframework.orm.hibernate3.LocalSessionFactoryBean.buildSessionFactory(LocalSessionFactoryBean.java:732)
     [java]     at org.springframework.orm.hibernate3.AbstractSessionFactoryBean.afterPropertiesSet(AbstractSessionFactoryBean.java:211)
     [java]     at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1367)
     [java]     at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1333)
     [java]     at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:471)
     [java]     at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:409)
     [java]     at java.security.AccessController.doPrivileged(Native Method)
     [java]     at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:380)
     [java]     at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:264)
     [java]     at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:220)
     [java]     at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:261)
     [java]     at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:185)
     [java]     at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:164)
     [java]     at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:269)
     [java]     at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:104)
     [java]     at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1244)
     [java]     at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1008)
     [java]     at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:470)
     [java]     at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:409)
     [java]     at java.security.AccessController.doPrivileged(Native Method)
     [java]     at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:380)
     [java]     at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:264)
     [java]     at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:220)
     [java]     at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:261)
     [java]     at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:185)
     [java]     at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:164)
     [java]     at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:269)
     [java]     at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:104)
     [java]     at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1244)
     [java]     at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1008)
     [java]     at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:470)
     [java]     at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:409)
     [java]     at java.security.AccessController.doPrivileged(Native Method)
     [java]     at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:380)
     [java]     at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:264)
     [java]     at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:220)
     [java]     at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:261)
     [java]     at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:185)
     [java]     at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:164)
     [java]     at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:269)
     [java]     at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:104)
     [java]     at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1244)
     [java]     at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1008)
     [java]     at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:470)
     [java]     at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:409)
     [java]     at java.security.AccessController.doPrivileged(Native Method)
     [java]     at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:380)
     [java]     at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:264)
     [java]     at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:220)
     [java]     at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:261)
     [java]     at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:185)
     [java]     at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:164)
     [java]     at csns.test.FileTest.main(FileTest.java:51)
     [java]     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
     [java]     at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
     [java]     at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
     [java]     at java.lang.reflect.Method.invoke(Unknown Source)
     [java]     at org.apache.tools.ant.taskdefs.ExecuteJava.run(ExecuteJava.java:217)
     [java]     at org.apache.tools.ant.taskdefs.ExecuteJava.execute(ExecuteJava.java:152)
     [java]     at org.apache.tools.ant.taskdefs.Java.run(Java.java:764)
     [java]     at org.apache.tools.ant.taskdefs.Java.executeJava(Java.java:218)
     [java]     at org.apache.tools.ant.taskdefs.Java.executeJava(Java.java:132)
     [java]     at org.apache.tools.ant.taskdefs.Java.execute(Java.java:105)
     [java] org.springframework.jdbc.UncategorizedSQLException: Hibernate operation: Cannot open connection; uncategorized SQLException for SQL [???]; SQL state [null]; error code [0]; Cannot load JDBC driver class 'org.postgresql.Driver'; nested exception is org.apache.commons.dbcp.SQLNestedException: Cannot load JDBC driver class 'org.postgresql.Driver'
     [java]     at org.apache.tools.ant.taskdefs.ExecuteJava.execute(ExecuteJava.java:194)
     [java]     at org.apache.tools.ant.taskdefs.Java.run(Java.java:764)
     [java]     at org.apache.tools.ant.taskdefs.Java.executeJava(Java.java:218)
     [java]     at org.apache.tools.ant.taskdefs.Java.executeJava(Java.java:132)
     [java]     at org.apache.tools.ant.taskdefs.Java.execute(Java.java:105)
     [java]     at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:288)
     [java]     at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
     [java]     at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
     [java]     at java.lang.reflect.Method.invoke(Unknown Source)
     [java]     at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
     [java]     at org.apache.tools.ant.Task.perform(Task.java:348)
     [java]     at org.apache.tools.ant.Target.execute(Target.java:357)
     [java]     at org.apache.tools.ant.Target.performTasks(Target.java:385)
     [java]     at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1337)
     [java]     at org.apache.tools.ant.Project.executeTarget(Project.java:1306)
     [java]     at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
     [java]     at org.eclipse.ant.internal.launching.remote.EclipseDefaultExecutor.executeTargets(EclipseDefaultExecutor.java:32)
     [java]     at org.apache.tools.ant.Project.executeTargets(Project.java:1189)
     [java]     at org.eclipse.ant.internal.launching.remote.InternalAntRunner.run(InternalAntRunner.java:423)
     [java]     at org.eclipse.ant.internal.launching.remote.InternalAntRunner.main(InternalAntRunner.java:137)
     [java] Caused by: org.springframework.jdbc.UncategorizedSQLException: Hibernate operation: Cannot open connection; uncategorized SQLException for SQL [???]; SQL state [null]; error code [0]; Cannot load JDBC driver class 'org.postgresql.Driver'; nested exception is org.apache.commons.dbcp.SQLNestedException: Cannot load JDBC driver class 'org.postgresql.Driver'
     [java]     at org.springframework.jdbc.support.SQLStateSQLExceptionTranslator.translate(SQLStateSQLExceptionTranslator.java:124)
     [java]     at org.springframework.jdbc.support.SQLErrorCodeSQLExceptionTranslator.translate(SQLErrorCodeSQLExceptionTranslator.java:322)
     [java]     at org.springframework.orm.hibernate3.HibernateAccessor.convertJdbcAccessException(HibernateAccessor.java:424)
     [java]     at org.springframework.orm.hibernate3.HibernateAccessor.convertHibernateAccessException(HibernateAccessor.java:410)
     [java]     at org.springframework.orm.hibernate3.HibernateTemplate.doExecute(HibernateTemplate.java:424)
     [java]     at org.springframework.orm.hibernate3.HibernateTemplate.executeWithNativeSession(HibernateTemplate.java:374)
     [java]     at org.springframework.orm.hibernate3.HibernateTemplate.find(HibernateTemplate.java:917)
     [java]     at org.springframework.orm.hibernate3.HibernateTemplate.find(HibernateTemplate.java:913)
     [java]     at csns.model.dao.hibernate.UserDaoImpl.getUserByName(UserDaoImpl.java:79)
     [java]     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
     [java]     at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
     [java]     at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
     [java]     at java.lang.reflect.Method.invoke(Unknown Source)
     [java]     at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:310)
     [java]     at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:198)
     [java]     at $Proxy0.getUserByName(Unknown Source)
     [java]     at csns.test.FileTest.test(FileTest.java:21)
     [java]     at csns.test.FileTest.main(FileTest.java:52)
     [java]     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
     [java]     at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
     [java]     at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
     [java]     at java.lang.reflect.Method.invoke(Unknown Source)
     [java]     at org.apache.tools.ant.taskdefs.ExecuteJava.run(ExecuteJava.java:217)
     [java]     at org.apache.tools.ant.taskdefs.ExecuteJava.execute(ExecuteJava.java:152)
     [java]     ... 19 more
     [java] Caused by: org.apache.commons.dbcp.SQLNestedException: Cannot load JDBC driver class 'org.postgresql.Driver'
     [java]     at org.apache.commons.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:1136)
     [java]     at org.apache.commons.dbcp.BasicDataSource.getConnection(BasicDataSource.java:880)
     [java]     at org.springframework.orm.hibernate3.LocalDataSourceConnectionProvider.getConnection(LocalDataSourceConnectionProvider.java:82)
     [java]     at org.hibernate.jdbc.ConnectionManager.openConnection(ConnectionManager.java:423)
     [java]     at org.hibernate.jdbc.ConnectionManager.getConnection(ConnectionManager.java:144)
     [java]     at org.hibernate.jdbc.AbstractBatcher.prepareQueryStatement(AbstractBatcher.java:139)
     [java]     at org.hibernate.loader.Loader.prepareQueryStatement(Loader.java:1547)
     [java]     at org.hibernate.loader.Loader.doQuery(Loader.java:673)
     [java]     at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:236)
     [java]     at org.hibernate.loader.Loader.doList(Loader.java:2213)
     [java]     at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2104)
     [java]     at org.hibernate.loader.Loader.list(Loader.java:2099)
     [java]     at org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:378)
     [java]     at org.hibernate.hql.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:338)
     [java]     at org.hibernate.engine.query.HQLQueryPlan.performList(HQLQueryPlan.java:172)
     [java]     at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1121)
     [java]     at org.hibernate.impl.QueryImpl.list(QueryImpl.java:79)
     [java]     at org.springframework.orm.hibernate3.HibernateTemplate$30.doInHibernate(HibernateTemplate.java:926)
     [java]     at org.springframework.orm.hibernate3.HibernateTemplate.doExecute(HibernateTemplate.java:419)
     [java]     ... 38 more
     [java] Caused by: java.lang.ClassNotFoundException: org.postgresql.Driver
     [java]     at org.apache.tools.ant.AntClassLoader.findClassInComponents(AntClassLoader.java:1400)
     [java]     at org.apache.tools.ant.AntClassLoader.findClass(AntClassLoader.java:1341)
     [java]     at org.apache.tools.ant.AntClassLoader.loadClass(AntClassLoader.java:1094)
     [java]     at java.lang.ClassLoader.loadClass(Unknown Source)
     [java]     at java.lang.Class.forName0(Native Method)
     [java]     at java.lang.Class.forName(Unknown Source)
     [java]     at org.apache.commons.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:1130)
     [java]     ... 56 more
     [java] --- Nested Exception ---
     [java] org.springframework.jdbc.UncategorizedSQLException: Hibernate operation: Cannot open connection; uncategorized SQLException for SQL [???]; SQL state [null]; error code [0]; Cannot load JDBC driver class 'org.postgresql.Driver'; nested exception is org.apache.commons.dbcp.SQLNestedException: Cannot load JDBC driver class 'org.postgresql.Driver'
     [java]     at org.springframework.jdbc.support.SQLStateSQLExceptionTranslator.translate(SQLStateSQLExceptionTranslator.java:124)
     [java]     at org.springframework.jdbc.support.SQLErrorCodeSQLExceptionTranslator.translate(SQLErrorCodeSQLExceptionTranslator.java:322)
     [java]     at org.springframework.orm.hibernate3.HibernateAccessor.convertJdbcAccessException(HibernateAccessor.java:424)
     [java]     at org.springframework.orm.hibernate3.HibernateAccessor.convertHibernateAccessException(HibernateAccessor.java:410)
     [java]     at org.springframework.orm.hibernate3.HibernateTemplate.doExecute(HibernateTemplate.java:424)
     [java]     at org.springframework.orm.hibernate3.HibernateTemplate.executeWithNativeSession(HibernateTemplate.java:374)
     [java]     at org.springframework.orm.hibernate3.HibernateTemplate.find(HibernateTemplate.java:917)
     [java]     at org.springframework.orm.hibernate3.HibernateTemplate.find(HibernateTemplate.java:913)
     [java]     at csns.model.dao.hibernate.UserDaoImpl.getUserByName(UserDaoImpl.java:79)
     [java]     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
     [java]     at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
     [java]     at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
     [java]     at java.lang.reflect.Method.invoke(Unknown Source)
     [java]     at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:310)
     [java]     at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:198)
     [java]     at $Proxy0.getUserByName(Unknown Source)
     [java]     at csns.test.FileTest.test(FileTest.java:21)
     [java]     at csns.test.FileTest.main(FileTest.java:52)
     [java]     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
     [java]     at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
     [java]     at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
     [java]     at java.lang.reflect.Method.invoke(Unknown Source)
     [java]     at org.apache.tools.ant.taskdefs.ExecuteJava.run(ExecuteJava.java:217)
     [java]     at org.apache.tools.ant.taskdefs.ExecuteJava.execute(ExecuteJava.java:152)
     [java]     at org.apache.tools.ant.taskdefs.Java.run(Java.java:764)
     [java]     at org.apache.tools.ant.taskdefs.Java.executeJava(Java.java:218)
     [java]     at org.apache.tools.ant.taskdefs.Java.executeJava(Java.java:132)
     [java]     at org.apache.tools.ant.taskdefs.Java.execute(Java.java:105)
     [java]     at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:288)
     [java]     at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
     [java]     at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
     [java]     at java.lang.reflect.Method.invoke(Unknown Source)
     [java]     at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
     [java]     at org.apache.tools.ant.Task.perform(Task.java:348)
     [java]     at org.apache.tools.ant.Target.execute(Target.java:357)
     [java]     at org.apache.tools.ant.Target.performTasks(Target.java:385)
     [java]     at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1337)
     [java]     at org.apache.tools.ant.Project.executeTarget(Project.java:1306)
     [java]     at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
     [java]     at org.eclipse.ant.internal.launching.remote.EclipseDefaultExecutor.executeTargets(EclipseDefaultExecutor.java:32)
     [java]     at org.apache.tools.ant.Project.executeTargets(Project.java:1189)
     [java]     at org.eclipse.ant.internal.launching.remote.InternalAntRunner.run(InternalAntRunner.java:423)
     [java]     at org.eclipse.ant.internal.launching.remote.InternalAntRunner.main(InternalAntRunner.java:137)
     [java] Caused by: org.apache.commons.dbcp.SQLNestedException: Cannot load JDBC driver class 'org.postgresql.Driver'
     [java]     at org.apache.commons.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:1136)
     [java]     at org.apache.commons.dbcp.BasicDataSource.getConnection(BasicDataSource.java:880)
     [java]     at org.springframework.orm.hibernate3.LocalDataSourceConnectionProvider.getConnection(LocalDataSourceConnectionProvider.java:82)
     [java]     at org.hibernate.jdbc.ConnectionManager.openConnection(ConnectionManager.java:423)
     [java]     at org.hibernate.jdbc.ConnectionManager.getConnection(ConnectionManager.java:144)
     [java]     at org.hibernate.jdbc.AbstractBatcher.prepareQueryStatement(AbstractBatcher.java:139)
     [java]     at org.hibernate.loader.Loader.prepareQueryStatement(Loader.java:1547)
     [java]     at org.hibernate.loader.Loader.doQuery(Loader.java:673)
     [java]     at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:236)
     [java]     at org.hibernate.loader.Loader.doList(Loader.java:2213)
     [java]     at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2104)
     [java]     at org.hibernate.loader.Loader.list(Loader.java:2099)
     [java]     at org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:378)
     [java]     at org.hibernate.hql.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:338)
     [java]     at org.hibernate.engine.query.HQLQueryPlan.performList(HQLQueryPlan.java:172)
     [java]     at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1121)
     [java]     at org.hibernate.impl.QueryImpl.list(QueryImpl.java:79)
     [java]     at org.springframework.orm.hibernate3.HibernateTemplate$30.doInHibernate(HibernateTemplate.java:926)
     [java]     at org.springframework.orm.hibernate3.HibernateTemplate.doExecute(HibernateTemplate.java:419)
     [java]     ... 38 more
     [java] Caused by: java.lang.ClassNotFoundException: org.postgresql.Driver
     [java]     at org.apache.tools.ant.AntClassLoader.findClassInComponents(AntClassLoader.java:1400)
     [java]     at org.apache.tools.ant.AntClassLoader.findClass(AntClassLoader.java:1341)
     [java]     at org.apache.tools.ant.AntClassLoader.loadClass(AntClassLoader.java:1094)
     [java]     at java.lang.ClassLoader.loadClass(Unknown Source)
     [java]     at java.lang.Class.forName0(Native Method)
     [java]     at java.lang.Class.forName(Unknown Source)
     [java]     at org.apache.commons.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:1130)
     [java]     ... 56 more
     [java] Java Result: -1