cancel
Showing results for 
Search instead for 
Did you mean: 

Accessing Alfresco from another Tomcat container

hbf
Champ on-the-rise
Champ on-the-rise
Hi!

Does anyboy know how to set up a second webapp in Alfresco's Tomcat installation that accesses Alfresco?

My goal is to run Alfresco and Tapestry on the same Tomcat installation.

For this, I followed the instructions to tie Alfresco's Spring application context into my Tapestry webapp.

I think the approach would work but unfortunately, in order to access Alfresco (via the Spring framework) I need to have the Alfresco-jars (including Spring) from webapps/alfresco/WEB-INF/lib/ in tomcat/shared/lib. Otherwise I get an ClassNotFoundException:

java.lang.ClassNotFoundException: org.springframework.web.context.ContextLoaderListener

However, if I just move the jars, it does not work either (I guess that some duplication takes place)!

What is the best way to share Alfresco's jars with another webapp?

I have not enough experience with tomcat, but could it be that changing "shared.loader" in tomcat/conf/catalina.properties to include webapps/alfresco/WEB-INF/lib helps?

Am completely lost here and would be very glad to receive some help!

Many thanks,
Kaspar
3 REPLIES 3

hbf
Champ on-the-rise
Champ on-the-rise
Does anybody have an idea how to accomplish this?

Again for clarity: I have the Web Client running as a webapp in Tomcat (normally Alfresco installation). I added another Tomcat webapp (Tapestry) and want to use Alfresco. I see three options:

1. Use the Alfresco Java API directlty: For this, I'd have to access the "nodeService", "contentService", etc. beans of the Web Client webapp. I guess that would be all in order to be able to work with Alfresco, but I am not sure whether this approach does not lead to problems (transactions being shared between Web Client and my webapp?). Any Alfresco engineer can comment on this, please?

2. Something similar to FirstFoundationClient (in Alfresco SDK) does not work as this runs an embedded Alfresco version – but I am already running the Web Client. Again, am I right in saying that the FirstFoundationClient and the Web Client cannot run in parallel? (At least I could not get them to work together.)

3. Use the Web Services API: I am not sure whether this is so good with respect to performance and feature-richtness. If I understand correctly, the Web Services API runs through a wire (as it can be used remotely): is this a big overhead? Will it cache data? Also, the Alfresco Java API is not fully available, right?

4. Is there another option?

I just need a few "yes's"/"no's" to understand which way to go.

Kaspar

hbf
Champ on-the-rise
Champ on-the-rise
Or, could it be that I should go for a Clustered Repository Server? Could I use Alfresco Web Client in one web server and the Java API (as in the FirstFoundationClient) in the other web server?

Is there an example configuration that I could use as a starting point?

Many thanks for an answer!
Kaspar

hbf
Champ on-the-rise
Champ on-the-rise
After several hours of research and experimenting I've come up with a solution. The details are documented on Alfresco's wiki.

I hope this helps others that need to do a similar thing.