cancel
Showing results for 
Search instead for 
Did you mean: 

Web Service called by servlet

cristian
Champ in-the-making
Champ in-the-making
Hi all.
I would like to implement a servlet that use FirstWebServiceClient in SDK. My servlet is named "TestServlet" an calls the web service sample simply in doGet() method.
My goal is to build a servlet based application that works in CRUD on the alfresco repository.

For now I tried to:
1. *.war deploying in the alfresco's tomcat instance and call http://localhost:8080/MyApp/TestServlet.
The doGet() method call of TestServlet class creates the sample content in company_home, but it also shutdown tomcat. stderr.log reports:
1-dic-2010 12.25.01 org.apache.coyote.http11.Http11AprProtocol pause
INFO: Pausing Coyote HTTP/1.1 on http-8080
1-dic-2010 12.25.01 org.apache.coyote.ajp.AjpAprProtocol pause
INFO: Pausing Coyote AJP/1.3 on ajp-8009

2. I also tried to deploy MyApp.war in another tomcat instance (configured to run on different ports that alfresco has in its one). So I have 2 tomcat instances (alfresco on 8080 and MyApp on 8085)
Calling TestServlet I have the same result as above (sample content is created in company_home but tomcat shut down). This is the log.
1-dic-2010 12.41.10 org.apache.coyote.http11.Http11Protocol pause
INFO: Pausing Coyote HTTP/1.1 on http-8085
1-dic-2010 12.41.11 org.apache.catalina.core.StandardService stop
INFO: Stopping service Catalina
1-dic-2010 12.41.11 org.apache.catalina.core.StandardWrapper unload
INFO: Waiting for 1 instance(s) to be deallocated
1-dic-2010 12.41.12 org.apache.catalina.core.StandardWrapper unload
INFO: Waiting for 1 instance(s) to be deallocated
1-dic-2010 12.41.13 org.apache.catalina.core.StandardWrapper unload
INFO: Waiting for 1 instance(s) to be deallocated
1-dic-2010 12.41.13 org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
GRAVE: The web application [/MyApp] is still processing a request that has yet to finish. This is very likely to create a memory leak. You can control the time allowed for requests to finish by using the unloadDelay attribute of the standard Context implementation.
1-dic-2010 12.41.13 org.apache.catalina.loader.WebappClassLoader clearThreadLocalMap
GRAVE: The web application [/MyApp] created a ThreadLocal with key of type [org.apache.axis.utils.XMLUtils.ThreadLocalDocumentBuilder] (value [org.apache.axis.utils.XMLUtils$ThreadLocalDocumentBuilder@168497f6]) and a value of type [org.apache.xerces.jaxp.DocumentBuilderImpl] (value [org.apache.xerces.jaxp.DocumentBuilderImpl@5b14a306]) but failed to remove it when the web application was stopped. This is very likely to create a memory leak.
1-dic-2010 12.41.13 org.apache.catalina.loader.WebappClassLoader clearThreadLocalMap
GRAVE: The web application [/MyApp] created a ThreadLocal with key of type [org.apache.xml.security.utils.UnsyncByteArrayOutputStream$1] (value [org.apache.xml.security.utils.UnsyncByteArrayOutputStream$1@1e5bd978]) and a value of type [byte[]] (value [[B@202264da]) but failed to remove it when the web application was stopped. This is very likely to create a memory leak.
1-dic-2010 12.41.13 org.apache.coyote.http11.Http11Protocol destroy
INFO: Stopping Coyote HTTP/1.1 on http-8085

Which is the best approach to achieve this goal?

Thanks for help.
2 REPLIES 2

jcustovic
Champ in-the-making
Champ in-the-making
Check your code and remove all System.exit() commands. That could cause Tomcat to shutdown.
I see that there is one in FirstWebServiceClient.java.

cristian
Champ in-the-making
Champ in-the-making
Thanks  :!: