Re: [OT] Java method size limitations

2003-03-07 Thread Davor Cengija
Craig R. McClanahan wrote:

 
 
 On Thu, 6 Mar 2003, Davor Cengija wrote:
 

 I had that problem in a compiled JSP page (therefore, in the created
 servlet): a table with 150 rows and 8 bean:write / columns (some
 financial data).

 The solution was to split the table into 3 files and in the first one
 just included the second and the third using jsp:include /. Now it
 works just fine.
 
 You might also be assisted by updated JSP page compilers that do not put
 the entire page into a single method.  For example, the Jasper2 compiler
 in Tomcat 4.1.18 takes care of this -- it splits your page into multiple
 methods as long as you are not using scriptlets.  (As an extra added
 benefit, the compiled pages run *much* faster than older Tomcat versions
 also :-).
 

Thanks for the tip!

However, I didn't mention that I used WebSphere 4.0.3 and WebSphere 
Application Developer 4.0.3 (with WAS test environment 4.0.2 in it) for 
development. I don't know how to replace the JSP engine in WAS, and I don't 
think it would by very clever idea, anyway.

Has anyone tried it? Any tips?

Cheers,
Davor
-- 
[EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [OT] Java method size limitations

2003-03-06 Thread Davor Cengija
Kwok Peng Tuck wrote:


 
I had that problem in a compiled JSP page (therefore, in the created
servlet): a table with 150 rows and 8 bean:write / columns (some
financial data).

The solution was to split the table into 3 files and in the first one just
included the second and the third using jsp:include /. Now it works just
fine.
  

 Were you iterating over  a collection ?  If so you could have used the
 logic:iterate tag to give you a hand . :)

No. Those were some financial data (numbers with different formatting, 
texts, calculations) in a bean with method names such as getFP001() to 
getFP155() with some exceptions. Each method had to be called directly. 
Therefore the problems.

Regards,
Davor

P.S.
A: When the answer is above the question.
Q: What's the most annoying thing in an email?

