You are on page 1of 9

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:

A u g2 4 ,2 0 1 21 1 : 2 5 : 3 7A Mc l i e n t . C l i e n t $ 1o n E x c e p t i o n S E V E R E :C o n n e c t i o nt ot h eS e r v e rh a sb e e nl o s t ,w i l lr e t r yi n3 0s e c o n d s .w e b l o g i c . j m s . c o m m o n . L o s t S e r v e r E x c e p t i o n :j a v a w e b l o g i c . s o c k e t . M a x M e s s a g e S i z e E x c e e d e d E x c e p t i o n :I n c o m i n gm e s s a g eo fs i z e :' 1 0 0 0 0 0 8 0 'b y t e se x c e e d st h ec o n f i g u r e d < A u g2 4 ,2 0 1 21 1 : 2 5 : 3 7A MC D T >< E r r o r >< S o c k e t >< B E A 0 0 0 4 0 3 >< I O E x c e p t i o no c c u r r e do ns o c k e t :S o c k e t [ a d d r = 1 2 7 . 0 . 0 . 1 w e b l o g i c . s o c k e t . M a x M e s s a g e S i z e E x c e e d e d E x c e p t i o n :I n c o m i n gm e s s a g eo fs i z e :' 1 0 0 0 0 0 8 0 'b y t e se x c e e d st h ec o n f i g u r e dm a x w e b l o g i c . s o c k e t . M a x M e s s a g e S i z e E x c e e d e d E x c e p t i o n :I n c o m i n gm e s s a g eo fs i z e :' 1 0 0 0 0 0 8 0 'b y t e se x c e e d st h ec o n f i g u r e dm a x i a tw e b l o g i c . s o c k e t . B a s e A b s t r a c t M u x a b l e S o c k e t . i n c r e m e n t B u f f e r O f f s e t ( B a s e A b s t r a c t M u x a b l e S o c k e t . j a v a : 1 7 4 ) a tw e b l o g i c . r j v m . t 3 . M u x a b l e S o c k e t T 3 . i n c r e m e n t B u f f e r O f f s e t ( M u x a b l e S o c k e t T 3 . j a v a : 3 5 1 ) a tw e b l o g i c . s o c k e t . S o c k e t M u x e r . r e a d F r o m S o c k e t ( S o c k e t M u x e r . j a v a : 9 8 3 ) a tw e b l o g i c . s o c k e t . S o c k e t M u x e r . r e a d R e a d y S o c k e t O n c e ( S o c k e t M u x e r . j a v a : 9 2 2 )

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

+a r g 0 . t o S t r i n g ( ) ) ;

}e l s e{ l o g 2 . s e v e r e ( a r g 0 . t o S t r i n g ( ) ) ; } } } ) ; s h u t d o w n L i s t e n e r=n e wS h u t d o w n L i s t e n e r ( c o n n e c t i o n ,s e s s i o n ,p r o d u c e r ,c o n s u m e r ) ; c o n n e c t i o n . s t a r t ( ) ; l o g . i n f o ( " S u c c e s s f u l l yc o n n e c t e dt o"+i P r o p s . g e t U R L ( ) ) ; r e t u r nt r u e ; }c a t c h( J M S E x c e p t i o nj e ){ l o g . s e v e r e ( " C o u l dn o tc o n n e c tt ot h eW e b L o g i cS e r v e r ,w i l lr e t r yi n3 0s e c o n d s ." +j e . g e t M e s s a g e ( ) ) ; t r y{ T h r e a d . s l e e p ( 3 0 0 0 0 L ) ; }c a t c h( I n t e r r u p t e d E x c e p t i o ne ){ l o g . w a r n i n g ( e . t o S t r i n g ( ) ) ; } r e t u r ns e t C l i e n t ( l i s t e n e r ) ; }c a t c h( E x c e p t i o ne ){ l o g . s e v e r e ( " C o u l dn o tc o n n e c tt ot h eW e b L o g i cS e r v e r ,w i l lr e t r yi n3 0s e c o n d s ." +e . t o S t r i n g ( ) ) ; t r y{ T h r e a d . s l e e p ( 3 0 0 0 0 L ) ; }c a t c h( I n t e r r u p t e d E x c e p t i o ni e ){ l o g . w a r n i n g ( i e . t o S t r i n g ( ) ) ; } r e t u r ns e t C l i e n t ( l i s t e n e r ) ; } } 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

p u b l i cc l a s sC o n s u m e r L i s t e n e ri m p l e m e n t sM e s s a g e L i s t e n e r{ p r i v a t eL o g g e rl o g ; p r i v a t eF i l ed e s t i n a t i o n ; p r i v a t eE x e c u t ei n s t r u c t i o n s ; p u b l i cC o n s u m e r L i s t e n e r ( E x e c u t ei n s t r u c t i o n s ,F i l ed e s t i n a t i o n ){ t h i s . i n s t r u c t i o n s=i n s t r u c t i o n s ; t h i s . d e s t i n a t i o n=d e s t i n a t i o n ; l o g=n e wM y L o g g e r ( ) . g e t L o g g e r ( " B P E LC l i e n t " ) ; } @ O v e r r i d e p u b l i cv o i do n M e s s a g e ( M e s s a g ea r g 0 ){ t r y{ i f( a r g 0 . g e t J M S R e d e l i v e r e d ( ) ){ l o g . s e v e r e ( " Ar e d e l i v e r e dm e s s a g eh a sb e e nr e c e i v e d ,a n di th a sb e e ni g n o r e d ! " +a r g 0 . t o S t r i n g ( ) ) ; }e l s e{ t r y{ i f( a r g 0i n s t a n c e o fT e x t M e s s a g e ){ c o n s u m e M e s s a g e ( ( T e x t M e s s a g e )a r g 0 ) ; }e l s ei f( a r g 0i n s t a n c e o fB y t e s M e s s a g e ){ c o n s u m e M e s s a g e ( ( B y t e s M e s s a g e )a r g 0 ) ; }e l s e{ l o g . w a r n i n g ( " C u r r e n t l y ,o n l yT e x t M e s s a g e sa n dB y t e s M e s s a g e sa r es u p p o r t e d ! " ) ; } }c a t c h( J M S E x c e p t i o ne ){ l o g . s e v e r e ( e . t o S t r i n g ( ) ) ; }c a t c h( I O E x c e p t i o ne ){ l o g . s e v e r e ( e . t o S t r i n g ( ) ) ; }c a t c h( T h r o w a b l et ){ l o g . s e v e r e ( t . t o S t r i n g ( ) ) ; }

} }c a t c h( J M S E x c e p t i o ne ){ l o g . s e v e r e ( e . t o S t r i n g ( ) ) ; stackoverflow.com/questions/12113315/configuring-jms-message-size-in-weblogic-weblogic-socket-maxmessagesizeexceeded

java

jms

weblogic

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 account 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 admin 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 ADMIN first and when the ADMIN 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 Admin 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 Administration 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 administration console when configuring MaxMessageSize on there). If your largest message is over that size, then weblogic won't be able to support 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 account 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

You might also like