I was wondering if there is a way to make Tapestry application to always have the exact same context root when deployed on Glassfish server?
For example, I'd like to always access my app as localhost:8080/myApp instead of localhost:8080/myApp-1.01-SNAPSHOT or localhost:8080/myApp-2.01-SNAPSHOT.
I have made a glassfish-web.xml with the following property in there:
<glassfish-web-app>
<context-root>/admin</context-root>
</glassfish-web-app>
but it doesn't do the trick.
Apparently, an oversight was done on my part. If I want Glassfish to use the context root I provided, I have to leave the Context Root field blank when deploying from web admin console.
Everything else is fine, including WEB-INF/glassfish-web.xml file.
Related
For a web service project, I need to install two API versions of a Java EE web on my web server at
example.com/myservice/v1 and
example.com/myservice/v2
The safest way to separate the different versions seems to be deploying them in different WAR files, one for v1 and one for v2.
I created and deployed two JBoss 6 Java EE 6 Web Profile applications with these entries in jboss-web.xml:
<?xml version="1.0" encoding="UTF-8"?>
<jboss-web>
<context-root>/test/v1</context-root>
</jboss-web>
and
<?xml version="1.0" encoding="UTF-8"?>
<jboss-web>
<context-root>/test/v2</context-root>
</jboss-web>
Both war files deployed and ran without errors. JBoss did not complain that they use the same root context part /test.
Is this a standard behaviour of a servlet container (specified) or just a JBoss feature and not guaranteed to be portable?
For example, Oracle docs for Glassfish say that A context root must start with a forward slash (/); and end with a string - no restrictions of slash inside the context root.
Another example is JBoss docs where there is an example of two web applications with nested context roots (paragraph 1).
Tomcat also supports nested context paths - see Naming section of Apache Context Configuration doc.
There is no requirement of not having slash inside the context root in the specification also. I think it means that as well as any other feature you may assume that it works on your application server, but the way it is configured may differ, and of course you have to test your application before moving to another container.
Regarding context root JBoss says:
The context root of a web application determines which URLs Tomcat
will delegate to your web application. If your application's context
root is myapp then any request for /myapp or /myapp/* will be handled
by your application unless a more specific context root exists. If a
second web application were assigned the context root myapp/help, a
request for /myapp/help/help.jsp would be handled by the second web
application, not the first.
Two context root that you have defined in jboss-web.xml are i) /test/v1 and ii) /test/v2. These two are entirely different since they specify two different URLs.
So your apprehension that:
JBoss did not complain that they use the same root context part /test.
does not hold good as they are different from one another.
I am trying to migrate an enterprise application from JBoss to Websphere 8.5. The application is configured with Spring MVC and tiles. The application is hosted in the server root of the JBoss Server, i.e. to access the application we just type https://localhost/ in the browser.For this reason all the links and association in the applications are currently written as follows:
<link href="/resources/jQuery.js" .../>
...
Home
etc.
But in WebSphere the application needs to be in a context root viz. https://localhost:9443/MigratedApplication.
The problem is that all the links and resources mapped in the application now are inside https://localhost:9443/MigratedApplication/resources but they are still looked for in https://localhost:9443/resources resulting in errors on the application throughout.
Any ways to resolve the issue by configuration in WebSphere?
Unfortunately you have hardcoded paths in your application, so you have 2 choices:
change the context root of the application on WebSphere to / as in JBoss (probably easier one, as doesnt require changes in application)
change all links to relative ones (this should be done in the first place during application development to make it independent of context root)
I have two applications that I need to deploy to GlassFish and I'd like to know how to put the two in the same GlassFish root context. I know that to put an application in the root context, I need to write the following line in glassfish-web.xml:
<context-root> / </ context-root>
So, when I acess http://localhost:8080 this address will open my application. But how to deploy both in the root context? Will I have to change the port?
I am attempting to embed tomcat in my existing Jersey web application.
I am able to get Tomcat running no problem, and even loading my JSP's from the webapp dir. The issue is getting it to see my WebApplicationInitializer class like it does in the full container. I'm fairly certain this is a class path issue, if I add a VirtualDirResource and set the context to it, my Jersey app loads. The issue there is, Jersey can no longer load my JSP Viewables. It returns 404. Again, I have no web.xml anywhere. Not sure what code would be helpful, so ask for code samples if you think you have an answer.
I ran into a Strange Problem. I'm currently working on a project with the following configuration:
Spring Framwork for data services
JSF and Vaadin as web Framwork (2 seperated subcontexts)
Tomcat 7 as application Container
Spring EL resolver
When I deploy this application to my Tomcat Server everything works fine. When I build the application as a war-file with maven and deploy this war file on my Tomcat (the same tomcat!) the Vaadin frontend works fine, but in the JSF all Tags with values from beans stay empty. Tags with just plain text in it are processed correctly.
My biggest Problem is, that I don't get any exception. I'm also a bit confused that I also don't get an exception, when I try to access non-existing beans in my eclipse-deployed environment no error occurs, just no output is produced at that point.
I raised all Log Levels to max, but in the logs everything seems to be fine.
So, has anybody an idea, how to get JSF to display errors, when beans are not accessable and why there are difference when I deploy directly from eclipse or from a war file?
Thanks in advance!
nclaasen