Question

I am using derby in-memory db in java . And I want to run a sql. My sql string's length is 61671 byte. But I get Java class file format limit(s) exceeded: method:e1 code_length (72447 > 65535) error. I know the limitation about derby like code limit must be less than 65535 byte. It's ok (class file format limit(s) exceeded)

But now my string' length is just 61671. Why I am getting code_length (72447 > 65535) error ?

How can I fix it?

Thx

Was it helpful?

Solution

my string' length is just 61671. Why I am getting code_length (72447 > 65535) error ?

Because code length and string length are two different things. Your code is too long. Split it.

OTHER TIPS

As others have said, your problem is that your code is too long, not any specific string. I am afraid splitting your code into smaller methods/classes is your only option. Not only that, but it's just good practice. It's good practice to break your code into as many different segments as reasonably possible. Often, if you end up with giant classes/methods, it's because your classes or methods have low cohesion.

High cohesion (and therefore ultimately small classes etc) is strongly encouraged (essential reading for object oriented programmers). It will make your life, and the life of any programmers working with you, much more comfortable.

If you're trying to store your classfiles in a Derby databse, perhaps you should use a BLOB datatype, which does not have such a small length limit.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top