java – 从源代码构建C3p0时出错

我下载了源代码(v 0.9.1.2)并尝试构建它,首先来自

命令行然后在IDE中.

我认为问题是在build.properties文件中设置classpath.
 这是我当前的类路径.当然,我尝试过各种各样的事情
在这里,但都给出了相同的结果:

j2ee.classpath=C:/glassfishv3/glassfish/lib/j2ee.jar
and tried:
j2ee.jar.base.dir=C:/glassfishv3/glassfish/lib
etc.

以下是我得到的错误:

init-codegen:
[javac] Compiling 6 source files to C:\downloads\c3p0-0.9.1.2.src\c3p0-0.9.1.2.src\build\classes

beangen:
     [echo] Some warnings are expected here. Don't worry about them.

newproxygen:

codegen:

compile-common:
    [javac] Compiling 222 source files to C:\downloads\c3p0-0.9.1.2.src\c3p0-0.9.1.2.src\build\classes
    [javac] C:\downloads\c3p0-0.9.1.2.src\c3p0-0.9.1.2.src\build\codegen\com\mchange\v2\c3p0\impl\NewProxyConnection.jav
a:1339: unreported exception java.sql.SQLException; must be caught or declared to be thrown
    [javac]                             throw SqlUtils.toSQLException("You can't operate on a closed Connection!!!", exc
);
    [javac]                             ^
    [javac] C:\downloads\c3p0-0.9.1.2.src\c3p0-0.9.1.2.src\build\codegen\com\mchange\v2\c3p0\impl\NewProxyConnection.jav
a:1347: unreported exception java.sql.SQLException; must be caught or declared to be thrown
    [javac]                             throw parentPooledConnection.handleThrowable( exc );
    [javac]                             ^
    [javac] C:\downloads\c3p0-0.9.1.2.src\c3p0-0.9.1.2.src\build\codegen\com\mchange\v2\c3p0\impl\NewProxyConnection.jav
a:1349: unreported exception java.sql.SQLException; must be caught or declared to be thrown
    [javac]                     else throw SqlUtils.toSQLException( exc );
    [javac]                          ^
    [javac] C:\downloads\c3p0-0.9.1.2.src\c3p0-0.9.1.2.src\build\codegen\com\mchange\v2\c3p0\impl\NewProxyConnection.jav
a:1365: unreported exception java.sql.SQLException; must be caught or declared to be thrown
    [javac]                             throw SqlUtils.toSQLException("You can't operate on a closed Connection!!!", exc
);
    [javac]                             ^
    [javac] C:\downloads\c3p0-0.9.1.2.src\c3p0-0.9.1.2.src\build\codegen\com\mchange\v2\c3p0\impl\NewProxyConnection.jav
a:1373: unreported exception java.sql.SQLException; must be caught or declared to be thrown
    [javac]                             throw parentPooledConnection.handleThrowable( exc );
    [javac]                             ^
    [javac] C:\downloads\c3p0-0.9.1.2.src\c3p0-0.9.1.2.src\build\codegen\com\mchange\v2\c3p0\impl\NewProxyConnection.jav
a:1375: unreported exception java.sql.SQLException; must be caught or declared to be thrown
    [javac]                     else throw SqlUtils.toSQLException( exc );
    [javac]                          ^
    [javac] C:\downloads\c3p0-0.9.1.2.src\c3p0-0.9.1.2.src\src\classes\com\mchange\v2\c3p0\impl\NewPooledConnection.java
