retrieve deployed EAR on WIldfly domain - wildfly

Is there a way to retrieve an EAR deployed in a Wildfly in domain mode?
If I have only one server-group with two servers (e.g. server-one and server-two) each host has a directory ubnder domain called servers/server-one(two)/data/content containing all deployed artifacts, but they are encrypted.
Is there a way (maybe from Wildfly Admin Console) to retrieve the original deployed EAR?

This is not currently supported but will be in the future. For what it's worth the contents is not encrypted. The content file is just a compressed file.

Related

How to deploy EAR into the WAS cluster and IBM HTTP server by Monitored Directory Deployment functionality

My goal is to automatically deploy EAR file in WebSphere Application server cluster by Monitored Directory Deployment. So my deployment target is cluster. WAS version is 9.0.0.10. Everything works fine if I drop EAR file in
monitored directory for example '/{monitored_directory_defined_in_WAS}/clusters/my_cluster_name/'. Application is deployed and started. But I also want to deploy that application into the IBM HTTP server(resides in the same WebSphere cell with cluster) in the same automatically process by Monitored Directory Deployment.
I tried to manually predefine deploymentTargets(cluster and ibm http server) in deployment.xml file, put it in the EAR file, and drop EAR in the '/{monitored_directory_defined_in_WAS}/clusters/my_cluster_name/', but WAS deploy EAR only in cluster. As a consequence I must manually via WAS console map all modules from EAR to ibm http server, but I do not want to do it manually.
My second idea/attempt was sto create separate monitored directory for the ibm http server '/{monitored_directory_defined_in_WAS}/servers/my_ibm_http_server_name/'.
First I drop EAR into the '/{monitored_directory_defined_in_WAS}/clusters/my_cluster_name/' and right after that I drop EAR in to the '/{monitored_directory_defined_in_WAS}/servers/my_ibm_http_server_name/'. Result is that the EAR modules are deployed only in to the web server, and that is not my goal.
Is that even possible by WAS Monitored Deployment Directory functionality?
Is it allowed to manually create the deployment.xml file and add it to the EAR file?
First of all installing via monitored director is not recommended in the production environments, as it lacks control.
As you correctly suspected it is not possible to install it to the cluster and web server - check Installing enterprise application files by adding them to a monitored directory.
Because you can use only one server directory, drag and drop to map
applications to combinations of servers is limited. Scenarios
requiring use of more than one server, such as mapping to an
application server and a web server, are not supported by direct drag
and drop of an application file.
However, you still want to use it, you may deploy property file into monitored directory. That property file can fully customize your deployment e.g. configuring also module to map to web server.
Check Installing enterprise application files by adding properties files to a monitored directory for more details
UPDATE
If you have issues, I'd suggest the following approach - install your application 'classically' via admin console and map it to both web server and cluster. Then run wsadmin command to extract propertes:
AdminTask.extractConfigProperties('[-propertiesFileName myApp.props -configData Deployment=MyApplication -options [[SimpleOutputFormat true]]]')
Try to use format from that exported file for your properties
I had time to run it in my environment. I have app with 2 modules inside, one module is just mapped to the cluster, other is mapped to both cluster and web server. Here is relevant part of the property file:
taskName=MapModulesToServers
row1={ module=HelloTestUI #readonly
uri=HelloTestUI.war,WEB-INF/web.xml #readonly
server=WebSphere:cell=!{cellName},cluster=!{clusterName} }
row0={ module=HelloTestWeb #readonly
uri=HelloTestWeb.war,WEB-INF/web.xml #readonly
server=WebSphere:cell=!{cellName},cluster=!{clusterName}+WebSphere:cell=!{cellName},node=!{nodeName},server=!{serverName} }
I didnt try to use that property file to deploy the app via monitored directory, but as you can see the entry is created and mapping is done via + sign that connects cluster and web server.
If you dont see the mapping to your web server, make sure you saved the changes done in the console, and then connected via wsadmin, otherwise wsadmin will have not current data.

Deployment scanner/folder in JBoss AS7 domain managed mode

Is there a deployment folder where a war can be placed in the master node so that it gets deployed to all the slave nodes in a domain managed setup in JBoss AS7?
I know that we can use the JBoss CLI to deploy to a server group which places the artifact in the JBOSS_HOME/domain/data//content directory.
However I would like to find out if there is a way that it can be placed in a deployments folder under the domain of the master node (e.g. JBOSS_HOME/domain/deployments) that is similar to the one available in the standalone mode (i.e. JBOSS_HOME/standalone/deployments) so that the deployment scanner picks it up and makes it available to the slave nodes in the domain without the explicit deploy command via CLI.
To summarize the comments above: There is no deployment directory in domain mode.
You can use the CLI
the web console
the maven plugin
or create your own deployment manager.
I wrote a, now old, blog post on how to do this on a standalone server, but it could be slightly changed to use on a domain server. Have a look at how it's done with the jboss-as-maven-plugin for an example.

