axis-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Steve Hall <sh...@starmountsystems.com>
Subject Re: AxisFault not Serializable
Date Thu, 19 Jun 2008 17:21:22 GMT
Michael,

I use Axis2 not Axis and I don't have Axis source code in front of me 
but looking at the stack trace it appears that AxisFault has an inner 
class named FaultReason that is throwing the not serializable exception. 
I would guess that FaultReason doesnt implement  Serializable.

Steve

Michael Mathers wrote:
> Despite this class implements Serializable, I get 
> NotSerializableException when I try to do so.
>
> I am using Axis 1.1.1.   I searched the Issue database but I did not 
> find this issue anywhere (resolved or unresolved).  I even searched 
> this list but to no avail.
>
> Please excuse me if I'm being ignorant somehow and just kindly point 
> out what I'm not understanding.
>
>
> Below is the sample code and the exception generated.
>
>
> Michael
>
>
>         @Test
>        * public * * void * testSerial() {
>                 AxisFault af = * new * AxisFault( "test" );
>                
>                 // Test serialization
>                * try * {
>                     FileOutputStream os = * new * FileOutputStream( 
> "serial.txt" );
>                     ObjectOutputStream oos = * new * 
> ObjectOutputStream(os);
>                     oos.writeObject(af);
>                     oos.close();
>                     os.close();
>                 } * catch * (Exception e) {
>                         e.printStackTrace();
>                 }
>         }
>
> java.io.NotSerializableException : org.apache.axis2.AxisFault$FaultReason
>         at java.io.ObjectOutputStream.writeObject0( 
> ObjectOutputStream.java:1081 )
>         at java.io.ObjectOutputStream.writeObject( 
> ObjectOutputStream.java:302 )
>         at java.util.ArrayList.writeObject( ArrayList.java:569 )
>         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:585 )
>         at java.io.ObjectStreamClass.invokeWriteObject( 
> ObjectStreamClass.java:917 )
>         at java.io.ObjectOutputStream.writeSerialData( 
> ObjectOutputStream.java:1339 )
>         at java.io.ObjectOutputStream.writeOrdinaryObject( 
> ObjectOutputStream.java:1290 )
>         at java.io.ObjectOutputStream.writeObject0( 
> ObjectOutputStream.java:1079 )
>         at java.io.ObjectOutputStream.defaultWriteFields( 
> ObjectOutputStream.java:1375 )
>         at java.io.ObjectOutputStream.writeSerialData( 
> ObjectOutputStream.java:1347 )
>         at java.io.ObjectOutputStream.writeOrdinaryObject( 
> ObjectOutputStream.java:1290 )
>         at java.io.ObjectOutputStream.writeObject0( 
> ObjectOutputStream.java:1079 )
>         at java.io.ObjectOutputStream.writeObject( 
> ObjectOutputStream.java:302 )
>         at com.ipd.esb.job.EFTRoster.TestEFTRosterBatch.testSerial( 
> TestEFTRosterBatch.java:215 )
>         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:585 )
>         at 
> org.junit.internal.runners.TestMethodRunner.executeMethodBody( 
> TestMethodRunner.java:99 )
>         at org.junit.internal.runners.TestMethodRunner.runUnprotected( 
> TestMethodRunner.java:81 )
>         at 
> org.junit.internal.runners.BeforeAndAfterRunner.runProtected( 
> BeforeAndAfterRunner.java:34 )
>         at org.junit.internal.runners.TestMethodRunner.runMethod( 
> TestMethodRunner.java:75 )
>         at org.junit.internal.runners.TestMethodRunner.run( 
> TestMethodRunner.java:45 )
>         at 
> org.junit.internal.runners.TestClassMethodsRunner.invokeTestMethod( 
> TestClassMethodsRunner.java:71 )
>         at org.junit.internal.runners.TestClassMethodsRunner.run( 
> TestClassMethodsRunner.java:35 )
>         at 
> org.junit.internal.runners.TestClassRunner$1.runUnprotected( 
> TestClassRunner.java:42 )
>         at 
> org.junit.internal.runners.BeforeAndAfterRunner.runProtected( 
> BeforeAndAfterRunner.java:34 )
>         at org.junit.internal.runners.TestClassRunner.run( 
> TestClassRunner.java:52 )
>         at 
> org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run( 
> JUnit4TestReference.java:38 )
>         at org.eclipse.jdt.internal.junit.runner.TestExecution.run( 
> TestExecution.java:38 )
>         at 
> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests( 
> RemoteTestRunner.java:460 )
>         at 
> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests( 
> RemoteTestRunner.java:673 )
>         at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run( 
> RemoteTestRunner.java:386 )
>         at 
> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main( 
> RemoteTestRunner.java:196 )
>
> This message is private and confidential. If you have received it in 
> error, please notify the sender and remove it from your system.
>
> This message is private and confidential. If you have received it in 
> error, please notify the sender and remove it from your system.
>


---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org


Mime
View raw message