0

I'm getting this error when I run javac -d classes myfiles.... The strange thing is, I do not have PooledPreparedStatementHandler.java in any folder nor do I have the PooledPreparedStatementHandler sub-string in any of my source files. The only reference I found was PooledPreparedStatementHandler.class in the jaybird jar (used and needed in my classpath).

./lib/jaybird-full-2.1.6.jar (all class files, no java files)

Here is the error:

org/firebirdsql/pool/PooledPreparedStatementHandler.java(org/firebirdsql/pool:PooledPreparedStatementHandler.java):32: package org.apache.xalan.lib.sql does not exist
import org.apache.xalan.lib.sql.XConnection;

This is the compile command:

find src/main/java -type f -name "*.java"| xargs javac -target 1.5 -d war/WEB-INF/classes

What is the source of this error? I'm using oracle javac 1.6.0_26

Swapnil
  • 8,201
  • 4
  • 38
  • 57
jcalfee314
  • 4,642
  • 8
  • 43
  • 75

3 Answers3

1

From the source code, it looks like PooledPreparedStatementHandler tries to import org.apache.xalan.lib.sql.XConnection, so you're dependent on it. And as you don't have that on your build classpath, you're getting the error.

Swapnil
  • 8,201
  • 4
  • 38
  • 57
  • I think your describing a run-time dependency. The code, with jaybird classes jar, compiles in eclipse. Eclipse 'Open Type' does not show any XConnection class by Apache. – jcalfee314 Jan 14 '13 at 19:48
  • 1
    Interestingly enough, the actual Jaybird 2.1.6 source does not reference this class: http://firebird.svn.sourceforge.net/viewvc/firebird/client-java/tags/Jaybird_2_1_6/src/pool/org/firebirdsql/pool/PooledPreparedStatementHandler.java?revision=57506&view=markup – Mark Rotteveel Jan 15 '13 at 11:05
1

It looks like you have a modified copy of the Jaybird sources inside your project that is compiled together with the rest of your code. The original Jaybird 2.1.6 version of org.firebirdsql.pool.PooledPreparedStatementHandler (links to the 2.1.6 tag on GitHub) does not reference org.apache.xalan.lib.sql.XConnection.

It actually looks like it is trying to compile a version of PooledPreparedStatementHandler.java, and not just use the class from the Jaybird jar file. You might want to check if the result of find src/main/java -type f -name "*.java" includes any Jaybird .java files (ie in the org.firebirdsql.* packages).

You could also try to include Xalan-J on your classpath while building. If a copy of PooledPreparedStatementHandler gets included in the destination folder, then the source file is somehow getting included in your build.

Mark Rotteveel
  • 100,966
  • 191
  • 140
  • 197
  • I see your point, so I grabbed Jaybird-2.1.6JDK_1.5.zip from Sourceforge and used the jaybird-full-2.1.6.jar within. The check sums were different. Same problem! I may have gotten the jar from a maven repository and, who knows, a build process could have changed some bits. Your both on to something, it is referencing a line in the code that does not exist. – jcalfee314 Jan 15 '13 at 14:45
  • 1
    It actually looks like it is trying to **compile** a version of `PooledPreparedStatementHandler.java`, and not just use the class from the Jaybird jar file. You might want to check the result of `find src/main/java -type f -name "*.java"` if it does not include any Jaybird `.java` files (ie in the `org.firebirdsql.*` packages). – Mark Rotteveel Jan 15 '13 at 15:19
  • yes, i did check the results... all my own code. also, that is why I did the egrep inside of source files to try and find some embedded classes. – jcalfee314 Jan 15 '13 at 18:47
  • 1
    You could try to include [Xalan-J](http://xml.apache.org/xalan-j/) on your classpath while building. If a copy of `PooledPreparedStatementHandler` gets included in the destination folder, then the source file is somehow getting included in your build. – Mark Rotteveel Jan 16 '13 at 08:32
0

Mark actually gave me the answer in a comment. If you want the points Mark, move it to a answer. Until then, JayBird lists Xalan 2.3.1 as a dependence. I just needed to include that in the classpath.

jcalfee314
  • 4,642
  • 8
  • 43
  • 75