Websphere Application Server importing settings - import

I want to import silently server configuration (such as Applications servers -> Process Definition -> Java Virtual Machine -> Generic JVM arguments etc.).
I've tried wsadmin tool, but it requires WSA to be running - and this is bad for me, because I need to write script that copies these settings without any interaction.
wsadmin -lang jython -c "AdminTask.importWasprofile('[-archive d:\profil2.car]')"
Another way was the "Import server configuration from server..." option in Eclipse context menu (Servers tab), but it still needs interaction from user.
Is there any way to copy those settings? Should I copy some files or something?
I'm installing Rational Application Developer 7.0.0.7. I have also generated .car file with exported settings.

Ok, I've managed to import all those settings silently.
First, you have to export profile using f.e. wsadmin script.
Command
wsadmin -lang jython -c "AdminTask.exportWasprofile(['-archive', 'd:\sampleProfileName.car'])
Will export default profile to .car file (which is, in fact, .zip file with other extension). It is nice to add here, that my version of WAS wouldn't export SIB settings.
Importing those settings is as easy, as exporting, you just have to run command
wsadmin -lang jython -conntype none -c "AdminTask.importWasprofile('[-archive d:\sampleProfileName.car]')"
Note using -conntype option, as #bkail mentioned
Sadly, WAS 6.x and earlier does not support exporting/importing SIB settings (as mentioned HERE). In order to copy them, you have to add manually to .car file buses directory (as mentioned HERE). The problem is - adding them by admin console didn't create this directory for me.
I had to use another wsadmin script that creates SIB - I've found it HERE. It simply uses AdminTask object to create bus manually - and thanks to it, it created the buses directory.
Hope this helps somebody who has the same problem as I had - and it will save him MANY hours.
Greetings.

Related

Rundeck is not generating service.log

One of my colleague is trying to install rundeck on a windows 10 OS. We have both followed the documentation guide on Rundeck's website. I was able to run and install Rundeck as a service but my colleague is stuck on the part where we need to run start_rundeck.bat because his Rundeck is not generating service.log. He can access the Rundeck UI but the logs are still not generating. Anyone knows how to fix this issue? Thanks!
Your colleague just needs to follow the instructions carefully.
Let me clarify the first steps focused on redirecting the standard output to the service.log file, I recreated the Rundeck installation on my Windows virtual machine:
First, check the minimal requirements. Rundeck needs OpenJDK 11 as the main dependency to work. You can obtain it from here, this implementation also works.
Create a new directory where the Rundeck .war file must be saved, e.g: C:\rundeck.
Go to this page and download .war file on the directory created in the previous step.
Open a new PowerShell terminal and set the Rundeck base directory: set RDECK_BASE=C:\rundeck.
Launch Rundeck for the first time to generate all files: java -jar rundeck-3.4.6-20211110.war (inside the directory created in the second step), wait until the Grails application running at http://localhost:4440 message appear, then stop the instance with ctrl + c key combination.
With any text editor, create a new file at C:\rundeck\ path called start_rundeck.bat with the following content:
set CURDIR=%~dp0
call %CURDIR%etc\profile.bat
java %RDECK_CLI_OPTS% %RDECK_SSL_OPTS% -jar rundeck-3.4.6-20211110.war --skipinstall -d >> %CURDIR%\var\logs\service.log 2>&1
And save it.
Go to the PowerShell terminal and just run the start_rundeck.bat file with .\start_rundeck.bat.
Now check the C:\rundeck\var\logs\service.log file.
At this point, it's possible to continue with the next steps: Configure Rundeck as a service using the nssm.exe program.

OpenERP 7 development environment: web module not found

