-
1. Re: Deploying 2 Almost Identifical Ear Files
jules_gosnell Apr 10, 2002 6:27 AM (in response to thorntond)ensure that in their application.xml they specify different context root's for their servlets otherwise one will overwrite the other.
The context is the first section of your servlets url :
http://localhost:8080/bookshop/purchase/...
protocol://host:port/context/servlet-mapping
If both ears servlets are using the same servlet-mappings and context - your will have confusion. Think of the context as a namespace.
Jules -
2. Re: Deploying 2 Almost Identifical Ear Files
thorntond Apr 10, 2002 3:06 PM (in response to thorntond)In the application.xml files, the context root for web app 1 is specified as <context-root>/App1<context-root> and the context root for web app2 is <context-root>/App2<context-root>. Is there another way to change the contexts for the servlets?
Danny -
3. Re: Deploying 2 Almost Identifical Ear Files
thorntond Apr 10, 2002 3:09 PM (in response to thorntond)Sorry, made a typo. The above message should read <context-root>/App1</context-root> and <context-root>/App2</context-root>.
-
4. Re: Deploying 2 Almost Identifical Ear Files
jules_gosnell Apr 10, 2002 6:47 PM (in response to thorntond)My fault, I read your post too quickly and did not notice you had said that you were using different contexts.
Offhand I can't think why you should have a problem.
I'll give it some further thought and come back to you tomorrow.
Jules -
5. Re: Deploying 2 Almost Identifical Ear Files
jules_gosnell Apr 10, 2002 6:49 PM (in response to thorntond)I assume that the ear files have different names ?
Jules -
6. Re: Deploying 2 Almost Identifical Ear Files
thorntond Apr 10, 2002 7:22 PM (in response to thorntond)Yes, App1.ear & App2.ear. The war files also have different names.
-
7. Re: Deploying 2 Almost Identifical Ear Files
jules_gosnell Apr 12, 2002 6:09 AM (in response to thorntond)Hmmmm.... !
OK,
I'm very busy until next week - I'll have a good look at it then.
Are the ears too big/private to mail me ?
Jules (jules@jboss.org) -
8. Re: Deploying 2 Almost Identifical Ear Files
thorntond Apr 12, 2002 2:14 PM (in response to thorntond)My EAR file is large and requires a fair amount of other kinds of setup, db and stuff. The easiest way to test this is to just create an ear file with a war with one servlet. In one war file write a message from the servlet that says "I am the servlet from web app 1" and have the servlet in the other war file write a message, "I am the servlet from web app 2". I haven't actually done this yet but when I have some extra time to work on this, that will be my next step.
-
9. Re: Deploying 2 Almost Identifical Ear Files
jules_gosnell Apr 16, 2002 4:49 PM (in response to thorntond)After a little more thought I think you are coming up against JBoss' ClassLoader architecture.
I don't claim to fully understand this, but AFAIK this is a flat namespace.
It looks as if the classes from App1 are being loaded and then the next time similarly named classes are requested, instead of being loaded again, they are supplied immediately from app1.
There may be a solution.
Jetty has a JMX attribute in jetty-plugin.sar/META-INF/jboss-service.xml called something like Java2Compliance which controls how the Jetty ClassLoader behaves.
It has 2 modes - compliant - in which case requests to load classes are first delegated upward and non-compliant - in which an attempt is first made to service them locally.
Try playing toggling this setting and let me know how it goes.
Jules