Hello, the features of OJB as described on
http://jakarta.apache.org/ojb/features.html
are very promising, so we decided to use OJB in our project instead of
JDO Genie.
At first, we tried to use 0.9.8 in our application. Because many
clients access the data in one database we decided straightforward to
use 3-tier architecture without an application server. An application
server would be overkill for our small application.
The first steps were very frustrating, even the simplest techniques as
described in tutorial 1 didn't work. If we use OJB in standalone mode
and connect via JDBC to the database everything works fine. But as
soon as we switch to Client/Server mode the server throws many many
exception like this one:
java.net.SocketException: Connection reset
at java.net.SocketInputStream.read(SocketInputStream.java:168)
at java.io.ObjectInputStream$PeekInputStream.read(ObjectInputStream.java:2150)
at
java.io.ObjectInputStream$PeekInputStream.readFully(ObjectInputStream.java:2163)
at
java.io.ObjectInputStream$BlockDataInputStream.readShort(ObjectInputStream.java:2634)
at java.io.ObjectInputStream.readStreamHeader(ObjectInputStream.java:734)
at java.io.ObjectInputStream.<init>(ObjectInputStream.java:253)
at org.apache.ojb.broker.server.BetterObjectInputStream.<init>(Unknown Source)
at org.apache.ojb.broker.server.ConnectionHandler.getRequestFromSocket(Unknown
Source)
at org.apache.ojb.broker.server.ConnectionHandler.run(Unknown Source)
at java.lang.Thread.run(Thread.java:536)
[org.apache.ojb.broker.server.ConnectionHandler] ERROR: null
[org.apache.ojb.broker.server.ConnectionHandler] ERROR: null
[org.apache.ojb.broker.server.ConnectionHandler] ERROR: Connection reset
and this one:
[org.apache.ojb.broker.server.ConnectionHandler] ERROR: null
[org.apache.ojb.broker.server.ConnectionHandler] ERROR: null
[org.apache.ojb.broker.server.ConnectionHandler] ERROR: null
java.io.EOFException
at
java.io.ObjectInputStream$PeekInputStream.readFully(ObjectInputStream.java:2165)
at
java.io.ObjectInputStream$BlockDataInputStream.readShort(ObjectInputStream.java:2634)
at java.io.ObjectInputStream.readStreamHeader(ObjectInputStream.java:734)
at java.io.ObjectInputStream.<init>(ObjectInputStream.java:253)
at org.apache.ojb.broker.server.BetterObjectInputStream.<init>(Unknown Source)
at org.apache.ojb.broker.server.ConnectionHandler.getRequestFromSocket(Unknown
Source)
at org.apache.ojb.broker.server.ConnectionHandler.run(Unknown Source)
at java.lang.Thread.run(Thread.java:536)
If we use transactions the server behaves more horrible.
After two days we tried the regression tests, first for version 0.9.8
and then for version 0.9.7, because 0.9.8 seems to be very flawed.
STEP #1 : JUnit w/ 0.9.7 - standalone mode
------------------------------------------
$ tar xvzf jakarta-ojb-0.9.7.tgz
$ cd jakarta-ojb-0.9.7
jakarta-ojb-0.9.7$ chmod u+x bin/*.sh
jakarta-ojb-0.9.7$ bin/build.sh junit > step_1.txt 2>&1
Among other things, this will result in:
[...]
junit-no-compile-no-prepare:
[junit] Running org.apache.ojb.broker.AllTests
[junit] [BOOT] INFO: OJB.properties:
file:/home/koma/ojb_0.9.7/jakarta-ojb-0.9.7/target/test/ojb/OJB.properties
[junit] Tests run: 124, Failures: 0, Errors: 0, Time elapsed: 11.15 sec
[junit] Running org.apache.ojb.odmg.AllTests
[junit] [BOOT] INFO: OJB.properties:
file:/home/koma/ojb_0.9.7/jakarta-ojb-0.9.7/target/test/ojb/OJB.properties
[junit] Tests run: 128, Failures: 0, Errors: 0, Time elapsed: 16.091 sec
[junit] Running org.apache.ojb.soda.AllTests
[junit] [BOOT] INFO: OJB.properties:
file:/home/koma/ojb_0.9.7/jakarta-ojb-0.9.7/target/test/ojb/OJB.properties
[junit] Tests run: 3, Failures: 0, Errors: 0, Time elapsed: 5.663 sec
[...]
Fine.
STEP #2 : JUnit w/ 0.9.7 - Client/Server mode
---------------------------------------------
$ tar xvzf jakarta-ojb-0.9.7.tgz
$ cd jakarta-ojb-0.9.7
jakarta-ojb-0.9.7$ chmod u+x bin/*.sh
jakarta-ojb-0.9.7$ bin/build.sh prepare-tutorials > step_2_prep.txt 2>&1
jakarta-ojb-0.9.7$ joe target/test/ojb/OJB.properties
"Edit the file target/test/ojb/OJB.properties and change the line
useServer=false to useServer=true"
jakarta-ojb-0.9.7$ cd ..
$ mkdir server
$ mkdir client
$ cp -R jakarta-ojb-0.9.7/* server/
$ cp -R jakarta-ojb-0.9.7/* client/
$ cd server
server$ bin/server.sh > step_2_server.txt 2>&1
Open another login shell.
$ cd client
client$ bin/build.sh junit-no-compile-no-prepare > step_2_client.txt 2>&1
This will result in
[...]
junit-no-compile-no-prepare:
[junit] Running org.apache.ojb.broker.AllTests
[junit] [BOOT] INFO: OJB.properties:
file:/home/koma/ojb_0.9.7/client/target/test/ojb/OJB.properties
[junit] Tests run: 124, Failures: 17, Errors: 9, Time elapsed: 52.292 sec
[junit] TEST org.apache.ojb.broker.AllTests FAILED
[junit] Running org.apache.ojb.odmg.AllTests
[junit] [BOOT] INFO: OJB.properties:
file:/home/koma/ojb_0.9.7/client/target/test/ojb/OJB.properties
[junit] Tests run: 128, Failures: 3, Errors: 125, Time elapsed: 1.215 sec
[junit] TEST org.apache.ojb.odmg.AllTests FAILED
[junit] Running org.apache.ojb.soda.AllTests
[junit] [BOOT] INFO: OJB.properties:
file:/home/koma/ojb_0.9.7/client/target/test/ojb/OJB.properties
[junit] Tests run: 3, Failures: 0, Errors: 0, Time elapsed: 2.724 sec
BUILD SUCCESSFUL
Total time: 1 minute 2 seconds
So, in the Client/Server mode there are many failed tests. The server
throws many exceptions.
At next, the same procedure with version 0.9.8:
STEP #3 : JUnit w/ 0.9.8 - standalone mode
------------------------------------------
$ tar xvzf jakarta-ojb-0.9.8.tgz
$ cd jakarta-ojb-0.9.8
jakarta-ojb-0.9.8$ chmod u+x bin/*.sh
jakarta-ojb-0.9.8$ bin/build.sh junit > step_3.txt 2>&1
This will result in
[...]
junit-no-compile-no-prepare:
[junit] Running org.apache.ojb.broker.AllTests
[junit] [BOOT] INFO: OJB.properties:
file:/home/koma/ojb_0.9.8/jakarta-ojb-0.9.8/target/test/ojb/OJB.properties
[junit] Tests run: 163, Failures: 0, Errors: 0, Time elapsed: 16.692 sec
[junit] Running org.apache.ojb.odmg.AllTests
[junit] [BOOT] INFO: OJB.properties:
file:/home/koma/ojb_0.9.8/jakarta-ojb-0.9.8/target/test/ojb/OJB.properties
[junit] Tests run: 144, Failures: 0, Errors: 2, Time elapsed: 20.094 sec
[junit] TEST org.apache.ojb.odmg.AllTests FAILED
[junit] Running org.apache.ojb.soda.AllTests
[junit] [BOOT] INFO: OJB.properties:
file:/home/koma/ojb_0.9.8/jakarta-ojb-0.9.8/target/test/ojb/OJB.properties
[junit] Tests run: 3, Failures: 0, Errors: 0, Time elapsed: 5.97 sec
[...]
In contrast to 0.9.7 not all tests passed.
STEP #4 : JUnit w/ 0.9.8 - Client/Server mode
---------------------------------------------
$ tar xvzf jakarta-ojb-0.9.8.tgz
$ cd jakarta-ojb-0.9.8
jakarta-ojb-0.9.8$ chmod u+x bin/*.sh
jakarta-ojb-0.9.8$ bin/build.sh prepare-tutorials > step_4_prep.txt 2>&1
jakarta-ojb-0.9.8$ joe target/test/ojb/OJB.properties
"Edit the file target/test/ojb/OJB.properties and change the line
useServer=false to useServer=true"
jakarta-ojb-0.9.8$ cd ..
$ mkdir server
$ mkdir client
$ cp -R jakarta-ojb-0.9.8/* server/
$ cp -R jakarta-ojb-0.9.8/* client/
$ cd server
server$ bin/server.sh > step_4_server.txt 2>&1
Open another login shell.
$ cd client
client$ bin/build.sh junit-no-compile-no-prepare > step_4_client.txt 2>&1
After about 5 minutes I canceled the test.
The JUnit target results in
junit-no-compile-no-prepare:
[junit] Running org.apache.ojb.broker.AllTests
[junit] [BOOT] INFO: OJB.properties:
file:/home/koma/ojb_0.9.8/client/target/test/ojb/OJB.properties
and the servers throws many many exceptions.
What do you say? Are this really bugs or aren't we able to run OJB
properly?
Regards,
Martin Burger
--
>> netbeyond
D. Barth & M. Burger GbR
Im Stadtwald, Geb�ude 34.2
66123 S a a r b r � c k e n
Tel. : +49 (0)700 netbeyond
+49 (0)700 63 82 39 66
Fax : +49 (0)681 3 02 63 84
Mail : [EMAIL PROTECTED]
Web : www.netbeyond.de
steps.zip
Description: Zip compressed data
-- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
