0

I am working on a fix which needs to accept a SOAP XML Request which is less than 1,00,000 threshold value. So that we can validate large xml documents before processing.

Now, I am confused about the error reporting by akka when the threshold value is less than 1,00,000. I noticed the if the elements under one parent is more than 2000 I am getting this error. if the elements are divided with multiple parent elements we are not getting the error. Please help me to figure out the below the error from akka.

I have also to tried with disabling "akka.jvm-exit-on-fatal-error" in the configuration.

akka {

  jvm-exit-on-fatal-error = off

  actor {
    provider = "akka.remote.RemoteActorRefProvider"
  }

  remote {
    enabled-transports = ["akka.remote.netty.ssl"] 
    .
    .
    .
  }
} 

Example of Soap Request Body:

<soapenv:Body>
    <cai3:Create>
        <cai3:Attributes>
            <CreateAttributes attributeId="1">
                <attributeId>12345678</attributeId>
                <!--Zero or more repetitions:-->
                <node1 attributeId="12345678">
                    <node1>12345678</node1>
                    <node1/>
                </node1> 
                .......
                .......
                .......
                .......
                .......
                .......
                .......

                on so on upto 3000 same elements

                </CreateAttributes>
        </cai3:Attributes>
    </cai3:Create>
</soapenv:Body>

Exception Log

Module 2019-02-13 17:07:20,669+0800 [t-dispatcher-16] ERROR [akka.actor.ActorSystemImpl] Uncaught error from thread [mpe-akka.remote.default-remote-dispatcher-6]: null, shutting down JVM since 'akka.jvm-exit-on-fatal-error' is enabled for ActorSystem[mpe]
java.lang.StackOverflowError: null
        at java.lang.Exception.<init>(Exception.java:76) [na:1.8.0_172]
        at java.lang.ReflectiveOperationException.<init>(ReflectiveOperationException.java:89) [na:1.8.0_172]
        at java.lang.reflect.InvocationTargetException.<init>(InvocationTargetException.java:72) [na:1.8.0_172]
        at sun.reflect.GeneratedMethodAccessor46.invoke(Unknown Source) [na:na]
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) [na:1.8.0_172]
        at java.lang.reflect.Method.invoke(Method.java:498) [na:1.8.0_172]
        at java.io.ObjectStreamClass.invokeWriteObject(ObjectStreamClass.java:1128) [na:1.8.0_172]
        at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1496) [na:1.8.0_172]
        at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1432) [na:1.8.0_172]
        at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1178) [na:1.8.0_172]
        at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1548) [na:1.8.0_172]
        at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1509) [na:1.8.0_172]
        at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1432) [na:1.8.0_172]
        at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1178) [na:1.8.0_172]
        at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1548) [na:1.8.0_172]
        at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1509) [na:1.8.0_172]
        at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1432) [na:1.8.0_172]
        at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1178) [na:1.8.0_172]
        at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1548) [na:1.8.0_172]
        at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1509) [na:1.8.0_172]
        at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1432) [na:1.8.0_172]
        at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1178) [na:1.8.0_172]
        at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1548) [na:1.8.0_172]
Mohammed Asif
  • 41
  • 1
  • 5

1 Answers1

0

It does not look that you are having a problem with consumption of the SOAP message via akka-http.

Based on the stack trace you posted, the problem is with java serialisation that causes java.lang.StackOverflowError and it's either coming because you send a message via akka-remote,akka-cluster or you persist this message with akka-persistence. These are the places where java serialisation may be used in akka. Unless you do use it explicitly yourself.

You can read why JavaSerializationIsBroken and causes StackOverflowError errors.

I suggest you to try out you message consumption without involving akka-remote and akka-persistence. If this does help, you know that the problem is with java serialisation.

Next step would be replacing java serialisation with more modern serialisation protocols, like protocol-buffers.

Ivan Stanislavciuc
  • 7,140
  • 15
  • 18