I'm currently working on a fix for this. J�rgen GZIP solution does cover 
the PBServlet only. It does not work for the SOcketServer yet.

For the time being try to uncomment the GZIP stuff from the PBClient.

I will make compression an option. SO that you are not forced to use it.

cheers,
Thomas

Corey Klaasmeyer wrote:
> I'm running into an error when executed the following code. Any ideas about
> what's happening here? Possibly related to GZIPOutputStream? Is that
> configurable? Bandwidth is not my constraint...
> 
> Code:
>         PersistenceBroker broker =
> PersistenceBrokerFactory.createPersistenceBroker(
>                 new PBKey("repository.xml"));
>         Criteria criteria = new Criteria();
>         criteria.addEqualTo("job", jobCode);
>         Query query = new QueryByCriteria(Phase.class, criteria);
>         System.out.println("query = " + query);
>         Collection phases = null;
>         try {
>             phases = broker.getCollectionByQuery(query);
>         } catch (Throwable ex) {
>             ex.printStackTrace();
>         }
> 
> Server:
> [org.apache.ojb.broker.server.ConnectionHandler] ERROR: null
> [org.apache.ojb.broker.server.ConnectionHandler] ERROR: null
> [org.apache.ojb.broker.server.ConnectionHandler] ERROR: invalid stream
> header
> java.io.StreamCorruptedException: invalid stream header
>       at
> java.io.ObjectInputStream.readStreamHeader(ObjectInputStream.java:737)
>       at java.io.ObjectInputStream.<init>(ObjectInputStream.java:253)
>       at
> org.apache.ojb.broker.server.BetterObjectInputStream.<init>(BetterObjectInpu
> tStream.java:74)
>       at
> org.apache.ojb.broker.server.ConnectionHandler.getRequestFromSocket(Connecti
> onHandler.java:181)
>       at
> org.apache.ojb.broker.server.ConnectionHandler.run(ConnectionHandler.java:12
> 1)
>       at java.lang.Thread.run(Thread.java:536)
> 
> Client:
> java.net.SocketException: Software caused connection abort: socket write
> error
>       at java.net.SocketOutputStream.socketWrite0(Native Method)
>       at
> java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:92)
>       at java.net.SocketOutputStream.write(SocketOutputStream.java:136)
>       at java.util.zip.GZIPOutputStream.finish(GZIPOutputStream.java:91)
>       at
> org.apache.ojb.broker.server.PersistenceBrokerClient.callServer(PersistenceB
> rokerClient.java:309)
>       at
> org.apache.ojb.broker.server.PersistenceBrokerClient.callServer(PersistenceB
> rokerClient.java:212)
>       at
> org.apache.ojb.broker.server.PersistenceBrokerClient.getCollectionByQuery(Pe
> rsistenceBrokerClient.java:593)
>       at
> com.klaasmeyer.webapp.report.UnitCostReport.getUnitCostByPhase(UnitCostRepor
> t.java:34)
>       at
> com.klaasmeyer.webapp.report.TestUnitCostReport.testReport(TestUnitCostRepor
> t.java:29)
>       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>       at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39
> )
>       at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl
> .java:25)
>       at java.lang.reflect.Method.invoke(Method.java:324)
>       at junit.framework.TestCase.runTest(TestCase.java:166)
>       at junit.framework.TestCase.runBare(TestCase.java:140)
>       at junit.framework.TestResult$1.protect(TestResult.java:106)
>       at junit.framework.TestResult.runProtected(TestResult.java:124)
>       at junit.framework.TestResult.run(TestResult.java:109)
>       at junit.framework.TestCase.run(TestCase.java:131)
>       at junit.framework.TestSuite.runTest(TestSuite.java:173)
>       at junit.framework.TestSuite.run(TestSuite.java:168)
>       at junit.textui.TestRunner.doRun(TestRunner.java:74)
>       at junit.textui.TestRunner.start(TestRunner.java:234)
>       at junit.textui.TestRunner.main(TestRunner.java:112)
> rethrown as org.apache.ojb.broker.PersistenceBrokerException: Error while
> communicating with OJB server: Software caused connection abort: socket
> write error
>       at
> org.apache.ojb.broker.server.PersistenceBrokerClient.callServer(PersistenceB
> rokerClient.java:341)
>       at
> org.apache.ojb.broker.server.PersistenceBrokerClient.callServer(PersistenceB
> rokerClient.java:212)
>       at
> org.apache.ojb.broker.server.PersistenceBrokerClient.getCollectionByQuery(Pe
> rsistenceBrokerClient.java:593)
>       at
> com.klaasmeyer.webapp.report.UnitCostReport.getUnitCostByPhase(UnitCostRepor
> t.java:34)
>       at
> com.klaasmeyer.webapp.report.TestUnitCostReport.testReport(TestUnitCostRepor
> t.java:29)
>       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>       at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39
> )
>       at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl
> .java:25)
>       at java.lang.reflect.Method.invoke(Method.java:324)
>       at junit.framework.TestCase.runTest(TestCase.java:166)
>       at junit.framework.TestCase.runBare(TestCase.java:140)
>       at junit.framework.TestResult$1.protect(TestResult.java:106)
>       at junit.framework.TestResult.runProtected(TestResult.java:124)
>       at junit.framework.TestResult.run(TestResult.java:109)
>       at junit.framework.TestCase.run(TestCase.java:131)
>       at junit.framework.TestSuite.runTest(TestSuite.java:173)
>       at junit.framework.TestSuite.run(TestSuite.java:168)
>       at junit.textui.TestRunner.doRun(TestRunner.java:74)
>       at junit.textui.TestRunner.start(TestRunner.java:234)
>       at junit.textui.TestRunner.main(TestRunner.java:112)
> Caused by: java.net.SocketException: Software caused connection abort:
> socket write error
>       at java.net.SocketOutputStream.socketWrite0(Native Method)
>       at
> java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:92)
>       at java.net.SocketOutputStream.write(SocketOutputStream.java:136)
>       at java.util.zip.GZIPOutputStream.finish(GZIPOutputStream.java:91)
>       at
> org.apache.ojb.broker.server.PersistenceBrokerClient.callServer(PersistenceB
> rokerClient.java:309)
>       ... 19 more
> 
> --
> To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
> 
> 
> 
> 



--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to