Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot invoke method makeServerURL() on null object after upgrading to Assetpipeline 2.7.4 #345

Open
rodriguezkatarina opened this issue Apr 27, 2016 · 17 comments

Comments

@rodriguezkatarina
Copy link

rodriguezkatarina commented Apr 27, 2016

ERROR errors.GrailsExceptionResolver  - NullPointerException occurred when processing request: [POST] /sendLink/
Cannot invoke method makeServerURL() on null object. Stacktrace follows:
java.lang.NullPointerException: Cannot invoke method makeServerURL() on null object
    at asset.pipeline.grails.LinkGenerator.makeServerURL(LinkGenerator.groovy:34)

How to fix this? This used to work in lower version. I didn't modify anything in the code.

@rodriguezkatarina rodriguezkatarina changed the title Cannot invoke method makeServerURL() on null object after upgrading to 2.7.4 Cannot invoke method makeServerURL() on null object after upgrading to Assetpipeline 2.7.4 Apr 27, 2016
@dtamm
Copy link

dtamm commented Apr 27, 2016

I dont know if this may be the same issue, but after upgrading my application to asset-pipeline >= 2.7.x (from 2.6.10) i get this stacktrace while opening one of my gsps:

2016-04-27 12:34:52,994 [http-nio-8150-exec-2] ERROR errors.GrailsExceptionResolver  - NullPointerException occurred when processing request: [GET] /kmi/contantForm/4 - parameters:
execution: e1s1
Stacktrace follows:
org.springframework.webflow.execution.FlowExecutionException: Exception thrown in state 'datenschutz' of flow 'kontakt/kontakt'
    at grails.plugin.cache.web.filter.PageFragmentCachingFilter.doFilter(PageFragmentCachingFilter.java:189)
    at grails.plugin.cache.web.filter.AbstractFilter.doFilter(AbstractFilter.java:63)
    at com.brandseye.cors.CorsFilter.doFilter(CorsFilter.java:100)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
    at java.lang.Thread.run(Thread.java:744)
Caused by: java.lang.IllegalStateException: Exception occurred rendering view org.codehaus.groovy.grails.web.sitemesh.SitemeshLayoutView: unnamed; URL [null]
    ... 6 more
Caused by: org.codehaus.groovy.grails.web.pages.exceptions.GroovyPagesException: Error applying layout : contactLayoutCompanyOne
    ... 6 more
Caused by: org.codehaus.groovy.grails.web.pages.exceptions.GroovyPagesException: Error processing GroovyPageView: null
    ... 6 more
Caused by: java.lang.NullPointerException
    at java.util.Hashtable.hash(Hashtable.java:239)
    at java.util.Hashtable.get(Hashtable.java:434)
    at java.util.Properties.getProperty(Properties.java:951)
    at asset.pipeline.grails.AssetProcessorService.getResolvedAssetPath(AssetProcessorService.groovy:57)
    at asset.pipeline.grails.AssetProcessorService.asset(AssetProcessorService.groovy:72)
    at asset.pipeline.grails.CachingLinkGenerator.asset(CachingLinkGenerator.groovy:32)
    at asset.pipeline.grails.CachingLinkGenerator.resource(CachingLinkGenerator.groovy:24)
    at gsp_kmi_layoutscontactLayoutCompanyOne_gsp$_run_closure1.doCall(gsp_kmi_layoutscontactLayoutCompanyOne_gsp.groovy:57)
    at gsp_kmi_layoutscontactLayoutCompanyOne_gsp.run(gsp_kmi_layoutscontactLayoutCompanyOne_gsp.groovy:60)
    ... 6 more
2016-04-27 12:34:53,040 [http-nio-8150-exec-2] ERROR errors.GrailsExceptionResolver  - NullPointerException occurred when processing request: [GET] /kmi/contantForm/4 - parameters:
execution: e1s1
Stacktrace follows:
java.lang.NullPointerException
    at grails.plugin.cache.web.filter.PageFragmentCachingFilter.doFilter(PageFragmentCachingFilter.java:189)
    at grails.plugin.cache.web.filter.AbstractFilter.doFilter(AbstractFilter.java:63)
    at com.brandseye.cors.CorsFilter.doFilter(CorsFilter.java:100)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
    at java.lang.Thread.run(Thread.java:744)

And in the compiled gsp it is this code which does not run without the exception:

expressionOut.print(createLinkTo(uri: ""))

Another example would be this here:

expressionOut.print(createLinkTo(dir: 'images/knowledgebase/faq.png'))

Tried with Grails 2.5.0 and Grails 2.5.4 on Windows 7 and Java 7 and 8.

@davydotcom
Copy link
Contributor

try with 2.8.0

@dtamm
Copy link

dtamm commented Apr 27, 2016

