Glassfish administration scripting - scripting

I am trying to move a web application that currently runs on WebSphere 6.1 application server over Glassfish 3.X. I currently have a set of WebSphere jacl files that configure an instance of a WAS for my web application (data sources, queues, etc.) and a .bat and a .sh file that execute the jacl files (I think via wsadmin). I develop on a WAS instance on my Windows PC and the software is tested on a WAS instance installed on a Solaris test machine.
Is there the equivalent concept for Glassfish?
That is, does Glassfish have a concept of a platform independent administration scripting language like WebSphere jacl/jython that can be executed from a call from a Windows .bat file or a Unix .sh file?
I'm relatively new to web development and so I may have made some conceptual mistakes and you may also have to fill in some gaps in my question.
Thanks

You can feed a configuration script to asadmin, that contains asadmin subcommands like deploy and create-jdbc-resource, etc...
The 'language' does not have any real flow-of-control or looping constructs, so you would need to flatten those types of things out of the script that would get called by your dot-bat or dot-sh.
If you are really leveraging jacl/jython this might not be possible... but if you aren't putting these interpreters through their paces, the asadmin 'language' may be rich enough for you.

Yes, take at a look at the "asadmin" command. It should be able to configure most anything you need from a script.

Related

Cross platform desktop development

I would like to develop a cross platform (Linux/Windows) desktop service.
This service needs to run a local HTTP server and needs to have access to a local DB.
It doesn't have any GUI components though.
Also I need to be able to create an installer for both Linux and Windows.
What is the best language/framework/SDK to build such service ?
Java could be perfect for this but I'm not sure there is a decent installer builder out there.
10x
Gilad
Have you considered the Dlib C++ Library found at http://dlib.net/? It includes "A simple HTTP server object you can use to embed a web server into your applications."
As for an installer, perhaps you should consult the following resource: http://en.wikipedia.org/wiki/List_of_installation_software#Cross-platform.

Deploying an application server to a server

I am building a client-server application, this is all running locally on my computer whilst I am developing the system. However, eventually I would like to deploy the server-side part of the application to a server to run 24/7, enabling client applications to connect and consume the service at will. What I would like to know is, when I come to doing this would I simply just install the server-side application on the server, hit run and that's it? That just seems... well not right (to me), is this the way it is done? or is there a lot more to it? I imagine there is, but I can't seem to find any content on this subject.
FYI - the server is a self hosted WCF application.
You'd want to take your program's executable, support dlls and config files and drop them into a folder. Then create a Windows Service to run the program; if you don't use a Windows Service, the program will only run while you're logged on, which isn't good. As a Windows Service, a reboot of the server will bring the program back online even if you're not logged on.
Here's a knowledge base article from MS on how to make a windows service.
http://support.microsoft.com/kb/251192
If you're program is compiled as a DLL, then create a small .exe program to run it (a wrapper) then deploy the program as described in the article.
Good luck.

Sandbox a java applet

