What is the simplest solution to integrate 2 apps within a Tomcat server?


What is the simplest solution to integrate 2 apps within a Tomcat server?



I'm new to this and is looking at Apache Camel, Spring Integration and even Terracotta.

I'm looking at sharing of common data like user/groups/account/permission and common business data like inventory/product details/etc.

Any example will be really appreciated.




dynamically change spring beans

1:



call 2 or more views with one controller in spring java
How about database-level integration?.
Is anyone using SpringSource tc server as a Tomcat replacement?
Have both applications access the same relational database.


I'm interviewing for a j2EE position using the Spring Framework; help me brush up
Those are built for that kind of task..
annotations in Spring MVC
To do that, the two applications can use a shared library (of which for the sake of simplicity each one will have a copy in their WEB-INF/lib)..
How assign bean's property an Enum value in Spring config file?


Is fine grained control of aspectj-autoproxy possible in spring?


Do I want to minimize the scope of @Transactional?

2:


You should consider creating a full blown EAR instead, if you want this to be web container independent.. As different web applications have different classloaders you cannot just create an object in one web app which is immediately usable by another.

Hence you need to have a common classloader which knows about the classes in common, and - to be 100% compliant - these classes may not be in either web apps WEB-INF/lib.

This is hard to get right, and the result is fragile.. Therefore consider migrating to a web container which can deploy EAR's instead as they may contain several web applications sharing objects.

I believe a good choice for starting would be JBoss..


3:


I'm looking at sharing of common data like user/groups/account/permission and common business data like inventory/product details/etc..
Common data like users, groups, and permissions belong in a central LDAP or database.

These are part of your Spring Security solution, and all apps can share those regardless of whether they're on the same app server or not.. It can be argued that common business data like inventory, product details, etc.

should be "owned" by a single service.

It's the only one that can modify the data.

Others can get access by querying the service, but it's the one that manages CRUD operations on those tables.. If you do this, you keep objects and systems from being coupled at the database level.

You're trading looser coupling for increased network latency..


4:


In theory, every application has its own memory space, but off the top of my head I can think of a number of methods for sharing information between applications.. If the amount of shared information is small, perhaps a direct approach is best.

set up a communication channel (web services are a bit of an overkill, but a good example) and have the applications request info from each other.. If there is massive sharing, perhaps the two applications should be reading from the same database or local file.

Mind you, This brings up synchronization issues, and gets you into the realm of lockings and blockings.

Tread lightly in this realm....


5:


If your new an idea may be to build the classes to handle the common data and just build a separate servlet for each application.. This will at least get you started and more familiar with the technologies..



74 out of 100 based on 84 user ratings 734 reviews