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