You are viewing a plain text version of this content. The canonical link for it is here.
Posted to derby-user@db.apache.org by BeNdErR <be...@hotmail.com> on 2010/11/29 23:45:54 UTC

Derby : No suitable driver found for jdbc:derby:db;create=true

Hello everyone.
I'm trying to configure properly derby, but I run into this error:

Client RemoteException: No suitable driver found for
jdbc:derby:db;create=true
java.sql.SQLException: No suitable driver found for
jdbc:derby:db;create=true

I'm trying to run a server / client application under Linux, my minimal
client runs and loads everything he needs from the server codebase. The
derby db is on the same machine where the server is, I moved (not sure I can
anyway) the lib folder in my app folder (path ~/home/user/app/lib/), because
i need to move the entire database with the application.
These are my settings (exported both in my user profile file)


CLASSPATH=/home/user/app/lib/derby.jar:.:/home/user/app/lib/derbytools.jar:
DERBY_HOME=/opt/Apache/db-derby-10.6.2.1-bin


this is the code inside the DBMS constructor 


String pathDB = "db";
String connectionURL = "jdbc:derby:"+pathDB+";create=true";
try{
			Class.forName("org.apache.derby.jdbc.EmbeddedDriver").newInstance();
			File db = new File(pathDB);
			if (!db.isDirectory()){
				conn = DriverManager.getConnection(connectionURL);
				initTables();
				closeConnection();
			}
		}catch(ClassNotFoundException cnfe){
			System.out.println(" DBMS.java ClassNotFoundException Error:
"+cnfe.getMessage());
			cnfe.printStackTrace();
		}

the DBMS call is inside a method of the server, which is called remotely by
the client (thinks it's the cause of the RemoteException). to run the server
I use these classpath/codebase parameters:


java -classpath :/home/user/app/lib/*:/home/user/app/shared/
-Djava.rmi.server.codebase=file:///home/user/app/shared/


but it seems the server couldn't reach the drivers.. I don't understand why!
Do I have to run the derby server before running anything else? or else it's
started automatically when the DBMS is used? I tryed both, withouth success
:(

I hope I explained well my problem, if you need more info, ask and I will
tell you what you need. Thanks in advance,
-- 
View this message in context: http://old.nabble.com/Derby-%3A-No-suitable-driver-found-for-jdbc%3Aderby%3Adb-create%3Dtrue-tp30335341p30335341.html
Sent from the Apache Derby Users mailing list archive at Nabble.com.


Re: Derby : No suitable driver found for jdbc:derby:db;create=true

Posted by Bryan Pendleton <bp...@gmail.com>.
>   java -classpath :/home/user/app/lib/*:/home/user/app/shared/
>
> Do I have to change this? I thought I already set it up properly :\ as you
> can see in the classpath there's the path to derby (inside the lib folder),
> maybe the " * " part is wrong. You think i need to specify the complete path
> .../lib/derby.jar or using the "star" works?

Yes, sorry, I didn't pay close enough attention to that the first time.

I rather doubt that the asterisk is doing what you expect it to. What happens
when you try

    echo :/home/user/app/lib/*:/home/user/app/shared/

I suspect that your shell (which may be is doing the asterisk expansion) is
probably not finding any matches, and so it is probably not expanding the
asterisk in the manner you desire.

    echo /home/user/app/lib/*

probably works fine, of course, but that's not what the shell sees.

In JDK 1.6, Sun added some wildcard support to classpath variables, but I've
never got it to work because it's rather picky about the syntax. See:
http://download.oracle.com/javase/6/docs/technotes/tools/windows/classpath.html

In my projects, I always specify the full classpath explicitly, using full
absolute jar names, because that's what works for me. I often write small
scripts to do the setup and to manage switching from one configuration to another,
but when I run a Java program, it's with a complete classpath that is explicit
and that I fully understand. Not only does it make the behavior more reliable,
it seems less likely to be subject to security problems (loading classes from
places I didn't expect).

To make things simpler, Derby's JAR files are bound together internally, using
the Manifest mechanism, so if you simply specify the full classpath to derbyrun.jar,
then derbyrun.jar will internally reference all the other Derby JAR files from
the same directory, so that makes it easy to add a single JAR reference to your
classpath and get all the Derby jars loaded.

So I suggest changing your classpath argument to specify the full name of
derbyrun.jar in place of the asterisk, and see if that improves the behavior.

thanks,

bryan

Re: Derby : No suitable driver found for jdbc:derby:db;create=true

Posted by BeNdErR <be...@hotmail.com>.
I need to say again that I don't run any derby server with "server start"
command before I run my entire server. I mentioned that in one of my earlier
posts, I dunno if this can help or not. Again, thanks
-- 
View this message in context: http://old.nabble.com/Derby-%3A-No-suitable-driver-found-for-jdbc%3Aderby%3Adb-create%3Dtrue-tp30335341p30354407.html
Sent from the Apache Derby Users mailing list archive at Nabble.com.


Re: Derby : No suitable driver found for jdbc:derby:db;create=true

Posted by BeNdErR <be...@hotmail.com>.
@kristian

I edited my post probably while you were posting your reply, I found that I
made a mistake, forgetting the "jdbc:derby:" prefix. With that everything
works fine using ij, but I can't figure out why it won't work with my server
:(

you can see the output in my previous message.

Thanks
-- 
View this message in context: http://old.nabble.com/Derby-%3A-No-suitable-driver-found-for-jdbc%3Aderby%3Adb-create%3Dtrue-tp30335341p30354088.html
Sent from the Apache Derby Users mailing list archive at Nabble.com.


Re: Derby : No suitable driver found for jdbc:derby:db;create=true

Posted by Kristian Waagan <kr...@oracle.com>.
On01.12.2010 19:45, BeNdErR wrote:
> @bryan
> I tryed to run ij instead of tmp.Setup, as you said, then I tryed to connect
> to a new db, that's what I got:
>
> ij>  CONNECT 'ciao;create=true';
> ERRORE 08001: No suitable driver found for ciao;create=true

Note that unless you have configured Derby to use a specific protocol 
(impossible to say based on the output above), the connection URL has to 
be 'jdbc:derby:ciao;create=true'.
ij is a rather general tool, and you could use it to connect to another 
database, in which case 'derby' would have to be replaced and maybe that 
driver would need different connection attributed.

Another example is if you want to use the in-memory back end with Derby, 
in which case the URL would be something like 
'jdbc:derby:memory;ciao;create=true';


Regards,
-- 
Kristian

> ij>
>
>
> so something is still wrong :\
>
> running org.apache.derby.tools.sysinfo I have:
>
>
> ------------------ Informazioni su Java ------------------
> Versione Java:   1.6.0_22
> Fornitore Java:  Sun Microsystems Inc.
> Home Java:       /usr/lib/jvm/java-6-sun-1.6.0.22/jre
> Percorso classi Java:
> /home/user/app/lib/derby.jar:.:/home/user/app/lib/derbytools.jar:.
> Nome SO:         Linux
> Architettura SO: i386
> Versione SO:     2.6.35-23-generic
> Nome utente Java: user
> Home utente Java: /home/user
> Dir utente Java: /home/user/app/server
> java.specification.name: Java Platform API Specification
> java.specification.version: 1.6
> java.runtime.version: 1.6.0_22-b04
> --------- Informazioni su Derby --------
> JRE - JDBC: Java SE 6 - JDBC 4.0
> [/home/user/app/lib/derby.jar] 10.6.2.1 - (999685)
> [/home/user/app/lib/derbytools.jar] 10.6.2.1 - (999685)
> ------------------------------------------------------
> ----------------- Informazioni sulla locale -----------------
> Locale attuale:  [italiano/Italia [it_IT]]
> E' stato trovato il supporto per la locale: [it]
> 	 versione: 10.6.2.1 - (999685)
> ------------------------------------------------------
>
> If you need something to be translated, tell me.
> In ~/home/user/app/lib/ folder I have these files: derby.jar, derby.war.
> derbyclient.jar, derbyLocale_it.jar, derbynet.jar, derbyrun.jar,
> derbytools.jar.
> In the original derby installation folder, in /lib/ there are more file than
> I have in my app/lib, because I removed all the *.jar for the other
> languages (to be nerdy, i removed all derbyLocale_xy.jar where (xy != it). I
> don't think the problem it's there anyway...
>
> To anyone who is still reading and replying to this thread, thanks a lot,
> you're very kind.


Re: Derby : No suitable driver found for jdbc:derby:db;create=true

Posted by Bryan Pendleton <bp...@gmail.com>.
> the problem now is that if I run login server with embeddeddriver, and
> client with clientdriver, once the client tries to connect to to the
> database it raises an error saying that "maybe another instance of derby is
> running the server".

The embedded driver uses a lock file to detect two copies of the driver
accidentally accessing the same database, so perhaps even though you think
you are using the client driver for your second connection, your code is
falling through into the embedded driver in both cases, and so both programs
are trying to access the database directly, which is not allowed.

> Reading the manuals, it seems that the server that uses the embeddeddriver
> can use the relative path to find the db, while the client can't and need to
> use //localhost:port/blahblah.. or am I wrong?

The "blahblah" part of the client connection URL can also be either a relative
or absolute database path name, just as is true with the EmbeddedDriver. So you
should be able to have your client URL be something like:

   jdbc:derby://localhost:1527//home/user/app/db

I can't remember for sure whether you need two slashes after the 1527 when you do this.

thanks,

bryan

Re: Derby : No suitable driver found for jdbc:derby:db;create=true

Posted by BeNdErR <be...@hotmail.com>.
thanks kristian, I've followed the instructions in the link and it works, but
only using clientdriver for both servers..
It was, probably, a path problem, I was running the server (java -jar
path/derbyun.jar server start) in the app/lib/ folder, then I told to the
client to search for the db in the app/ folder, making it not working at
all. Fixed!

the problem now is that if I run login server with embeddeddriver, and
client with clientdriver, once the client tries to connect to to the
database it raises an error saying that "maybe another instance of derby is
running the server".

these are my connection settings (with the embeddeddriver)

if(classCallingDBMS.equals("tmp.AuthServer")){	//here enters the
login-server
			driver = "org.apache.derby.jdbc.EmbeddedDriver";
			connectionURL = "jdbc:derby:/home/user/app/db;create=true;";
			System.out.println("Accesso effettuato da "+classCallingDBMS);
		}else{
			driver = "org.apache.derby.jdbc.ClientDriver";	//here enters the other
server
			connectionURL = "jdbc:derby://localhost:1527/db;";
			System.out.println("Accesso effettuato da "+classCallingDBMS);
		}

Reading the manuals, it seems that the server that uses the embeddeddriver
can use the relative path to find the db, while the client can't and need to
use //localhost:port/blahblah.. or am I wrong? the login server with these
setting works, but the client don't and throws the error I said before
(another instance....).

thanks for your help, best regards
-- 
View this message in context: http://old.nabble.com/Derby-%3A-No-suitable-driver-found-for-jdbc%3Aderby%3Adb-create%3Dtrue-tp30335341p30418078.html
Sent from the Apache Derby Users mailing list archive at Nabble.com.


Re: Derby : No suitable driver found for jdbc:derby:db;create=true

Posted by Bryan Pendleton <bp...@gmail.com>.
> there is a way to connect to the db with IJ, using ClientDriver? I want to
> see within ij it works or not..

You bet!

In fact, you'll probably feel a lot more comfortable working with Derby if
you take some time now to get more comfortable with the built-in Derby tools,
such as ij, and the network server.

Here's a great place to start for learning how to use ij with the client driver:
http://db.apache.org/derby/docs/10.6/getstart/twwdactivity2.html

You'll find lots of other similar material in the Getting Started guide:
http://db.apache.org/derby/docs/10.6/getstart/

thanks,

bryan

Re: Derby : No suitable driver found for jdbc:derby:db;create=true

Posted by BeNdErR <be...@hotmail.com>.
I used embeddeddriver for login-server, and clientdriver for the other
server, starting network server inside the first one(login server).
Now there's a problem with the client, that can't found the right path to
the db :\ I think my "localhost" path is not correct, this is first part of
the error:


DBMS.newThread() SQLException: java.net.ConnectException : connection error
at localhost on port 1527 with message Connection refused.
java.sql.SQLNonTransientConnectionException: java.net.ConnectException :
connection error at localhost on port 1527 with message Connection refused.


(I translated the error, you should understand it anyway).
These are the settings I run for the client server within the connection
function:


driver = "org.apache.derby.jdbc.ClientDriver";
connectionURL = "jdbc:derby://localhost:1527/db;user=APP;password=";
..
Class.forName(driver).newInstance();
..
conn = DriverManager.getConnection(connectionURL);
..

the psw is empty because I read there's no password as default. By the way I
can't find out how to create another user or change a password in derby :(

I also tryed to use this connectionURL, thinking the "localhost" was the
thing that was messing all up:

connectionURL = "jdbc:derby:/home/user/app/db;user=APP;password=";

that is the same I use for the loginserver to connect to derby (tell me if I
have to use localhost too there)

and this is the error:


DBMS.newThread() SQLException: No suitable driver found for
jdbc:derby:/home/user/app/db;user=APP;password=
java.sql.SQLException: No suitable driver found for
jdbc:derby:/home/user/app/db;user=APP;password=


there is a way to connect to the db with IJ, using ClientDriver? I want to
see within ij it works or not..

Thanks

-- 
View this message in context: http://old.nabble.com/Derby-%3A-No-suitable-driver-found-for-jdbc%3Aderby%3Adb-create%3Dtrue-tp30335341p30406849.html
Sent from the Apache Derby Users mailing list archive at Nabble.com.


Re: Derby : No suitable driver found for jdbc:derby:db;create=true

Posted by Bryan Pendleton <bp...@gmail.com>.
> My app is made of a login-server connected with embeddeddriver to the derby,
> and another server that needs to connect too to the database.

You can use what is called the "Embedded Server", where one program directly
accesses the database using the embedded driver, while that same program
also accepts connections over the net, thus allowing your other program(s)
to access the database using the client driver.

http://db.apache.org/derby/docs/10.4/adminguide/radminembeddedserverex.html

So:
1) Main server accesses Derby directly, with embedded driver
2) Main server also starts a Network Server inside of it
3) All other programs access Derby via the main server, using the client driver

Alternately (and this is what I generally do), you can run the Network Server
as a standalone Derby server, and then run *all* of your programs using the
client driver:
1) Start the Network Server as a standalone process
2) Main server accesses Derby via client driver
3) All other programs access Derby via client driver

No matter what, the programs which access Derby via the client driver can
only do so successfully when the Network Server is up and running, so
operationally your procedures have to allow for starting the Network Server
at the appropriate time(s) and having it running when you need access to
the database.

thanks,

bryan

Re: Derby : No suitable driver found for jdbc:derby:db;create=true

Posted by BeNdErR <be...@hotmail.com>.
I'm quoting this message from Bryan, that replyed in another thread due to
post pending in this thread. I preferred to answer here for the context of
the argument.

(this is the link of the other thread:
http://old.nabble.com/Derby%3A-SQL-ERROR--%3E-Encountered-%22CASCADE%22-at-line-xyz-td30366617.html#a30398400)


Bryan Pendleton-3 wrote:
> 
> I'm not sure. That problem is really odd. I think that Kristian's theory
> about classloaders is the most likely, as application servers and RMI
> runtimes
> tend to provide really finicky class loading behaviors. Since you've
> demonstrated
> that the simple "java -classpath ..." command can successfully load and
> run
> Derby, you've obviously got a valid copy of the Derby jar files, and
> you've
> obviously set the classpath correctly to point at those jars, which
> normally
> is all you need to do.
> 
> So something in your server code must be interfering with the
> Class.forName()
> behavior, which as I noted above is not uncommon with complex server
> runtimes.
> 
> For example, some application servers have security constraints in their
> class loading behaviors, and won't allow application code to load
> arbitrary
> libraries without configuring the server's security system to allow the
> library loading.
> 
> Class.forName() is a base JDK call, not a Derby call, so I'm afraid
> that you're going to need to seek help from your server provider. Did you
> write this server code yourself, or is it a well-known server of some
> type?
> 
> The only other things I can think to try are:
> 1) see if your JDK has any additional diagnostic flags you can run; for
> example I think the Sun JDK provides a "java -verbose:class" flag that
> might give you more clues about the class-loading activity.
> 2) see if you can find a powerful Java debugger, and run your server under
> the Java debugger, and break at the point where you're about to do the
> Class.forName call, and see if your debugger has any tools to diagnose the
> ClassNotFoundException; for example I think you can load the Sun JDK
> source.zip
> for the Sun Java runtime sources, and possibly your debugger will then
> allow
> you to step through the Class.forName call and see if you can spot why
> it's failing.
> 
> thanks,
> 
> bryan
> 

as you can read in my penultimate post, I found the right configuration. It
was (probably) a problem with the activatable server, as bryan said too.

But now that's working, I've another question for you:

My app is made of a login-server connected with embeddeddriver to the derby,
and another server that needs to connect too to the database. Reading derby
manual, I found I need to use ClientDriver, to avoid the "maybe someone is
already connected to the db" (in this case, the login-server) message.
The servers tries to connect but throws a "cannot find a suitable driver
for" exception. The question is:

if, for the login srv, I use 'jdbc:derby:/path/db/;create=true' as the
connection url the driver manager connects to (with embeddedDriver), do I
have to use the same connection url for the client driver? Do I have to
specify the user (APP as default) and the password (I can't find out how to
set a new pass, the default seems to be empty reading derby tutorials)? Do I
have to run the derby-server before I start my entire application and then
connect with something like
'jdbc:derby://localhost:port/dbname;blahblahblah' for both my servers?

thanks in advance, I hope you understand what I said :D
-- 
View this message in context: http://old.nabble.com/Derby-%3A-No-suitable-driver-found-for-jdbc%3Aderby%3Adb-create%3Dtrue-tp30335341p30398519.html
Sent from the Apache Derby Users mailing list archive at Nabble.com.


Re: Derby : No suitable driver found for jdbc:derby:db;create=true

Posted by BeNdErR <be...@hotmail.com>.
Thanks everyone, I made it!

Maybe it was a classpath conflict, because I specifyed more than once the
path to get the derby.jar file. I removed every call to -classpath, then I
used it only in the activatable server setup, and it works :) probably as
kristian said there were a mess with that.

Thanks again
-- 
View this message in context: http://old.nabble.com/Derby-%3A-No-suitable-driver-found-for-jdbc%3Aderby%3Adb-create%3Dtrue-tp30335341p30366664.html
Sent from the Apache Derby Users mailing list archive at Nabble.com.


Re: Derby : No suitable driver found for jdbc:derby:db;create=true

Posted by BeNdErR <be...@hotmail.com>.
For the login I use an activatable server (this app uses java rmi), then,
once I'm done with this derby problem, I'll use another "normal" server that
extends UnicastRemoteObject.

If I haven't answered your question properly, tell me :)


Kristian Waagan-2 wrote:
> 
>   On 02.12.10 16:35, BeNdErR wrote:
>> I modifyed as you told me, that's the error print I get in the client
>> window:
>>
>> SQLState:08001
>> Error Code:0
>> Message:No suitable driver found for jdbc:derby:db;create=true
>>
>>
>> The rmid window, for the activatable server, shows this error:
> 
> Maybe you already said, but what kind of server are you using?
> 
> I have experienced that if you include a jar-file ([1]) on the classpath 
> from two different locations, things will go crazy. This was using an 
> appserver, where the jar was loaded both from a system-wide lib 
> directory and a domain-specific lib directory.
> 
> 
> -- 
> Kristian
> 
> [1] Not sure if this is a general problem, or a Derby-specific problem.
> 
>>
>> Thu Dec 02 16:22:34 CET 2010:ExecGroup-0:out: DBMS.java
>> ClassNotFoundException Error: org.apache.derby.jdbc.EmbeddedDriver
>> Thu Dec 02 16:22:34 CET
>> 2010:ExecGroup-0:err:java.lang.ClassNotFoundException:
>> org.apache.derby.jdbc.EmbeddedDriver
>> Thu Dec 02 16:22:34 CET 2010:ExecGroup-0:err:	at
>> java.net.URLClassLoader$1.run(URLClassLoader.java:202)
>> Thu Dec 02 16:22:34 CET 2010:ExecGroup-0:err:	at
>> java.security.AccessController.doPrivileged(Native Method)
>> Thu Dec 02 16:22:34 CET 2010:ExecGroup-0:err:	at
>> java.net.URLClassLoader.findClass(URLClassLoader.java:190)
>> Thu Dec 02 16:22:34 CET 2010:ExecGroup-0:err:	at
>> java.lang.ClassLoader.loadClass(ClassLoader.java:307)
>> Thu Dec 02 16:22:34 CET 2010:ExecGroup-0:err:	at
>> java.lang.ClassLoader.loadClass(ClassLoader.java:248)
>> Thu Dec 02 16:22:34 CET 2010:ExecGroup-0:err:	at
>> java.lang.Class.forName0(Native Method)
>> Thu Dec 02 16:22:34 CET 2010:ExecGroup-0:err:	at
>> java.lang.Class.forName(Class.java:169)
>> Thu Dec 02 16:22:34 CET 2010:ExecGroup-0:err:	at
>> tmp.DBMS.<init>(DBMS.java:24)
>> Thu Dec 02 16:22:34 CET 2010:ExecGroup-0:out:Apro la connessione con il
>> DB.
>> Thu Dec 02 16:22:34 CET 2010:ExecGroup-0:err:	at
>> tmp.AuthServer.register(AuthServer.java:79)
>> Thu Dec 02 16:22:34 CET 2010:ExecGroup-0:err:	at
>> sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>> Thu Dec 02 16:22:34 CET 2010:ExecGroup-0:err:	at
>> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>> Thu Dec 02 16:22:34 CET 2010:ExecGroup-0:err:	at
>> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>> Thu Dec 02 16:22:34 CET 2010:ExecGroup-0:err:	at
>> java.lang.reflect.Method.invoke(Method.java:597)
>> Thu Dec 02 16:22:34 CET 2010:ExecGroup-0:err:	at
>> sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:305)
>> Thu Dec 02 16:22:34 CET 2010:ExecGroup-0:err:	at
>> sun.rmi.transport.Transport$1.run(Transport.java:159)
>> Thu Dec 02 16:22:34 CET 2010:ExecGroup-0:err:	at
>> java.security.AccessController.doPrivileged(Native Method)
>> Thu Dec 02 16:22:34 CET 2010:ExecGroup-0:err:	at
>> sun.rmi.transport.Transport.serviceCall(Transport.java:155)
>> Thu Dec 02 16:22:34 CET 2010:ExecGroup-0:err:	at
>> sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:535)
>> Thu Dec 02 16:22:34 CET 2010:ExecGroup-0:err:	at
>> sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:790)
>> Thu Dec 02 16:22:34 CET 2010:ExecGroup-0:err:	at
>> sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:649)
>> Thu Dec 02 16:22:34 CET 2010:ExecGroup-0:err:	at
>> java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
>> Thu Dec 02 16:22:34 CET 2010:ExecGroup-0:err:	at
>> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
>> Thu Dec 02 16:22:34 CET 2010:ExecGroup-0:err:	at
>> java.lang.Thread.run(Thread.java:662)
>>
>> the first error is thrown when he enters the DBMS constructor. In the
>> setup
>> code of the activatable server I used this setting to tell him where he
>> can
>> find *.class he needs:
>> prop.put("java.class.path", "/home/user/app/lib/");
>> because rmid does not accept a -classpath option, I assume that putting
>> the
>> classpath into the code is an alternative method..
>> I never mentioned before this error because, sincerely and stupidly, I
>> never
>> watched the rmid window, focusing only on the client error.
>>
>> I have a question: does the fact that I run every piece of the app
>> (server,
>> rmid, client) in different shells? I mean, running (or trying) derby in
>> one
>> shell, lets the others interact with it?
>> Another question: my scope is to build this app with a database, then
>> move
>> ALL the codes into another pc, without installing derby (I can't because
>> on
>> that pc I'm not the admin). I thought was enough to move all the derby
>> libraries in a folder, and then run everywhere I need my application.. Am
>> I
>> all abroad?
>>
>> Hoping I'm not wasting your time in a useless thing, thanks a lot
> 
> 
> 

-- 
View this message in context: http://old.nabble.com/Derby-%3A-No-suitable-driver-found-for-jdbc%3Aderby%3Adb-create%3Dtrue-tp30335341p30366541.html
Sent from the Apache Derby Users mailing list archive at Nabble.com.


Re: Derby : No suitable driver found for jdbc:derby:db;create=true

Posted by BeNdErR <be...@hotmail.com>.
@kristian
For the login I use an activatable server (this app uses java rmi), then,
once I'm done with this derby problem, I'll use another "normal" server that
extends UnicastRemoteObject.

If I haven't answered your question properly, tell me. Thanks
-- 
View this message in context: http://old.nabble.com/Derby-%3A-No-suitable-driver-found-for-jdbc%3Aderby%3Adb-create%3Dtrue-tp30335341p30366559.html
Sent from the Apache Derby Users mailing list archive at Nabble.com.


Re: Derby : No suitable driver found for jdbc:derby:db;create=true

Posted by Kristian Waagan <kr...@oracle.com>.
  On 02.12.10 16:35, BeNdErR wrote:
> I modifyed as you told me, that's the error print I get in the client window:
>
> SQLState:08001
> Error Code:0
> Message:No suitable driver found for jdbc:derby:db;create=true
>
>
> The rmid window, for the activatable server, shows this error:

Maybe you already said, but what kind of server are you using?

I have experienced that if you include a jar-file ([1]) on the classpath 
from two different locations, things will go crazy. This was using an 
appserver, where the jar was loaded both from a system-wide lib 
directory and a domain-specific lib directory.


-- 
Kristian

[1] Not sure if this is a general problem, or a Derby-specific problem.

>
> Thu Dec 02 16:22:34 CET 2010:ExecGroup-0:out: DBMS.java
> ClassNotFoundException Error: org.apache.derby.jdbc.EmbeddedDriver
> Thu Dec 02 16:22:34 CET
> 2010:ExecGroup-0:err:java.lang.ClassNotFoundException:
> org.apache.derby.jdbc.EmbeddedDriver
> Thu Dec 02 16:22:34 CET 2010:ExecGroup-0:err:	at
> java.net.URLClassLoader$1.run(URLClassLoader.java:202)
> Thu Dec 02 16:22:34 CET 2010:ExecGroup-0:err:	at
> java.security.AccessController.doPrivileged(Native Method)
> Thu Dec 02 16:22:34 CET 2010:ExecGroup-0:err:	at
> java.net.URLClassLoader.findClass(URLClassLoader.java:190)
> Thu Dec 02 16:22:34 CET 2010:ExecGroup-0:err:	at
> java.lang.ClassLoader.loadClass(ClassLoader.java:307)
> Thu Dec 02 16:22:34 CET 2010:ExecGroup-0:err:	at
> java.lang.ClassLoader.loadClass(ClassLoader.java:248)
> Thu Dec 02 16:22:34 CET 2010:ExecGroup-0:err:	at
> java.lang.Class.forName0(Native Method)
> Thu Dec 02 16:22:34 CET 2010:ExecGroup-0:err:	at
> java.lang.Class.forName(Class.java:169)
> Thu Dec 02 16:22:34 CET 2010:ExecGroup-0:err:	at
> tmp.DBMS.<init>(DBMS.java:24)
> Thu Dec 02 16:22:34 CET 2010:ExecGroup-0:out:Apro la connessione con il DB.
> Thu Dec 02 16:22:34 CET 2010:ExecGroup-0:err:	at
> tmp.AuthServer.register(AuthServer.java:79)
> Thu Dec 02 16:22:34 CET 2010:ExecGroup-0:err:	at
> sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> Thu Dec 02 16:22:34 CET 2010:ExecGroup-0:err:	at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> Thu Dec 02 16:22:34 CET 2010:ExecGroup-0:err:	at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> Thu Dec 02 16:22:34 CET 2010:ExecGroup-0:err:	at
> java.lang.reflect.Method.invoke(Method.java:597)
> Thu Dec 02 16:22:34 CET 2010:ExecGroup-0:err:	at
> sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:305)
> Thu Dec 02 16:22:34 CET 2010:ExecGroup-0:err:	at
> sun.rmi.transport.Transport$1.run(Transport.java:159)
> Thu Dec 02 16:22:34 CET 2010:ExecGroup-0:err:	at
> java.security.AccessController.doPrivileged(Native Method)
> Thu Dec 02 16:22:34 CET 2010:ExecGroup-0:err:	at
> sun.rmi.transport.Transport.serviceCall(Transport.java:155)
> Thu Dec 02 16:22:34 CET 2010:ExecGroup-0:err:	at
> sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:535)
> Thu Dec 02 16:22:34 CET 2010:ExecGroup-0:err:	at
> sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:790)
> Thu Dec 02 16:22:34 CET 2010:ExecGroup-0:err:	at
> sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:649)
> Thu Dec 02 16:22:34 CET 2010:ExecGroup-0:err:	at
> java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
> Thu Dec 02 16:22:34 CET 2010:ExecGroup-0:err:	at
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
> Thu Dec 02 16:22:34 CET 2010:ExecGroup-0:err:	at
> java.lang.Thread.run(Thread.java:662)
>
> the first error is thrown when he enters the DBMS constructor. In the setup
> code of the activatable server I used this setting to tell him where he can
> find *.class he needs:
> prop.put("java.class.path", "/home/user/app/lib/");
> because rmid does not accept a -classpath option, I assume that putting the
> classpath into the code is an alternative method..
> I never mentioned before this error because, sincerely and stupidly, I never
> watched the rmid window, focusing only on the client error.
>
> I have a question: does the fact that I run every piece of the app (server,
> rmid, client) in different shells? I mean, running (or trying) derby in one
> shell, lets the others interact with it?
> Another question: my scope is to build this app with a database, then move
> ALL the codes into another pc, without installing derby (I can't because on
> that pc I'm not the admin). I thought was enough to move all the derby
> libraries in a folder, and then run everywhere I need my application.. Am I
> all abroad?
>
> Hoping I'm not wasting your time in a useless thing, thanks a lot


Re: Derby : No suitable driver found for jdbc:derby:db;create=true

Posted by BeNdErR <be...@hotmail.com>.
I modifyed as you told me, that's the error print I get in the client window:

SQLState:08001
Error Code:0
Message:No suitable driver found for jdbc:derby:db;create=true


The rmid window, for the activatable server, shows this error:


Thu Dec 02 16:22:34 CET 2010:ExecGroup-0:out: DBMS.java
ClassNotFoundException Error: org.apache.derby.jdbc.EmbeddedDriver
Thu Dec 02 16:22:34 CET
2010:ExecGroup-0:err:java.lang.ClassNotFoundException:
org.apache.derby.jdbc.EmbeddedDriver
Thu Dec 02 16:22:34 CET 2010:ExecGroup-0:err:	at
java.net.URLClassLoader$1.run(URLClassLoader.java:202)
Thu Dec 02 16:22:34 CET 2010:ExecGroup-0:err:	at
java.security.AccessController.doPrivileged(Native Method)
Thu Dec 02 16:22:34 CET 2010:ExecGroup-0:err:	at
java.net.URLClassLoader.findClass(URLClassLoader.java:190)
Thu Dec 02 16:22:34 CET 2010:ExecGroup-0:err:	at
java.lang.ClassLoader.loadClass(ClassLoader.java:307)
Thu Dec 02 16:22:34 CET 2010:ExecGroup-0:err:	at
java.lang.ClassLoader.loadClass(ClassLoader.java:248)
Thu Dec 02 16:22:34 CET 2010:ExecGroup-0:err:	at
java.lang.Class.forName0(Native Method)
Thu Dec 02 16:22:34 CET 2010:ExecGroup-0:err:	at
java.lang.Class.forName(Class.java:169)
Thu Dec 02 16:22:34 CET 2010:ExecGroup-0:err:	at
tmp.DBMS.<init>(DBMS.java:24)
Thu Dec 02 16:22:34 CET 2010:ExecGroup-0:out:Apro la connessione con il DB.
Thu Dec 02 16:22:34 CET 2010:ExecGroup-0:err:	at
tmp.AuthServer.register(AuthServer.java:79)
Thu Dec 02 16:22:34 CET 2010:ExecGroup-0:err:	at
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
Thu Dec 02 16:22:34 CET 2010:ExecGroup-0:err:	at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
Thu Dec 02 16:22:34 CET 2010:ExecGroup-0:err:	at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
Thu Dec 02 16:22:34 CET 2010:ExecGroup-0:err:	at
java.lang.reflect.Method.invoke(Method.java:597)
Thu Dec 02 16:22:34 CET 2010:ExecGroup-0:err:	at
sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:305)
Thu Dec 02 16:22:34 CET 2010:ExecGroup-0:err:	at
sun.rmi.transport.Transport$1.run(Transport.java:159)
Thu Dec 02 16:22:34 CET 2010:ExecGroup-0:err:	at
java.security.AccessController.doPrivileged(Native Method)
Thu Dec 02 16:22:34 CET 2010:ExecGroup-0:err:	at
sun.rmi.transport.Transport.serviceCall(Transport.java:155)
Thu Dec 02 16:22:34 CET 2010:ExecGroup-0:err:	at
sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:535)
Thu Dec 02 16:22:34 CET 2010:ExecGroup-0:err:	at
sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:790)
Thu Dec 02 16:22:34 CET 2010:ExecGroup-0:err:	at
sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:649)
Thu Dec 02 16:22:34 CET 2010:ExecGroup-0:err:	at
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
Thu Dec 02 16:22:34 CET 2010:ExecGroup-0:err:	at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
Thu Dec 02 16:22:34 CET 2010:ExecGroup-0:err:	at
java.lang.Thread.run(Thread.java:662)

the first error is thrown when he enters the DBMS constructor. In the setup
code of the activatable server I used this setting to tell him where he can
find *.class he needs:
prop.put("java.class.path", "/home/user/app/lib/");
because rmid does not accept a -classpath option, I assume that putting the
classpath into the code is an alternative method..
I never mentioned before this error because, sincerely and stupidly, I never
watched the rmid window, focusing only on the client error.

I have a question: does the fact that I run every piece of the app (server,
rmid, client) in different shells? I mean, running (or trying) derby in one
shell, lets the others interact with it?
Another question: my scope is to build this app with a database, then move
ALL the codes into another pc, without installing derby (I can't because on
that pc I'm not the admin). I thought was enough to move all the derby
libraries in a folder, and then run everywhere I need my application.. Am I
all abroad?

Hoping I'm not wasting your time in a useless thing, thanks a lot
-- 
View this message in context: http://old.nabble.com/Derby-%3A-No-suitable-driver-found-for-jdbc%3Aderby%3Adb-create%3Dtrue-tp30335341p30359597.html
Sent from the Apache Derby Users mailing list archive at Nabble.com.


Re: Derby : No suitable driver found for jdbc:derby:db;create=true

Posted by Bryan Pendleton <bp...@gmail.com>.
> --------- Informazioni su Derby --------
> JRE - JDBC: Java SE 6 - JDBC 4.0
> [/home/user/app/lib/derby.jar] 10.6.2.1 - (999685)
> [/home/user/app/lib/derbytools.jar] 10.6.2.1 - (999685)
> ------------------------------------------------------

What the above tells me is that your classpath is OK. The problem
is not with the classpath, it must be somewhere else, because
the sysinfo tool is able to load and read the relevant Derby jar
files from your classpath without problems.

I think the next thing to try is to get more information about
the actual exception that is thrown.

Firstly, can you find a 'derby.log' file with a timestamp that
matches the run of your server? If so, can you post the contents
of the derby.log file that correspond to the run that gets the
'no suitable driver' message?

Secondly, can you try modifying your application along the lines
described here: http://wiki.apache.org/db-derby/UnwindExceptionChain
and see if you can gather more detailed information about the
actual exception that is being thrown?

thanks,

bryan

Re: Derby : No suitable driver found for jdbc:derby:db;create=true

Posted by BeNdErR <be...@hotmail.com>.
@bryan
I tryed to run ij instead of tmp.Setup, as you said, then I tryed to connect
to a new db, that's what I got:

ij> CONNECT 'ciao;create=true';
ERRORE 08001: No suitable driver found for ciao;create=true
ij> 


so something is still wrong :\

running org.apache.derby.tools.sysinfo I have:


------------------ Informazioni su Java ------------------
Versione Java:   1.6.0_22
Fornitore Java:  Sun Microsystems Inc.
Home Java:       /usr/lib/jvm/java-6-sun-1.6.0.22/jre
Percorso classi Java: 
/home/user/app/lib/derby.jar:.:/home/user/app/lib/derbytools.jar:.
Nome SO:         Linux
Architettura SO: i386
Versione SO:     2.6.35-23-generic
Nome utente Java: user
Home utente Java: /home/user
Dir utente Java: /home/user/app/server
java.specification.name: Java Platform API Specification
java.specification.version: 1.6
java.runtime.version: 1.6.0_22-b04
--------- Informazioni su Derby --------
JRE - JDBC: Java SE 6 - JDBC 4.0
[/home/user/app/lib/derby.jar] 10.6.2.1 - (999685)
[/home/user/app/lib/derbytools.jar] 10.6.2.1 - (999685)
------------------------------------------------------
----------------- Informazioni sulla locale -----------------
Locale attuale:  [italiano/Italia [it_IT]]
E' stato trovato il supporto per la locale: [it]
	 versione: 10.6.2.1 - (999685)
------------------------------------------------------

If you need something to be translated, tell me.
In ~/home/user/app/lib/ folder I have these files: derby.jar, derby.war.
derbyclient.jar, derbyLocale_it.jar, derbynet.jar, derbyrun.jar,
derbytools.jar.
In the original derby installation folder, in /lib/ there are more file than
I have in my app/lib, because I removed all the *.jar for the other
languages (to be nerdy, i removed all derbyLocale_xy.jar where (xy != it). I
don't think the problem it's there anyway...

To anyone who is still reading and replying to this thread, thanks a lot,
you're very kind.
-- 
View this message in context: http://old.nabble.com/Derby-%3A-No-suitable-driver-found-for-jdbc%3Aderby%3Adb-create%3Dtrue-tp30335341p30352053.html
Sent from the Apache Derby Users mailing list archive at Nabble.com.


Re: Derby : No suitable driver found for jdbc:derby:db;create=true

Posted by Bryan Pendleton <bp...@gmail.com>.
> reading the last link you posted, about classpath usage, I had some doubts
> about my server startup, so here is the entire command I run for the server:
>
>
> java -classpath :/home/user/app/lib/derbyrun.jar:/home/user/app/shared/
> -Djava.rmi.server.codebase=file:///home/user/app/shared/
> -Dtmp.impl.codebase=file:///home/user/app/shared/
> -Djava.security.policy=/home/user/app/server/tmp/setup.policy
> -Dtmp.classeserver=tmp.AuthServer
> -Dtmp.policy=/home/user/app/server/tmp/group.policy tmp.Setup

Try replacing 'tmp.Setup' at the end of this command with
'org.apache.derby.tools.ij'. Does the Derby IJ tool then start up and
run properly? Can you create and open a database, and create data in it?

Another useful class to run is 'org.apache.derby.tools.sysinfo'; when it runs,
it will print a useful report about the java environment that is running it.

If these run, then the classpath is working properly, as least for Derby's purposes.

But if you can't run the IJ tool using this java command, then we need to keep
working on this command until you can successfully run IJ with it, then we
can return to trying to run your full server with this command.

thanks,

bryan

P.S. Like Ron Rudy, I'm also unsure about the leading colon, I generally don't have that.

Re: Derby : No suitable driver found for jdbc:derby:db;create=true

Posted by BeNdErR <be...@hotmail.com>.
@ron

I'm running everything under linux :) you see windows code because of the
windows classpath guide. By the way, I did not rename any file, maybe I have
to add all the others packages... But the strange thing is that he can't
find a suitable driver


Admin RemoteException: No suitable driver found for
jdbc:derby:db;create=true
java.sql.SQLException: No suitable driver found for
jdbc:derby:db;create=true


The CLASSPATH setting is right? (I wrote my settings in the first post).

about this:
> Though I get my jars through maven so I don't know whether direct
> downloads are named differently 
> or if you renamed anything.  Also, you shouldn't need a leading
> colon/semicolon.

I didn't understand what "maven" is, is a site? And about the leading
colon/semicolon, you mean I need just one path in the classpath command?

thanks
-- 
View this message in context: http://old.nabble.com/Derby-%3A-No-suitable-driver-found-for-jdbc%3Aderby%3Adb-create%3Dtrue-tp30335341p30348689.html
Sent from the Apache Derby Users mailing list archive at Nabble.com.


Re: Derby : No suitable driver found for jdbc:derby:db;create=true

Posted by Ron Rudy <ro...@gmail.com>.
Windows uses the semicolon, not the colon, to separate files/paths for the
classpath.  So it should read:

java -classpath /home/user/app/lib/derbyrun.jar;/home/user/app/shared/
-Djava.rmi.server.codebase=file:///home/user/app/shared/
-Dtmp.impl.codebase=file:///home/user/app/shared/
-Djava.security.policy=/home/user/app/server/tmp/setup.policy
-Dtmp.classeserver=tmp.AuthServer
-Dtmp.policy=/home/user/app/server/tmp/group.policy tmp.Setup

I'm also not sure that derbyrun.jar is the only derby file you need?  Though
I get my jars through maven so I don't know whether direct downloads are
named differently or if you renamed anything.  Also, you shouldn't need a
leading colon/semicolon.

-Ron

On Wed, Dec 1, 2010 at 6:13 AM, BeNdErR <be...@hotmail.com>wrote:

>
> thanks everyone for your reply.
>
> The wildcard is recognised by the shell (echo /path/* works, showing all
> the
> files in the directory) but as Ron said, I can't use wildcards for
> classpath.
> I tryed changing "/*" with "/derbyrun.jar" but nothing new happened, same
> error shows
>
> @bryan
>
> reading the last link you posted, about classpath usage, I had some doubts
> about my server startup, so here is the entire command I run for the
> server:
>
>
> java -classpath :/home/user/app/lib/derbyrun.jar:/home/user/app/shared/
> -Djava.rmi.server.codebase=file:///home/user/app/shared/
> -Dtmp.impl.codebase=file:///home/user/app/shared/
> -Djava.security.policy=/home/user/app/server/tmp/setup.policy
> -Dtmp.classeserver=tmp.AuthServer
> -Dtmp.policy=/home/user/app/server/tmp/group.policy tmp.Setup
>
>
> my doubt is on this part of "Setting the class path" link, maybe because I
> read the windows version and not the linux one :D
> (
> http://download.oracle.com/javase/6/docs/technotes/tools/windows/classpath.html
> )
>
>
> C:> java -classpath C:\java\MyClasses utility.myapp.Cool
>
> When the app runs, the JVM uses the class path settings to find any other
> classes defined in the utility.myapp package that are used by the Cool
> class.
>
>
> as you can see I run the server setup in the tmp package. Reading the
> article mentioned before, what I understood is that all the classes my
> Setup
> needs are searched in the classpath linked by the command, but in a tmp
> folder. Am I wrong?
>
> thanks (hope you understand my english-way-to-explain)
>
>
> --
> View this message in context:
> http://old.nabble.com/Derby-%3A-No-suitable-driver-found-for-jdbc%3Aderby%3Adb-create%3Dtrue-tp30335341p30347946.html
> Sent from the Apache Derby Users mailing list archive at Nabble.com.
>
>

Re: Derby : No suitable driver found for jdbc:derby:db;create=true

Posted by BeNdErR <be...@hotmail.com>.
thanks everyone for your reply.

The wildcard is recognised by the shell (echo /path/* works, showing all the
files in the directory) but as Ron said, I can't use wildcards for
classpath.
I tryed changing "/*" with "/derbyrun.jar" but nothing new happened, same
error shows

@bryan

reading the last link you posted, about classpath usage, I had some doubts
about my server startup, so here is the entire command I run for the server:


java -classpath :/home/user/app/lib/derbyrun.jar:/home/user/app/shared/
-Djava.rmi.server.codebase=file:///home/user/app/shared/
-Dtmp.impl.codebase=file:///home/user/app/shared/
-Djava.security.policy=/home/user/app/server/tmp/setup.policy
-Dtmp.classeserver=tmp.AuthServer
-Dtmp.policy=/home/user/app/server/tmp/group.policy tmp.Setup


my doubt is on this part of "Setting the class path" link, maybe because I
read the windows version and not the linux one :D
(http://download.oracle.com/javase/6/docs/technotes/tools/windows/classpath.html)


C:> java -classpath C:\java\MyClasses utility.myapp.Cool

When the app runs, the JVM uses the class path settings to find any other
classes defined in the utility.myapp package that are used by the Cool
class.


as you can see I run the server setup in the tmp package. Reading the
article mentioned before, what I understood is that all the classes my Setup
needs are searched in the classpath linked by the command, but in a tmp
folder. Am I wrong?

thanks (hope you understand my english-way-to-explain)


-- 
View this message in context: http://old.nabble.com/Derby-%3A-No-suitable-driver-found-for-jdbc%3Aderby%3Adb-create%3Dtrue-tp30335341p30347946.html
Sent from the Apache Derby Users mailing list archive at Nabble.com.


Re: Derby : No suitable driver found for jdbc:derby:db;create=true

Posted by Ron Rudy <ro...@gmail.com>.
That will not work, you can't use wildcards for classpath.

When you add a folder to the classpath, it's expected to be a folder
containing classes exploded (complete with the folder path matching the
package names); when you add individual jars to the classpath you must add
each separately.

-Ron

On Tue, Nov 30, 2010 at 7:47 AM, BeNdErR
<be...@hotmail.com>wrote:

>
>
>
> Bryan Pendleton-3 wrote:
> >
> > I believe that the server will need to have derby.jar in its classpath.
> > When
> > you use the EmbeddedDriver, the Derby database libraries run inside of
> > your
> > application's JVM and so they need to be in your application's classpath.
> > Here,
> > the relevant application is the server, since it is the one making the
> > JDBC calls.
> >
> > thanks,
> >
> > bryan
> >
> >
>
>  java -classpath :/home/user/app/lib/*:/home/user/app/shared/
>
> Do I have to change this? I thought I already set it up properly :\ as you
> can see in the classpath there's the path to derby (inside the lib folder),
> maybe the " * " part is wrong. You think i need to specify the complete
> path
> .../lib/derby.jar or using the "star" works?
>
> Thanks
>
>
> --
> View this message in context:
> http://old.nabble.com/Derby-%3A-No-suitable-driver-found-for-jdbc%3Aderby%3Adb-create%3Dtrue-tp30335341p30339246.html
> Sent from the Apache Derby Users mailing list archive at Nabble.com.
>
>

Re: Derby : No suitable driver found for jdbc:derby:db;create=true

Posted by BeNdErR <be...@hotmail.com>.


Bryan Pendleton-3 wrote:
> 
> I believe that the server will need to have derby.jar in its classpath.
> When
> you use the EmbeddedDriver, the Derby database libraries run inside of
> your
> application's JVM and so they need to be in your application's classpath.
> Here,
> the relevant application is the server, since it is the one making the
> JDBC calls.
> 
> thanks,
> 
> bryan
> 
> 

 java -classpath :/home/user/app/lib/*:/home/user/app/shared/

Do I have to change this? I thought I already set it up properly :\ as you
can see in the classpath there's the path to derby (inside the lib folder),
maybe the " * " part is wrong. You think i need to specify the complete path
.../lib/derby.jar or using the "star" works?

Thanks


-- 
View this message in context: http://old.nabble.com/Derby-%3A-No-suitable-driver-found-for-jdbc%3Aderby%3Adb-create%3Dtrue-tp30335341p30339246.html
Sent from the Apache Derby Users mailing list archive at Nabble.com.


Re: Derby : No suitable driver found for jdbc:derby:db;create=true

Posted by Bryan Pendleton <bp...@gmail.com>.
> 			Class.forName("org.apache.derby.jdbc.EmbeddedDriver").newInstance();
>
> the DBMS call is inside a method of the server, which is called remotely by
> the client (thinks it's the cause of the RemoteException). to run the server
> I use these classpath/codebase parameters:
>
> java -classpath :/home/user/app/lib/*:/home/user/app/shared/
> -Djava.rmi.server.codebase=file:///home/user/app/shared/
>
>
> but it seems the server couldn't reach the drivers.. I don't understand why!

I believe that the server will need to have derby.jar in its classpath. When
you use the EmbeddedDriver, the Derby database libraries run inside of your
application's JVM and so they need to be in your application's classpath. Here,
the relevant application is the server, since it is the one making the JDBC calls.

thanks,

bryan