Difference between jboss 6 and jboss 7 standalone server?

I was using Jboss 6 . I am wondering to see jboss 7 which does not have many folders that jboss 6 had. It will be helpful if someone explains the difference between the jboss 7 stand alone server and the previous versions.
AS7 is different in a lot of respects to its predecessors AS6,5. So it wont be possible to list down all the differences here.
to list supported technology related differences, refer to below table.
Some Major Differences: (Thanks for #Jyore for additions)
Modular (on-demand) class-loading
Addition of domain managed nodes (multiple JVM management)
All configuration is done in Standalone.xml for standalone mode and domain.xml for domain mode.
About the new DIRECTORY Structure
configuration : Configuration files for the standalone server that runs off of this installation. All configuration information for the running server is located here and is the single place for configuration modifications for the standalone server.
data :Persistent information written by the server to survive a restart of the server
deployments: End user deployment content can be placed in this directory for automatic detection and deployment of that content into the server's runtime.
NOTE: The server's management API is recommended for installing deployment content. File system based deployment scanning capabilities remain for developer convenience.
lib/ext : Location for installed library jars referenced by applications using the Extension-List mechanism
log : standalone server log files
tmp : location for temporary files written by the server
Apart from that I really dont want to duplicate information on web
There is a migration guide from AS5,AS6 to AS7. This can help you understand what are the config changes that are generally required to switch to AS7. it also points out what has significantly changed, highly recommend going through it.
Also You can read Getting Started with AS7, to know AS7 better

How things work after deployement in Application Server?

Till now I have been coding in Java.
Wanted to know - what happens after deployment in Application Server
Suppose I deployed my EAR in AppServer (WebSphere or Jboss and Assuming Deployed Successfully!)
EAR convert into tmp files.. etc etc
How request picks some EAR or WAR in 100's of EARs or WARs in
Application Server ?
How application server look for datasources ?
How Plugin-cfg.xml works.
..
..
etc...etc..many more
Is there any document or anything ?
That is a VERY VERY vague question, I would start here: http://pic.dhe.ibm.com/infocenter/wasinfo/v7r0/index.jsp
with the instructions for WebSphere Application server v7 "Developing and deploying applications" section.
I think the implementation of servers vary, so trying to put some basic principles.
How request picks some EAR or WAR in 100's of EARs or WARs in Application Server ?
Application Server keeps a list of WAR and bind URL patterns /* . If pattern matched, request goes to the application. Otherwise - error 404. Then application should be in memory, i.e. loaded by using specific classloader. After that methods like doGet called using reflection.
How application server look for datasources?
Application server collected all resources from xml description during startup and changes on request. Next, return it on call. Here is example from Tomcat source of taking datasource from Hashtable environment.

Deploying .ear file (contains rest services)

I have a few questions about deploying my .ear file (was provided to me, the file itself should not be the problem). I set up jBoss application server jboss-6.0.0.Final and was able to run a simple hello world app to ensure the server was functioning properly.
I was told to place the .ear file in /server/default/deploy so I did. When I ran jboss (through /bin/run.bat) I got no errors related to deploying the ear file.
Question
Is this all the software I need (jBoss)? Do I also need something like Apache or tomcat?
The .ear file contains RESTful service calls that should return xml. Will these be deployed (accessible through a jQuery ajax call after the server (jboss/bin/run.bat) is executed?
Currently when I try to make the calls, the resources do not seem to exist.
Thanks in advance for taking the time to help.
JBoss AS ships with an embedded Tomcat as a servlet container so you really don't need that anymore. Apache Web Server is NOT required for your .EAR to be deployed properly.
To answer your questions
No other software is needed to deploy the EAR. You simply copy your EAR file to deploy directory (which you have rightfully done so).
If your EAR contains RESTFul services, they will be deployed and you can access them using any client including jQuery or even a simple browsers. The trick is to know the access URL to the RESTFul services.
If you have difficulty identifying the URL for accessing your RESTFul services please refer [1] for more information.
Hope this helps.
Good luck!
[1] https://docs.jboss.org/author/display/AS7/JAX-RS+Reference+Guide
I can answer the first question. You need apache if you want to serve static content or you need to isolate the traffic (say keep apache in the dmz and then use apache to proxy traffic to the internal jboss servers). tomcat is bundled along with jboss, so you do not need it.