cancel
Showing results for 
Search instead for 
Did you mean: 

Webscripts in Eclipse project

dgenard
Champ on-the-rise
Champ on-the-rise
Hi,
I'm developping an AMP extension in an Eclipse project.
All source code and config files are in the source path of my project, so I can run/debug my extension directly from Eclipse.
Most config files are correctly loaded from the source path, except webscripts.

Here is the stacktrace produced by Alfresco started from Eclipse :
12:31:47,595 INFO  [web.scripts.DeclarativeWebScriptRegistry] Registered 7 Web Scripts, 8 URLs (in 162553ms)
12:35:34,652 ERROR [web.context.ContextLoader] Context initialization failed
java.lang.StringIndexOutOfBoundsException: String index out of range: -9
   at java.lang.String.substring(String.java:1768)
   at java.lang.String.substring(String.java:1735)
   at org.alfresco.web.scripts.ClassPathStore.getDescriptionDocumentPaths(ClassPathStore.java:138)
   at org.alfresco.web.scripts.DeclarativeWebScriptRegistry.initWebScripts(DeclarativeWebScriptRegistry.java:207)
   at org.alfresco.web.scripts.DeclarativeWebScriptRegistry.reset(DeclarativeWebScriptRegistry.java:157)
   at org.alfresco.web.scripts.DeclarativeWebScriptRegistry.onBootstrap(DeclarativeWebScriptRegistry.java:172)
   at org.alfresco.util.AbstractLifecycleBean.onApplicationEvent(AbstractLifecycleBean.java:62)
   at org.springframework.context.event.SimpleApplicationEventMulticaster$1.run(SimpleApplicationEventMulticaster.java:77)
   at org.springframework.core.task.SyncTaskExecutor.execute(SyncTaskExecutor.java:49)
   at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:75)
   at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:241)
   at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:349)
   at org.springframework.web.context.support.AbstractRefreshableWebApplicationContext.refresh(AbstractRefreshableWebApplicationContext.java:156)
   at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:246)
   at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:184)
   at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:49)
   at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3763)
   at org.apache.catalina.core.StandardContext.start(StandardContext.java:4211)
   at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:759)
   at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:739)
   at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:524)
   at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:809)
   at org.apache.catalina.startup.HostConfig.deployWARs(HostConfig.java:698)
   at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:472)
   at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1122)
   at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:310)
   at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
   at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1021)
   at org.apache.catalina.core.StandardHost.start(StandardHost.java:718)
   at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1013)
   at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:442)
   at org.apache.catalina.core.StandardService.start(StandardService.java:450)
   at org.apache.catalina.core.StandardServer.start(StandardServer.java:709)
   at org.apache.catalina.startup.Catalina.start(Catalina.java:551)
   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
   at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
   at java.lang.reflect.Method.invoke(Method.java:585)
   at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:294)
   at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:432)
Webscripts are correctly loaded when starting Alfresco out of Eclipse.
Inspecting variables just before the exception is raised shows :
fileDir.getAbsolutePath() = "C:\Projects\Etnic\alfresco-enterprise-tomcat-2.0.1\tomcat\webapps\alfresco\WEB-INF\classes\alfresco\extension\templates\webscripts"

filePathLength=131

resource.getFile().getAbsolutePath() = "C:\Documents and Settings\dg\workspace\Courrier\config\alfresco\extension\templates\webscripts\myspaces.get.desc.xml"
We use Alfresco Enterprise 2.1.0
Any hint on how to organize AMP projects including webscripts using Eclipse ?

Denis
4 REPLIES 4

dgenard
Champ on-the-rise
Champ on-the-rise
Problem solved in Alfresco 2.1.2

dinger
Champ in-the-making
Champ in-the-making
What was the problem with 2.1.1?

Rob

dinger
Champ in-the-making
Champ in-the-making
Oh, sorry, this works with 2.1.1 right?

Rob

dgenard
Champ on-the-rise
Champ on-the-rise
Bug was present in 2.1.0, but 2.1.2 is OK.
I'm not sure about 2.1.1…