Re: Can't figure this error out...
Per Nyfelt <[email protected]> Sun, 13 Mar 2005 18:00:24 +0100
| Newsgroups | gmane.comp.java.ozone.user |
|---|---|
| Organization | Resourcing Networks |
| Message-ID | <[email protected]> |
söndagen den 13 mars 2005 16.34 skrev Nicolas Barrera:
> there is no $OZONE_HOME/classes directory, so i didn't found any
> older .class in the classpath (?).
You're missing my point which is about how the server classpath is
constructed. Classes dir is not in the binary distribution but nevertheless
ozoneEnv includes that directory in the classpath if it exists. I use it
personnally to separate Ozone stuff from my own. See the ozoneEnv script for
more details on how the classpath is set.
>
> Here is the code of the client test:
>
> import java.io.BufferedReader;
> import java.io.InputStreamReader;
>
> import org.ozoneDB.ExternalDatabase;
>
> /**
> * @author Nicolás Barrera
> */
> public class Test2 {
>
> private static ExternalDatabase db;
> public static void main (String[] args)throws Exception{
> db = ExternalDatabase.openDatabase("ozonedb:remote://localhost:3333");
> System.out.println("Connected...");
> db.reloadClasses();
>
> Post p = (Post) (db.objectForName("mensaje 3"));
> if (p == null){
> System.out.println("obj not found :@!");
> return;
> }
> System.out.println("Fecha del post: "+p.getFecha()); //ALL THESE
> PRNLN ARE OUTPUTED ON THE ECLIPSE CONSOLE AND NOT ON THE SERVER'S
> (???)
Yes, this is your client program - you are not on the server side here and
hence System.out.printline should output text on the client console. This is
the way it should work IMHO.
> System.out.println("Autor del post: "+p.getAuthor());
> System.out.println("Asunto del post: "+p.getSubject());
>
> BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
> System.out.println("Wanna modify this post?");
> if (in.readLine().equals("y")){
> System.out.println("Set new subject for the post: ");
> p.setSubject("irlandes",in.readLine()); //FIRST PARAM STANDS FOR
> THE USERNAME IN THE PREVIOUS VERSION HERE IT USED TO ASK IF THE
> ENTERED USERNAME WAS EQUAL TO THE STORED IN THE POST OBJ, ELSE IT
> PRINTS A "CAN'T MODIFY POST" MESSAGE..., WHICH IN FACT IS STILL
> APPEARING (IN THE SERVER'S CONSOLE ONLY!).
I think that you have not made your new version available to the server.
> }
> db.close();
> }
> }
>
> I believe the problem has much to do with what you said to me but
> unfortunately i didn't found any /classes directory on OZONE_HOME :(
> any other place i should search?? (i also looked in /lib, but as i
> wasn't using any .jar it was useless)
>
Probably existing CLASSPATH variable affecting the server then...
> well that's it... i could paste more code but i don't wanna be that heavy.
>
> c ya!
Hope this helps,
Per
-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_ide95&alloc_id396&op=click