Export EARs from Websphere Application Server with resources - migration

I need a little help from you.
I have to migrate several applications from WAS 7 to WAS 8.5 with a script in Jython using wsadmin. The thing is that on WAS 7 there are a lot of Datasources and i only need to import the Datasources that are used by the applications that i have to migrate.
Long story short: i have to get the datasource properties for a specific application.
Thanks for your help!
UPDATE: After this I have to install the applications using the exported properties of datasources.

If your application developers were smart enough to use resource references, you can find JNDI names of the Datasources used by the application in the web admin console Applications > applicationName > Resource References. If not, you will have to somehow learn what the datasources are (application documentation, developers, sources). There is no other way than references to know datasources used by given app.
Then I'd suggest you to use Property files wsadmin commands to extract relevant information from one environment and apply to the other. (Or just give you datasources configuration for use in jython scripts).
If don't want to use Property files commands you can use command assistance in the console to help you create jython files, or use some already provide Jython script library
For details see:
Using properties files to manage system configuration
Accessing command assistance from the administrative console
JDBC configuration scripts (library)

Related

Deploying multiple/single instances of a website

We have an ASP.NET website that we want to deploy (and remove) multiple instances of the site on the same IIS machine.
We also have a few number of customers that need to install the product on their system.
I was hoping WIX would be able to handle this, but it appears you can only have one instance installed at a time.
What options are available to me? Right now we use FinalBuilder to setup a generic "install package" which uses a batch file that a user populated with their environment settings, and uses tools like sed and awk to update config files and more scripts to deploy to IIS.
It works, but it's very cumbersome. I was hoping to find more of a GUI/command line interface to replace this process.
It sounds like MSDeploy will work for your use case. It can deploy multiple instances to the same IIS instance and can also delete instances.
The following post is specifically about service versioning but you could use the same technique to install several instances of a web app.
http://www.dotnetcatch.com/2016/03/03/simple-service-versioning-with-webdeploy/

Install cursors using VB.NET app?

Is it possible to create a VB.NET application that can install cursors? I have already been using .inf files to install them, but I want more flexibility. Is this possible?
Please note I do not want to use them in the application, but install them so they work in Windows all around.
This Code will help you in making this program:
CurrentUser - Stores information about user preferences (HKEY_CURRENT_USER)
LocalMachine - Stores configuration information for the local machine (HKEY_LOCAL_MACHINE)
ClassesRoot - Stores information about types (and classes) and their properties (HKEY_CLASSES_ROOT).
Users - Stores information about the default user configuration (HKEY_USERS).

How to access system properties from a Tomcat app deployed on Cloudbees?

I want to run a Tomcat app in Cloudbees. This app accesses some private and confidential properties from the file system. How could I access a file system on Cloudbees? Please note that it should be highly protected, e.g. 700 or similar.
Regards,
Marco
RUN#Cloud platform don't provide a persistent (nor distributed) filesystem. So you can't use it to as canonical store for those files, but need to use an external file store to match your security requirements, and copy them as application is starting (or lazy-load) to java.io.temp directory. As files are stored on RUN#Cloud there is no security issue as your server instance is fully isolated, and files will be deleted after application undeployed/passivated
So you can use Amazon S3 or comparable to store files
Another option is for you to attach properties to the RUN#Cloud instance as configuration parameters, and access them as System properties. See http://wiki.cloudbees.com/bin/view/RUN/Configuration+Parameters
If they data is modest in size - you could consider using properties - using the CLI you can set them using
bees config:set propertyName=value
you can then access that as a System property (for example) in your application. The properties themselves are stored encrypted by cloudbees.
I've actually moved to OpenShift since then and I solved the problem. Thank you for your answers

eclipse plugin/rcp: configure driver defintions similar to jdbc

i am writing an eclipse plugin that will connect to a server (no database!).
for each platform and each release of said server there will be a different jar to use for connecting and a different set of .dll/.so files used by said driver jar.
i'd like to create a mechanism like the one for jdbc drivers allowing the user to create a profile for a specific configuration of platform/release and select an existing profile to create a connection to a specific server.
thus, it is pretty much similar to what most databse plugins do where one can configure different jdbc drivers for different databases and use such a profile to create a databse connection.
maybe i haven't found the right search terms, but so far i failed to get an example how to write this kind of mechanism.
can someone please point me to a working example for eg jdbc?
to summarize:
- store location of jar
- store location of native shared libraries (dll/so)
- when connection export the location of the shared libs (at least in linux i currently need to export LD_LIBRARY_PATH) and use/load the configured jar
I cannot point you to a working example, but I would suggest to define an extension point in your core application. For each configuration create a "driver plug-in" which implements an extension to this extension point. In those driver plug-ins you could bundle the platform specific dlls and so on. Concerning platforms (operating system level) additionally consider to user fragments. For more details on how to implement your own extension point look Eclipse FAQ How do I declare my own extension point?
In the core application you can programatically query all extensions (driver plug-ins) which are available and for example let the user choose which configuration he would like to use via a dropdown box .

How to expose information about a running .NET exe?

I have a .NET exe that I wrote and it has a couple properties that I made public and want to expose.
I want to shell this exe (Process.Start()) and then somehow reference this exe and get access to these public properties. These properties expose information about the running exe.
I know how to shell to the exe. And I know how to add a reference to the exe from my project that I want to use this object. But how do I get access to the properties of this running exe?
I hope I am explaining myself well.
If you do know the answer maybe you could just tell me what the standard method is to expose properties of a running exe to another application at run-time.
Thanks for any help!
It does not work that way.
The only ways to share data between processes are pipes (Process.Start() can redirect standard input, standard output, and standard error), shared memory (not available in pure managed code), the exit code, and filesystem or network communications mechanisms.
In your specific case I'd guess that named pipe is the technique you want.
Personally I've never used named pipe but I have used redirect standard input and standard output.
Have you considered exposing the objects to PowerShell so that you can call the object from PowerShell?
Expose the object:
runspace.SessionStateProxy.SetVariable("ObjectName", ObjectName)
Then a PS script could call:
$ IDLevel.ObjectName
In this object then you could have some simple "getter" methods that would return information about the exe.
I like this approach as not only can you get the info. but if you want, you can expose methods which will allow you to make changes to the object based on the info. returned.
The standard "Windows way" to do what you describe is to expose PerfMon counters and update them regularly.
Your EXE can host a WCF service. This service can expose operations (not properties) that can expose this information about the running EXE.
You can write a simple WMI.NET Provider Extension for your first App that exposes the configuration settings to WMI... then other programs can monitor and alter the settings...
WMI.NET Provider Extension Scenarios
http://msdn.microsoft.com/en-us/library/bb885141(v=vs.90).aspx
How to Expose Configuration Settings Through WMI
http://msdn.microsoft.com/en-us/library/bb404687(v=vs.90).aspx
Windows has many different providers for monitoring and managing Windows settings. You can register a new namespace for your application, then use PowerShell or System.Management.Instrumentation in another .NET application to monitor that namespace.