Trying to have unique jars for each application, so using
"org.apache.catalina.loader.VirtualWebappLoader
configuration in context.xml. The application is an EAR, deployed in 'apps' folder under TomEE install directory. context.xml is in
/apps/myApp/META-INF/
but the jars are not visible to app. Question is,
1) is this the right location? or should it be in META-INF of the webApp inside ear - /apps/myApp/webApp/META-INF
2) VirtualWebappLoader is only for webApps and for EAR under apps?
Related
Can I deploy an application without WAR/EAR in JBoss 6.4.0 eap ?
I need to migrate an application from Weblogic to JBoss. Is it possible to do so without creating the WAR ?
Deploy your app as an exploded set of files within directories, rather than packaged up within war and ear files. For example, assume you have xxx.ear which contains aaa.war. Under the deploy directory, create a directory named xxx.ear. In that directory create two more directories aaa.war. Into those directories place the contents of the two war files. Also, in the xxx.ear directory place the rest of the contents that would have been in the ear file, such as the META-INF/application.xml file.
Now, for example, you can easily add deploy/xxx.ear/aaa.war/some-new-file.html or edit deploy/xxx.ear/aaa.war/some-file.jsp.
currently I develop my applications with eclipse and I have configured tomcat's context.xml file in tomcat/config directory and all works fine.
But when I create war with mvn clean package command, I'd like to include into META-INF folder of the project, another customized context.xml file.
How can I do this?
I tried to create 2 profiles without success.
Thanks
Tomcat's context.xml file is located under $catalina_base/conf/ and can add things to that of your web application's context file. Add your (separate) web application's context.xml in Maven project at
src
main
webapp
META-INF
context.xml
Say there is a ear1, inside ear1 there are war1 and war2. Structure likes below
ear1
lib
war1
war2
We use glassfish as the server and maven as the build tool. After deploy the ear1 onto glassfish, war1 got broken which because of a jar inside WEB-INF/lib of war2.
I have to pointed out this jar file is not in the lib directory of ear level or in the war1.
After remove that jar in war2 in the glassfish server application directory and restart glassfish, war1 will be ok. But the thing is war2 need that jar in order to work.
I have no idea why war1 will pick up that jar in war2 runtime and how to solve it.
I do not know if this would be possible for you. But what if you create a project as a pom.xml (aggregator) and inside it, some different submodules (lib, war1, war2). And instead of deploying the whole ear in the server, deploy separately in the server the war1 and the war2.
I have developed a web-service client and tested it as ear on local jboss always. this ear work fine. Now I want to create war for this application. whenever I tries:
project:export:war file
in eclipse, it creates war without any third party dependency jars files added to it. This war does not gets deployed on jboss successfully.
Can anybody guide me hw to create war from ear.
you cannot create war from ear. ear is enterprise archive, and war is web archive. ear may contain many war files. So when you are creating war using eclipse, it creates a web archive. To add your third party jars, put them into the lib folder of your web application, that way it will be included into your war.
when I run my dynamic web project from eclipse it gets deployed to wtpwebapps. However I want to deploy a war file to tomcat so when I checked here in SO this came up
How to deploy a war file in Tomcat 7
It says I have to deploy to webapps folder in tomcat.
Can anybody please explain me the details between wtpwebapps folder and webapps folder in tomcat and also if I can deploy war files to wtwebpapps folder instead of webapps folder.
wtpwebapps is an eclipse-specific folder created when you run a dynamic web project on Tomcat within eclipse.
Webapps directory is within the Tomcat home and it's where you copy over your WAR files manually.
Recently, i've struggled with webapp strange behavior while debugging in Eclipse. I've noticed that it was double deployed.
My setup was:
web module with context path that differs from document base;
enabled autoDeploy in server.xml;
and deploy was set into webapps directory.
When checking tomcat-manager i've noticed that this webapp was deployed once with its context path name and once with document base name.
Here is what the documentation states (All credits goes to octopus, Tomcat docs):
If you want to deploy a WAR file or a directory using a context path that is not related to the base file name then one of the following options must be used to prevent double-deployment:
Disable autoDeploy and deployOnStartup and define all Contexts in server.xml
Locate the WAR and/or directory outside of the Host's appBase and use a context.xml file with a docBase attribute to define it.
And, i believe it's the main reason to use wtpwebapps instead of webapps for Tomcat with Eclipse.