Получение ошибок при сборке C3p0 из источника - PullRequest
4 голосов
/ 07 января 2011

Я скачал исходный код (v 0.9.1.2) и попытался собрать его сначала из командной строки, а затем внутри IDE.

Я думаю, что проблема заключается в установке classpath в файле build.properties.Вот мой текущий путь к классу.Конечно, я пробовал разные вещи здесь, но все они дают одинаковые результаты:

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>

1 Ответ

2 голосов
/ 07 января 2011

Мне кажется, что вы пытаетесь собрать с Java6, и это не сработает. Версия c3p0 0.9.1.2 работает только с Java5.

Вам нужно будет попробовать собрать его снова с JDK1.5

К сожалению, цель "ant clean" не очищает 100%, поэтому вы, вероятно, захотите удалить свою папку и начать заново.

Почему вы все равно пытаетесь собрать из исходного кода? Доступна бинарная загрузка, и похоже, что вы сами все усложняете.

...