:38: com.mchange.v2.c3p0.impl.NewPooledConnection is not abstract and does not override abstract method removeStatementE
ventListener(javax.sql.StatementEventListener) in javax.sql.PooledConnection
    [javac] public final class NewPooledConnection extends AbstractC3P0PooledConnection{
    [javac]              ^
    [javac] C:\downloads\c3p0-0.9.1.2.src\c3p0-0.9.1.2.src\src\classes\com\mchange\v2\c3p0\ComboPooledDataSource.java:42
: com.mchange.v2.c3p0.ComboPooledDataSource is not abstract and does not override abstract method isWrapperFor(java.lang
.Class) in java.sql.Wrapper
    [javac] public final class ComboPooledDataSource extends AbstractPoolBackedDataSource implements PooledDataSource, S
erializable, Referenceable
    [javac]              ^
    [javac] C:\downloads\c3p0-0.9.1.2.src\c3p0-0.9.1.2.src\src\classes\com\mchange\v2\c3p0\DriverManagerDataSource.java:
45: com.mchange.v2.c3p0.DriverManagerDataSource is not abstract and does not override abstract method isWrapperFor(java.
lang.Class) in java.sql.Wrapper
    [javac] public final class DriverManagerDataSource extends DriverManagerDataSourceBase implements DataSource
    [javac]              ^
    [javac] C:\downloads\c3p0-0.9.1.2.src\c3p0-0.9.1.2.src\src\classes\com\mchange\v2\c3p0\JndiRefForwardingDataSource.j
ava:47: com.mchange.v2.c3p0.JndiRefForwardingDataSource is not abstract and does not override abstract method isWrapperF
or(java.lang.Class) in java.sql.Wrapper
    [javac] final class JndiRefForwardingDataSource extends JndiRefDataSourceBase implements DataSource
    [javac]       ^
    [javac] C:\downloads\c3p0-0.9.1.2.src\c3p0-0.9.1.2.src\src\classes\com\mchange\v2\c3p0\PoolBackedDataSource.java:28:
 com.mchange.v2.c3p0.PoolBackedDataSource is not abstract and does not override abstract method isWrapperFor(java.lang.C
lass) in java.sql.Wrapper
    [javac] public final class PoolBackedDataSource extends AbstractPoolBackedDataSource implements PooledDataSource
    [javac]              ^
    [javac] C:\downloads\c3p0-0.9.1.2.src\c3p0-0.9.1.2.src\src\classes\com\mchange\v2\c3p0\impl\C3P0PooledConnection.jav
a:39: com.mchange.v2.c3p0.impl.C3P0PooledConnection is not abstract and does not override abstract method removeStatemen
tEventListener(javax.sql.StatementEventListener) in javax.sql.PooledConnection
    [javac] public final class C3P0PooledConnection extends AbstractC3P0PooledConnection
    [javac]              ^
    [javac] C:\downloads\c3p0-0.9.1.2.src\c3p0-0.9.1.2.src\src\classes\com\mchange\v2\c3p0\impl\C3P0PooledConnection.jav
a:503: com.mchange.v2.c3p0.impl.C3P0PooledConnection.StatementProxyingSetManagedResultSet is not abstract and does not o
verride abstract method updateNClob(java.lang.String,java.io.Reader) in java.sql.ResultSet
    [javac]     private static class StatementProxyingSetManagedResultSet extends SetManagedResultSet
    [javac]                    ^
    [javac] C:\downloads\c3p0-0.9.1.2.src\c3p0-0.9.1.2.src\src\classes\com\mchange\v2\c3p0\impl\C3P0PooledConnection.jav
a:618: ProxyCallableStatement is not abstract and does not override abstract method setNClob(java.lang.String,java.io.Re
ader) in java.sql.CallableStatement
    [javac]             class ProxyCallableStatement extends FilterCallableStatement implements C3P0ProxyStatement
    [javac]             ^
    [javac] C:\downloads\c3p0-0.9.1.2.src\c3p0-0.9.1.2.src\src\classes\com\mchange\v2\c3p0\impl\C3P0PooledConnection.jav
a:655: ProxyPreparedStatement is not abstract and does not override abstract method setNClob(int,java.io.Reader) in java
.sql.PreparedStatement
    [javac]             class ProxyPreparedStatement extends FilterPreparedStatement implements C3P0ProxyStatement
    [javac]             ^
    [javac] C:\downloads\c3p0-0.9.1.2.src\c3p0-0.9.1.2.src\src\classes\com\mchange\v2\c3p0\impl\C3P0PooledConnection.jav
a:692: ProxyStatement is not abstract and does not override abstract method isPoolable() in java.sql.Statement
    [javac]             class ProxyStatement extends FilterStatement implements C3P0ProxyStatement
    [javac]             ^
    [javac] C:\downloads\c3p0-0.9.1.2.src\c3p0-0.9.1.2.src\src\classes\com\mchange\v2\c3p0\impl\NullStatementSetManagedR
esultSet.java:37: com.mchange.v2.c3p0.impl.NullStatementSetManagedResultSet is not abstract and does not override abstra
ct method updateNClob(java.lang.String,java.io.Reader) in java.sql.ResultSet
    [javac] final class NullStatementSetManagedResultSet extends SetManagedResultSet
    [javac]       ^
    [javac] C:\downloads\c3p0-0.9.1.2.src\c3p0-0.9.1.2.src\src\classes\com\mchange\v2\c3p0\impl\SetManagedDatabaseMetaDa
ta.java:30: com.mchange.v2.c3p0.impl.SetManagedDatabaseMetaData is not abstract and does not override abstract method ge
tFunctionColumns(java.lang.String,java.lang.String,java.lang.String,java.lang.String) in java.sql.DatabaseMetaData
    [javac] final class SetManagedDatabaseMetaData extends FilterDatabaseMetaData
    [javac]       ^
    [javac] C:\downloads\c3p0-0.9.1.2.src\c3p0-0.9.1.2.src\src\classes\com\mchange\v2\c3p0\impl\SnatchFromSetResultSet.j
ava:30: com.mchange.v2.c3p0.impl.SnatchFromSetResultSet is not abstract and does not override abstract method updateNClo
b(java.lang.String,java.io.Reader) in java.sql.ResultSet
    [javac] final class SnatchFromSetResultSet extends FilterResultSet
    [javac]       ^
    [javac] C:\downloads\c3p0-0.9.1.2.src\c3p0-0.9.1.2.src\src\classes\com\mchange\v2\c3p0\test\FreezableDriverManagerDa
taSource.java:49: com.mchange.v2.c3p0.test.FreezableDriverManagerDataSource is not abstract and does not override abstra
ct method isWrapperFor(java.lang.Class) in java.sql.Wrapper
    [javac] public final class FreezableDriverManagerDataSource extends DriverManagerDataSourceBase implements DataSourc
e
    [javac]              ^
    [javac] C:\downloads\c3p0-0.9.1.2.src\c3p0-0.9.1.2.src\src\classes\com\mchange\v2\c3p0\util\CloseReportingConnection
Wrapper.java:29: com.mchange.v2.c3p0.util.CloseReportingConnectionWrapper is not abstract and does not override abstract
 method createStruct(java.lang.String,java.lang.Object[]) in java.sql.Connection
    [javac] public class CloseReportingConnectionWrapper extends FilterConnection
    [javac]        ^
    [javac] Note: Some input files use or override a deprecated API.
    [javac] Note: Recompile with -Xlint:deprecation for details.
    [javac] 21 errors

BUILD FAILED
C:\downloads\c3p0-0.9.1.2.src\c3p0-0.9.1.2.src\build.xml:256: Compile failed; see the compiler error output for details.

编辑:
以下是使用Java 5构建时出现的错误:

compile-common:
    [javac] Compiling 226 source files to C:\downloads\c3p0-0.9.1.2.src\c3p0-0.9.1.2.src\build\classes
    [javac] C:\downloads\c3p0-0.9.1.2.src\c3p0-0.9.1.2.src\src\classes\com\mchange\v2\c3p0\impl\NewPooledConnection.jav
:38: com.mchange.v2.c3p0.impl.NewPooledConnection is not abstract and does not override abstract method removeStatement
ventListener(javax.sql.StatementEventListener) in javax.sql.PooledConnection
    [javac] public final class NewPooledConnection extends AbstractC3P0PooledConnection{
    [javac]              ^
    [javac] C:\downloads\c3p0-0.9.1.2.src\c3p0-0.9.1.2.src\src\classes\com\mchange\v2\c3p0\ComboPooledDataSource.java:4
: com.mchange.v2.c3p0.ComboPooledDataSource is not abstract and does not override abstract method isWrapperFor(java.lan
.Class) in java.sql.Wrapper
    [javac] public final class ComboPooledDataSource extends AbstractPoolBackedDataSource implements PooledDataSource,
erializable, Referenceable
    [javac]              ^
    [javac] C:\downloads\c3p0-0.9.1.2.src\c3p0-0.9.1.2.src\src\classes\com\mchange\v2\c3p0\DriverManagerDataSource.java
45: com.mchange.v2.c3p0.DriverManagerDataSource is not abstract and does not override abstract method isWrapperFor(java
lang.Class) in java.sql.Wrapper
    [javac] public final class DriverManagerDataSource extends DriverManagerDataSourceBase implements DataSource
    [javac]              ^
    [javac] C:\downloads\c3p0-0.9.1.2.src\c3p0-0.9.1.2.src\src\classes\com\mchange\v2\c3p0\JndiRefForwardingDataSource.
ava:47: com.mchange.v2.c3p0.JndiRefForwardingDataSource is not abstract and does not override abstract method isWrapper
or(java.lang.Class) in java.sql.Wrapper
    [javac] final class JndiRefForwardingDataSource extends JndiRefDataSourceBase implements DataSource
    [javac]       ^
    [javac] C:\downloads\c3p0-0.9.1.2.src\c3p0-0.9.1.2.src\src\classes\com\mchange\v2\c3p0\PoolBackedDataSource.java:28
 com.mchange.v2.c3p0.PoolBackedDataSource is not abstract and does not override abstract method isWrapperFor(java.lang.
lass) in java.sql.Wrapper
    [javac] public final class PoolBackedDataSource extends AbstractPoolBackedDataSource implements PooledDataSource
    [javac]              ^
    [javac] C:\downloads\c3p0-0.9.1.2.src\c3p0-0.9.1.2.src\src\classes\com\mchange\v2\c3p0\impl\C3P0PooledConnection.ja
a:39: com.mchange.v2.c3p0.impl.C3P0PooledConnection is not abstract and does not override abstract method removeStateme
tEventListener(javax.sql.StatementEventListener) in javax.sql.PooledConnection
    [javac] public final class C3P0PooledConnection extends AbstractC3P0PooledConnection
    [javac]              ^
    [javac] C:\downloads\c3p0-0.9.1.2.src\c3p0-0.9.1.2.src\src\classes\com\mchange\v2\c3p0\impl\C3P0PooledConnection.ja
a:503: com.mchange.v2.c3p0.impl.C3P0PooledConnection.StatementProxyingSetManagedResultSet is not abstract and does not
verride abstract method updateNClob(java.lang.String,java.io.Reader) in java.sql.ResultSet
    [javac]     private static class StatementProxyingSetManagedResultSet extends SetManagedResultSet
    [javac]                    ^
    [javac] C:\downloads\c3p0-0.9.1.2.src\c3p0-0.9.1.2.src\src\classes\com\mchange\v2\c3p0\impl\C3P0PooledConnection.ja
a:618: ProxyCallableStatement is not abstract and does not override abstract method setNClob(java.lang.String,java.io.R
ader) in java.sql.CallableStatement
    [javac]             class ProxyCallableStatement extends FilterCallableStatement implements C3P0ProxyStatement
    [javac]             ^
    [javac] C:\downloads\c3p0-0.9.1.2.src\c3p0-0.9.1.2.src\src\classes\com\mchange\v2\c3p0\impl\C3P0PooledConnection.ja
a:655: ProxyPreparedStatement is not abstract and does not override abstract method setNClob(int,java.io.Reader) in jav
.sql.PreparedStatement
    [javac]             class ProxyPreparedStatement extends FilterPreparedStatement implements C3P0ProxyStatement
    [javac]             ^
    [javac] C:\downloads\c3p0-0.9.1.2.src\c3p0-0.9.1.2.src\src\classes\com\mchange\v2\c3p0\impl\C3P0PooledConnection.ja
a:692: ProxyStatement is not abstract and does not override abstract method isPoolable() in java.sql.Statement
    [javac]             class ProxyStatement extends FilterStatement implements C3P0ProxyStatement
    [javac]             ^
    [javac] C:\downloads\c3p0-0.9.1.2.src\c3p0-0.9.1.2.src\src\classes\com\mchange\v2\c3p0\impl\NullStatementSetManaged
esultSet.java:37: com.mchange.v2.c3p0.impl.NullStatementSetManagedResultSet is not abstract and does not override abstr
ct method updateNClob(java.lang.String,java.io.Reader) in java.sql.ResultSet
    [javac] final class NullStatementSetManagedResultSet extends SetManagedResultSet
    [javac]       ^
    [javac] C:\downloads\c3p0-0.9.1.2.src\c3p0-0.9.1.2.src\src\classes\com\mchange\v2\c3p0\impl\SetManagedDatabaseMetaD
ta.java:30: com.mchange.v2.c3p0.impl.SetManagedDatabaseMetaData is not abstract and does not override abstract method g
tFunctionColumns(java.lang.String,java.lang.String,java.lang.String,java.lang.String) in java.sql.DatabaseMetaData
    [javac] final class SetManagedDatabaseMetaData extends FilterDatabaseMetaData
    [javac]       ^
    [javac] C:\downloads\c3p0-0.9.1.2.src\c3p0-0.9.1.2.src\src\classes\com\mchange\v2\c3p0\impl\SnatchFromSetResultSet.
ava:30: com.mchange.v2.c3p0.impl.SnatchFromSetResultSet is not abstract and does not override abstract method updateNCl
b(java.lang.String,java.io.Reader) in java.sql.ResultSet
    [javac] final class SnatchFromSetResultSet extends FilterResultSet
    [javac]       ^
    [javac] C:\downloads\c3p0-0.9.1.2.src\c3p0-0.9.1.2.src\src\classes\com\mchange\v2\c3p0\test\FreezableDriverManagerD
taSource.java:49: com.mchange.v2.c3p0.test.FreezableDriverManagerDataSource is not abstract and does not override abstr
ct method isWrapperFor(java.lang.Class) in java.sql.Wrapper
    [javac] public final class FreezableDriverManagerDataSource extends DriverManagerDataSourceBase implements DataSour
e
    [javac]              ^
    [javac] C:\downloads\c3p0-0.9.1.2.src\c3p0-0.9.1.2.src\src\classes\com\mchange\v2\c3p0\util\CloseReportingConnectio
Wrapper.java:29: com.mchange.v2.c3p0.util.CloseReportingConnectionWrapper is not abstract and does not override abstrac
 method createStruct(java.lang.String,java.lang.Object[]) in java.sql.Connection
    [javac] public class CloseReportingConnectionWrapper extends FilterConnection
    [javac]        ^
    [javac] Note: Some input files use or override a deprecated API.
    [javac] Note: Recompile with -Xlint:deprecation for details.
    [javac] 15 errors

BUILD FAILED
C:\downloads\c3p0-0.9.1.2.src\c3p0-0.9.1.2.src\build.xml:256: Compile failed; see the compiler error output for details


Total time: 15 seconds
C:\downloads\c3p0-0.9.1.2.src\c3p0-0.9.1.2.src>java -version
java version "1.5.0_22"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_22-b03)
Java HotSpot(TM) Client VM (build 1.5.0_22-b03, mixed mode, sharing)

C:\downloads\c3p0-0.9.1.2.src\c3p0-0.9.1.2.src>

最佳答案 它看起来像你正在尝试用Java6构建,这是行不通的.

0.9.1.2版本的c3p0仅适用于Java5.

您需要尝试使用JDK1.5再次构建它

不幸的是,“ant clean”目标没有100%清理,所以你可能想要删除你的文件夹并重新开始.

你为什么要尝试从源代码构建?
有一个二进制下载可用,看起来你只是让自己复杂化.

点赞