I am trying to upgrade struts from version 2.2.1.1 to 2.5.17. But after upgrading it to 2.5.17 and upgrading few more dependencies I am getting below run time exception? I have also upgraded jars such as jquery plugin,tiles,ognl,dojo etc..
I am trying to upgrade struts from version 2.2.1.1 to 2.5.17. But after upgrading it to 2.5.17 and upgrading few more dependencies I am getting below run time exception? I have also upgraded jars such as jquery plugin,tiles,ognl,dojo etc..
Can anyone please suggest.
Exception occured:
java.lang.RuntimeException: Invalid action class configuration that references an unknown class named [LoginAction]
org.apache.struts2.convention.ConventionsServiceImpl.determineResultPath(ConventionsServiceImpl.java:97)
org.apache.struts2.convention.ConventionUnknownHandler.determinePath(ConventionUnknownHandler.java:376)
org.apache.struts2.convention.ConventionUnknownHandler.handleUnknownResult(ConventionUnknownHandler.java:272)
com.opensymphony.xwork2.DefaultUnknownHandlerManager.handleUnknownResult(DefaultUnknownHandlerManager.java:95)
com.opensymphony.xwork2.DefaultActionInvocation.createResult(DefaultActionInvocation.java:223)
com.opensymphony.xwork2.DefaultActionInvocation.executeResult(DefaultActionInvocation.java:369)
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:279)
com.aniket.web.struts.interceptors.CDMVI18nInterceptor.intercept(CDMVI18nInterceptor.java:43)
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249)
org.apache.struts2.factory.StrutsActionProxy.execute(StrutsActionProxy.java:48)
org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:574)
org.apache.struts2.dispatcher.ExecuteOperations.executeAction(ExecuteOperations.java:79)
org.apache.struts2.dispatcher.filter.StrutsPrepareAndExecuteFilter.doFilter(StrutsPrepareAndExecuteFilter.java:141)
weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:78)
com.aniket.web.filter.EncodingFilter.doFilter(EncodingFilter.java:41)
weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:78)
weblogic.servlet.internal.RequestEventsFilter.doFilter(RequestEventsFilter.java:32)
weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:78)
weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.wrapRun(WebAppServletContext.java:3701)
weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3667)
weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:326)
weblogic.security.service.SecurityManager.runAsForUserCode(SecurityManager.java:197)
weblogic.servlet.provider.WlsSecurityProvider.runAsForUserCode(WlsSecurityProvider.java:203)
weblogic.servlet.provider.WlsSubjectHandle.run(WlsSubjectHandle.java:71)
weblogic.servlet.internal.WebAppServletContext.doSecuredExecute(WebAppServletContext.java:2443)
weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2291)
weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2269)
weblogic.servlet.internal.ServletRequestImpl.runInternal(ServletRequestImpl.java:1703)
weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1663)
weblogic.servlet.provider.ContainerSupportProviderImpl$WlsRequestExecutor.run(ContainerSupportProviderImpl.java:272)
weblogic.invocation.ComponentInvocationContextManager._runAs(ComponentInvocationContextManager.java:352)
weblogic.invocation.ComponentInvocationContextManager.runAs(ComponentInvocationContextManager.java:337)
weblogic.work.LivePartitionUtility.doRunWorkUnderContext(LivePartitionUtility.java:57)
weblogic.work.PartitionUtility.runWorkUnderContext(PartitionUtility.java:41)
weblogic.work.SelfTuningWorkManagerImpl.runWorkUnderContext(SelfTuningWorkManagerImpl.java:644)
weblogic.work.ExecuteThread.execute(ExecuteThread.java:415)
weblogic.work.ExecuteThread.run(ExecuteThread.java:355)
java.lang.ClassNotFoundException: LoginAction
weblogic.utils.classloaders.GenericClassLoader.findLocalClass(GenericClassLoader.java:1029)
weblogic.utils.classloaders.GenericClassLoader.findClass(GenericClassLoader.java:990)
weblogic.utils.classloaders.ChangeAwareClassLoader.findClass(ChangeAwareClassLoader.java:104)
weblogic.utils.classloaders.GenericClassLoader.doFindClass(GenericClassLoader.java:611)
weblogic.utils.classloaders.GenericClassLoader.loadClass(GenericClassLoader.java:543)
weblogic.utils.classloaders.GenericClassLoader.loadClass(GenericClassLoader.java:496)
weblogic.utils.classloaders.ChangeAwareClassLoader.loadClass(ChangeAwareClassLoader.java:89)
weblogic.utils.classloaders.ChangeAwareClassLoader.loadClass(ChangeAwareClassLoader.java:53)
com.opensymphony.xwork2.util.ClassLoaderUtil.loadClass(ClassLoaderUtil.java:179)
org.apache.struts2.convention.ConventionsServiceImpl.determineResultPath(ConventionsServiceImpl.java:95)
org.apache.struts2.convention.ConventionUnknownHandler.determinePath(ConventionUnknownHandler.java:376)
org.apache.struts2.convention.ConventionUnknownHandler.handleUnknownResult(ConventionUnknownHandler.java:272)
com.opensymphony.xwork2.DefaultUnknownHandlerManager.handleUnknownResult(DefaultUnknownHandlerManager.java:95)
com.opensymphony.xwork2.DefaultActionInvocation.createResult(DefaultActionInvocation.java:223)
com.opensymphony.xwork2.DefaultActionInvocation.executeResult(DefaultActionInvocation.java:369)
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:279)
com.aniket.web.struts.interceptors.CDMVI18nInterceptor.intercept(CDMVI18nInterceptor.java:43)
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249)
org.apache.struts2.factory.StrutsActionProxy.execute(StrutsActionProxy.java:48)
org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:574)
org.apache.struts2.dispatcher.ExecuteOperations.executeAction(ExecuteOperations.java:79)
org.apache.struts2.dispatcher.filter.StrutsPrepareAndExecuteFilter.doFilter(StrutsPrepareAndExecuteFilter.java:141)
weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:78)
com.aniket.web.filter.EncodingFilter.doFilter(EncodingFilter.java:41)
weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:78)
weblogic.servlet.internal.RequestEventsFilter.doFilter(RequestEventsFilter.java:32)
weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:78)
weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.wrapRun(WebAppServletContext.java:3701)
weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3667)
weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:326)
weblogic.security.service.SecurityManager.runAsForUserCode(SecurityManager.java:197)
weblogic.servlet.provider.WlsSecurityProvider.runAsForUserCode(WlsSecurityProvider.java:203)
weblogic.servlet.provider.WlsSubjectHandle.run(WlsSubjectHandle.java:71)
weblogic.servlet.internal.WebAppServletContext.doSecuredExecute(WebAppServletContext.java:2443)
weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2291)
weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2269)
weblogic.servlet.internal.ServletRequestImpl.runInternal(ServletRequestImpl.java:1703)
weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1663)
weblogic.servlet.provider.ContainerSupportProviderImpl$WlsRequestExecutor.run(ContainerSupportProviderImpl.java:272)
weblogic.invocation.ComponentInvocationContextManager._runAs(ComponentInvocationContextManager.java:352)
weblogic.invocation.ComponentInvocationContextManager.runAs(ComponentInvocationContextManager.java:337)
weblogic.work.LivePartitionUtility.doRunWorkUnderContext(LivePartitionUtility.java:57)
weblogic.work.PartitionUtility.runWorkUnderContext(PartitionUtility.java:41)
weblogic.work.SelfTuningWorkManagerImpl.runWorkUnderContext(SelfTuningWorkManagerImpl.java:644)
weblogic.work.ExecuteThread.execute(ExecuteThread.java:415)
weblogic.work.ExecuteThread.run(ExecuteThread.java:355)
I got this issue resolved by replacing below:
<context-param>
<param-name>org.apache.tiles.impl.BasicTilesContainer.DEFINITIONS_CONFIG</param-name>
<param-value>/WEB-INF/tiles.xml</param-value>
</context-param>
with :
<context-param>
<param-name>org.apache.tiles.definition.DefinitionsFactory.DEFINITIONS_CONFIG</param-name>
<param-value>/WEB-INF/tiles.xml</param-value>
</context-param>
As per below documentation we dont have to specify tiles.xml path in web.xml post upgrade to struts 2.5. But it is not true in case of weblogic server.
https://cwiki.apache.org/confluence/display/WW/Struts+2.3+to+2.5+migration
Related
When schemaExport is executed using Gradle for a Grails 3.3 application, below warning is in the log though ddl.sql is created. According to Grails 3 documentation sitemesh.xml is removed so naturally the file wouldn't be available. Am I missing something?
Tools and version: Grails 3.3.0, Gradle 3.3, Hibnerate 5, Sybase ASE 15.7
2017-09-13 12:50:45.264 WARN --- [ main] o.s.mock.web.MockServletContext : Couldn't determine real path of resource class path resource [src/main/webapp/WEB-INF/sitemesh.xml]
java.io.FileNotFoundException: class path resource [src/main/webapp/WEB-INF/sitemesh.xml] cannot be resolved to URL because it does not exist
at org.springframework.core.io.ClassPathResource.getURL(ClassPathResource.java:187)
at org.springframework.core.io.AbstractFileResolvingResource.getFile(AbstractFileResolvingResource.java:49)
at org.springframework.mock.web.MockServletContext.getRealPath(MockServletContext.java:458)
at org.grails.web.sitemesh.Grails5535Factory.<init>(Grails5535Factory.java:78)
at org.grails.web.servlet.view.SitemeshLayoutViewResolver.loadSitemeshConfig(SitemeshLayoutViewResolver.java:105)
at org.grails.web.servlet.view.SitemeshLayoutViewResolver.init(SitemeshLayoutViewResolver.java:67)
at org.grails.web.servlet.view.SitemeshLayoutViewResolver.onApplicationEvent(SitemeshLayoutViewResolver.java:146)
at org.grails.web.servlet.view.SitemeshLayoutViewResolver.onApplicationEvent(SitemeshLayoutViewResolver.java:42)
at org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:167)
at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:139)
at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:393)
at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:347)
at org.springframework.context.support.AbstractApplicationContext.finishRefresh(AbstractApplicationContext.java:883)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:546)
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:693)
at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:360)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:303)
at grails.boot.GrailsApp.run(GrailsApp.groovy:83)
at grails.ui.command.GrailsApplicationContextCommandRunner.run(GrailsApplicationContextCommandRunner.groovy:55)
at grails.ui.command.GrailsApplicationContextCommandRunner.main(GrailsApplicationContextCommandRunner.groovy:102)
This is just a WARN message. The underlying spring class is looking for it and just saying it's not there. The default the log level does not show this output.
You can safely ignore the message or adjust your logger to not show it.
https://github.com/spring-projects/spring-framework/blob/master/spring-test/src/main/java/org/springframework/mock/web/MockServletContext.java#L460
I have a grails-2.4.4 application deployed in weblogic 12c. The application works fine. However, when I stop and start the app, all GET action works, but not others [POST, PUT, DELETE, ...].
I got this exception message in console
No WebApplicationContext found: no ContextLoaderListener registered?
I did some search and the solution everybody say is to add this line in web.xml file:
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
Grails generate its own web.xml file, and inside, this file has the following line:
<listener>
<listener-class>org.codehaus.groovy.grails.web.context.GrailsContextLoaderListener</listener-class>
</listener>
GrailsContextLoaderListener is an inheritance of ContextLoaderListener, so this is not my solution
What should I do?
After having upgraded one of my apps from Grails 1.3.7 to 2.1.0 and installed a couple of additional plugins the app will no longer deploy on JBOSS AS 5.1, which is used for production.
The error I am getting from the JBOSS server log is the following:
13:39:10,263 ERROR [[/]] Exception sending context initialized event to listener instance of class org.codehaus.groovy.grails.web.context.GrailsContextLoaderListener
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'transactionManagerPostProcessor': Initialization of bean failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'transactionManager': Cannot resolve reference to bean 'sessionFactory' while setting bean property 'sessionFactory'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory': Invocation of init method failed; nested exception is java.lang.IncompatibleClassChangeError: Found class org.hibernate.cfg.Mappings, but interface was expected
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:527)
at org.codehaus.groovy.grails.commons.spring.ReloadAwareAutowireCapableBeanFactory.doCreateBean(ReloadAwareAutowireCapableBeanFactory.java:126)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:294)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:225)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:291)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:197)
at org.springframework.context.support.AbstractApplicationContext.registerBeanPostProcessors(AbstractApplicationContext.java:707)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:449)
at org.codehaus.groovy.grails.commons.spring.DefaultRuntimeSpringConfiguration.getApplicationContext(DefaultRuntimeSpringConfiguration.java:153)
at org.codehaus.groovy.grails.commons.spring.GrailsRuntimeConfigurator.configure(GrailsRuntimeConfigurator.java:170)
at org.codehaus.groovy.grails.commons.spring.GrailsRuntimeConfigurator.configure(GrailsRuntimeConfigurator.java:127)
at org.codehaus.groovy.grails.web.context.GrailsConfigUtils.configureWebApplicationContext(GrailsConfigUtils.java:121)
at org.codehaus.groovy.grails.web.context.GrailsContextLoader.initWebApplicationContext(GrailsContextLoader.java:104)
at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:111)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3910)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4393)
In order to resolve another issue I had earlier on( LifecycleException/ReflectionException: Cannot find method addChild...) I have introduced a jboss-classloading.xml into my WEB-INF directory. At the current moment this has the following contents:
<classloading xmlns="urn:jboss:classloading:1.0" name="ROOT.war" domain="DefaultDomain" top-level-classloader="true" export-all="NON_EMPTY" import-all="true" parent-first="false"> </classloading>
I suspect that the current issue is also class-loading related, especially since I see that the class in question is being loaded from JBOSS lib folder, and not from the jars in the war's lib folder:
[Loaded org.hibernate.cfg.Mappings from jar:file:/usr/local/jboss-5.1.0.GA/common/lib/hibernate-core.jar!/]
Apparently the class org.hibernate.cfg.Mappings exists both in hibernate-core.jar as well as inside the app's lib folder(hibernate-core-3.6.10.Final.jar). I have therefore tried to tweak the jboss-classloading.xml file in different ways in order to force JBOSS to load this specific class from within the war file, but no matter what I do I keep getting the same error (or different ones much earlier in the deploy cycle).
The full contents of my war's WEB-INF/lib dir:
activation-1.1.jar google-collections.jar h2-1.3.164.jar sitemesh-2.4.jar
antlr-2.7.7.jar grails-bootstrap-2.1.0.jar hamcrest-all-1.1.jar smartsprites-0.2.1.jar
aopalliance-1.0.jar grails-core-2.1.0.jar hibernate-commons-annotations-3.2.0.Final.jar spring-aop-3.1.0.RELEASE.jar
asm-3.1.jar grails-crud-2.1.0.jar hibernate-core-3.6.10.Final.jar spring-asm-3.1.0.RELEASE.jar
aspectjrt-1.6.10.jar grails-datastore-core-1.0.9.RELEASE.jar hibernate-ehcache-3.6.10.Final.jar spring-aspects-3.1.0.RELEASE.jar
aspectjweaver-1.6.10.jar grails-datastore-gorm-1.0.9.RELEASE.jar hibernate-jpa-2.0-api-1.0.1.Final.jar spring-beans-3.1.0.RELEASE.jar
avalon-framework-4.1.3.jar grails-datastore-simple-1.0.9.RELEASE.jar hibernate-validator-4.1.0.Final.jar spring-binding-2.0.8.RELEASE.jar
axis-1.4.jar grails-hibernate-2.1.0.jar javase-1.7.jar spring-context-3.1.0.RELEASE.jar
axis-jaxrpc-1.4.jar grails-logging-2.1.0.jar javassist-3.12.0.GA.jar spring-context-support-3.1.0.RELEASE.jar
axis-saaj-1.4.jar grails-plugin-codecs-2.1.0.jar javassist-3.7.ga.jar spring-core-3.1.0.RELEASE.jar
axis-wsdl4j-1.5.1.jar grails-plugin-controllers-2.1.0.jar jcaptcha-all-1.0-RC6.jar spring-expression-3.1.0.RELEASE.jar
cas-client-core-3.2.1.jar grails-plugin-converters-2.1.0.jar jstl-1.1.2.jar spring-jdbc-3.1.0.RELEASE.jar
cglib-2.2.jar grails-plugin-datasource-2.1.0.jar jta-1.1.jar spring-jms-3.1.0.RELEASE.jar
commons-beanutils-1.8.3.jar grails-plugin-domain-class-2.1.0.jar jul-to-slf4j-1.6.2.jar spring-js-2.0.8.RELEASE.jar
commons-codec-1.5.jar grails-plugin-filters-2.1.0.jar logkit-1.0.1.jar spring-orm-3.1.0.RELEASE.jar
commons-collections-3.2.1.jar grails-plugin-gsp-2.1.0.jar mail-1.4.3.jar spring-test-3.1.0.RELEASE.jar
commons-dbcp-1.4.jar grails-plugin-i18n-2.1.0.jar mysql-connector-java-5.1.6.jar spring-tx-3.1.0.RELEASE.jar
commons-discovery-0.2.jar grails-plugin-log4j-2.1.0.jar ognl-2.7.3.jar spring-web-3.1.0.RELEASE.jar
commons-el-1.0.jar grails-plugin-mimetypes-2.1.0.jar oro-2.0.8.jar spring-webflow-2.0.8.RELEASE.jar
commons-fileupload-1.2.2.jar grails-plugin-scaffolding-2.1.0.jar pjl-comp-filter-1.7.jar spring-webmvc-3.1.0.RELEASE.jar
commons-io-2.1.jar grails-plugin-services-2.1.0.jar quartz-1.6.1.jar tomcat-catalina-ant-7.0.27.jar
commons-lang-2.6.jar grails-plugin-servlets-2.1.0.jar quartz-2.1.5.jar tomcat-embed-core-7.0.27.jar
commons-logging-1.1.jar grails-plugin-tomcat-2.1.0.jar selenium-java-client-driver-1.0.2.jar tomcat-embed-jasper-7.0.27.jar
commons-pool-1.5.6.jar grails-plugin-url-mappings-2.1.0.jar servlet-api-2.5.jar tomcat-embed-logging-juli-7.0.27.jar
commons-validator-1.3.1.jar grails-plugin-validation-2.1.0.jar shiro-cas-1.2.0.jar tomcat-embed-logging-log4j-7.0.27.jar
concurrentlinkedhashmap-lru-1.2_jdk5.jar grails-resources-2.1.0.jar shiro-core-1.2.0.jar utils-0.0.2.jar
core-1.7.jar grails-spring-2.1.0.jar shiro-ehcache-1.2.0.jar validation-api-1.0.0.GA.jar
dom4j-1.6.1.jar grails-web-2.1.0.jar shiro-quartz-1.2.0.jar xpp3_min-1.1.4c.jar
ecj-3.6.2.jar grails-webflow-2.1.0.jar shiro-spring-1.2.0.jar yuicompressor-2.4.2.jar
ehcache-core-2.4.6.jar groovy-all-1.8.6.jar shiro-web-1.2.0.jar
Does anyone have an idea about how to get around this issue?
There is a plugins for this :)
http://grails.org/plugin/jbossas
The docs are located here:
http://grails-plugins.github.com/grails-jbossas/
This is why this is happenning:
https://community.jboss.org/thread/156441
You will need to configure JBoss to exclude the hibernate jars. The JBoss Hibernate jars that are in common/lib in the JBoss install are loading first, instead of the Grails Hibernate jars. This is a classloader order / preference issue.
A very dirty solution is to remove the jars under common/lib or as recommended get the classloader working to exclude those jars.
I'm using JBoss 6.1 for a project. We started on 1.3.7, then moved to 2.0.3 and are now on 2.1.
I never got that exact issue, nor have I experienced any conflicts with Hibernate, but we did experience conflicts with Quartz.
Here's what I use to isolate things...
I have this in /WEB-INF/jboss-scanning.xml:
<?xml version='1.0' encoding='UTF-8' ?>
<scanning xmlns='urn:jboss:scanning:1.0'>
<path name='WEB-INF/lib/grails-datastore-gorm-*.jar'>
<include name='org.grails.datastore' />
</path>
</scanning>
I have this in /WEB-INF/jboss-classloading.xml:
<?xml version="1.0" encoding="UTF-8" ?>
<classloading
xmlns="urn:jboss:classloading:1.0"
domain="hotdesk.war"
export-all="NON_EMPTY"
import-all="true"
/>
And finally, I have this in BuildConfig.groovy:
dependencies {
//Added to deal with problems running Quartz on JBoss
//NoSuchMethodError: org.objectweb.asm.ClassWriter.<init>(I)V]
compile ('cglib:cglib-nodep:2.2')
}
//Added to deal with problems running Quartz on JBoss
//NoSuchMethodError: org.objectweb.asm.ClassWriter.<init>(I)V]
grails.war.resources = { stagingDir, args ->
println "Removing export jars from WEB-INF/lib/"
delete(file: "${stagingDir}/WEB-INF/lib/cglib-2.2.jar")
}
Hope that gets you closer to resolving your issue.
I'm migrating an app from grails 1.3.6 to 2.0 and I need to change its context root. If I remember correctly, in 1.3.6 I installed the template plugin and changed:
<context-param>
<param-name>webAppRootKey</param-name>
<param-value>/newcontextroot</param-value>
</context-param>
I did the same in 2.0 with no success. Any hints ?
Thanks
You can configure the context in Config.groovy:
// grails-app/conf/Config.groovy
grails.app.context = '/newcontextroot'
or in application.properties:
app.context = /newcontextroot
Start your grails application with this command
grails -Dapp.context=/ run-app
In Grails version 3.3.9 I know changing:
project/grails-app/conf/application.yml
adding
server:
contextPath: /yourcontextpath
port: 9214
will do the trick.
Is there an issue to set the app.servlet.version to 3.0 in the application.properties for grails 2.0?
I created a new app, added the line app.servlet.version=3.0 to the application.properties and executed grails war (even tried clean before). However the web.xml still starts with:
<web-app xmlns="http://java.sun.com/xml/ns/javaee"
version="2.5"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
Iwould have expected to see 3.0. I also tried this Procedere with 2.4 and it is still 2.5. Is it the wrong place, which I am looking at?
It looks like, that you need to change the BuildConfig.groovy as well, in order to achieve servlet version 3.0 in your web.xml. Add the following line into a plain grails project and the web.xml will start with desired version 3.0:
grails.servlet.version = "3.0"