-- 
[EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [OT] Java method size limitations

2003-03-06 Thread Kwok Peng Tuck
I hit those limitations once, although it wasn't really my fault. Some 
eons ago when tomcat 3.X was in use in my company, some guy decided he 
would like us all to be able access the db through tomcat easily. 
Problem was it required plugging your select statement into his code 
until  well you get the picture. So I spent about 2-3 working hours 
trying to track down the problem only to find out it is a limitation in 
the jvm :( .

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: [OT] Java method size limitations

2003-03-06 Thread Craig R. McClanahan


On Thu, 6 Mar 2003, Davor Cengija wrote:

 Date: Thu, 06 Mar 2003 08:09:53 +0100
 From: Davor Cengija [EMAIL PROTECTED]
 Reply-To: Struts Users Mailing List [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 Subject: Re: [OT] Java method size limitations

 Becky Norum wrote:

  This is FYI - it was an issue that came up when someone (not me!) had an
  8500 line Java source file.  He got a code too large for try statement
  exception during compilation, which puzzled even some long term Java
  programmers.
 
  Apparently, there is an upper limit of 64K (compiled) on java methods.
  (see
 
 http://java.sun.com/docs/books/vmspec/2nd-edition/html/ClassFile.doc.html#154)
 
  The Java method bytecode code length is defined as an int (32-bit), but
  exception start/end blocks are defined by shorts (16-bit).  This limits
  the method length to 2^16=64K.
 
  Hopefully, noone on this list will ever write a class that large, but in
  case you ever run across this..
 

 I had that problem in a compiled JSP page (therefore, in the created
 servlet): a table with 150 rows and 8 bean:write / columns (some
 financial data).

 The solution was to split the table into 3 files and in the first one just
 included the second and the third using jsp:include /. Now it works just
 fine.

You might also be assisted by updated JSP page compilers that do not put
the entire page into a single method.  For example, the Jasper2 compiler
in Tomcat 4.1.18 takes care of this -- it splits your page into multiple
methods as long as you are not using scriptlets.  (As an extra added
benefit, the compiled pages run *much* faster than older Tomcat versions
also :-).

 --
 [EMAIL PROTECTED]


Craig

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



[OT] Java method size limitations

2003-03-05 Thread Becky Norum
This is FYI - it was an issue that came up when someone (not me!) had an
8500 line Java source file.  He got a code too large for try statement
exception during compilation, which puzzled even some long term Java
programmers.

Apparently, there is an upper limit of 64K (compiled) on java methods.
(see
http://java.sun.com/docs/books/vmspec/2nd-edition/html/ClassFile.doc.html#154)

The Java method bytecode code length is defined as an int (32-bit), but
exception start/end blocks are defined by shorts (16-bit).  This limits
the method length to 2^16=64K.

Hopefully, noone on this list will ever write a class that large, but in
case you ever run across this.. 

-- 
Becky Norum
Database Administrator
Center for Subsurface Sensing and Imaging Systems (CenSSIS)
Northeastern University
http://www.censsis.neu.edu



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [OT] Java method size limitations

2003-03-05 Thread alexj
loool

--
Alexandre Jaquet
- Original Message -
From: Becky Norum [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Wednesday, March 05, 2003 3:28 PM
Subject: [OT] Java method size limitations


 This is FYI - it was an issue that came up when someone (not me!) had an
 8500 line Java source file.  He got a code too large for try statement
 exception during compilation, which puzzled even some long term Java
 programmers.

 Apparently, there is an upper limit of 64K (compiled) on java methods.
 (see

http://java.sun.com/docs/books/vmspec/2nd-edition/html/ClassFile.doc.html#15
4)

 The Java method bytecode code length is defined as an int (32-bit), but
 exception start/end blocks are defined by shorts (16-bit).  This limits
 the method length to 2^16=64K.

 Hopefully, noone on this list will ever write a class that large, but in
 case you ever run across this..

 --
 Becky Norum
 Database Administrator
 Center for Subsurface Sensing and Imaging Systems (CenSSIS)
 Northeastern University
 http://www.censsis.neu.edu



 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]





-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [OT] Java method size limitations

2003-03-05 Thread David Graham
This came up before in relation to tomcat's jsp compiler generating large 
methods.  I believe they now break up methods into smaller pieces to avoid 
the limitation.  Regardless, I can't think of any good reason to have an 
8500 line class!

David



From: Becky Norum [EMAIL PROTECTED]
Reply-To: Struts Users Mailing List [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Subject: [OT] Java method size limitations
Date: 05 Mar 2003 09:28:14 -0500
This is FYI - it was an issue that came up when someone (not me!) had an
8500 line Java source file.  He got a code too large for try statement
exception during compilation, which puzzled even some long term Java
programmers.
Apparently, there is an upper limit of 64K (compiled) on java methods.
(see
http://java.sun.com/docs/books/vmspec/2nd-edition/html/ClassFile.doc.html#154)
The Java method bytecode code length is defined as an int (32-bit), but
exception start/end blocks are defined by shorts (16-bit).  This limits
the method length to 2^16=64K.
Hopefully, noone on this list will ever write a class that large, but in
case you ever run across this..
--
Becky Norum
Database Administrator
Center for Subsurface Sensing and Imaging Systems (CenSSIS)
Northeastern University
http://www.censsis.neu.edu


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


_
Help STOP SPAM with the new MSN 8 and get 2 months FREE*  
http://join.msn.com/?page=features/junkmail

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


RE: [OT] Java method size limitations

2003-03-05 Thread James Childers

 -Original Message-
 From: David Graham [mailto:[EMAIL PROTECTED]
 Sent: Wednesday, March 05, 2003 8:43 AM
 To: [EMAIL PROTECTED]
 Subject: Re: [OT] Java method size limitations
 
 This came up before in relation to tomcat's jsp compiler 
 generating large methods.  I believe they now break up 
 methods into smaller pieces to avoid the limitation.  
 Regardless, I can't think of any good reason to have an 
 8500 line class!

First off, Tomcat has indeed fixed this problem. Jasper now translates custom tag 
calls into private methods, instead of just inlining them in the _jspService method. 

But some servlet containers (*cough*Dynamo*cough*) throw *everything* in the 
_jspService method. So you could have a really tight, well designed page -- no 
scriplets, all tags, tiled, etc. -- and, if you have a lot of tags or other hidden 
code, it will still blow up because of the way the container performs it's JSP -- 
.java translation. And you won't know it until runtime.

This is really frustrating when you encounter it on supposedly enterprise level 
containers. If it's really enterprise level, you'd think they'd have less of a brain 
dead translation engine.

In any case, I remember looking over the list of items for Java 1.5 and the upper 
limit on jumps was something that was being addressed.

-= J

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [OT] Java method size limitations

2003-03-05 Thread Davor Cengija
Becky Norum wrote:

 This is FYI - it was an issue that came up when someone (not me!) had an
 8500 line Java source file.  He got a code too large for try statement
 exception during compilation, which puzzled even some long term Java
 programmers.
 
 Apparently, there is an upper limit of 64K (compiled) on java methods.
 (see
 
http://java.sun.com/docs/books/vmspec/2nd-edition/html/ClassFile.doc.html#154)
 
 The Java method bytecode code length is defined as an int (32-bit), but
 exception start/end blocks are defined by shorts (16-bit).  This limits
 the method length to 2^16=64K.
 
 Hopefully, noone on this list will ever write a class that large, but in
 case you ever run across this..
 

I had that problem in a compiled JSP page (therefore, in the created 
servlet): a table with 150 rows and 8 bean:write / columns (some 
financial data). 

The solution was to split the table into 3 files and in the first one just 
included the second and the third using jsp:include /. Now it works just 
fine.
-- 
[EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [OT] Java method size limitations

2003-03-05 Thread Kwok Peng Tuck
Were you iterating over  a collection ?  If so you could have used the 
logic:iterate tag to give you a hand . :)

I had that problem in a compiled JSP page (therefore, in the created 
servlet): a table with 150 rows and 8 bean:write / columns (some 
financial data). 

The solution was to split the table into 3 files and in the first one just 
included the second and the third using jsp:include /. Now it works just 
fine.
 



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]