How do I run a .jacl script against a WebService Liberty Profile server?
I am told to run:
wsadmin.sh -conntype none -f setupWAS.jacl
But I don't think wsadmin is available in Liberty Profile.
You cannot manage Liberty profile using wsadmin. Quoting infocenter;
Restriction: The wsadmin tool does not apply to the Liberty profile.
See Administering the Liberty profile from the command prompt instead.
The Liberty profile only supports configuration (or reconfiguration) via editing of the XML configuration file (at least server.xml, perhaps others if you use includes).
I recommend following samples and examples from WASDev instead:
https://www.ibmdw.net/wasdev/docs/category/coding/
Related
As the title already states JNLP cnnections are deprecated. Jenkins also gives a message and a hyperlink to
https://en.wikipedia.org/wiki/Java_Web_Start#Deprecation.
So what's the recommended way to attach a Windows agent to Jenkins now? There seems to be no real good guide on https://jenkins.io covering that topic.
There are two options: Either use an open source alternative for Java Web Start or use the Jenkins service wrapper instead. The latter gives you the most control.
Open Source Alternative to Java Web Start
There is an open source replacement called OpenWebStart which is based on IcedTeaWeb.
More information: Java Web Start is dead - long live OpenWebStart!
OpenWebStart is an open source implementation of the WebStart and JNLP
standards (JSR-56).
[...]
In IcedTeaWeb we are currently working on mapping the JNLP spec and
supporting its functions to the greatest extent possible. In addition
to OpenWebStart, which uses IcedTeaWeb as its core, IcedTeaWeb is also
used within AdoptOpenJDK to provide minimal WebStart in the Java 8
releases of AdoptOpenJDK. However, these are limited compared to
OpenWebStart because they can only use the current JVM to run
JNLP-based applications.
Using the Jenkins Service Wrapper
When installing Jenkins service through the service wrapper (winsw-*.exe), Java Web Start is no longer required. It seems that JNLP protocol is still used behind the scenes, so it may still have some deprecation issue in the future.
Official installation guide
Steps (assuming you have already set up the node in Jenkins master):
Download latest service wrapper from http://repo.jenkins-ci.org/releases/com/sun/winsw/winsw/ (e. g. "winsw-2.2.0-net4.exe")
Place it in the Custom WorkDir path and rename it to "jenkins-agent.exe"
Download "agent.jar": http://YourJenkinsServer:8080/jnlpJars/agent.jar
Place it in the Custom WorkDir path and rename it to "agent.jar"
Create "jenkins-agent.xml" in the same directory:
<service>
<id>YourJenkinsAgentServiceId</id>
<name>Your Jenkins Agent Service Name</name>
<description>This service runs an agent for Jenkins automation server.</description>
<executable>C:\Program Files\Java\bin\java.exe</executable>
<arguments>-Xrs -jar "%BASE%\agent.jar" -jnlpUrl http://YourJenkinsServer:8080/manage/computer/YourNodeName/jenkins-agent.jnlp -secret YourSecretStringConsistingOfHexadecimalCharacters -workDir=C:\YourNodeWorkDir</arguments>
<logmode>rotate</logmode>
<onfailure action="restart" />
<download from="http://YourJenkinsServer:8080/jnlpJars/agent.jar" to="%BASE%\agent.jar"/>
<extensions>
<extension enabled="true" className="winsw.Plugins.RunawayProcessKiller.RunawayProcessKillerExtension" id="killOnStartup">
<pidfile>%BASE%\jenkins_agent.pid</pidfile>
<stopTimeout>5000</stopTimeout>
<stopParentFirst>false</stopParentFirst>
</extension>
</extensions>
</service>
Adjust "jenkins-agent.xml" according to your environment. The java.exe should be the same version as used by Jenkins. Make sure to adjust all strings I prefixed with "Your" and also the path to "java.exe". You'll find the secret string and correct jnlpUrl on the node configuration page of Jenkins master (e. g. http://YourJenkinsServer:8080/manage/computer/YourNodeName/).
Official documentation
Create "jenkins-agent.exe.conf" file to prevent the executable from running on an earlier version of the .NET Framework.
<configuration>
<startup>
<supportedRuntime version="v4.0"/>
</startup>
</configuration>
Launch "cmd.exe" as administrator and navigate to directory of "jenkins-agent.exe".
Install the service: jenkins-agent.exe install
Launch the service: sc start YourJenkinsAgentServiceId
Notes:
For simplicity I have used http protocol only. When the connection is working, I recommend to switch to https for improved security.
If you are using a self-signed certificate on the Jenkins server (typically in a LAN), you have to install the certificate on the agent into the Java certificate store (as the Windows certificate store is ignored by Java). This can be done using Java's keytool (more information).
This question already has an answer here:
Apache Felix shell with SSH
(1 answer)
Closed 5 years ago.
In my local environment I use the "start.bat" file to start application bundle.
This is like as follows:
java -jar -ea -Declipse.ignoreApp=true -Dosgi.clean=true -Ddebug=true plugins/org.eclipse.equinox.launcher_1.3.0.v20140415-2008.jar -console -noExit
OSGi is starting on the command prompt by the way I can list existing plugins. However the production will be a saaj environment and I think to start OSGi as a background process by installing a process manager package. Then my question is how to monitor it? How to start or stop the bundles? Do I need to use some monitoring tools such as Apache Felix web console to be able to make telnet connection? Is there an easy way (or common usage) to do on a cloud server?
Can someone inform me about this issue because I am new to OSGi concept?
After some further researches, I've found a solution for my situation. "-console" option of eclipse equinox (which is equivalent to "osgi.console") takes host and port parameters. So I 've changed my start script as follows(just added port number):
java -jar -ea -Declipse.ignoreApp=true -Dosgi.clean=true -Ddebug=true plugins/org.eclipse.equinox.launcher_1.3.0.v20140415-2008.jar -console 5555 -noExit
However this additional configuration needs some extra libraries and OSGi config changes. I had to place following jar files on the same folder with "org.eclipse.equinox.launcher_1.3.0.v20140415-2008.jar". That is the plugins folder in my environment.
org.apache.felix.gogo.command_0.10.0.v201209301215.jar
org.apache.felix.gogo.runtime_0.10.0.v201209301036.jar
org.apache.felix.gogo.shell_0.10.0.v201212101605.jar
org.eclipse.equinox.console_1.1.0.v20140131-1639.jar
Secondly I have configured my config.ini file. It should contain following key/values:
osgi.bundles=org.eclipse.equinox.console#start, org.apache.felix.gogo.command#start, org.apache.felix.gogo.shell#start, org.apache.felix.gogo.runtime#start
osgi.noShutdown=true
eclipse.ignoreApp=true
After these changes, I can pass commands to the OSGi runtime from the command line by simply using a telnet connection to the port given. A tricky point is OSGi is always up until you termşnate OSGi console by typing 'exit' even if you terminate your ssh connection.
Reference: OSGi Modularity - Tutorial
i'm trying to migrate WAS server 8.0.0.10 to Liberty Profile. So I downloaded the Migration Tool using the "Install New Software" option in the "Help" Menu just a week ago. I selected the "Migration Tools" -> "Websphere Application Server Migration" -> "Configuration Manager" -> "Websphere Configuration Migration Toolkit for Websphere". Followed below link steps http://www.ibm.com/developerworks/websphere/library/techarticles/1404_vines2/1404_vines2.html . But while executing comments in command prompt:
wsadmin -lang jython -c "AdminTask.extractConfigProperties(['-propertiesFileName my.props'])"
Getting Below error message :
C:\Users\DSIVARAM\WAS-profiles\8.0\SFQ\bin>wsadmin(.sh/.bat) -lang jython -c "AdminTask.extractConfigProperties(['-propertiesFileName my.props'])"
WASX7209I: Connected to process "SFQ" on node SFQNode using SOAP connector; The type of process is: UnManagedProcess
WASX7411W: Ignoring the following provided option: [(.sh/.bat)]
WASX7015E: Exception running command: "AdminTask.extractConfigProperties(['-propertiesFileName my.props'])"; exception information:
com.ibm.ws.management.wasresource.common.WASResourceException: com.ibm.ws.management.wasresource.common.WASResourceException: com.ibm.ws.management.wasresource.common.WASResourceException: com.ibm.websphere.management.exception.AdminException:
ADMA0144E: Application SourcingForQuality20031104 is installed with the zero binary copy option. Applications are installed using this option in a Rational unit test environment or using AppManagement MBean API.
When an application is installed using this option it is not possible to perform any operation on this application using wsadmin or administrative console that involves accessing the application metadata or EAR file.
Such operations include view/edit application information, export, export DDL etc. The only possible operations using wsadmin or admin console are start, stop and uninstall.
If this application is installed using WSAD unit test environment then use WSAD to view/edit application information.
Please help me to sort out the issue.
If you are running your server from development tool (Eclipse/Rad), change your server publishing settings from run resources from workspace to run from server , restart and redeploy application. You should be able to export then.
You won't be able to extract application information with extractConfigProperties if you have a zero-binary installed application. I think you can limit the extent of the extract using the -filterMechanism or -configData options to just extract the configuration needed by the application without extracting the application information itself.
See http://www.ibm.com/support/knowledgecenter/SSAW57_8.5.5/com.ibm.websphere.nd.doc/ae/txml_7extractprops.html for examples.
We are unable to deploy our application from our BuildServer to our appliation server.
This is the maven command we use in Jenkins:
clean install jboss-as:deploy -Pjboss7 -Dmaven.test.skip=true
We have tried the following:
Confirmed we can telnet from our BuildServer to our appliation server
Upgrade Jboss maven plugin
Started Jboss (on our application server) with
$JBOSS_HOME/bin/standalone.sh -b 0.0.0.0
Jenkins seems to hang at the following point:
INFO: JBoss Remoting version 3.2.12.GA
Authenticating against security realm: ManagementRealm
Is the JBoss AS 7 working on the same machine as Jenkins?
Currently your binding your public interface to all network interfaces on the host machine (the -b command). You should also bind your management interface of the app server to a proper network interface (Jboss allows remote deployment only by the management interface). You can do it in the $JBOSS_HOME/standalone/configuration/standalone.xml (or domain.xml for domain mode) file. Find:
and set the inet-address to the ip of the machine which hosts the application server. You can also use the -bmanagement switch to bind the management interface, as such:
$JBOSS_HOME/bin/standalone.sh -bmanagement=192.168.100.10
You also stated, that you have a potential problem with authentication. Please post your maven plugin configuration. Note that the username and password you provide for the maven plugin should match the administrator user on JBoss (you can add him by choosing Management User in the $JBOSS_HOME/bin/add-user.sh promp). This is the most likely source of your problem - but it is hard to tell without any further information (for example something from the pom.xml file).
Also if the app server is working on the same machine as Jenkins, JBoss allows the "local user authentication" which basicaly checks if the call has originated from the same machine.
Additional source for network interface binding: https://docs.jboss.org/author/display/AS71/Command+line+parameters#Commandlineparameters-bindaddress
I'm throwing a dependency jar into my exploded EAR on WebSphere app server. I need to stop/start the EAR to get WS to execute the new code. Is there a way to do this from command line?
Try running something like this:
/opt/ibm/websphere/appserver/profiles/<MyProfileName>/bin/wsadmin.sh -c "AdminControl.invoke(AdminControl.queryNames('type=ApplicationManager,process=<MyServerName>,*'),'stopApplication','MyAppName')" -lang jython
It will prompt you for a WAS Userid and password (in case you have enabled "Administrative Security") and when you enter them - provided your userid has at least been assigned the Operator Role - your application will be stopped.
In a similar way you may start the same application.
You should be able to manage that using the wsadmin command line tool provided as a part of your WAS installation. Pretty much any administration task can be scripted using this tool.
I don't know the specific command to do what you've asked but here is a link to the documentation that should help get you going.
http://pic.dhe.ibm.com/infocenter/wasinfo/v7r0/index.jsp?topic=%2Fcom.ibm.websphere.express.doc%2Finfo%2Fexp%2Fae%2Ftxml_script.html