cancel
Showing results for 
Search instead for 
Did you mean: 
  • 4,508 Views

How does jBoss server extract the war file in Domain Mode?

How does jBoss server extract the war file in Domain Mode? We have an applicatiuon running on jBoss 6.3

It is in Domain mode. We are unable to understand how the server gets to know about the location of war file after each deployment of code? And where is the war file stored in Domain Mode?

0 Kudos
4 Replies
flozano
Moderator
Moderator
  • 4,502 Views

Hi @Vrushalik2,

Is this a question about the internals of EAP, out of curiosity, or do you have a need to access the actual files from the WAR package?

About the internals: in Domain mode, you use the management API (or the CLI) to send the package to the domain controller and it sends the package to each server it is activated. The domain controller saves it in the /data/container folder. Each server in the domain saves its own copy in its private /data/container folder. Each folder is named using a hash over the package contents, and you can see the hash on the master logs, for example:

[Host Controller] 09:29:01,518 INFO  [org.jboss.as.repository] (management-handler-thread - 3) WFLYDR0001: Content added at location /home/flozano/EAP-7.1.0/domain/data/content/32/e208f97a744c0e29a6af28c1424fee11f0b640/content

If you need to access these files, please do not use the knoledge about EAP internals to get the files directly. This is against the Java EE specs and makes your app non-portable. You should use the getResourceAsStream methods from Class or ServletContext. The first is able to get any file in the application classpath, such as files in the META-INF folder and resource files saved alongside your class files. The second should be able to get any file 'browser visible' file such as HTML pages in a WAR file.

https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html#getResourceAsStream-java.lang.String-

https://docs.oracle.com/javaee/7/api/javax/servlet/ServletContext.html#getResourceAsStream-java.lang...

 

0 Kudos
  • 4,489 Views

Hello @flozano ,

Thank you for your swift response.


1) We do NOT need to access the actual files from the WAR package, but we need the war package itslef to create a backup.

2) We also need to know where is the war package stored when application is deployed in Domain Mode?

3) Also one of our biggest issue is - Whenever our application is down and we restart the batch file then a copy of our JSP files which are rendered as web application are created in this path C:\EAP\jboss-eap-6.3\standalone\tmp\vfs\temp\tempe3d5c3f902c47ca9\content-6bf1215e2d26114 , we want to know how does the server know from where to extract these files, since it is in Domain mode and there is no physical presence of war file.

Please correct me if I'm wrong at any point.
Thank you again for your help. Good day! :)

Best Regards,

Vrushali K

0 Kudos
flozano
Moderator
Moderator
  • 4,482 Views

Hi @Vrushalik2,

1) Wy don't you backup the WAR from your build pipelines? I'd work towards being able to reproduce the configuration of my EAP instances instead of doing a 'black box' full backup of whatever is there. If you have you xml configuration files and can suply them your application packages, you can recreate it all from the product ZIPs.

2) My previous reply answered that: you can see in the logs. I guess you can also retrieve the information from the deployment management object.

3) I'd not other backing up these. They are re-generated on demand. Actually each inidivual JSP page is compiled when first accessed, not during deployment.

Looks like you're trying to implement a Disaster Recovery scenario. Is that true? I am not sure, maybe you should open a support ticket, or engace Red Hat Consulting, but I assume that having a copy of all xml configuration files (for all servers) and the domain controller data folder would be sufficient to restore deployed applications and other domain state. When the slaves start up, they'd get whaterver application packages they need from the domain controller.

oldbenko
Moderator
Moderator
  • 4,419 Views


 

1) Wy don't you backup the WAR from your build pipelines? I'd work towards being able to reproduce the configuration of my EAP instances instead of doing a 'black box' full backup of whatever is there. If you have you xml configuration files and can suply them your application packages, you can recreate it all from the product ZIPs.

Hey, Fernando,

The problem with backing up just the XML files (more specifically, domain.xml) is that they contain references to data/content/ and will prevent the DC from starting if the content there is missing (DC will crash upon startup).

So in addition to XML files, simply adding data/content/ to the backup scheme fixes this.

Hosts (slaves) will re-download that content from the master if it's missing.

However, other subdirectories in data/ may also contain important files (messaging journal, for example), so it is best if the entire data directory is included in the backup scheme.

Cheers,

A black cat crossing the street signifies that the animal is going somewhere.
[don't forget to kudo a helpful post or mark it as a solution!]
0 Kudos
Join the discussion
You must log in to join this conversation.