I setup an Ubuntu environment and used bzr to get the 3 trunks: addons, server, web
Everything works and the server starts fine.
I then loaded the project in Eclipse and tried to run openerp-server. I got this error (module web: module not found). I then copied the entries (addons_path) in the openerp-server.conf from /etc/ to the conf file in server/install folder. I also created a copy of this file and pasted in server folder, in the hopes that eclipse would pick it up.
But I am still getting the same error. Three questions please:
Which conf file should I add this path for eclipse to use? Where does this file reside?
If I must use a command line switch to specify the web/addons path then how do I do that in eclipse?
There used to be a file with a lot of different variable such as pg_path, rpc, etc. Is that file still around? Maybe that is where I need to make this entry?
Thanks
I had to add a "-c /etc/openerp-server.conf" argument. Right click on the openerp-server file, launch the properties window, select Run/Debug Settings, select the only launch configuration available, edit, select the arguments tab.
I added them manually to eclipse run configurations > arguments.
e.g.
--db_host = {host}
--db_port = {port}
--db_user = {user}
--db_password = {password}
--addons = ../addons,../server/addons

Modify Eclipse RCP startup args in protected directory

I am enabling internationalization for my RCP application. The preferences tab allows the user to select between languages. I understand that Eclipse (3.7) has to load the language at start-up and can not dynamically change languages.
I know of three approaches to accomplish this:
1) Modify the OS level shortcut to pass in -nl XX
2) Change the app.ini file to have -nl XX (on separate lines)
3) Change the config.ini to have osgi.nl = XX
The issue with these approaches is that they all require write permission to the application directory. When running under Vista / Windows 7 and Linux implementations that do not provide write access to programs, a normal user does not have permissions to modify these files.
Is there another approach to pass in arguments that change the VM language? Is there a workaround for the file protection provided by the OS?
In Windows the application directory is write-protected for a good reason. Fortunately one can set Eclipse Runtime Options to configure where the RCP application should store
configuration data
workspace data
This can be accomplished in two ways:
setting command line arguments (-configuration , -data)
defining system properties (osgi.configuration.area to , osgi.instance.area to ) for example in config.ini
For further information see Runtime Options in official Eclipse Help.
In Windows such data should be stored in the user directory.
By the way you should be able to locate these settings in the Installation Details pane of the standard About dialog.
However setting these properties is a bit tricky. In my case the application installer evaluates the location of the user directory at installation time and modifies the config.ini file accordingly.

How to distribute my Java program so that it is runnable by double-clicking a single file?

