cancel
Showing results for 
Search instead for 
Did you mean: 

Access to the AVM after deploy

mvlach
Champ in-the-making
Champ in-the-making
Hi all,

i have problem with this: I am developing the WCM application that read the XML content from the AVM repository (cl:getContentList from WSF). I would like to know what will be happen when this project will be deployed to the single tomcat in DMZ (not connected to the alfresco).

I tried this and become the exception:

Thanks Mila


java.lang.NullPointerException
   org.alfresco.web.forms.FormDataFunctions.parseXMLDocuments(FormDataFunctions.java:93)
   org.alfresco.web.forms.ServletContextFormDataFunctionsAdapter.parseXMLDocuments(ServletContextFormDataFunctionsAdapter.java:78)
   cz.csa.alfresco.web.content.AlfrescoContentListBean.getContentList(AlfrescoContentListBean.java:31)
   sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
   sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
   sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
   java.lang.reflect.Method.invoke(Method.java:597)
   org.apache.commons.el.FunctionInvocation.evaluate(FunctionInvocation.java:172)
   org.apache.commons.el.ExpressionEvaluatorImpl.evaluate(ExpressionEvaluatorImpl.java:263)
   org.apache.commons.el.ExpressionEvaluatorImpl.evaluate(ExpressionEvaluatorImpl.java:190)
   org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate(PageContextImpl.java:929)
   org.apache.jsp.views.components.novinky.news_jsp._jspx_meth_c_005fforEach_005f0(news_jsp.java:88)
   org.apache.jsp.views.components.novinky.news_jsp._jspService(news_jsp.java:65)
   org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:98)
   javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
   org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:328)
   org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:315)
   org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
   javax.servlet.http.HttpServlet.service(HttpServlet.java:803)


8 REPLIES 8

pmonks
Star Contributor
Star Contributor
If your webapp accesses an AVM repository directly then you will require an Alfresco instance somewhere in your DMZ, and content would be deployed to that instance via ASR deployment (http://wiki.alfresco.com/wiki/Deployment#Alfresco_To_Alfresco_Deployment_.28ASR.29), in addition to whatever other deployment you're already doing.

This "Alfresco runtime" (as they're known) doesn't necessarily have to run within the same Tomcat instance as your own web app, although separating them will mean you need to access the AVM via one of the remotely invokable APIs ie. Web Scripts (http://wiki.alfresco.com/wiki/Web_Scripts) or AVM Remote (http://dev.alfresco.com/resource/docs/java/repository/org/alfresco/service/cmr/remote/AVMRemote.html).

uh7415
Champ in-the-making
Champ in-the-making
Hi

I am facing a similar issue. I use WSF 1.5 content listing tag library.
In the deployment, alfresco runtime tomcat is different from  the tomcat hosting the application.

Kindly suggest how to configure AVM Remote? or any other mechanism that should be used.

Regards
//uh7415

pmonks
Star Contributor
Star Contributor
Web Scripts (http://wiki.alfresco.com/wiki/Web_Scripts) are the recommended way to do this.

Cheers,
Peter

uh7415
Champ in-the-making
Champ in-the-making
Hello Peter,

Thanks for replying.
It seems you are suggesting "webscripts based architecture" over "AVMRemote" (rather "WSF" that uses AVMRemote internally).
In that scenario, WSF has no meaning apart from being a demo/example application over WCM. !!!  Smiley Sad

Still If I have a deploy a WSF based application onto a production tomcat server what are my best options and how can I do that.
(Moving the application from WSF tag libraries –> web scripts will be an effort now).
My thoughts:
- I would like to connect to Alfresco Runtime on production via RMI
- I dont want to configure production tomcat (deploying my webapp) as a another virtual server i.e. AVMHost & AVMValve and connecting to Alfresco runtime via RMI.

Another question: Your thoughts on which one (Webscripts vs. AVMRemote) would scale & perform better?

Thanks in advance
// uh7451

pmonks
Star Contributor
Star Contributor
In that scenario, WSF has no meaning apart from being a demo/example application over WCM. !!!
WSF was developed on Alfresco 2.0 (which didn't include the Web Script functionality - that was added in 2.1), so at that time there was no choice but to use AVMRemote for dynamic content retrieval.  Things have moved on since then, and the recommended approach is to use Web Scripts in preference to AVMRemote (in fact in preference to any of the other remote APIs).

- I would like to connect to Alfresco Runtime on production via RMI
There has been some discussion about providing an RMI based Web Script Runtime (http://wiki.alfresco.com/wiki/Web_Script_Runtimes), but as far as I'm aware nothing concrete has been implemented yet.  Of course this is a public extension point, so there's always the opportunity to roll it yourself (in which case I'd encourage you to consider putting it on the forge, so that everyone can benefit from it).

- I dont want to configure production tomcat (deploying my webapp) as a another virtual server i.e. AVMHost & AVMValve and connecting to Alfresco runtime via RMI.
Indeed.  The virtualisation server is intended for preview purposes only - attempting to use it to serve a production web application is an approach that will have significant challenges.

Another question: Your thoughts on which one (Webscripts vs. AVMRemote) would scale & perform better?
As I've mentioned in other threads, performance is dependent on so many different factors that it's impossible to make any clear assertions for a given use case.  What I can say is that Web Scripts have one fundamental advantage over RMI (and all of the other remote APIs, for that matter): with Web Scripts you can extend Alfresco with your own custom APIs that are perfectly tuned for your use cases.  For AVMRemote (and all of the other remote APIs) you're stuck with the APIs Alfresco provides, and if you find you have a use case that requires multiple calls into those APIs, performance will suffer (remembering that excessive chattiness is one of the biggest performance killers in a distributed system).

Cheers,
Peter

marctsg
Champ in-the-making
Champ in-the-making
Hi Peter,

I've been following the discussions here with some interest.  I'm working on a web application and we ended up going down the road of web scripts because of the flexibility they've offered.  One thing I have struggled with is finding a way to make the web scripts play well in the preview server.  It is prudent to write web scripts that take as an input the store you want to look into, but I can't seem to find a way to identify which sandbox is being previewed without using AVMRemote.  As a result, I can't seem to preview any sandboxes.  Is there a way to work around this apparent limitation?

pmonks
Star Contributor
Star Contributor
If you're using Web Scripts I'd suggest one of the two approaches to preview that don't use the virtualisation server (see http://wiki.alfresco.com/wiki/WCM_Preview for details).

The virtualisation server was never intended to support web applications that perform dynamic content retrieval from an ASR, so as you point out it's difficult to make them work well when preview is performed via the virtualisation server.

Cheers,
Peter

mark_smithson
Champ in-the-making
Champ in-the-making
We had some success with using the server name in the webapp. This contains the information you need to work out if you are running in a sandbox and also which sandbox you are running in. You can then pass this as a parameter to your webscript.

I believe that the virtualisation server uses the server name for the same purpose as well.