Error 500: Error processing GroovyPageView: null - grails

I'm building a Grails/Groovy/GSP app.
I'm used to seeing errors such as "Cannot get property 'id' on null object", or "no property named ...". But I'm not sure what "null" by itself means!
Error 500: Error processing GroovyPageView: null
Just "null".
Now I understand that the full error stack is going to help, and I'm still studying it to understand the error. But I just wonder in general what type of error is just "null".
One other thing I noticed is that for error messages regarding groovy/gsp pages, the line numbers are always completely off and useless.
org.codehaus.groovy.grails.web.pages.exceptions.GroovyPagesException: Error processing GroovyPageView: null
at org.apache.jk.server.JkCoyoteHandler.invoke(JkCoyoteHandler.java:199)
at org.apache.jk.common.HandlerRequest.invoke(HandlerRequest.java:282)
at org.apache.jk.common.ChannelSocket.invoke(ChannelSocket.java:754)
at org.apache.jk.common.ChannelSocket.processConnection(ChannelSocket.java:684)
at org.apache.jk.common.ChannelSocket$SocketConnection.runIt(ChannelSocket.java:876)
at java.lang.Thread.run(Thread.java:619)
Caused by: java.lang.NullPointerException
at gsp_shop_viewCategoryshow_gsp$_run_closure1.doCall(gsp_shop_viewCategoryshow_gsp.groovy:36)
at gsp_shop_viewCategoryshow_gsp$_run_closure1.doCall(gsp_shop_viewCategoryshow_gsp.groovy)
at gsp_shop_viewCategoryshow_gsp.run(gsp_shop_viewCategoryshow_gsp.groovy:54)
... 6 more

I'd again assume you are doing something with a null object in your gsp. If you don't see such a thing, go and fine gsp_shop_viewCategoryshow_gsp.groovy, and see what's there on line 36.
I'm not sure exactly where this file would reside, and it depends on the settings, but check your HOME/.grails folder.

Related

How to fine-tune the level for SonarQube Gradle plugin

I'm using SonarQube plugin (version 2.6.1) for Gradle (version 4.7) and have the problem that a lot of unimportant log output is being written while running the sonar analysis on my CI server.
Is there a way to fine-tune the log level for this plugin?
I checked the documentation but the only setting related to the log output I found was the JVM argument "verbose" which I'm not using either way (I guess the default is false so this shouldn't be turned on for me).
EDIT: Here are some examples of the output I would like to get rid of:
Some huge exception stacktraces during findbugs analysis (this one is shortened, didn't want to post the whole stacktrace, it's really huge).
16:23:34.993 ERROR - Unable to create symbol table for : /opt/workspace/pipeline-1/src/main/java/com/SomeClass.java
java.lang.NullPointerException: null
at org.sonar.java.resolve.TypeAndReferenceSolver.getSymbolOfMemberSelectExpression(TypeAndReferenceSolver.java:232) ~[java-squid-2.5.1.jar:na]
at org.sonar.java.resolve.TypeAndReferenceSolver.resolveAs(TypeAndReferenceSolver.java:200) ~[java-squid-2.5.1.jar:na]
at org.sonar.java.resolve.TypeAndReferenceSolver.resolveAs(TypeAndReferenceSolver.java:182) ~[java-squid-2.5.1.jar:na]
at...
Stacktraces from PMD:
16:23:37.206 ERROR - Fail to execute PMD. Following file is ignored: /opt/workspace/pipeline-1/src/main/java/com/SomeClass.java
java.lang.RuntimeException: null
at org.objectweb.asm.MethodVisitor.visitParameter(Unknown Source) ~[asm-5.0.3.jar:5.0.3]
at org.objectweb.asm.ClassReader.b(Unknown Source) ~[asm-5.0.3.jar:5.0.3]
at org.objectweb.asm.ClassReader.accept(Unknown Source) ~[asm-5.0.3.jar:5.0.3]
at org.objectweb.asm.ClassReader.accept(Unknown Source) ~[asm-5.0.3.jar:5.0.3]
at net.sourceforge.pmd.lang.java.typeresolution.PMDASMClassLoader.getImportedClasses(PMDASMClassLoader.java:77) ~[pmd-java-5.2.1.jar:na]...
Lots of irrelevant warnings like these:
16:23:38.638 WARN - /opt/workspace/pipeline-1/src/main/java/com/SomeClass.java: Got an exception - expecting EOF, found '}'
/opt/workspace/pipeline-1/src/main/java/com/SomeClass.java:28:5: expecting RCURLY, found 'default'
16:23:38.655 WARN - /opt/workspace/pipeline-1/src/main/java/com/SomeClass.java: Got an exception - expecting EOF, found 'someVariable'
I don't know what exactly is causing these problems, but since both my app and the results of the sonar analysis are looking OK, I would like to get rid of those log outputs since they only pollute my logs on Jenkins and make them unreadable.
There's property sonar.log.level and sonar.verbose; for example:
allprojects {
sonarqube {
properties {
// property "sonar.log.level", "INFO"
property "sonar.log.level", "TRACE"
}
}
}
see the analysis parameters.

On production server at one page I am getting Fatal error ActionView::Template::Error

