Re: -URGENT HELP-ozone installation problems....
Per Nyfelt <[email protected]> Mon, 28 Nov 2005 20:46:30 +0000
| Newsgroups | gmane.comp.java.ozone.user |
|---|---|
| Organization | New Field Consulting |
| Message-ID | <[email protected]> |
You need the jar files in %OZONE-HOME%\lib in your classpath to be able to
compile. Easiest is to use Ant to build but if you insist on building
manually run ozoneEnv and then set classpath to %OZONE_CLASSPATH% when
compiling e.g.
javac -classpath %OZONE_CLASSPATH% Car.java
/Per
On Monday 28 November 2005 17.42, ss wrote:
> Hi,
> I intend to run the simple client application given in the ozone user
> guide..... but i get some errors written at the bottom of the code.
>
>
> The Car interface
>
> In our example we would like to store cars. So we need a class named Car.
> But we remember that all database objects are controlled by Proxy objects.
> So the first thing we do is to define the method interface of our Car
> objects. Only the methods of this interface can be used to access the
> underlying database object. To mark this interface as an external interface
> we inherit it from the OzoneRemote interface of Ozone.
>
> import org.ozoneDB.OzoneRemote;
>
> public interface Car extends OzoneRemote {
>
> public void setName( String name ); /*update*/
>
> public String name();
>
> public void setYearOfConst( int year ); /*update*/
>
> public int age();
> }
>
>
>
> The CarImpl class
>
> Our database objects will be instances of the CarImpl class. This class has
> to implement the Car interface. It extends OzoneObject to mark it as a
> database class. Here comes the code for the CarImpl class:
>
> import org.ozoneDB.OzoneObject;
> import java.util.*;
>
> public class CarImpl extends OzoneObject implements Car { /**
> Set version of the serialized data to make it compatible
> with new class versions.
> */
> final static long serialVersi
>
> private String _name;
>
> private int _yearOfConst;
>
> public CarImpl() {
> _name = new String( "" );
> _yearOfC
> }
>
> public String name() {
> return _name;
> }
>
> public void setName( String name ) {
> _name = name;
> }
>
> public void setYearOfConst( int year ) {
> _yearOfC
> }
>
> public int age() {
> Calendar cal = Calendar.getInstance();
> return cal.get (Calendar.YEAR) - _yearOfConst;
> }
> }
>
>
> A simple client application
>
> The client application will create a car, make some operations on it and
> finally delete it. Here is the code of the client application:
>
> import org.ozoneDB.*;
>
> public class MyApp {
>
> private static ExternalDatabase db;
>
> public static void main( String[] args ) throws Exception {
>
> if (args.length == 0) {
> System.out.println( "usage: ojvm MyApp
> create|delete|print" ); System.exit( 1 );
> } // create and open a new database connection
> db = ExternalDatabase.openDatabase(
> "ozonedb:remote://localhost:3333"); System.out.println( "Connected ..." );
>
> db.reloadClasses();
>
> if (args[0].equals( "create" )) {
> createCar();
> } else if (args[0].equals( "delete" )) {
> deleteCar();
> } else {
> printCar();
> }
>
> db.close();
> }
>
> public static void createCar() throws Exception { // create
> a new Car object with the name "my_first_car" // the return value is
> Car_proxy, which implements the Car-interface Car car =
> (Car)(db.createObject( CarImpl.class.getName(), 0, "my_first_car" ));
>
> car.setName( "gottfried" );
> car.setYearOfConst( 1957 );
> }
>
> public static void printCar() throws Exception {
> Car car = (Car)(db.objectForName( "my_first_car" ));
> if (car != null) {
> System.out.println( "The car " + car.name() + " is
> " + car.age() + " years old." );
> } else {
> System.out.println( "Object my_first_car not
> found." ); }
> }
>
> public static void deleteCar() throws Exception {
> Car car = (Car)(db.objectForName( "my_first_car" ));
> if (car != null) {
> db.deleteObject( car );
> } else {
> System.out.println( "Object my_first_car not
> found." ); }
> }
> }
>
>
>
> The following errors i get :...plz help
> What local host am i supposed to set .....look in the client application
> code......it sets some local host......
>
> E:\jdk1.4\bin\ozone-1.2\samples\simple>javac Car.java
> Car.java:1: package org.ozoneDB does not exist
> import org.ozoneDB.OzoneRemote;
> ^
> Car.java:3: cannot resolve symbol
> symbol : class OzoneRemote
> location: interface Car
> public interface Car extends OzoneRemote {
> ^
> 2 errors
>
> On Mon, 28 Nov 2005 Per Nyfelt wrote :
> >The error means ozoneAnt cannot find the ant.jar in %OZONE_HOME%\lib, not
> > sure why and I do not have a windows machine to test on until this
> > week-end.
> >
> >What if you:
> >
> >set OZONE_HOME=E:\jdk1.4\bin\ozone-1.2
> >set PATH=%OZONE_HOME%\bin;%PATH%
> >E:\jdk1.4\bin\ozone-1.2\samples\simple>ozoneAnt
> >
> >Do you get the same result?
> >
> >Regards,
> >Per
> >
> >On Monday 28 November 2005 13.53, ss wrote:
> > > Sorry to be back again:
> > > problem when the client is to b build in the example of sample\simple
> > > is that when the following stmt is executed :
> > >
> > >
> > > E:\jdk1.4\bin\ozone-1.2\samples\simple>E:\jdk1.4\bin\ozone-1.2\bin\ozon
> > >eAnt the error message is:
> > > The system cannot find the specified path
> > > Exception in thread "main" java.lang.NoClassDefFoundError:
> > > org/apache/tools/ant/Main .......plz help me out urgently
> > >
> > > On Sun, 27 Nov 2005 Per Nyfelt wrote :
> > > >If you have %OZONE_HOME%\bin included in the PATH you can run the
> > > > build file (called build.xml btw) by typing ozoneAnt. Actually
> > > > standing in the sample\simple directory you can build by typing
> > > > ..\..\bin\ozoneAnt. This is already described in the README file
> > > > btw...
> > > >
> > > >Regards,
> > > >Per
> > > >
> > > >On Saturday 26 November 2005 18.54, ss wrote:
> > > > > thnx 4 d cooperation so far.......i jst hope it to b the last
> > > > > time..... the ozone server is successfully compiled.... but the
> > > > > problem is in the running of the example: there is a problem in
> > > > > starting the client....there is no build.bat file that needs to b
> > > > > run to build the client....nor could i find 'make' newhere
> > > > > ..........plz suggest smthng
> > > > >
> > > > > On Sat, 26 Nov 2005 Per Nyfelt wrote :
> > > > > >OK, one more try:
> > > > > >
> > > > > >Ozone releases comes in two flavors: a binary and a source
> > > > > > package. The binary distribution is already compiled and is the
> > > > > > easiest one to get started with.
> > > > > >The source distribution contains all source code but no compiled
> > > > > > or packaged classes and needs to be built before it can be used.
> > > > > >
> > > > > >To get started with the binary distribution do the following:
> > > > > >1. unzip ozone-1.2-bin.zip to a directory of choice (eg.
> > > > > > c:\ozone-1.2) 2. set OZONE_HOME to this directory (e.g.
> > > > > > c:\ozone-1.2)
> > > > > >3. create a classes directory (c:\ozone-1.2\classes) where you can
> > > > > > put your own code i.e.
> > > > > >both interface and implementation classes tht needs to be visible
> > > > > > for the server should be in here.
> > > > > >An alternative to this, which is mentioned in the samples, is to
> > > > > > start ozone from the directory where your
> > > > > >classes are compiled (both current directory and
> > > > > > OZONE_HOME\classes are included in the classpath per default.
> > > > > >
> > > > > >That's it; you are now ready to try something out. Client code
> > > > > > that connects to the server needs the ozoneServer.jar to be able
> > > > > > to connect to the server. Look in the samples and in the users
> > > > > > guide for things to get started with and try out.
> > > > > >If later you need more full blown apps look in the ozoneApps cvs
> > > > > > module (also released as ozone applications in source forge)
> > > > > >
> > > > > >Running the ozone server
> > > > > >------------------------
> > > > > >
> > > > > >1. Initialize database directory.
> > > > > >
> > > > > >A database directory holds all files of an ozone database. To
> > > > > > initialize an empty database start the ozone install tool:
> > > > > >
> > > > > > ozoneInst -d<data_directory>
> > > > > >
> > > > > >e.g.
> > > > > >c:\ozone-1.2\bin\>ozoneInst -dc:/ozone-1.2/data
> > > > > >
> > > > > >To see all possible parameters of ozoneInst type 'ozoneInst -h'.
> > > > > >
> > > > > >2. Start the server.
> > > > > >
> > > > > > ozone -d<data_directory> -u<username>
> > > > > >-u can be omitted
> > > > > >e.g.
> > > > > >c:\ozone-1.2\bin\>ozone -dc:/ozone-1.2/data
> > > > > >
> > > > > >You will get some status information and after the initialisation
> > > > > > ozone is up and running. You can setup as many databases and you
> > > > > > can run as many servers as you need on one system. To define
> > > > > > users and to do other administration things use the admin tool:
> > > > > >
> > > > > > ozoneAdmin
> > > > > >
> > > > > >To see all possible commands and parameters of ozoneAdmin type
> > > > > > 'ozoneAdmin -h'.
> > > > > >
> > > > > >You can also try the adminGui which is a Swing based admin tool
> > > > > >
> > > > > > ozoneAdminGui
> > > > > >
> > > > > >Trying out the ozone samples
> > > > > >----------------------------
> > > > > >
> > > > > >IMPORTANT NOTE: the VM of the ozone server must be able to access
> > > > > > the class files of the application. To run the ozone samples, you
> > > > > > may add "." to your CLASSPATH and start the ozone server INSIDE
> > > > > > THE SAMPLE DIRECTORY. Alternatively put your compiled classes in
> > > > > > %OZONE_HOME%\classes.
> > > > > >
> > > > > >1. Start the server.
> > > > > >
> > > > > >Open a new console. Change directory to
> > > > > > <OZONE_HOME>/samples/simple. Install a new database via
> > > > > > 'ozoneInst -d<db_dir>'. Start the server via 'ozone -d<db_dir>
> > > > > > -u<username>' as described above.
> > > > > >
> > > > > >2. Start the Client.
> > > > > >
> > > > > >Open a new console. Change directory to
> > > > > > <OZONE_HOME>/samples/simple. Build the client via
> > > > > > '../../build.[sh|bat]' or 'make'. Start the client via 'ojvm
> > > > > > Client'.
> > > > > >
> > > > > >Good luck!
> > > > > >
> > > > > >On Saturday 26 November 2005 13.36, ss wrote:
> > > > > > > sorry to bother u again:
> > > > > > >
> > > > > > > 1. the problem with binary version is that i could not find
> > > > > > > build.bat file in it......suggest sumthng
> > > > > > >
> > > > > > > 2. plz give me a brief intro of "ant build script"
> > > > > > >
> > > > > > > On Sat, 26 Nov 2005 Per Nyfelt wrote :
> > > > > > > >On Saturday 26 November 2005 05.23, ss wrote:
> > > > > > > > > 1. i ve changed my ozone home to
> > > > > > > > >
> > > > > > > > > :E:\jdk1.4\bin\ozone-1.2\server
> > > > > > > > >
> > > > > > > > > hope it works out
> > > > > > > >
> > > > > > > >No it is not correct for the source distribution.
> > > > > > > >I would strongly you switch to the binary distribution. Get
> > > > > > > > things up and running first before attempting to build the
> > > > > > > > server from source.
> > > > > > > >
> > > > > > > > > 2. kindly specify the step by step procedure to build this
> > > > > > > > > ant build script (where to edit,how to save,how to execute
> > > > > > > > > etc.) as i ve no idea abt it......plz help me out
> > > > > > > >
> > > > > > > >I just did! I dont know how to make it any clearer.
> > > > > > > >
> > > > > > > > > 3. when ozone -d E:\jdk1.4\bin\ozone-1.2\server\data -u
> > > > > > > > > is executed , the err mssg is
> > > > > > > > > Exception in thread "main" java.lang.NoClassDefFoundError:
> > > > > > > > > org/ozoneDB/core/Server wat might b the reason 4
> > > > > > > > > this???????
> > > > > > > >
> > > > > > > >Something is wrong with your classpath. Probably the linefeed
> > > > > > > > problem that makes the scripts uninterpretable by windows.
> > > > > > > >
> > > > > > > > > On Fri, 25 Nov 2005 Per Nyfelt wrote :
> > > > > > > > > >As a told you earlier: you need to edit your batch files
> > > > > > > > > > and replace linefeed (LF) with Carriage Return Linefeed
> > > > > > > > > > (CRLF)!
> > > > > > > > > >
> > > > > > > > > >One way to do this is to create a simple ant build script:
> > > > > > > > > ><project name="scriptfix" default="lineend" basedir=".">
> > > > > > > > > > <target name="lineend">
> > > > > > > > > > <fixcrlf srcdir="server/bin" includes="**/*.bat" />
> > > > > > > > > > </target>
> > > > > > > > > ></project>
> > > > > > > > > >
> > > > > > > > > >If you are building from src do the following:
> > > > > > > > > >1. Make sure server\bin\ozoneAnt.bat has the right end of
> > > > > > > > > > line characters. In notepad they will look like empty
> > > > > > > > > > boxes replace all boxes with an enter (sorry for the
> > > > > > > > > > pain) 2. cd server
> > > > > > > > > >3. execute the build.bat script (this will also fix all
> > > > > > > > > > your EOL characters in build/bin to match your system) 4.
> > > > > > > > > > Your ozone distribution are now in server\build - this is
> > > > > > > > > > your OZONE_HOME (unless you copy the files elsewhere if
> > > > > > > > > > course)
> > > > > > > > > >
> > > > > > > > > >There is also a dist.bin target besides the default one
> > > > > > > > > > that builds a structure like the binary distribution that
> > > > > > > > > > might be of interest.
> > > > > > > > > >
> > > > > > > > > >Good luck!
> > > > > > > > > >
> > > > > > > > > >/Per
> > > > > > > > > >
> > > > > > > > > >On Friday 25 November 2005 13.36, ss wrote:
> > > > > > > > > > > i ve installed the src version of ozone n set the
> > > > > > > > > > > variables as follows: ozone_home:
> > > > > > > > > > > E:\jdk1.4\bin\ozone-1.2 ozone_path:
> > > > > > > > > > > E:\jdk1.4\bin\ozone-1.2\server\bin ozone_jvm: java
> > > > > > > > > > > ozone_javac: javac
> > > > > > > > > > >
> > > > > > > > > > > if any correction is to b made in thse variables do
> > > > > > > > > > > inform
> > > > > > > > > > >
> > > > > > > > > > > i get the following message when this is executed:
> > > > > > > > > > > ozoneInst -d E:\jdk1.4\bin\ozone-1.2\data
> > > > > > > > > > > offrem $Id: ozoneInst.bat,v 1.2 2002/12/29 11:15:55
> > > > > > > > > > > per_nyfelt Exp $call ojvm.bat org.ozoneDB.tools.Install
> > > > > > > > > > > -d E:\jdk1.4\bin\ozone-1.2\data
> > > > > > > > > > >
> > > > > > > > > > > i could not find the path for making the changes u
> > > > > > > > > > > suggested.........plz help me out.......urgently
> > > > > > > > > >
> > > > > > > > > >-------------------------------------------------------
> > > > > > > > > >This SF.net email is sponsored by: Splunk Inc. Do you grep
> > > > > > > > > > through log files for problems? Stop! Download the new
> > > > > > > > > > AJAX search engine that makes searching your log files as
> > > > > > > > > > easy as surfing the web. DOWNLOAD SPLUNK!
> > > > > > > > > > http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
> > > > > > > > > > _______________________________________________
> > > > > > > > > >Ozone-users mailing list
> > > > > > > > > >[email protected]
> > > > > > > > > >https://lists.sourceforge.net/lists/listinfo/ozone-users
> > > > > >
> > > > > >-------------------------------------------------------
> > > > > >This SF.net email is sponsored by: Splunk Inc. Do you grep through
> > > > > > log files for problems? Stop! Download the new AJAX search
> > > > > > engine that makes searching your log files as easy as surfing the
> > > > > > web. DOWNLOAD SPLUNK!
> > > > > > http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
> > > > > > _______________________________________________
> > > > > >Ozone-users mailing list
> > > > > >[email protected]
> > > > > >https://lists.sourceforge.net/lists/listinfo/ozone-users
> > > >
> > > >-------------------------------------------------------
> > > >This SF.net email is sponsored by: Splunk Inc. Do you grep through log
> > > > files for problems? Stop! Download the new AJAX search engine that
> > > > makes searching your log files as easy as surfing the web. DOWNLOAD
> > > > SPLUNK! http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
> > > >_______________________________________________
> > > >Ozone-users mailing list
> > > >[email protected]
> > > >https://lists.sourceforge.net/lists/listinfo/ozone-users
> >
> >-------------------------------------------------------
> >This SF.net email is sponsored by: Splunk Inc. Do you grep through log
> > files for problems? Stop! Download the new AJAX search engine that
> > makes searching your log files as easy as surfing the web. DOWNLOAD
> > SPLUNK! http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
> >_______________________________________________
> >Ozone-users mailing list
> >[email protected]
> >https://lists.sourceforge.net/lists/listinfo/ozone-users
-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems? Stop! Download the new AJAX search engine that makes
searching your log files as easy as surfing the web. DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click