13/7/29
java - Configuring JMS Message Size in WebLogic: weblogic.socket.MaxMessageSizeExceededException - Stack Overflow
Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free, no registration required.
Tell me more
×
Configuring JMS Message Size in WebLogic: weblogic.socket.MaxMessageSizeExceededException
I currently have two clients (Producer/Consumer), and I am trying to send a large file via JMS. I am successfully producing and sending the file to the JMS Server without any problems. The problem is when I try to consume the message, and I get the following exception:
Aug 24, 2012 11:25:37 AM client.Client$1 onException SEVERE: Connection to the Server has been lost, will retry in 30 seconds. weblogic.jms.common.LostServerException: java weblogic.socket.MaxMessageSizeExceededException: Incoming message of size: '10000080' bytes exceeds the configured
<Error> <Socket>
stackoverflow.com/questions/12113315/configuring-jms-message-size-in-weblogic-weblogic-socket-maxmessagesizeexceeded
1/9
13/7/29
java - Configuring JMS Message Size in WebLogic: weblogic.socket.MaxMessageSizeExceededException - Stack Overflow
I believe this has to do with my MaxMessage size setting in WebLogic and not a code problem (but I could of course be wrong). Here are my settigns for Maximum Message Size
I am not sure why I am getting this exception since the Maximum message size for this protocol is larger than what the exception is claiming... Any thoughts? I have also tried adding the server start argument -Dweblogic.MaxMessageSize=200000000, but to no avail.
stackoverflow.com/questions/12113315/configuring-jms-message-size-in-weblogic-weblogic-socket-maxmessagesizeexceeded
2/9
13/7/29
java - Configuring JMS Message Size in WebLogic: weblogic.socket.MaxMessageSizeExceededException - Stack Overflow
Here is some code of my where I set the MessageListener, and the message consumer itself.
stackoverflow.com/questions/12113315/configuring-jms-message-size-in-weblogic-weblogic-socket-maxmessagesizeexceeded
3/9
13/7/29
java - Configuring JMS Message Size in WebLogic: weblogic.socket.MaxMessageSizeExceededException - Stack Overflow
+ arg0.toString());
} else { log2.severe(arg0.toString()); } } }); shutdownListener = new ShutdownListener(connection, session, producer, consumer); connection.start(); log.info("Successfully connected to " + iProps.getURL()); return true; } catch (JMSException je) { log.severe("Could not connect to the WebLogic Server, will retry in 30 seconds. " + je.getMessage()); try { Thread.sleep(30000L); } catch (InterruptedException e) { log.warning(e.toString()); } return setClient(listener); } catch (Exception e) { log.severe("Could not connect to the WebLogic Server, will retry in 30 seconds. " + e.toString()); try { Thread.sleep(30000L); } catch (InterruptedException ie) { log.warning(ie.toString()); } return setClient(listener); } } Here's the MessageListener:
stackoverflow.com/questions/12113315/configuring-jms-message-size-in-weblogic-weblogic-socket-maxmessagesizeexceeded
4/9
13/7/29
java - Configuring JMS Message Size in WebLogic: weblogic.socket.MaxMessageSizeExceededException - Stack Overflow
public class ConsumerListener implements MessageListener { private Logger log; private File destination; private Execute instructions; public ConsumerListener(Execute instructions, File destination) { this.instructions = instructions; this.destination = destination; log = new MyLogger().getLogger("BPEL Client"); } @Override public void onMessage(Message arg0) { try { if (arg0.getJMSRedelivered()) { log.severe("A re-delivered message has been received, and it has been ignored!" + arg0.toString()); } else { try { if (arg0 instanceof TextMessage) { consumeMessage((TextMessage) arg0);
java
jms
weblogic
} else if (arg0 instanceof BytesMessage) { consumeMessage((BytesMessage) arg0); } else { log.warning("Currently, only TextMessages and BytesMessages are ed!"); } } catch (JMSException e) { log.severe(e.toString()); } catch (IOException e) { log.severe(e.toString()); } catch (Throwable t) { log.severe(t.toString()); }
} } catch (JMSException e) { log.severe(e.toString()); stackoverflow.com/questions/12113315/configuring-jms-message-size-in-weblogic-weblogic-socket-maxmessagesizeexceeded
5/9
13/7/29
java - Configuring JMS Message Size in WebLogic: weblogic.socket.MaxMessageSizeExceededException - Stack Overflow
edited Aug 30 '12 at 15:29
asked Aug 24 '12 at 16:31 Reid Mac 716 6 28
You can try to change your broadcast type in cluster..if it is already set to UNICAST then please ignore this. – kukku Oct 8 '12 at 11:56 I've already figured out the problem, I wasn't setting the -Dweblogic.MaxMessageSize on the Client applications, it now works fine. – Reid Mac Oct 8 '12 at 14:04 add comment (requires an with 50 reputation)
2 Answers You will also have to increase the Maximum Message Size from the WLS console as shown in the screenshot for all the managed servers. Afterwards perform a restart and the problem will be solved. Furthermore there is a second alternative solution. According the Oracle Tuning WebLogic JMS Doc: Tuning MessageMaximum Limitations If the aggregate size of the messages pushed to a consumer is larger than the current protocol's maximum message size (default size is 10 MB and is configured on a per WebLogic Server instance basis using the console and on a per client basis using the Dweblogic.MaxMessageSize command line property), the message delivery fails. Setting Maximum Message Size on a Client You may need to configure WebLogic clients in addition to the WebLogic Server instance, when sending and receiving large messages. To set the maximum message size on a client, use the following command line property: -Dweblogic.MaxMessageSize Note: This setting applies to all WebLogic Server network packets delivered to the client, not just JMS related packets. stackoverflow.com/questions/12113315/configuring-jms-message-size-in-weblogic-weblogic-socket-maxmessagesizeexceeded
6/9
13/7/29
java - Configuring JMS Message Size in WebLogic: weblogic.socket.MaxMessageSizeExceededException - Stack Overflow
EDITED: This issue can be resolved by following one or more of the below actions. Configure the System Property -Dweblogic.MaxMessageSize Increase the max message size using the WLS console for the and all the managed servers. The steps in the WLS console are: server / Protocols / General Increase the Maximum Message Size from WLS console. The steps in the WLS console are: Queue / Configuration / Threshholds and Quotas / Maximum Message Size PROCEDURE for applying the weblogic.MaxMessageSize Property Keep a backup of the setDomainEnv files. Stop all the servers. Add the Dweblogic.MaxMessageSize=yourValue in each setDomainEnv file and more specifically in the EXTRA_JAVA_PROPERTIES line. Afterwards start the first and when the is in status RUNNING, then start the MANAGED servers. I hope this helps. edited Aug 30 '12 at 10:53
answered Aug 25 '12 at 6:12 Tolis Emmanouilidis 3,852 1 5 19
Thanks for the response, though I have already tried both of these, and the problem still persists. What I don't understand is why I can produce a large JMS message and put it on the queue, but I cannot consume the exact same JMS message? – Reid Mac Aug 27 '12 at 14:18 I have updated the post. Have you tried all the 3 available solutions and none of them resolves your issue? Have you configured the Max Message Size from the WLS console in your Server and all the managed servers? Thanks – Tolis Emmanouilidis Aug 27 '12 at 18:16 I have tried all 3 options, the only option I am not sure I am doing correctly is the System Property. I edited my question with an image of where I am setting the property. Is this the correct place? I have tried restarting the server after making the changes, but I am still receiving the same error. – Reid Mac Aug 29 '12 at 14:34 It seems OK. Could you tell me the WLS version? – Tolis Emmanouilidis Aug 29 '12 at 14:48 stackoverflow.com/questions/12113315/configuring-jms-message-size-in-weblogic-weblogic-socket-maxmessagesizeexceeded
7/9
13/7/29
java - Configuring JMS Message Size in WebLogic: weblogic.socket.MaxMessageSizeExceededException - Stack Overflow
WebLogic Server Version: 10.3.5.0 – Reid Mac Aug 29 '12 at 17:14 show 5 more comments
In my case setting the -Dweblogic.MaxMessageSize solved the issue. My questions is what should be the maximum limit of the message size? We just can not keep on increasing the message size to resolve this issue. Is there any way to optimise this value in addition with certain other values? answered Jul 11 at 8:08 sujikin 18 7 This would be something you would have to discover yourself by finding the largest message you are sending. – Reid Mac Jul 19 at 14:28 How do i find the largest t3 message? I do not see any mechanism to log t3 messages in weblogic. – sujikin Jul 23 at 11:48 You can monitor the queue by using the istration Console, or you can have a more graphical layout using Enterprise Manager, but EM is primarily used for a Live view of the traffic. Another option is just setting the value to the Maximum possible number (This can be found using the istration console when configuring MaxMessageSize on there). If your largest message is over that size, then weblogic won't be able to it. – Reid Mac Jul 23 at 15:42 It is actually t3 message in my case and not a JMS Message. I checked the weblogic console and could not find any flag or any configuration which would help me to log or monitor it. Of course by increasing the size it works. But it is more of hit and trial case. I wanted to know how it grows up in proportion to the increase in size of my remote data. Any pointer to any mechanism to log or monitor the t3 message will be very helpful. I asked the same in official weblogic forum but not got any answer yet. – sujikin Jul 23 at 18:54 add comment (requires an with 50 reputation)
stackoverflow.com/questions/12113315/configuring-jms-message-size-in-weblogic-weblogic-socket-maxmessagesizeexceeded
8/9
13/7/29
java - Configuring JMS Message Size in WebLogic: weblogic.socket.MaxMessageSizeExceededException - Stack Overflow
Not the answer you're looking for? Browse other questions tagged java jms weblogic or ask your own question.
stackoverflow.com/questions/12113315/configuring-jms-message-size-in-weblogic-weblogic-socket-maxmessagesizeexceeded
9/9