I am getting this error " ActionView::Template::Error (bad component(expected host component): ): ", on research on stackoverflow I observed this error is occurring on wrong config of mailer. But I have not configured any mails.
From the details shared , the first line indicates error in fetching the data.
A line of action to resolve this could be,
first to check the correctness of data fetch using rails console/sandbox environment.
Once point 1 above is sorted out and still error, then have a look at the view and check the rendering/flow.
This will point you to the error.

what is correct format for list param in hql

RaceRegistration.executeQuery("select RaceRegistration.compositeEvent.id FROM RaceRegistration where RaceRegistration.id in :registrationIds group by RaceRegistration.compositeEvent.id",
[registrationIds: [1,2]])
In the above query my doubt is in the last part [registrationIds: [1,2]]. Here i am assuming that the format for the list is wrong. I appreciate any help in correcting the format. Thanks!
I get the following exception
Exception thrown
org.springframework.orm.hibernate3.HibernateQueryException: Unable to resolve path [RaceRegistration.compositeEvent], unexpected token [RaceRegistration] [select RaceRegistration.compositeEvent.id FROM com.runnercard.registration.RaceRegistration where RaceRegistration.id in :registrationIds group by RaceRegistration.compositeEvent.id]; nested exception is org.hibernate.QueryException: Unable to resolve path [RaceRegistration.compositeEvent], unexpected token [RaceRegistration] [select RaceRegistration.compositeEvent.id FROM com.runnercard.registration.RaceRegistration where RaceRegistration.id in :registrationIds group by RaceRegistration.compositeEvent.id]
at org.springframework.orm.hibernate3.SessionFactoryUtils.convertHibernateAccessException(SessionFactoryUtils.java:656)
at org.springframework.orm.hibernate3.HibernateAccessor.convertHibernateAccessException(HibernateAccessor.java:412)
at org.springframework.orm.hibernate3.HibernateTemplate.doExecute(HibernateTemplate.java:411)
at org.springframework.orm.hibernate3.HibernateTemplate.executeFind(HibernateTemplate.java:343)
at com.runnercard.registration.RaceRegistration.executeQuery(RaceRegistration.groovy)
at com.runnercard.registration.RaceRegistration$executeQuery.call(Unknown Source)
at ConsoleScript5.run(ConsoleScript5:4)
Caused by: org.hibernate.QueryException: Unable to resolve path [RaceRegistration.compositeEvent], unexpected token [RaceRegistration] [select RaceRegistration.compositeEvent.id FROM com.runnercard.registration.RaceRegistration where RaceRegistration.id in :registrationIds group by RaceRegistration.compositeEvent.id]
at org.hibernate.hql.ast.tree.IdentNode.resolveAsNakedComponentPropertyRefLHS(IdentNode.java:219)
at org.hibernate.hql.ast.tree.IdentNode.resolve(IdentNode.java:108)
at org.hibernate.hql.ast.tree.DotNode.resolveFirstChild(DotNode.java:175)
at org.hibernate.hql.ast.HqlSqlWalker.lookupProperty(HqlSqlWalker.java:576)
at org.hibernate.hql.antlr.HqlSqlBaseWalker.propertyRef(HqlSqlBaseWalker.java:1181)
at org.hibernate.hql.antlr.HqlSqlBaseWalker.propertyRefLhs(HqlSqlBaseWalker.java:5495)
The exception says something else. It seems you have a problem with the mapping on the RaceRegistration class. It seems that the field compositeEvent is not mapped or is not mapped correctly.
So actually your question is wrong considering the exception thrown.

GeoServer PrintPlugin .yaml file HorizontalAllign Error

I tried all versions of geoserver and print module on both windows and ubuntu. I tried both war and exe installation. I use tomcat 7 and jdk 7. But there is the same error message.
HTTP Status 500 - Request processing failed; nested exception is org.ho.yaml.exception.YamlException: Error near line 0: Problem getting RİGHT value of enum type class org.mapfish.print.config.layout.HorizontalAlign
type Exception report
message Request processing failed; nested exception is org.ho.yaml.exception.YamlException: Error near line 0: Problem getting RİGHT value of enum type class org.mapfish.print.config.layout.HorizontalAlign
description The server encountered an internal error that prevented it from fulfilling this request.
exception
org.springframework.web.util.NestedServletException: Request processing failed; nested exception is org.ho.yaml.exception.YamlException: Error near line 0: Problem getting RİGHT value of enum type class org.mapfish.print.config.layout.HorizontalAlign

Handle Solr error messages from Blacklight

Whenever Solr fails executing a query for some reason it returns an error message and an error code. I would like to handle such errors in Blacklight. Right now, when receiving an error from Solr, the user gets a 500 internal error. As a developer I can see that what happens is an RSolr::Error::Http in CatalogController#index with the following line of code as the source of the problem:
res = blacklight_solr.send_and_receive(path, :params=>solr_params)
Is it possible to customize the error handling so that I can at least display an indicative error message to the user instead of the unhelpful 500 internal error?
Open file lib\blacklight\catalog.rb. The function rsolr_request_error(exception) is responsible to handle Solr errors. The exception parameter is an RSolr::RequestError and it represents the error from Solr. In order to handle the error by displaying the message from Solr just add the following inside the else:
error_status = eval(exception.response[:body])['error']
if !error_status.nil? and !error_status['msg'].nil?
flash_notice = error_status['msg']
else
flash_notice = I18n.t('blacklight.search.errors.request_error')
end
If you wish to display a different message then assign a different message to flash_notice. If you wish to handle the error differently then this is where to do so.

Resources