Is it possible to see the sha1 of deployments using jboss-cli? - wildfly

I would like to see the sha1 of existing deployments without having to open the [domain|standalone]/data/content folder.
I always know the sha1 of the war files I am deploying and I would like to check that they have been deployed successfully directly from within jboss-cli.
I'm using Wildfly version 23

If you do a /deployment=*:read-resource(recursive,include-runtime) you would get it.

Related

Packaging SF service into a single file

I am working through how to automate the build and deploy of my Service Fabric app. Currently I'm working on the package step and while it is creating files within the pkg subfolder it is always creating a folder hierarchy of files, not a true package in a single file. I would swear I've seem a .SFPKG file (or something similarly named) that has everything in one file (a zip maybe?). Is there some way to to create such a file with msbuild?
Here's the command line I'm using currently:
msbuild myservice.sfproj "/p:Configuration=Dev;Platform=AnyCPU" /t:Package /consoleloggerparameters:verbosity=minimal /maxcpucount
I'm concerned about not having a single file because it seems inefficient in sending a new package up to my clusters, and it's harder for me to manage a bunch of files on a build automation server.
I believe you read about the .sfpkg at
https://azure.microsoft.com/documentation/articles/service-fabric-get-started-with-a-local-cluster
Note that internally we do not yet support provisioning a .sfpkg file. This is a feature that will be coming in soon (date TBD). Instead, we upload each file in the application package.
Update (SF 6.1 - April 2018)
Since 6.1 it is possible to create a ZIP file (*.sfpkg) and upload it to an external store. Service Fabric executes a GET operation to download the sfpkg application package. For more infos see https://learn.microsoft.com/en-us/azure/service-fabric/service-fabric-package-apps#create-an-sfpkg
NOTE: This only works with external provisioning, the Azure image store still doesn't support sfpkg files.

IBM Liberty issue

An architect is having issues bringing Liberty up. Currently, an individual is running a server on his local computer and they want to move it to a shared server. When he tries to deploy a simple “helloworld” it’s failing and he is receiving an error “Context Root Not Found”. He is not sure what to set in server.xml file to have wlp recognize the application. They have ODM 8.5 on the mainframe. He thinks it might help if he saw an example of an EAR or WAR file deployed. Any ideas or suggestions?
Either put your application in the dropins folder, it will be detected and started automatically, or put it in the apps folder and configure in server.xml like this:
<webApplication id="HelloApp" location="HelloApp.war" name="HelloApp"/>
by default context root is application file name without extension, but you can change it by adding contextRoot="mycontext" attribute.

Generate code from deployed files

I had mistakely deleted my web services code. I don't have any backup of this code. Tried some file recovery tools but it didn't work. I have deployed the project in glass fish 4.0 server and the application works fine from there. So I am thinking is there any way I can generate the codes of that webservice?
Thank you
If you have the application deployed in your glassfish server then it is possible. You can always find your the .class files of original codes (not the one compiled by SEI) inside your domain folder of glassfish. Then you can use some third party tools to generate java codes from the class files. There are to ways that you can deploy your application in the glass fish server:-
By using the glass fish server web GUI and deploy it.
By using exernal IDE like eclipse where you create the glassfish server and deploy it.
For condition 1, goto :-
glassfish\domains\domain1\applications\__internal
where domain1 is your domain name. By default it is the name of your domain
For condition2, goto:-
glassfish4\glassfish\domains\domain1\eclipseApps
where domain1 is your domain name. By default it is the name of your domain
You can find your java codes inside WEB-INF\classes inside your project name.
Hope this helps.

Can't find file under Tomcat7 using AWS Elastic Beanstalk with EC2

I used Eclipse to deploy my Java web application on AWS Elastic Beanstalk which uses a UNIX 64-bit environment. And my application needs to read a file from the same project folder. However, after I run the project, the log in the Management Console shows that the directory cannot be found. I tried to resolve this by either using a relative path or a absolute path. But neither worked.
One weired thing is that I cannot find the Tomcat folder in the ec2 instance. Does anyone have an idea about how I can set up my file path in the application or where I should put my file to make it found?
Thank you!
I'm not certain what you're doing with your file, but I had the same problem finding a path to an image to use in a class. I hope this helps!
Preface: I'm deploying my .war to my elastic beanstalk instance via the AWS-Elastic Beanstalk console. I moved my image into the exact same package/folder as the class I'm referencing it in.
BufferedImage imBuff = ImageIO.read(MyAwesomeFooBarClass.class.getResourceAsStream("foobar.png"));
And that's it! I'm sure this isn't the most elegant solution, but it certainly works/I'm a bit crunched for time ;)

Is there a way to get the absolute path of the context root in tomcat?

I have a problem that, after a lot of reading and research, seems like tomcat is running another instance of itself and thus serving an old version of my updated app (or somehow has cached an older version of my webapp somewhere only serves that.)
I work on the app in eclipse on a windows machine and deploy it on a Linux server as a ROOT app (Renaming the war file to a ROOT.war).
What I'd like to know is if there's a way to locate the older version that tomcat is serving by getting tomcat to log an output of the context root of the servlet that's serving the older version of the app.
As it stands it the moment any files created by the updated app get created in the right directory but because the app instances are different it can't access the files shortly after they're created.
Any help/hints would be welcomed
To answer the question in the title, let your code basically do the following:
System.out.println(getServletContext().getRealPath("/"));
To solve the problem described in the question, shutdown Tomcat and delete everything in its /work directory, delete the expanded WAR in /webapps and remove the /Catalina subdirectory of /conf directory (if any) and then restart.