cancel
Showing results for 
Search instead for 
Did you mean: 

Web Script Status 400 - Bad Request

gman2
Champ in-the-making
Champ in-the-making
Just installed Alfresco Labs 3c and made no configuration changes. Alfresco itself works. I go to http://myserver:8080/alfresco/service and receive the following:

Web Script Status 400 - Bad Request

The Web Script /alfresco/service has responded with a status of 400 - Bad Request.

400 Description:   Request sent by the client was syntactically incorrect.

Message:   Script URL not specified
   
Exception:   org.alfresco.web.scripts.WebScriptException - Script URL not specified
   
   org.alfresco.web.scripts.AbstractRuntime.executeScript(AbstractRuntime.java:92)
   org.alfresco.web.scripts.servlet.WebScriptServlet.service(WebScriptServlet.java:116)
   javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
   org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:269)
   org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
   org.alfresco.web.app.servlet.MTWebScriptAuthenticationFilter.doFilter(MTWebScriptAuthenticationFilter.java:102)
   org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215)
   org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
   org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:210)
   org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:174)
   org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
   org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
   org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:108)
   org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:151)
   org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:870)
   org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:665)
   org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:528)
   org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:81)
   org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:685)
   java.lang.Thread.run(Thread.java:619)
   
Server:   Alfresco Labs v3.0.0 (c 1342) schema 1,000
Time:   Dec 16, 2008 2:59:59 PM

What does this mean?
6 REPLIES 6

gman2
Champ in-the-making
Champ in-the-making
Found the answer, the URL needs to end with a trailing /, so the correct URL is:

http://myserver:8080/alfresco/service/

gman2
Champ in-the-making
Champ in-the-making
So I tried to install a web script and when I click on the Install button I receive:

Web Script Status 500 - Internal Error

The Web Script /alfresco/service/installer has responded with a status of 500 - Internal Error.

500 Description:   An error inside the HTTP server which prevented it from fulfilling the request.

Message:   Error on line 1 of document : Content is not allowed in prolog. Nested exception: Content is not allowed in prolog.
   
Exception:   org.alfresco.web.scripts.WebScriptException - Error on line 1 of document : Content is not allowed in prolog. Nested exception: Content is not allowed in prolog.
   
   org.alfresco.web.scripts.bean.ServiceInstall.executeImpl(ServiceInstall.java:176)
   org.alfresco.web.scripts.DeclarativeWebScript.executeImpl(DeclarativeWebScript.java:234)
   org.alfresco.web.scripts.DeclarativeWebScript.execute(DeclarativeWebScript.java:68)
   org.alfresco.repo.web.scripts.RepositoryContainer$1.execute(RepositoryContainer.java:307)
   org.alfresco.repo.transaction.RetryingTransactionHelper.doInTransaction(RetryingTransactionHelper.java:294)
   org.alfresco.repo.transaction.RetryingTransactionHelper.doInTransaction(RetryingTransactionHelper.java:209)
   org.alfresco.repo.web.scripts.RepositoryContainer.transactionedExecute(RepositoryContainer.java:318)
   org.alfresco.repo.web.scripts.RepositoryContainer.transactionedExecuteAs(RepositoryContainer.java:340)
   org.alfresco.repo.web.scripts.RepositoryContainer.executeScript(RepositoryContainer.java:262)
   org.alfresco.web.scripts.AbstractRuntime.executeScript(AbstractRuntime.java:240)
   org.alfresco.web.scripts.AbstractRuntime.executeScript(AbstractRuntime.java:139)
   org.alfresco.web.scripts.servlet.WebScriptServlet.service(WebScriptServlet.java:116)
   javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
   org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:269)
   org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
   org.alfresco.web.app.servlet.MTWebScriptAuthenticationFilter.doFilter(MTWebScriptAuthenticationFilter.java:102)
   org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215)
   org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
   org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:210)
   org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:174)
   org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
   org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
   org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:108)
   org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:151)
   org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:870)
   org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:665)
   org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:528)
   org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:81)
   org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:685)
   java.lang.Thread.run(Thread.java:619)
   
Server:   Alfresco Labs v3.0.0 (c 1342) schema 1,000
Time:   Dec 16, 2008 3:07:10 PM
   
Diagnostics:   Inspect Web Script (org/alfresco/scriptinstall.post)

Are there issues with the web scripts installer?

pmonks
Star Contributor
Star Contributor
That error message can indicate you have an invalid XML file - in this case probably the Web Script descriptor.  More specifically it means there's content in the file prior to the <?xml> directive or the root element.

If you can't see any visible characters prior in the prolog, double check that the file doesn't have a UTF byte order mark - technically they're not allowed in XML files.

Cheers,
Peter

t_broyer
Champ in-the-making
Champ in-the-making
If you can't see any visible characters prior in the prolog, double check that the file doesn't have a UTF byte order mark - technically they're not allowed in XML files.

Technically, it's documented since the Second Edition of the XML 1.0:
http://www.w3.org/TR/2000/REC-xml-20001006#sec-guessing-no-ext-info
and made more explicit since the Third Edition:
http://www.w3.org/TR/2004/REC-xml-20040204/#charencoding

Please notice the dates: it's about 5 years ago!

It's a shame for any XML parser to disallow UTF-8 BOMs in XML files.

Should I file a bug?

pmonks
Star Contributor
Star Contributor
Sure!  Alfresco uses the Apache Xerces XML parser (http://xerces.apache.org/xerces2-j/), whose bug reporting process is described at http://xerces.apache.org/xerces2-j/jira.html.

Cheers,
Peter

t_broyer
Champ in-the-making
Champ in-the-making
Or maybe at issues.alfresco.org, as Xerces is OK with UTF-8 BOMs?
http://issues.apache.org/jira/browse/XERCESJ-1122
(org.alfresco.web.scripts.DeclarativeRegistry actually uses dom4j which, I suppose, will defer parsing to Xerces, but I'm not sure how all of this works)