I heard that minecraft server is very leaky, can consume a lot of resources very quickly. People say to use a virtual machine, all well and good. I'm making an application to automate server setup, and I'd like my whole application (including minecraft) to run in an ultra basic auto setup vm (or something similar). I've heard of mineos, but I'm not sure if that can be set up very quickly. The vm will be so basic it won't even have a ui. I'm using a Mac, not planning to distribute the server WITH the application but have it download from the minecraft server, not modified.
I want it to be like a one-click-done solution for the end user, they don't have to worry about minecraft server gobbling up resources because it's be in a controllable virtual machine.
Distrubuting minecraft server (Notch's property) could be an issue, but if anyone knows about that if be happy to hear.
If you intend for a server to be fully configured and only for your user to only have to download and 'open' it, what you're seeking is known as an 'appliance'. Virtualbox supports the open-standard of such appliances, allowing a single file to be distributed and it contains all the virtualized hardware info as well as the OS/filesystem. A number of other formats exist, such as Turnkey.
In all likelihood, I would find MineOS CRUX to be perfectly suited for this sort of one-click-done, since the OS was designed for pretty much exactly what you're trying to do...only without the configure-the-hardware-for-the-user (it uses an ISO and an installer, the process you would automate for the end-user).
That said, this distribution has never at any point packaged Minecraft files, as clearly stated: "this Linux distro does not contain ANY Minecraft files. The scripts are, however, designed to download/update files directly from the source: http://minecraft.net"
Hope this answers all the concerns, despite being an old thread.

Suggestions for software to ease setting up a build server

I'm currently setting up a new build server and I'm interested in any suggestions the community may have about software such as Hudson or CruiseControl.NET that may simplify and add additional value to the build process.
Previously I had a build server set up using custom batch files which would run msbuild and other such tools and these were triggered by subversion hooks to allow for a continuous builds to be done per branch. The idea was that eventually we would also execute automated tests and/or static analysis although we never really got that far. This server also acted as our source code repository, a test machine for web project builds, and a web server for custom dashboard and portal for developers on the team.
At this point my thoughts are to separate some of the responsibilities of the old build server and at least a Build Server which is responsible only for creating builds, a web server which is responsible for acting as the intranet style dashboard site for developers, and perhaps an additional web server as the Subversion repository. If it turns out to be better or easier to keep the Subversion code on the same server as SvnServe then I'll probably opt to place the Subversion repository on the web server but still keep the build server separate. Having no personal experience with any of the popular build server and CI solutions out there I'm curious how CruiseControl.NET, Hudson or other solutions would fit into this type of configuration. It appears that both of CC.NET and Hudson have web interfaces for example but the documentation doesn't clearly layout how this plays out with different hardware/system configurations so I'm not sure if either requires the web portion to be on the build server itself or not.
As far as technologies I'm dealing with .NET/C# based code which is a mix of Web/WinForms/WPF and we use a few separate Subversion repositories to host these projects. Additionally it would be nice to support Visual FoxPro and Visual Source Safe for some legacy applications. I would also like to get more team members involved in monitoring builds and would like to eventual have developers create build setups for their own projects as well with as much simplicity as possible. Also I should mention that I have no experience setting up a Java based web application in IIS but I do have quite a bit of experience setting up and managing ASP.NET applications so if that may make .NET based products more favorable unless I can be convinced otherwise.
UPDATE (after researching Hudson): After all the recommendations for Hudson I started looking into what is involved to get it up and running on my two Windows 2008 servers. From what I can gather the web portion (master) would run on my webserver but it seems that IIS isn't supported so this would greatly complicate things since I want to host it on the same machine as my other web applications. On the build server, I would be installing a second copy of Hudson that would act as a slave and only perform builds that are delegated to it by the master. To get this to work I would be installing Hudson as a Windows Service and would also need to install some unix compatibility utilities. Unfortunately the UnxUtils download link appears to be broken when I checked as well so I can't really move forward until I get that resolved. All of this is really sounding just as complex if not more complex than installing CruseControl.NET. For now this unfortunately leaves me to looking into CruiseControl.NET and TeamCity.
UPDATE (about TeamCity): After looking into TeamCity a little closer I realized that at least the server portion is also written in Java and is deployed in a manner very similar to Hudson. Fortunately it appears that Tomcat can be used to host servlets inside IIS although I can't find a good straight forward guide to describe how to actually do accomplish this. So skipping that for now I looked further when I ran into what looks like what might be a major snag.
TeamCity Professional edition only
supports TeamCity Default
Authentication and does not support
changing the authentication scheme.
Since windows authentication is likely the direction we will want to go, it's now looking like it might be back to evaluating CruiseControl.NET or possibly Hudson if I can get my hands on the UnxUtils and also find out more about how I can host the dashboard portion of Hudson within my existing IIS configuration. Any pointers?
UPDATE (about Jenkins): I ended up experimenting enough with Hudson that I ended up with a reasonable build server setup that I'm happy with and that can be extended to do much more if I need. Of course I went the rout of converting to Jenkins once Oracle took over Hudson and Jenkins is what I'm using today with little bits of powershell to help tie things together. I'm very happy with this approach right now and besides being Java based, Jenkins has quite a bit of support for other development environments such as .NET and MSBuild.
I'd vote for TeamCity here. Its is very, very easy to get stood up and running, integrates with all your .NET stuff without any trouble. The builds themselves are run by agents which can be on the build server or another machine depending on requirements--they could even be on a machine running an entirely different OS on a different network in a different country.
I highly recommend using Hudson. Not only will it allow you to build .NET applications on a continual basis, but you can also run code analysis and unit tests as well. It's easy to install (just deploy a WAR file to a web server such as Tomcat) and has many configuration options. There is also a large number of plugins available that you can use, many written by other Hudson users. Best of all, it is free and actively supported.
For our decision making process we started with following overview.
http://confluence.public.thoughtworks.org/display/CC/CI+Feature+Matrix
Our main objective was java, easy to configure/use even after nobody created a job for 6 months. We moved away from a old version of Cruise Control, since nobody really knew how to use it. Some of the commercial products are nice if you want to go beyond just continuous integration. Have a look and decide for yourself.
Be careful, I don't know how up to date this matrix is. So some of the projects might have implemented more functions right now.
An interesting alternative could be Jira studio by Atlasian. If you use the hosted version you don't have much on support issues and it comes with subversion, bamboo, and goodies (jira+greenhopper, confluence, crucible, fisheye). http://www.atlassian.com/hosted/studio/
I agree with Wyatt Barnett. TeamCity is the best choice. It is very easy to configure and use. Moreover, TeamCity has a Free Professional Edition. Previously we used CruiseControl.NET on our project. This is also a powerful tool, but it is very complicated and hard to understand.
What s.ermakovich said: Both TeamCity and Hudson separate the web UI from build agents. You shouldn't need to install IIS on a build agent. You'd need to install a JVM and the agent software on any build node - very straightforward.

Publish an web application on build with NAnt, MSBuild or any other tool

I have a scenario where I have to setup a test environment where I want to be able to tell my NAnt or other build tool to make an new IIS web application, put the latest bins in the newly created IIS web application, and post me an email where the new address and port where the new application are addressed, is this possible and how? which tool?
There are several ways to approach this:
Set up a continuous integration (CI) server on the test environment. This is a viable option if your test environment machine doesn't change often and it's a single machine.
Push the installation from your development machine using tools like PsExec
Combination of the two: you have a build CI server which pushes the installation to (multiple) test environments.
Of course, you also need a good build script which will set up the IIS application (NAnt offers tasks for this). Emailing to you can be done by CI server (CruiseControl.NET Email Publisher, Hudson...).
I suggest taking some time to read this excellent article series: Automation for the people: Deployment-automation patterns
Our CruiseControl .Net build server does exactly this as part of it's NAnt build-script process...
Once the code is retrieved from source control, it's all built/compiled in turn. Web projects are then handled slightly differently to normal .dlls, as they are deployed to a particular folder (either on the current machine or otherwise) where IIS (also set-up by the script) to serve the pages.
Admittedly, we're using Virtual Directories instead of creating and disposing of new website instances on the server, as otherwise we'd have to manage the port numbers for each website.
NAnt has the capabilities of doing all of this IIS work, as well as all of the email work too - I'd certainly recommend looking at this avenue of enquiry to solve your problem. Plus, you also get the continous integration aspect as a side-benefit in your case!