You are viewing a plain text version of this content. The canonical link for it is here.
Posted to derby-dev@db.apache.org by "rsjay1976 ." <rs...@gmail.com> on 2014/05/21 07:01:17 UTC

Derby 5219

Hi All,
When trying to replicate the Derby 5219 by running harness i am getting the
"Could not locate lang\supersimple.sql' issue..  I am attaching the trace

With Regards
jayaram

C:\Derby\trunk>set
CLASSPATH="C:\Derby\trunk\jars\sane\derbyrun.jar;C:\Derby\tru
nk\jars\sane\derbyTesting.jar;C:\Derby\trunk\tools\java\jakarta-oro-2.0.8.jar;C:
\Derby\trunk\tools\java\junit.jar"

C:\Derby\trunk>java -Dframework=DerbyNetClient
-DtestSpecialProps=derby.infolog.
append=true  org.apache.derbyTesting.functionTests.harness.RunTest
lang\supersim
ple.sql
Could not locate lang\supersimple.sql
Exception in thread "main" java.io.FileNotFoundException:
/org/apache/derbyTesti
ng/functionTests/tests/lang\supersimple.sql
        at
org.apache.derbyTesting.functionTests.harness.RunTest.setDirectories(
RunTest.java:700)
        at
org.apache.derbyTesting.functionTests.harness.RunTest.main(RunTest.ja
va:254)

Re: Derby 5219

Posted by Dyre Tjeldvoll <Dy...@oracle.com>.
On 05/21/2014 07:01 AM, rsjay1976 . wrote:
> Hi All,
> When trying to replicate the Derby 5219 by running harness i am getting
> the "Could not locate lang\supersimple.sql' issue..  I am attaching the
> trace
>
> With Regards
> jayaram
>
> C:\Derby\trunk>set
> CLASSPATH="C:\Derby\trunk\jars\sane\derbyrun.jar;C:\Derby\tru

If you look at the source code for RunTest, you'll notice that it (for 
reasons I don't know) uses Class.getResourceAsStream(String) to load the 
sql-script file.

The javadoc for this method states:

"Before delegation, an absolute resource name is constructed from the 
given resource name using this algorithm:

     If the name begins with a '/' ('\u002f'), then the absolute name of 
the resource is the portion of the name following the '/'.
     Otherwise, the absolute name is of the following form:

            modified_package_name/name


     Where the modified_package_name is the package name of this object 
with '/' substituted for '.' ('\u002e'). "

So unlike an FileIntputStream it will NOT accept a Windows-style path 
(lang\supersimple.sql) but only a Unix-style path 
(lang/supersimple.sql), even when running on Windows.

HTH

-- 
Regards,

Dyre