db-derby-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Matt Pouttu-Clarke <Matt.Pouttu-Cla...@icrossing.com>
Subject Bug with http sub protocol?
Date Mon, 20 Jun 2011 22:11:26 GMT
Hi All,

Trying to get Derby to open a read only database on Amazon EC2 via a HTTP
exposed S3 bucket.  This is critical and a blocker because on the cloud we
avoid using local shared mount points requiring setup on every host (i.e. We
don¹t use the file system directly).  Using Derby 10.8.

According to the JavaDoc, there exists a
org.apache.derby.impl.io.URLStorageFactory, which is addressed by using the
http sub protocol.  However, when I attempt to access the following URL,
Derby throws an exception:
            Connection conn =
                
DriverManager.getConnection("jdbc:derby:http://localhost:8080/ipinfo");

Exception:
java.sql.SQLException: Database 'http://localhost:8080/ipinfo' not found.
    at 
org.apache.derby.impl.jdbc.SQLExceptionFactory.getSQLException(SQLExceptionF
actory.java:45)
    at 
org.apache.derby.impl.jdbc.SQLExceptionFactory40.wrapArgsForTransportAcrossD
RDA(SQLExceptionFactory40.java:122)
    at 
org.apache.derby.impl.jdbc.SQLExceptionFactory40.getSQLException(SQLExceptio
nFactory40.java:71)
    at org.apache.derby.impl.jdbc.Util.newEmbedSQLException(Util.java:142)
    at org.apache.derby.impl.jdbc.Util.newEmbedSQLException(Util.java:148)
    at org.apache.derby.impl.jdbc.Util.generateCsSQLException(Util.java:227)
    at 
org.apache.derby.impl.jdbc.EmbedConnection.newSQLException(EmbedConnection.j
ava:3085)
    at 
org.apache.derby.impl.jdbc.EmbedConnection.handleDBNotFound(EmbedConnection.
java:735)
    at 
org.apache.derby.impl.jdbc.EmbedConnection.<init>(EmbedConnection.java:414)
    at 
org.apache.derby.impl.jdbc.EmbedConnection30.<init>(EmbedConnection30.java:7
3)
    at 
org.apache.derby.impl.jdbc.EmbedConnection40.<init>(EmbedConnection40.java:5
1)
    at 
org.apache.derby.jdbc.Driver40.getNewEmbedConnection(Driver40.java:70)
    at org.apache.derby.jdbc.InternalDriver.connect(InternalDriver.java:248)
    at 
org.apache.derby.jdbc.AutoloadedDriver.connect(AutoloadedDriver.java:144)
    at java.sql.DriverManager.getConnection(DriverManager.java:582)
    at java.sql.DriverManager.getConnection(DriverManager.java:207)
    at 
com.icrossing.collection.derbyurl.DerbyURLMain.main(DerbyURLMain.java:18)

When I debug the code it looks like the boot sequence cannot find the
service.properties since it looks like the URLFile:103 does not have the
³http:² in front of the URL so it throws a FileNotFoundException:
    /**
     * Creates an input stream from a file name.
     *
     * @return an input stream suitable for reading from the file.
     *
     * @exception FileNotFoundException if the file is not found.
     */
    public InputStream getInputStream( ) throws FileNotFoundException
    {
        try
        {
            URL url = new URL( path);
            return url.openStream();
        }
        catch( IOException ioe){ throw new
java.io.FileNotFoundException(path);}
    } // end of getInputStream

Any ideas why Derby is stripping the HTTP for this DB URL?  (by the way, it
doesn¹t work if I add ³http:http:² either). Should I log a Jira ticket for
this, submit a patch, or what?  These classes are not visible so I cannot
extend them to provide a work around for this problem.

Cheers,
Matt

iCrossing Privileged and Confidential Information
This email message is for the sole use of the intended recipient(s) and may contain confidential
and privileged information of iCrossing. Any unauthorized review, use, disclosure or distribution
is prohibited. If you are not the intended recipient, please contact the sender by reply email
and destroy all copies of the original message.



Mime
View raw message