Hero
Hero

Reputation: 647

MaxMessageSizeExceededException

We are doing a EJB call as below which is returning us the MaxMessageSizeExceededException.

Java Code to Call the EJB -

Properties env = new Properties(); 
env.put(Context.INITIAL_CONTEXT_FACTORY,"weblogic.jndi.WLInitialContextFactory"); 
env.put(Context.PROVIDER_URL, "t3://xxxxxx.xxxx.xxx.com:4444"); 
InitialContext context; 
try { 
    context = new InitialContext(env); 
    Home hb =  context.lookup("lookupname"); 
    Service service = hb.create(); 
    Request request = new Request(); 
    service.getAPI(request); 
}

Error Details -

<Error> <Socket> <BEA-000403> <IOException occurred on socket: Socket[addr=XXXX.xxx.xxx.com/xxx.x.xxx.xxx,port=xxxx,localport=xxxxx]
weblogic.socket.MaxMessageSizeExceededException: Incoming message of size: '10000080' bytes exceeds the configured maximum of: '10000000' bytes for protocol: 't3'.
weblogic.socket.MaxMessageSizeExceededException: Incoming message of size: '10000080' bytes exceeds the configured maximum of: '10000000' bytes for protocol: 't3'

On the Weblogic where the service is deployed they have updated the configs to 30MB,Do we have to do any changes in our client side to increase the incoming size of the response. Any JVM level changes.?

Upvotes: 1

Views: 1762

Answers (1)

Carlos Laspina
Carlos Laspina

Reputation: 2231

Try setting the value programatically in your java code e.g:

System.setProperty("weblogic.MaxMessageSize", "300000000"); 

You can also set the value in your JAVA_OPTIONS -Dweblogic.MaxMessageSize=300000000

Source: https://blogs.oracle.com/LuzMestre/entry/how_to_fix_weblogic_socket

Upvotes: 4

Related Questions