@davydotcom Already did, hence the '>=' in my description :-) so, with 2.8.0 the same exception :-(

@rodriguezkatarina
Copy link
Author

Same issue when upgrading to 2.8.0

@rodriguezkatarina
Copy link
Author

rodriguezkatarina commented May 2, 2016

I reverted to :asset-pipeline:2.1.5 as recommended by grails 2.4.5 release notes and it suddenly worked. @dtamm This might fix it for you.

@dtamm
Copy link

dtamm commented May 2, 2016

@rodriguezkatarina i switched back to 2.6.10, also works for me :) but i think using the latest plugins is always the best, so i will wait for 2.8.x to get the exception fixed.

@davydotcom
Copy link
Contributor

Should be released soon on a plane

Sent from my iPhone

On May 2, 2016, at 9:00 AM, Dominik Tamm notifications@github.com wrote:

@rodriguezkatarina i switched back to 2.6.10, also works for me :) but i think using the latest plugins is always the best, so i will wait for 2.8.x to get the exception fixed.


You are receiving this because you were mentioned.
Reply to this email directly or view it on GitHub

@rgoldberg
Copy link
Contributor

rgoldberg commented May 20, 2016

These weird issues might be caused by Grails 2.5.4.

I don't see any other changes from 2.6.10 to 2.7.4 that should cause this.

Grails was changed from 2.5.1 to 2.5.4 when moving from 2.6.10 to 2.7.0.

I had odd problems in an app of mine when I upgraded from 2.5.3 to 2.5.4.

Reverting fixed the issue in my, so you might want to try downgrading the Grails version for AP to 2.5.3.

@rgoldberg
Copy link
Contributor

@davydotcom downgraded Grails to 2.5.3 in AP 2.9.0. @rodriguezkatarina & @dtamm: Please try it and let everyone know if it fixes your problems.

@dtamm
Copy link

dtamm commented May 24, 2016

@rgoldberg cant downgrade to 2.5.3, since our office policy says always to use the latest framework versions where possible, and since grails ist "the" framework behind our application i just cant :-(

@dtamm
Copy link

dtamm commented May 24, 2016

btw, @rgoldberg your pull request has not been merged but a new version was released?

@rgoldberg
Copy link
Contributor

Yeah. @davydotcom downgraded Grails to 2.5.3 in a separate commit outside my PR.

If 2.5.4 has bugs that aren't in 2.5.3, and those bugs cause problems, then the latest possible framework version is 2.5.3. I tried 2.5.4, and it would not work correctly, so I had to downgrade.

@davydotcom
Copy link
Contributor

I should mention I'm using 2.5.4 fine with asset pipeline so I can dig

Sent from my iPhone

On May 24, 2016, at 9:56 AM, Ross Goldberg notifications@github.com wrote:

Yeah. @davydotcom downgraded Grails to 2.5.3 in a separate commit outside my PR.

If 2.5.4 has bugs that aren't in 2.5.3, and those bugs cause problems, then the latest possible framework version is 2.5.3. I tried 2.5.4, and it would not work correctly, so I had to downgrade.


You are receiving this because you were mentioned.
Reply to this email directly or view it on GitHub

@rgoldberg
Copy link
Contributor

rgoldberg commented May 25, 2016

The problems that I had with 2.5.4 weren't with AP, they were with GORM validation, but they were similarly weird, and the coincidence of the AP problems occurring after the AP upgrade to 2.5.4 just made me think that maybe downgrading to 2.5.3 would help. Maybe downgrading the AP Grails version to 2.5.3 suffices, and you can still use 2.5.4 for your app that uses AP. Maybe only downgrading the app is required. Maybe downgrading doesn't help at all. (I'm not sure if "using 2.5.4" from @davydotcom means using AP referencing 2.5.4, a 2.5.4 app, or 2.5.4 for both. Depending on what he meant, certain possibilities I've mentioned above would be ruled out by his tests)

I just figured if downgrading did fix things, it might save everyone a lot of debugging...

@dtamm So, does AP 2.9.0 referencing 2.5.3 work fine in your 2.5.4 app?

If so, then we probably have a fix. If not, if there's any way you could just try downgrading your app to 2.5.3, just to test, that would be very useful. If downgrading both to 2.5.3 works, you could try reverting to AP 2.8.0 (which references 2.5.4) running it with your 2.5.3 app, so we can determine if the issue is with the AP Grails version, the app Grails version, both, or neither.

@dtamm
Copy link

dtamm commented May 25, 2016

@rgoldberg nope, AP 2.9.0 doesn't work with my 2.5.4 application. i will check out if i can downgrade to 2.5.3 and tell you in the mid of the day!

@rgoldberg
Copy link
Contributor

@dtamm Any luck running app in 2.5.3?

@robertoschwald
Copy link

Same here when using the following dependencies in Grails 3.x:

asset-pipeline-core-2.14.3.jar
asset-pipeline-grails-2.14.3.jar

It works with this dependencies:

asset-pipeline-3.0.15.jar
asset-pipeline-core-2.9.1.jar

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants