2014-06-17 11:22:18,622 [Thread-11] ERROR compiler.GrailsProjectWatcher - Compilation Error: startup failed:
General error during class generation: Method code too large!
What is the solution? Only 4-5 line code hide and restart then fully run in successfully, the bootStrap file size is 149k. When I comment or delete 4-5 line code, it will be run without no error!
The Java Virtual Machine has a limitation that methods cannot be larger than 64k (65536 bytes). This post describes this limitation in details.
The best way to overcome this issue is simply splitting your large method into smaller ones, which is generally a good practice.
Also notice that the JVM JIT compiler will not compile methods larger than 8K. You can however change this behavior using the -XX:-DontCompileHugeMethods option.
The problem: Just got in Jenkins pipeline the following exception error: org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed:
General error during class generation: Method code too large!
java.lang.RuntimeException: Method code too large!
Explanation : The root cause related to 64kB limit of byte code of a single method. Java Virtual Machine has implicit limitations on class that there are mandatory to be followed and restricted according to performance and the language limitiation - such as: size of an operand stack in frame, length of fields and method names, number of methods may be declared in class etc... you can follow this "check list" on Oracle JVM documentation. You got the method size limitation on this scenario.
Solution: In order to solve this issue, just separate the class methods into shared-lib library or sub internal / external class (such as Utils.Groovy for example) and import that library in your main class. In general a code should be readable , lean and high level. if it's too long export the functionality use object oriented architecture and you would earn readable and maintainable code as well.
Related
I'm trying to build websphere message broker however I've stumbled into weird issue. When using mqsicreatebar to create BAR file the build returns following error trice (three times, with different problem number):
Problem 22: Resource - /ErrorHandlingLib/error/handling/ErrorHandler.subflow; Error message - Class should inherit from MbJavaComputeNode..
I have found solution for this in one of the forums which stated that adding full class path to MbJavaComputeNode (as in: extends com.ibm.broker.javacompute.MbJavaComputeNode) the problem should be solved. However it was older wmbt version and neither this, neither any of the new IBM released wmbt fixes helped.
The error printing three times is probably because Java compute node in the sublfow is used in three different routes.
Websphere message broker toolkit used is v8.0.0.5
The classes, that you assign to the Java Compute nodes in your flows must extend the MbJavaComputeNode class.
This error says that you have some Java Computes that are not referencing such classes.
I suggest creating the classes for the Java Compute nodes with the wizard, which starts when you double click a newly inserted Java Compute node which has no class assigned to it.
I use java and saxonee-9.5.1.6.jar included build path , when run, getting these errors at different times.
Error at xsl:import-schema on line 6 column 169 of stylesheet.xslt:
XTSE1650: net.sf.saxon.trans.LicenseException: Requested feature (xsl:import-schema)
requires Saxon-EE
Error on line 1 column 1
SXXP0003: Error reported by XML parser: Content is not allowed in prolog.
javax.xml.transform.TransformerConfigurationException: Failed to compile stylesheet. 1 error detected.
I open .xslt file in hex editor and dont see any different character at the beginning AND
I use transformerfactory in a different project but any error I get.
Check what the implementation class of tFactory is. My guess is it is probably net.sf.saxon.TransformerFactoryImpl - which is basically the Saxon-HE version.
When you use JAXP like this, you're very exposed to configuration problems, because it loads whatever it finds sitting around on the classpath, or is affected by system property settings which could be set in parts of the application you know nothing about.
If your application depends on particular features, it's best to load a specific TransformerFactory, e.g. tFactory = new com.saxonica.config.EnterpriseTransformerFactory().
I don't know whether your stylesheet expects the source document to be validated against the schema, but it it does, note that this isn't automatic: you can set properties on the factory to make it happen.
I would recommend using Saxon's s9api interface rather than JAXP for this kind of thing. The JAXP interface was designed for XSLT 1.0, and it's a real stretch to use it for some of the new 2.0 features like schema-awareness: it can be done, but you keep running into limitations.
I am doing some work with neo4j based around working out who knows who and what they do, it is in the format of
Company-node
product-node
person-node
and the relationships between them as
company borders,by location
person works at company
company has product.
I have a spreadsheet that has all the information written down and a macro that takes the iformation adn converts it into cypher. THe code comes to around 5000 lines.
When I try to import it I get an unknown error if I try to run it in the internet browser. If i run it in the shell it goes the whole way through and then gives the error
Error occurre in server thread ; nested exception is:
java.lang.StackOverflowerror
my heap size is set to 3gb
anyone have any ideas on what the error is and how to fix it?
Fist of all it has nothing to do with your heap size, it is related to stack size. if you want to increase stack size use -Xss parameter.
Also stack is used to hold intermediate variables and function calls, your import is somehow crossing the stack size set in you configuration.
I'm trying to connect my Windows XP program (Lazarus) to my Ubuntu postgres server.
When the Lazarus program runs, it seems to compile fine but I get this error:
Project ... raised exception class 'RunError(211)'.
Then it terminates execution (and I don't see any output), and opens up a file customform.inc. In that file, it shows a procedure procedure TCustomForm.DoCreate; where it highlights a line: if Assigned(FOnCreate) then FOnCreate(Self);
I believe this is one of the system's files.
I never get to see any output.
What could this be? Thanks!
MORE INFO:
I've narrowed down the error to this line:
dbQuery_Menu.SQL.Text:='Select * From "tblMenus"';
dbQuery_Menu.Open;
the exception is triggered when the OPEN statement gets executed.
BTW, dbQuery_Menu is defined as a TSQLQuery component.
Clueless! :(
Run error 211 appears when you try to call an abstract method. Check this link from more information on FreePascal/Lazarus runtime errors.
Since you say all is done by code and you have no visual components, the problem probably lies in your code trying to use an ancestor component which has not overriden the Open method. You should be able to solve this by using the correct descendant component.
Another possibility, although I would strongly recommend to avoid this one, is to override the Open method yourself. It should be avoided because if you are using an ancestor component then you probably would have to override more abstract methods.
HTH
After nearly 5 days I found the answer. Many thanks to all thos e ho have contributed with their ideas ESPECIALLY RRUZ, RBA and Guillem Vicens. there are other related posts all connected to getting the FIRST Lazarus program working with PostgreSQL.
Summary.
The biggest mistake I made here was that I used the TSQLConnection component. Don't do this. Instead use the TPQConnection.
Everything is done through code. We're not using any draggable components from the top tab.
Don't rely on the Lazarus docs (wiki) at least for working with PG DBs.. It is outdated. Some of the examples can be pretty misleading.
Make sure that fields have some default values. For example, if a Boolean field has no true or false (t/f) set, this may lead to errors.
And that's it! I hope many postgres+Lazarus newbies will find this useful.
From here - http://www.network-theory.co.uk/docs/postgresql9/vol2/SQLSTATEvsSQLCODE.html - -211 (ECPG_CONVERT_BOOL) This means the host variable is of type bool and the datum in the database is neither 't' nor 'f'. (SQLSTATE 42804)
my question is related to this question
We have different aspect class that do #around advice on different part of an application (fat client in Swing) to measure the execution time.
I have another aspect (ExceptionHandler) that do #around on all the aspects method i wrote.
I did this to avoid that the aspects created would throw exception and make the client application fails. So basically, i try catch the Proceed of my other #around method and just log exception that arise. I only throw an exception when i detect it come from the proceedingJoinPoint
if (joinPoint.getSignature().getDeclaringTypeName().equalsIgnoreCase("org.aspectj.lang.ProceedingJoinPoint")) {
throw exception;
}
Is it valid to do this?
In Eclipse with AJDT the app run fine and i tested the ExceptionHandler and it worked as expected.
But in other env. (Integration) the application fail as soon as it meet a line advised by the exceptionHandler with this Error
Exception in thread "main" java.lang.NoSuchMethodError: com.xxx.yyy.aop.aspect.ExceptionHandlerAspect.aspect
Of()Lcom/xxx/yyy/aop/aspect/ExceptionHandlerAspect;
at com.xxx.yyy.aop.aspect.ecs.AspectBaseEcs.inspectLoginInfo(AspectBaseEcs.java:65)
at com.xxx.yyy.app.es.security.Security.loadApplications(Security.java:172)
at com.xxx.yyy.app.es.gui.VSDlgLogin.loadSecurity(VSDlgLogin.java:346)
at com.xxx.yyy.app.es.ApplicationSuite.start(ApplicationSuite.java:839)
at com.xxx.yyy.app.es.ApplicationSuite.main(ApplicationSuite.java:501)
I have also decompile the code to see if aspectOf() was weaved into my ExceptionHandler and the method is there!!!!!!!???????????
Why this error rise...?
I'm clueless.
Finally found the problem. Our Application had a dependency on common module jar that was containing aspect too.
The base package name was the same : com.xxx.aop and the base class we used for our aspects was the same name!!!! So 2 com.xxx.aop.AspectBase.class were loaded.
Since we used a flag in our ant build file to enable compile time weaving at yes/no, one of our AspectBase.class was not weaved while the other was.
Can't believe i didn't see that before!!!!!