Deploy War into Mule Standalone server - mule

I've got a mule-standalone server with an application I'm working on. Many of the services this application uses will be moved out of the Mule container into a JBoss cluster in the future. Because of this, I'm keeping a strong separation between the mule flows, and the Web Services. However, as of right now, I need to deploy the War file on the same server as my Mule application.
It seems like Mule should be able to run my War within it. Does anyone know if this is possible? I'm OK with adding a War into the Mule deployable zip for the time being, but would also like to deploy the war separately.

Mule ESB is not a standard Java EE container so it won't be hable to handle directly WAR files. In fact mule applications have the following structure:
/
\- classes // application-specific resources(e.g. logging config, properties)
|- lib // application-specific jars
|- mule-config.xml // Main Mule configuration file, also monitored for changes
|- mule-deploy.properties // Application deployment descriptor (optional)
|- mule-app.properties // custom properties to be added to the registry instance used by the application (optional)
as better explained here:
http://www.mulesoft.org/documentation/display/MULE3USER/Application+Format
What you can do is leverage the mule jetty connector to expose your web application. Your connector configuration will look like the following:
<jetty:connector name="jettyConnector">
<jetty:webapps directory="${app.home}/webapps" port="8083"/>
</jetty:connector>
and you will be putting your war files into the webapps folder. You can use the bookstore example as a reference:
http://www.mulesoft.org/documentation/display/MULE3EXAMPLES/Bookstore+Example

Related

Handle multiple connector in one mule application using mule domain project

I have an application which consist of two http connector with different host and port. How to handle it with shared resource i.e. mule domain project.
Have a look at https://docs.mulesoft.com/mule-user-guide/v/3.8/shared-resources.
The general idea is simple:
1. Create a domain project (in AnypointStudio: New -> Mule Domain project)
2. Move your connector configuration from the project to the domain project (use cut/paste in XML, not the graphical editor)
3. Reference the domain project from your Mule project (property domain in mule-deploy.properties
And don't forget for deployment: The domain must be deployed before you deploy your project.
#Kishan Kumar Soni, The referenced documentation explains on how use the Shared Resources with mule and is not meant for single connector only. You can move your two http:listener-config into shared resources config(domain-config) file, make sure to have unique name, then reference them in your application(s) as desired. It will work.

How do I know contents of domain.xml using glassfish package

I creating some application, using glassfish v4 web container.
I want to know "how to get properties of domain.xml({GLASSFISH_HOME}/glassfish/domains/{APPLICATION_NAME}/config/domain.xml) in java source using glassfish package"
Actually I need a glassfish application root context path

Global web.xml conf in JBoss 7

In JBoss 4.2.3 we could configure items in
[jboss_server]/deploy/jboss-web.deployer/conf/web.xml
which would be adopted by all applications deployed. We've used this to configure context params, servlets, and default tag files.
We have dozens of apps deployed in war files, and this a very handy tool.
How is this accomplished in JBoss 7.1.1? I've googled and searched but can't seem to find the solution.
You could try web fragments (part of Servlet API 3.x). You'll be able to apply the same set of filters, mappings, listeners, variables to each web app's context using one META-INF/web-fragment.xml file (inside some WEB-INF/lib/my-common-context.jar, so it'd be easily managed as a simple dependency).

Axis2 and Spring3 integration

I have an Web application developed using Spring3. Some functions of Web app needs to be exposed as Web services also.
Web app is deployed in the Tomcat Server as a .war file.
I have gone through Axis2 and Spring integration in the site http://axis.apache.org/axis2/java/core/docs/spring.html. What I am unclear is how the final structure looks like. Need clarifiaction on the below points,
1) What should be the directory structure of my final app for "With ServletContext" as well as "Without ServletContext" ?
2)The .aar file also should be placed in WEB-INF/lib directory? If so how does axis2 recognize this as service as it has compulsion on the directory structure like .aar file and inside it META-INF which contains services.xml. and the classes at the same level as META-INF folder.
I am not sure if I am going wrong in getting the whole picture. Any guidelines or a good tutorial would be highly helpful.

GlassFish 3.1, how to deploy an EAR with a WAR in root of server?

I have an EAR with a WAR that I'm deploying on GlassFish 3.1
Currently, the application runs at localhost:8080/myapp/index.jsf
I want it to run on localhost:8080/index.jsf
To accomplish this, I changed the application.xml in the EAR from contextRoot "myapp" to contextRoot="/"
When I deploy my EAR using the GlassFish admin UI, it gives me a deployment error, then when I try to browse to the admin UI, it shows me the default GlassFish home page. To recover I have to undeploy my EAR using asadmin from the command line and then do a restart-domain to restart the server.
My theory is that my application and the GlassFish admin UI are both running on root "/".
QUESTION: What is the correct way to deploy my web app in root of GlassFish 3.1? Or is this bad practice?
Thanks!
Rob
Rob,
If your deploying from the command line you can use an argument to asadmin to choose the context root. This has never given me the issue you describe.
$ASADMIN deploy --contextroot "/" your.war
Your other option is to under the Virtual Server settings to choose a default web module, but personally I prefer just setting one application to /.
Kevin
The easisest way is having a glassfish-web.xml.
This is my configuration which is located at my WEB-INF directory.
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE glassfish-web-app PUBLIC "-//GlassFish.org//DTD GlassFish Application Server 3.1 Servlet 3.0//EN" "http://glassfish.org/dtds/glassfish-web-app_3_0-1.dtd">
<glassfish-web-app>
<context-root>/myapplication</context-root>
</glassfish-web-app>
As a note, you should consider to use war instead of ear. Glassfish 3.x which is reference implementation for the JavaEE6 has a feature to use war with EJB's. That is to say you can easily use your war with your ejb without ear bundle. It will not only decrease your application size significantly but also lets you to have a good practice in terms of class loading issues, memory footprint etc...