For some application was build a war with two web.xml files inside. I want to deploy that application in different servers, on of that being Jetty and other GlassFish for instance. For Jetty I try to deploy in jetty.xml, and I want it to load both web.xml descriptors files. It would be useful at least some tips for that. This question I consider that is a general one and I will not provide a concrete code for it.
Related
We extensively use Java ServiceLoaders as a plugin infrastructure for our application components. We define interfaces, and then use the loader to load them at run time. Adding additional jars with extensions and service files are fine for our use cases.
However, i'm struggling to understand how we would be able to continue this approach while deploying an application within Wildfly. The intent is as stated above, the ability to add "extension" jars to the web-application class path without having to
Stop the server
Unzip the war
Add additional jar
Zip war
Start the server
In Tomcat, we could deploy web application folders instead of a war. So stopping the server, dropping in a jar, and starting the server worked fine. Within Wildfly (latest), it appears to not like the deployment of a folder vs war.
I've read about the modules approach, but have not been successful using this approach to get the deployed application to see the module from the service loader implementations.
Would like to know if there is an alternative solution or perhaps we are doing something wrong?
Thanks
WildFly supports exploded deployments with the deployment scanner or using the explode command with jboss-cli. Using the jboss-cli you can even update files remotely.
I'm a .NET Programmer and right now I'm struggling with a web service I developed in JAVA. The web service doesn't have access to a database, only do some cryptographic tasks. To deploy it, I build the project with dependencies in Net Beans, generate a WAR File and upload it in the JBOSS web console.
The problem is that I'm looking for the analog of Web.Config in .Net, where some parameters can be set by a human without compiling again . In my code I call a XML file with all the parameters, however, the location of the file must be hardcoded. My solution was to set an enviornment variable with the folder so I always have to look for the XML there.
But I have an inconvenience: The same deploy will be set in two instances of JBOSS in the same server and both web services will have access to the same file, but that can't happen because some configurations are different in each one.
I tried the Web.xml file, but where can I find it in the JBOSS folder? Each time I upload the war or disable/enable it, it change the folder of the web.xml
What can you suggest?
The idea of using the web console is to work with artifacts (closed package) and you shouldn´t be manually modifying them.
From what i understood of your requirement, one option is to put an external file in the classpath of each jboss.
https://developer.jboss.org/wiki/HowToPutAnExternalFileInTheClasspath?_sscc=t
I have two WAR files that i need to deploy on a server.
the catch is that i cant run another tomcat on that server.
deploying two WAR files is easy but, is it possible to run them both while one of them uses
Spring 3.8
and the other one uses
Spring 4.1.4
which is the latest version?
Will it conflict?
answers like "try it out" are acceptable :) but i need to know for sure so i wont have issues in the future.
Thanks
See the following for an explanation of how Tomcat's classloading mechanism works:
http://tomcat.apache.org/tomcat-7.0-doc/class-loader-howto.html
WebappX — A class loader is created for each web application that is
deployed in a single Tomcat instance. All unpacked classes and
resources in the /WEB-INF/classes directory of your web application,
plus classes and resources in JAR files under the /WEB-INF/lib
directory of your web application, are made visible to this web
application, but not to other ones.
If, then, the Spring Jar files are bundled in WEB-INF/lib for each application then you will have no issues. An issue would only arise if they were in some shared location.
two different application under tomcat has two diffferent classpath and classloader so they don't conflict
latest as of today is 4.2.0 (under dev), you can keep track at http://projects.spring.io/spring-framework/
I have a web application which consist of JSP pages, Servlet and Consumes Web Services.
It also references apache axis and excel libraries.
Now I want to deploy my application directly in Weblogic server
How do i do that.Whcih archive shud i make WAR or JAR??
ALso how to ensures that it covers all the referenced libraries.
I have made my application in Jdeveloper, but I dont want to deploy it using Jdevelper..
I would package my solution as a .war file, containing all dependent .jar files.
That way your solution is self-contained. You can deploy to an app server containing other apps with their own versions of your libraries (dependent or developed). If you put the dependent jars directly into the app server (as you can do), then you're forcing those versions on all applications deployed, and that could well cause you grief.
The downside is that your developed .war file can become sizable. It's not normally a major problem, and I wouldn't worry about it until it's identified as an issue.
A JAR-file cannot contain a JAR-file, so that option is out. Since you mention JSPs and servlets a WAR would seem the appropriate option, although an EAR with a WAR and several JARs could also be a way forward...
Cheers,
Consider a WAR with your JAR files in WEB-INF/lib. Or, create an EAR with APP-INF/lib folder.
I'm using Maven to deploy a Java web project into my Tomcat 6.0 server. I have a "system" named project which is a war, and has his own JSF configuration and JSF managed beans.
The goal is that this system can have some apps installed on it, and apps themselves also have their web content and JSF configuration. My problem comes here, and I have two choices.
If I compile the app as a jar file, the faces-config.xml file has to be stored in the project's META-INF folder, so when loading the jar, JSF can find this file because it's located in the default place. However, my app also have web content, and I have to store it in the main system (webapp) location if I want it to be read. That's a functional but not elegant solution.
What I want to do is to define the app as a war file, and including it into the main system POM file, every web content from my app will be published in the server automatically. That's a good idea, but what can I do with my faces-config.xml file?? I already have one defined in my system and when Maven tries to deploy it, it finds there's already a same named file into the server. So I can't get my app JSF configuration from my system.
There is a way to define multiple jsf-config files, using a context-param in web.xml. Something like that works, but I want it to be dynamic:
<context-param>
<param-name>javax.faces.CONFIG_FILES</param-name>
<param-value>/WEB-INF/faces-config.xml, /WEB-INF/faces-managed-beans.xml,/WEB-INF/faces-navigation.xml</param-value>
</context-param>
Does anybody have any idea for that? Thanks in advance!
That's a good idea, but what can I do with my faces-config.xml file?? I already have one defined in my system ...
It sounds like you should remove that copy, and put a webapp specific copy in each webapp.