cancel
Showing results for 
Search instead for 
Did you mean: 

Custom Web script failing with 500 error

deane
Champ on-the-rise
Champ on-the-rise
I've written a custom Web script.  I have it working in a "Hello World" sense (just injecting data into the model, and spitting it back out), so I know all the files are in the right spots, the URL is mapped correctly, etc.

However, as soon as I try to search the repo, like this:

var stuff = search.luceneSearch("some search term");

The Web script fails with a 500 error:

Transaction must be active and synchronization is required

I've looked up the error, and poked around a bit, but I can't find a resolution.  People were talking about an authentication bug on v2.1, but I'm on v3.

Deane
3 REPLIES 3

mikeh
Star Contributor
Star Contributor
Check your webscript's .desc.xml file has the following:
<transaction>required</transaction>

Mike

deane
Champ on-the-rise
Champ on-the-rise
Yes, that fixed it.  Thank you.

chraja
Champ in-the-making
Champ in-the-making
I have <transaction>required</transaction> in my webscripts but the 500 error is still coming .

when I looked into the log i found the exception below , and the when i debugged the alfresco source code i found that
line number 235 in the file org.alfresco.web.scripts.WebScriptRequestImpl.java throws nullpointerexception. and the line is given below ..

logger.debug("Converting request (mimetype: " + contentType + ") to " + reader.getDestinationClass().getName());

further explanation is given below , Pls let me know if any info u may need


Jan 6, 2009 5:41:08 PM org.apache.catalina.core.StandardWrapperValve invoke
SEVERE: Servlet.service() for servlet apiServlet threw exception

I am trying to upload a file from JAVA program which actually sends a post request to the webscript .

the same request is working fine with the browser .

Included basic authentication headers also in the request

java.io.IOException: Server returned HTTP response code: 500 for URL: http://localhost:8090/alfresco/service/ … 004819746c
at sun.net.www.protocol.http.HttpURLConnection.getInputStream(Unknown Source)
at com.docharbor.repository.alfresco.service.webscripts.ClientHttpRequest.post(ClientHttpRequest.java:262)
at com.docharbor.repository.alfresco.dao.ImportDAO.processRequest(ImportDAO.java:80)
at com.docharbor.repository.alfresco.dao.AbstractDAORequest.process(AbstractDAORequest.java:59)
at com.docharbor.repository.alfresco.dao.ImportDAO.main(ImportDAO.java:155)

when i look in the log i found this exception …

java.lang.NullPointerException
at org.alfresco.web.scripts.WebScriptRequestImpl.parseContent(WebScriptRequestImpl.java:235)
at org.alfresco.web.scripts.servlet.WebScriptServletRequest.<init>(WebScriptServletRequest.java:90)
at org.alfresco.web.app.servlet.MTWebScriptAuthenticationFilter.doFilter(MTWebScriptAuthenticationFilter.java:94)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:845)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
at java.lang.Thread.run(Thread.java:595)

I am actually evaluating alfresco performance and trying to do some basic operation for custom content .
Please let me know if any other info u may require .

thanks,
raja
Getting started

Tags


Find what you came for

We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.