cancel
Showing results for 
Search instead for 
Did you mean: 

Alfresco aborts startup after exception in webscript init

sundance
Champ in-the-making
Champ in-the-making
I'm a Catch 22, where an Exception thrown during the init of one of my web scripts causes Alfresco to abort after startup, and I can't edit the webscript because I can't run Alfresco now. How can I startup Alfresco without initializing the webscript so that I can edit the webscript? Or otherwise edit the webscript before starting Alfresco? I don't want to lose the data I have in this instance of Alfresco. Please help!

The problem started when I modified the 'Folders' example on the Alfresco Wiki page to use transaction specification "new" rather than "required". I either misspelled 'new' or the enum type for it doesn't exist, as when I start up Alfesco, I get the error:

java.lang.IllegalArgumentException: No enum const class org.alfresco.web.scripts.WebscriptDescription$RequiredTransaction.new
at java.lang.Enum.valueOf(Enum.java:192)
at org.alfresco.web.scripts.WebscriptDescription$RequiredTransaction.valueOf(WebScriptDescription.java:52)


In any case, the enum type for the string I entered is not recognized and the java class doesn't handle it gracefully.

The webscript description causing this is the following, named folder.folder.get.desc.xml:

<webscript>
  <shortname>Folder Listing Sample</shortname>
  <description>Sample demonstrating the listing of folder contents</description>
  <url>/sample/folder/{path}</url>
  <format default="html">argument</format>
  <authentication>guest</authentication>
  <transaction>new</transaction>
</webscript>

Thanks in advance
4 REPLIES 4

sundance
Champ in-the-making
Champ in-the-making
The webscript first exhibited the exception only after I edited it. This is Alfresco 2.1 on Windows XP.

davidc
Star Contributor
Star Contributor
I thought that was fixed by 2.1 - in more recent builds, if there's an error/exception during web script initialisation, it will not stop the server from starting.  Instead, you get warnings, and you can see those warnings in the web script home page.

To work around, comment out the beans…

   <bean parent="webscripts.repostore">
      <property name="store"><value>workspace://SpacesStore</value></property>
      <property name="path"><value>/${spaces.company_home.childname}/${spaces.dictionary.childname}/cm:extensionwebscripts</value></property>
   </bean>

   <bean parent="webscripts.repostore">
      <property name="mustExist"><value>true</value></property>
      <property name="store"><value>workspace://SpacesStore</value></property>
      <property name="path"><value>/${spaces.company_home.childname}/${spaces.dictionary.childname}/cm:webscripts</value></property>
   </bean>

in web-scripts-application-context.xml.  Then restart, undo the change.

Then shutdown, uncomment the above beans and restart.

sundance
Champ in-the-making
Champ in-the-making
Hey thanks David, it worked.

davidc
Star Contributor
Star Contributor
no problem…