jcalfee314
jcalfee314

Reputation: 4830

javac compiler error for a source file that is not provided

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

Upvotes: 0

Views: 285

Answers (3)

Mark Rotteveel
Mark Rotteveel

Reputation: 109015

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.

Upvotes: 1

jcalfee314
jcalfee314

Reputation: 4830

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.

Upvotes: 0

Swapnil
Swapnil

Reputation: 8318

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.

Upvotes: 1

Related Questions