I have a Java rich client desktop app. that I want to distribute on some computers at work, but I've never done something like this before. People aren't too computer-savy at my workplace and since it is a student job, I won't be there for much longer and I'd like it if I could make my program easy to run by making it runnable when people double-click on it.
I also don't want to have to manually install a JRE to have it run. Basically, what I'd like to know is how to make my java application runnable easily by double-clicking (even if it's only on windows, it's okay). I'm pretty sure I'm going to need to package the correct JRE version alongside, but I don't know what's the correct way of doing this.
I read on some sites that you should not package a JRE along with your program because it makes people have multiple different versions, some of which are outdated, and it causes security issues, but this is not a problem in this case since the computers that are going to run my application are not connected to the internet and are only used to run this program anyway.
Somewhat related question: Since my application is currently an Eclipse project, I get my resources such as icons, images, SQLite database (for read and write), etc. using relative paths (e.g.: img/test.png).
Am I going to have to change any of those paths to have them keep working even while packaged?
What you're looking for is a JAR file. In eclipse, it's quite easy to make a Jar file. Specifically, you'll want to right click on your project, go to Export, and then select "Runnable Jar." Be careful with paths to folders. You may need to keep a resources folder next to the Jar file. You may need to provide some more specifics to get an exact answer on that. Typically, a Resources folder is located in the same spot as the JAR file (in the same folder on your computer).
A better option for easy install of a Java app. with a GUI is to launch it using Java Web Start. For the user, JWS is the 'one click' installation option that can (install & launch the app. then) add desktop shortcuts and menu items. A JWS launch would mean some more work for you, but it is a breeze for the end user.
To ensure a suitable JRE is present to run the app., use deployJava.js (see the JWS link for more details). The script would need to be reconfigured to get the JRE installer from your local network - the default is to get it from Oracle.
Most of the resources should be packaged in Jar files and supplied along with the app., but for the DB, use the JNLP ExtensionInstallerService to call the DB installer.
..Java Web Start is kind of a link (or I can make it a shortcut on the desktop) that the users will click to either install the JRE and run the program if the JRE isn't installed, or just run the program if the JRE is present on the computer.
The way it would work is to have a web page on the local intranet. When the user visits the page, the script checks for a suitable JRE.
If it is present, it writes the link to the launch file.
If there is no JRE, or the version is too low, it will guide the user through installing it (just a matter of them clicking 'OK' when prompted). Then it will put the link to the app.
I can then configure the link to grab the JRE from the server on our network.
That's the part where you need to reconfigure the script. AFAIR the script exposes an URL at which to look for JREs - that can be changed to point to a place on the intranet.
..So "Web" is only just in the name, the computers don't have to be connected to the internet to have this work, right?
Yes. JWS is a great launch technology for Java rich clients, but is a poorly chosen name.
To make the problem run by double clicking it you can distribute it as a jar file or a batch file to call the jar file.
For the installation part you can make a batch file that checks if java is present and then call the installer if it isn't.
Edit:
The batch code:
IF DEFINED JAVA GOTO ok
java-installer.exe
GOTO end
:ok
your-application.jar
:end
If you are finding it tough to implement the above mentioned methods. You can proceed with this simple approach.
Create a folder lib at a location. Place all the jars that your application uses into this. If you are able to create a jar for your application, you can very well place your application.jar into the lib folder too. Create a batch file at the same location that will contain the java command for your main class in it. The text within your batch might look something similiar to this :
set path="\lib\"
java -cp %path% package1.package2.MainClass
If you have any other dependencies, for ex: if you use images in your code under img/icon.jpg. Then you just have to shift the img folder to this location too.
Just zip these files using winrar and share it across. Running the batch file after extracting the zip would launch your java MainClass irrespective of the location in which it is placed in the client system.
PS : If you are unable to create a jar for your application and placing it in lib folder, just copy your bin folder with class files and paste it in the location and change the batch file accordingly to look for classes inside bin.

How to properly force a Blackberry Java application to install using Loader.exe

I want to include the Application Loader process in a software installation, to ensure that users get our software installed on their Blackberry by the time our installer software finishes.
I know this is possible, because Aerize Card Loader (http://aerize.com/blackberry/software/loader/) does this. When you install their software, if your Blackberry is connected the Application Loader will come up and force the .COD file to install to the device.
I can't make it work. Looking at RIM's own documentation, I need to:
Place the ALX and COD files into a subfolder here: C:\Program Files\Common Files\Research In Motion\Shared\Applications\
Add a path to the ALX file in HKCU\Software\Research In Motion\Blackberry\Loader\Packages
Index the application, by executing this at the command line: loader.exe /index
Start the force load, by doing this: loader.exe /defaultUSB /forceload
When I execute that last command, the Application Loader comes up and says that all applications are up to date and nothing needs to be done.
If I execute loader.exe by double-clicking on it (or typing in the command with no parameters), I get the regular Application Loader wizard. It shows my program as listed, but un-checked. If I check it and click next, it will install to the Blackberry. (This is the part that I want to avoid, and that Aerize Card Loader's install process avoids.)
What am I missing? It appears that the Aerize installer is doing something different but I haven't been able to ascertain what.
You can do it easily with the following command:
C:\RIM\JDE_4.7.0\bin\JavaLoader.exe -u load <.cod file>
With this command you don't need an alx at all, just the cod file. Look at JavaLoader usage help to see full options.
JavaLoader.exe can upload one code file. What about two or more cod files?