I got the following stacktrace when I try to access login page of my application:
21.03.2016 19:01:52,746: (HVK3) GrailsExceptionResolver: NullPointerException occurred when processing request: [GET] /wmp-hvk3-development/login/auth
Stacktrace follows:
org.codehaus.groovy.grails.web.pages.exceptions.GroovyPagesException: Error processing GroovyPageView: null
at grails.plugin.cache.web.filter.PageFragmentCachingFilter.doFilter(PageFragmentCachingFilter.java:198)
at grails.plugin.cache.web.filter.AbstractFilter.doFilter(AbstractFilter.java:63)
at grails.plugin.springsecurity.web.filter.GrailsAnonymousAuthenticationFilter.doFilter(GrailsAnonymousAuthenticationFilter.java:53)
at grails.plugin.springsecurity.web.authentication.logout.MutableLogoutFilter.doFilter(MutableLogoutFilter.java:62)
at grails.plugin.springsecurity.web.SecurityRequestHolderFilter.doFilter(SecurityRequestHolderFilter.java:59)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
Caused by: java.lang.NullPointerException
at java.util.Hashtable.hash(Hashtable.java:262)
at java.util.Hashtable.get(Hashtable.java:459)
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_wmpHvk3Development_loginauth_gsp$_run_closure2.doCall(gsp_wmpHvk3Development_loginauth_gsp.groovy:67)
Application works perfectly in test environment on local workstation but this stacktrace occurs when I deploy to production.
Im not sure what to make out of it, I guess there is a problem with the assets-pipeline assets path since AssetProcessorService.groovy:57 states:
I'm on RedHat linux running tomcat 7 with java 1.7 with assets pipeline 2.7.2 plugin as compile dependency and spring security core plugin 2.0.0 compile time dependency.
This was caused by missing configuration in BuildConfig. I added the following to the end of the file and it fixed this:
// This closure is passed the command line arguments used to start the war process.
grails.war.copyToWebApp = { args ->
fileset(dir: "web-app") {
include(name: "js/**")
include(name: "css/**")
include(name: "WEB-INF/**")
}
}
Related
Trying to deploy my grails app to jelastic environment and having a proper TomEE app server configured and all the plugins related to activemq I got the following exception on the server:
INFO: For help or more information please see: http://activemq.apache.org
2016-03-06 20:04:17,194 [localhost-startStop-1] ERROR context.GrailsContextLoader - Error initializing the application: Error creating bean with name 'myBrokerService': Invocation of init method failed; nested exception is java.lang.NoSuchMethodError: org.apache.activemq.usage.TempUsage.getStore()Lorg/apache/activemq/store/kahadb/plist/PListStore;
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'myBrokerService': Invocation of init method failed; nested exception is java.lang.NoSuchMethodError: org.apache.activemq.usage.TempUsage.getStore()Lorg/apache/activemq/store/kahadb/plist/PListStore;
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
at java.util.concurrent.FutureTask.run(FutureTask.java:262)
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:745)
Caused by: java.lang.NoSuchMethodError: org.apache.activemq.usage.TempUsage.getStore()Lorg/apache/activemq/store/kahadb/plist/PListStore;
at org.apache.activemq.xbean.XBeanBrokerService.ensureSystemUsageHasStore(XBeanBrokerService.java:72)
at org.apache.activemq.xbean.XBeanBrokerService.afterPropertiesSet(XBeanBrokerService.java:56)
... 5 more
On my local environment I use IntelliJ with the embedded tomcat and tomEE servers and it works properly. I suppose the issue is related to the fact that activemq doesn't have enough rights in order to create some files on the disk. Unfortunetly I'm not able to figure out where is the problem. Any advise is highly appreciated.
Find below the solution that works for Jelastic (tomcat 7, java7, grails 2.2.4) environment:
BuildConfig.groovy:
compile 'org.grails.plugins:jms:1.3'
compile 'org.apache.activemq:activemq-core:5.7.0'
compile 'org.apache.xbean:xbean-spring:4.1'
resources.groovy:
import org.apache.activemq.broker.TransportConnector
import org.apache.activemq.xbean.XBeanBrokerService
import org.springframework.jms.connection.SingleConnectionFactory
beans = {
tcpConnector(TransportConnector,uri:'tcp://localhost:61616'){}
connectors(ArrayList,[ref('tcpConnector')]){}
myBrokerService(XBeanBrokerService){bean->
myBrokerService.useJmx = false
myBrokerService.persistent = true
myBrokerService.dataDirectory = 'my-activemq_data'
myBrokerService.transportConnectors = ref('connectors')
}
amqConnectionFactory(org.apache.activemq.ActiveMQConnectionFactory) {
brokerURL = 'vm://localhost'
}
jmsConnectionFactory(SingleConnectionFactory) { bean ->
targetConnectionFactory = ref(amqConnectionFactory)
}
}
Embedded activemq started without any issues.
I was trying to run my grails project which I upgraded to 2.4.4 from 2.3.5.
Now after trying to run it, I get these error:
|Running Grails application
context.GrailsContextLoaderListener Error initializing the application: org/codehaus/groovy/grails/commons/ConfigurationHolder
java.lang.NoClassDefFoundError: org/codehaus/groovy/grails/commons/ConfigurationHolder
at grails.plugin.hibernate3.HibernatePluginSupport$__clinit__closure1.doCall(HibernatePluginSupport.groovy:129)
at grails.spring.BeanBuilder.invokeBeanDefiningClosure(BeanBuilder.java:754)
at grails.spring.BeanBuilder.beans(BeanBuilder.java:584)
at grails.spring.BeanBuilder.invokeMethod(BeanBuilder.java:527)
at java.util.concurrent.FutureTask.run(FutureTask.java:262)
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:745)
Caused by: java.lang.ClassNotFoundException: org.codehaus.groovy.grails.commons.ConfigurationHolder
at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
... 8 more
Error |
Forked Grails VM exited with error
Based on Grail's migration doc, it looks like they have remove ConfigurationHolder from 2.4.
You need to update the hibernate plugin.
From their doc:
Static Holder Classes The following deprecated classes have been
removed from Grails 2.4.x:
org.codehaus.groovy.grails.commons.ApplicationHolder
org.codehaus.groovy.grails.commons.ConfigurationHolder
org.codehaus.groovy.grails.plugins.PluginManagerHolder
org.codehaus.groovy.grails.web.context.ServletContextHolder
org.codehaus.groovy.grails.compiler.support.GrailsResourceLoaderHolder
If you or any plugins you have installed are using these classes you
will get a compilation error. The problem can be rectified by updating
to new plugins and using grails.util.Holders instead.
If your application uses the jquery plugin you will need to update to
version 1.11.0.2 or later as previous versions of the plugin made use
of the ApplicationHolder class. If your application uses the resources
plugin you will need to update to version 1.2.7 or later as previous
versions of the plugin made use of the ConfigurationHolder class.
migration doc: http://grails.github.io/grails-doc/2.4.x/guide/upgradingFrom23.html
If you are using Eclipse, go to Java build path, Order and Export, tick all the libraries and then execute the application
Grails version 2.4.1 was recently released. One of the bugs fixed was restoring the ability to use servlet version 2.5. See https://jira.grails.org/browse/GRAILS-11466
I created a new grails app. Without changing anything, I was able to compile it and run it. When I changed the grails.servlet.version to "2.5", I was able to compile but when I ran it I got the the following stack trace error.
Does anyone know if there are other settings I need to change to get Grails 2.4.1 to run on a servlet 2.5 container? Specifically, tomcat 6.
Error loading plugin manager: Unable to locate constructor with Class parameter for class org.codehaus.groovy.grails.commons.DefaultGrailsControllerClass (NOTE: Stack trace has been filtered. Use --verbose to see entire trace.)
java.lang.RuntimeException: Unable to locate constructor with Class parameter for class org.codehaus.groovy.grails.commons.DefaultGrailsControllerClass
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1612)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1549)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:539)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:475)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:304)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:228)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:300)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:195)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:684)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:760)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:482)
at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:403)
at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:306)
at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:106)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4973)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5467)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1559)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1549)
Caused by: java.lang.reflect.InvocationTargetException
at org.springsource.loaded.ri.ReflectiveInterceptor.jlrConstructorNewInstance(ReflectiveInterceptor.java:1002)
... 19 more
Caused by: java.lang.NoClassDefFoundError: Lorg/codehaus/groovy/grails/plugins/web/async/api/ControllersAsyncApi;
at org.springsource.loaded.ri.ReflectiveInterceptor.jlClassGetDeclaredFields(ReflectiveInterceptor.java:1593)
... 20 more
Caused by: java.lang.ClassNotFoundException: org.codehaus.groovy.grails.plugins.web.async.api.ControllersAsyncApi
... 21 more
Error |
Error loading plugin manager: Unable to locate constructor with Class parameter for class org.codehaus.groovy.grails.commons.DefaultGrailsControllerClass
Error |
Forked Grails VM exited with error
Process finished with exit code 1
This error would happen if you didn't do a grails clean prior to running Grails after changing the version to 2.5
What happens is that when the version is 3.0 Grails adds extra dependencies to the classpath that result in new behaviour being added to the compiled classes.
If you then change the version to 2.5 and just do run-app the extra dependencies are gone, but the new behaviour is still compiled into the classes. Doing a clean resolve this.
I can't seem to figure this one out...
When deploying a JSF web app Glassfish complains about not being able to find JSFSServlet.
It's Glassfish 4 EE and I checked that c:/glassfish4/glassfish/modules contains javax.faces.jar.
My webapp doesn't have a JSF jar included in the WEB-INF/lib so there is no clash with the jar on the glassfish server.
I've re-installed my JDK and re-set my JAVA_HOME & path environment variables. Confirmed these are working by running java -version & javac -version from the command prompt which indicate I am running JDK1.7.25.
I've tried running Glassfish by:
1) Using eclipse (pointing to the correct JDK)
2) Standalone with WAR
And I get the same result!
What may be related is the install failed for Glassfish with the "requires version 1.6 or above" message and I had to install using glassfish-4-install.exe -j %JAVA_HOME%
Any help would be much appreciated! Here is the stack trace from glassfish:
2013-10-28T11:35:36.815+0200|SEVERE: Exception during lifecycle processing
java.lang.Exception: java.lang.IllegalStateException: ContainerBase.addChild: start: org.apache.catalina.LifecycleException: org.apache.catalina.LifecycleException: java.lang.ClassNotFoundException: javax.faces.webapp.JSFServlet
at com.sun.enterprise.web.WebApplication.start(WebApplication.java:168)
at org.glassfish.internal.data.EngineRef.start(EngineRef.java:122)
at org.glassfish.internal.data.ModuleInfo.start(ModuleInfo.java:291)
at org.glassfish.internal.data.ApplicationInfo.start(ApplicationInfo.java:352)
at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:497)
at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:219)
at org.glassfish.deployment.admin.DeployCommand.execute(DeployCommand.java:491)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$2$1.run(CommandRunnerImpl.java:527)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$2$1.run(CommandRunnerImpl.java:523)
at java.security.AccessController.doPrivileged(Native Method)
at javax.security.auth.Subject.doAs(Subject.java:356)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$2.execute(CommandRunnerImpl.java:522)
at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:546)
at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:1423)
at com.sun.enterprise.v3.admin.CommandRunnerImpl.access$1500(CommandRunnerImpl.java:108)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1762)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1674)
at com.sun.enterprise.v3.admin.AdminAdapter.doCommand(AdminAdapter.java:534)
at com.sun.enterprise.v3.admin.AdminAdapter.onMissingResource(AdminAdapter.java:224)
at org.glassfish.grizzly.http.server.StaticHttpHandler.service(StaticHttpHandler.java:297)
at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:246)
at org.glassfish.grizzly.http.server.HttpHandler.runService(HttpHandler.java:191)
at org.glassfish.grizzly.http.server.HttpHandler.doHandle(HttpHandler.java:168)
at org.glassfish.grizzly.http.server.HttpServerFilter.handleRead(HttpServerFilter.java:189)
at org.glassfish.grizzly.filterchain.ExecutorResolver$9.execute(ExecutorResolver.java:119)
at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeFilter(DefaultFilterChain.java:288)
at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeChainPart(DefaultFilterChain.java:206)
at org.glassfish.grizzly.filterchain.DefaultFilterChain.execute(DefaultFilterChain.java:136)
at org.glassfish.grizzly.filterchain.DefaultFilterChain.process(DefaultFilterChain.java:114)
at org.glassfish.grizzly.ProcessorExecutor.execute(ProcessorExecutor.java:77)
at org.glassfish.grizzly.nio.transport.TCPNIOTransport.fireIOEvent(TCPNIOTransport.java:838)
at org.glassfish.grizzly.strategies.AbstractIOStrategy.fireIOEvent(AbstractIOStrategy.java:113)
at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.run0(WorkerThreadIOStrategy.java:115)
at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.access$100(WorkerThreadIOStrategy.java:55)
at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy$WorkerThreadRunnable.run(WorkerThreadIOStrategy.java:135)
at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:564)
at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.run(AbstractThreadPool.java:544)
at java.lang.Thread.run(Thread.java:724)
SOLVED! Eclipse was listing javax.faces.JSFServlet as the class for JSF.
Changed this to javax.faces.webapp.FacesServlet!
Since upgrading an app from grails 1.3.7 to 2.1.0 I am getting the error below when attempting to submit(post) forms.
It only happens in debug mode though!
I'm using Groovy/Grails Tool Suite 3.1.0
5:41:13 ERROR [GrailsExceptionResolver] ClassCircularityError occurred when processing request: [POST] /myapp/contextRoot/addItem - parameters:
startTimeDate:
addcoupon: Add Item
maxRedemptions:
timeZone: Europe/London
termsAndConditions:
percentOff:
title: test
buyX:
discountType:
shortDescription:
redemptionType.id:
getY:
categoryKey:
amountOff:
org/springframework/beans/PropertyBatchUpdateException. Stacktrace follows:
org.codehaus.groovy.grails.web.servlet.mvc.exceptions.ControllerExecutionException: Executing action [addItem] of controller [com.mastercard.deals.merchant.testController] caused exception: Runtime error executing action
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:662)
Caused by: org.codehaus.groovy.grails.web.servlet.mvc.exceptions.ControllerExecutionException: Runtime error executing action
... 3 more
Caused by: java.lang.reflect.InvocationTargetException
... 3 more
Caused by: java.lang.ClassCircularityError: org/springframework/beans/PropertyBatchUpdateException
... 3 more
I'm baffled as to why this is happening...any ideas?
Thanks
So the following JIRA appears similar to the issue:
I now run the app with -noreloading argument in debug mode and it works:
-grails-debug -noreloading -Dserver.port=8082 run-app