aspose file tools*
The moose likes JBoss/WildFly and the fly likes Different applications in the same context-root name Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Products » JBoss/WildFly
Bookmark "Different applications in the same context-root name" Watch "Different applications in the same context-root name" New topic
Author

Different applications in the same context-root name

Francisco Sariego
Greenhorn

Joined: Jan 07, 2009
Posts: 3
I need to know if is possible to deploy an EAR with two (or more) web modules in the same context-root name but in different ports.

I.e:

http://localhost:8080/web-application
http://localhost:8082/web-application

These are different applications but are web modules inside the same EAR.

Now, I'm using two separated Tomcat instances running in different HTTP ports and AJP connectors, but I want to move to EJB and share application logic through web applications. Also I want to use Local interfaces only.

Can I do this with JBoss AS?

Thanks In Advance!
Peter Johnson
author
Bartender

Joined: May 14, 2008
Posts: 5772
    
    7

Perhaps a virtual host will help you do what you want.


JBoss In Action
Javid Jamae
Author
Ranch Hand

Joined: May 14, 2008
Posts: 198
Francisco Sariego wrote:I need to know if is possible to deploy an EAR with two (or more) web modules in the same context-root name but in different ports.


I'm not sure if you can set up two connectors with different ports. You should try that. I don't think you can use virtual hosts to set up different ports, just domain names. If you can, I would just use virtual hosts and set up different subdomains: a1.myhost.com, a2.myhost.com.

What exactly are you trying to accomplish?


Author: JBoss in Action, javidjamae.com, @javidjamae on Twitter
Francisco Sariego
Greenhorn

Joined: Jan 07, 2009
Posts: 3
Javid Jamae wrote:What exactly are you trying to accomplish?


Thank you so much. I'll try to explain.

Actual situation
------------------

We have 2 different applications running in one physical server. Each application is running in a different Tomcat. Both applications are deployed to the ROOT context (/) and use the HTTP and AJP connectors. We use one Apache with mod_jk acting as a proxy for the two applications. We use Apache Virtual Host and Workers are configured for each application depending on the port.

To sum up,

In the physical application server (with the 2 Tomcat) we can access to:

http://server-name.domain.suffix:8080/ (HTTP for application-1)
http://server-name.domain.suffix:8009/ (AJP for application-1)
http://server-name.domain.suffix:8081/ (HTTP for application-2)
http://server-name.domain.suffix:8010/ (AJP for application-2)

In the physical web server (with Apache) we (and everyone in the Internet) can access to:

http://application-1.domain.suffix/ (port 80, HTTP)
http://application-2.domain.suffix/ (port 80, HTTP)


Future ideal situation
------------------------

We move to a Java EE Application Server. We use EJB and probably Seam (and JPA, Hibernate Search... we are training on this). The "old web applications" are refactored and share application logic through an one or more EJB modules. All are packaged in one EAR and use only Local interfaces.

All the "old URLs" should work. We also want to use Apache server (static files, logs, load balancing) in the other machine.

Thank you so much.
Victor Bucutea
Ranch Hand

Joined: Nov 24, 2008
Posts: 43
Has anyone found a solution to this problem?

I'm trying to achieve pretty much the same thing, without using virtuat hosts.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Different applications in the same context-root name
 
Similar Threads
EJB application runs as WebSphere Application client, fails as JavaApplication
Same EAR, same context name, different ports?
find context root of other web module in same application
Loading sequence of the different modules in an EAR....?
Question on GlassFish