dolfdijkstra / gst-foundation

Sites Global Foundation Project
Apache License 2.0
13 stars 14 forks source link

Groovy Actions not working #25

Closed DanielMerchan closed 10 years ago

DanielMerchan commented 10 years ago

Hi.

I'm doing a PoC using Groovy Actions, but I'm not being able to do it working.

I just installed gst-foundation-all.jar in a WebCenter Sites 11.1.1.8 (Patch 4) environment and create a Groovy Action placed in the gsf-groovy folder.

I'm receiving following stack trace.

[2014-04-07 09:04:20,965 BST] [TRACE] [TP-Processor1] [gst.foundation.url.LightweightAbstractAssembler] Parsing query string: d=&c=Page&pagename=Site1%2FPage%2FTestTemplate&rendermode=preview&cid=1391693995454 [2014-04-07 09:04:20,966 BST] [TRACE] [TP-Processor1] [gst.foundation.url.LightweightAbstractAssembler] Parsing query string. Found raw pair [name]=[value]: [d]=[] decoded to: [d]=[] [2014-04-07 09:04:20,966 BST] [TRACE] [TP-Processor1] [gst.foundation.url.LightweightAbstractAssembler] Parsing query string. Found raw pair [name]=[value]: [c]=[Page] decoded to: [c]=[Page] [2014-04-07 09:04:20,966 BST] [TRACE] [TP-Processor1] [gst.foundation.url.LightweightAbstractAssembler] Parsing query string. Found raw pair [name]=[value]: [rendermode]=[preview] decoded to: [rendermode]=[preview] [2014-04-07 09:04:20,968 BST] [TRACE] [TP-Processor1] [gst.foundation.url.LightweightAbstractAssembler] Parsing query string. Found raw pair [name]=[value]: [pagename]=[Site1%2FPage%2FTestTemplate] decoded to: [pagen ame]=[Site1Page/TestTemplate] [2014-04-07 09:04:20,969 BST] [TRACE] [TP-Processor1] [gst.foundation.url.LightweightAbstractAssembler] Parsing query string. Found raw pair [name]=[value]: [cid]=[1391693995454] decoded to: [cid]=[1391693995454] [2014-04-07 09:04:20,969 BST] [TRACE] [TP-Processor1] [gst.foundation.url.WraPathAssembler] WRAPathAssembler cannot disassemble URI 'http://host/cs/Satellite?d=&c=Page&pagename=Site1%2FPage%2FTestTemplate&rendermode=preview&cid=1391693995454' because the virtual-webroot parameter is either missing or has more than one value [2014-04-07 09:04:21,235 BST] [INFO ] [TP-Processor1] [beans.factory.xml.XmlBeanDefinitionReader] Loading XML bean definitions from class path resource [MobilityService.xml] [2014-04-07 09:04:21,745 BST] [INFO ] [TP-Processor1] [logging.cs.cache.page] EHCache-based page cache loaded. [2014-04-07 09:04:27,960 BST] [WARN ] [TP-Processor1] [fatwire.logging.cs.request] Unable to set header content-type because the header has already been committed [2014-04-07 09:04:27,964 BST] [DEBUG] [TP-Processor1] [gst.foundation.url.WraPathAssembler] WRAPathAssembler can't assemble definition due to missing 'virtual-webroot' and/or 'url-path' params. Definition: com.fatwire.cs.core.uri.Satelli teTokenAssembler$STADefinition@5b676e67 [2014-04-07 09:04:27,966 BST] [INFO ] [TP-Processor1] [beans.factory.xml.XmlBeanDefinitionReader] Loading XML bean definitions from class path resource [BeanConfiguration.xml] [2014-04-07 09:04:28,059 BST] [TRACE] [TP-Processor1] [gst.foundation.controller.support] Configuring WebAppContext from WebContextUtil; it is not explicitly configured in web.xml. Using default setup! [2014-04-07 09:04:28,099 BST] [TRACE] [TP-Processor8] [gst.foundation.url.LightweightAbstractAssembler] Parsing query string: blobcol=urldata&blobheader=image%2Fjpeg&blobheadername1=Content-Disposition&blobkey=id&blobtable=MungoBlobs&blo bwhere=1378390255363&ssbinary=true [2014-04-07 09:04:28,103 BST] [TRACE] [TP-Processor8] [gst.foundation.url.LightweightAbstractAssembler] Parsing query string. Found raw pair [name]=[value]: [blobkey]=[id] decoded to: [blobkey]=[id] [2014-04-07 09:04:28,105 BST] [TRACE] [TP-Processor8] [gst.foundation.url.LightweightAbstractAssembler] Parsing query string. Found raw pair [name]=[value]: [blobwhere]=[1378390255363] decoded to: [blobwhere]=[1378390255363] [2014-04-07 09:04:28,106 BST] [TRACE] [TP-Processor8] [gst.foundation.url.LightweightAbstractAssembler] Parsing query string. Found raw pair [name]=[value]: [blobheader]=[image%2Fjpeg] decoded to: [blobheader]=[image/jpeg] [2014-04-07 09:04:28,107 BST] [TRACE] [TP-Processor8] [gst.foundation.url.LightweightAbstractAssembler] Parsing query string. Found raw pair [name]=[value]: [ssbinary]=[true] decoded to: [ssbinary]=[true] [2014-04-07 09:04:28,108 BST] [TRACE] [TP-Processor8] [gst.foundation.url.LightweightAbstractAssembler] Parsing query string. Found raw pair [name]=[value]: [blobheadername1]=[Content-Disposition] decoded to: [blobheadername1]=[Content- Disposition] [2014-04-07 09:04:28,112 BST] [TRACE] [TP-Processor8] [gst.foundation.url.LightweightAbstractAssembler] Parsing query string. Found raw pair [name]=[value]: [blobcol]=[urldata] decoded to: [blobcol]=[urldata] [2014-04-07 09:04:28,113 BST] [TRACE] [TP-Processor8] [gst.foundation.url.LightweightAbstractAssembler] Parsing query string. Found raw pair [name]=[value]: [blobtable]=[MungoBlobs] decoded to: [blobtable]=[MungoBlobs] [2014-04-07 09:04:28,113 BST] [TRACE] [TP-Processor8] [gst.foundation.url.WraPathAssembler] WRAPathAssembler cannot disassemble URI 'http://host/cs/Satellite?blobcol=urldata&blobheader=image%2Fjpeg&blobheadername1=Con tent-Disposition&blobkey=id&blobtable=MungoBlobs&blobwhere=1378390255363&ssbinary=true' because the virtual-webroot parameter is either missing or has more than one value [2014-04-07 09:04:44,397 BST] [INFO ] [TP-Processor1] [gst.foundation.controller.support] Creating AppContext from class com.fatwire.gst.foundation.groovy.context.GroovyWebContext [2014-04-07 09:04:53,206 BST] [DEBUG] [TP-Processor1] [gst.foundation.controller.support] Asking for bean by name gsfActionLocator of type com.fatwire.gst.foundation.controller.action.ActionLocator. [2014-04-07 09:04:53,211 BST] [DEBUG] [TP-Processor1] [gst.foundation.controller.support] Asking for bean by name injector of type com.fatwire.gst.foundation.controller.action.Injector. [2014-04-07 09:04:53,213 BST] [DEBUG] [TP-Processor1] [gst.foundation.controller.support] Asking for bean by name factoryProducer of type com.fatwire.gst.foundation.controller.action.FactoryProducer. [2014-04-07 09:05:58,398 BST] [TRACE] [TP-Processor1] [foundation.controller.action.support] No Action found in action locator com.fatwire.gst.foundation.controller.action.support.ClassActionLocator. Trying with fallback action locator: com.fatwire.gst.foundation.groovy.action.GroovyActionLocator [2014-04-07 09:06:03,851 BST] [DEBUG] [TP-Processor1] [fatwire.gst.foundation.groovy] Loading groovy script test/TestGroovy [2014-04-07 09:06:03,860 BST] [DEBUG] [TP-Processor1] [fatwire.gst.foundation.groovy] GroovyScriptEngine was not able to load tst/TestGroovy as a script: Cannot open URL: file:/local/contrib/tomcat/webapps/cs/WEB-INF/gs f-groovy/test/TestGroovy.groovy. Now trying as a class. [2014-04-07 09:06:03,875 BST] [DEBUG] [TP-Processor1] [fatwire.gst.foundation.groovy] GroovyClassLoader was not able to load test.Groovy: test.TestGroovy. Aborting. [2014-04-07 09:06:06,469 BST] [DEBUG] [TP-Processor1] [foundation.controller.action.support] test/TestGroovy is not a valid script. [2014-04-07 09:06:12,695 BST] [TRACE] [TP-Processor1] [foundation.controller.action.support] No Action found in action locator com.fatwire.gst.foundation.groovy.action.GroovyActionLocator. Trying with fallback action locator: com.fatwire.gst.foundation.controller.action.support.RenderPageActionLocator [2014-04-07 09:06:17,923 BST] [ERROR] [TP-Processor1] [fatwire.logging.cs.request] Exception including resource /jsp/cs_deployed/Page/test.jsp org.apache.jasper.JasperException: java.lang.IllegalArgumentException: The com.fatwire.gst.foundation.controller.action.support.RenderPageActionLocator was called with a named Action. This is not intended as this means that a Action should have been found by a previous ActionLocator.

What can be missing?.

Thanks. Regards.

dolfdijkstra commented 10 years ago

Hi Daniel,

It seems you have defined action=test/TestGroovy as either a url parameter or as a resargs in SiteCatalog.

Is there a file at the location /local/contrib/tomcat/webapps/cs/WEB-INF/gs f-groovy/test/TestGroovy.groovy? In this Groovy class file you will need to implement a com.fatwire.gst.foundation.controller.action.Action.

And a note: with 11.1.1.8 you probably want to use the vanity urls that come with the product. Best is to replace the ServletContext.properties with the original from 11.1.1.8, not the modified one from the GSF installer. There should be a backup of the file with a timestamp number in the filename in the same directory as ServletContext.properties.

DanielMerchan commented 10 years ago

Hi Dolf.

Thanks for the quick reply.

I just followed:

Reviewing SiteCatalog I don't have action as URL parameter defined.

About you're note I replaced it with the original one.

Thanks. Regards.

DanielMerchan commented 10 years ago

Thanks for the help.

I was changing the names in this post just to don't provide official names.

It was a misspelling in the action property.

Thanks :).