Skip to end of metadata
Go to start of metadata

Installation

To install Jenkins on Glassfish, simply copy jenkins.war to $GLASSFISH_HOME/domains/domain1/autodeploy. Alternatively, you can do this from admin GUI. See this document for more about this.

Upgrade

You can upgrade your existing Jenkins by overwriting $GLASSFISH_HOME/domains/domain1/autodeploy/jenkins.war with a newer version. Again, you can also do this from the admin GUI by choosing to redeploy the application as illustrated below.

Setting JENKINS_HOME

There are many ways to do this, but one way to do so is to configure Glassfish to run with the "JENKINS_HOME" system property. From the command line, do the following:

% ./asadmin create-jvm-options -DJENKINS_HOME=/path/to/jenkins_home

You can do the same from the admin GUI, as illustrated below:

This technique should be also used to increase the VM heap size, when your Jenkins gets big.

If you get confused or this doesn't work, just try to set JENKINS_HOME environment variable before launching Glassfish:

% export JENKINS_HOME=/path/to/jenkins_home
% ./asadmin start-domain

Glassfish needs to be restarted for this change to take effect.

Securing Jenkins

See the forum thread on this topic.

Relevant Issues

See the list of issues filed that are specifically marked relevant to Glassfish.

There is also a known issue on Glassfish Enterprise that causes some Jenkins pages to fail. To workaround this issue, use Hudson 1.360 or higher and start Glassfish with -Dhudson.util.Secret.provider=SunJCE . See section above for into on setting system properties.

  • No labels

2 Comments

  1. Unknown User (jason.messmer@xerox.com)

     For my environment, I created a specific hudson user account and a specific domain owned by that user.  The hudson user owns the domain and controls the starting and stop of the domain.  The hudson user was created because the build environment needed to be setup properly and the root user, which is the owner of the glassfish install (Unix), is very limited and permissions must be open on all build repositories under source control.

    starting the domain:

    asadmin  start-domain --domaindir $HOME/domains hudson

  2. Unable to run a job in glassfish 5.

    Below is the log of the run. Is this an issue with jenkins or glassfish container?

    16:30:09 Started by user Vipin Jain
    16:30:09 Building in workspace ........\workspace\FluitoPHP - Deploy to Prod
    16:30:10 FATAL: sun.security.ssl.SessionId.checkLength(Lsun/security/ssl/ProtocolVersion;)V
    16:30:10 java.lang.NoSuchMethodError: sun.security.ssl.SessionId.checkLength(Lsun/security/ssl/ProtocolVersion;)V
    16:30:10 at sun.security.ssl.HandshakeMessage$ServerHello.<init>(HandshakeMessage.java:504)
    16:30:10 at sun.security.ssl.ClientHandshaker.processMessage(ClientHandshaker.java:209)
    16:30:10 at sun.security.ssl.Handshaker.processLoop(Handshaker.java:984)
    16:30:10 at sun.security.ssl.Handshaker.process_record(Handshaker.java:919)
    16:30:10 at sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:1050)
    16:30:10 at sun.security.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1363)
    16:30:10 at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1391)
    16:30:10 at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1375)
    16:30:10 at org.tmatesoft.svn.core.internal.util.SVNSocketFactory.createSSLSocket(SVNSocketFactory.java:96)
    16:30:10 at org.tmatesoft.svn.core.internal.io.dav.http.HTTPConnection.connect(HTTPConnection.java:237)
    16:30:10 at org.tmatesoft.svn.core.internal.io.dav.http.HTTPConnection.request(HTTPConnection.java:415)
    16:30:10 at org.tmatesoft.svn.core.internal.io.dav.http.HTTPConnection.request(HTTPConnection.java:352)
    16:30:10 at org.tmatesoft.svn.core.internal.io.dav.http.HTTPConnection.request(HTTPConnection.java:340)
    16:30:10 at org.tmatesoft.svn.core.internal.io.dav.DAVConnection.performHttpRequest(DAVConnection.java:910)
    16:30:10 at org.tmatesoft.svn.core.internal.io.dav.DAVConnection.exchangeCapabilities(DAVConnection.java:702)
    16:30:10 at org.tmatesoft.svn.core.internal.io.dav.DAVConnection.open(DAVConnection.java:113)
    16:30:10 at org.tmatesoft.svn.core.internal.io.dav.DAVRepository.openConnection(DAVRepository.java:1035)
    16:30:10 at org.tmatesoft.svn.core.internal.io.dav.DAVRepository.testConnection(DAVRepository.java:75)
    16:30:10 at hudson.scm.SubversionSCM$DescriptorImpl.checkRepositoryPath(SubversionSCM.java:2356)
    16:30:10 at hudson.scm.SubversionSCM$DescriptorImpl.checkRepositoryPath(SubversionSCM.java:2347)
    16:30:10 at hudson.scm.SubversionSCM.repositoryLocationsNoLongerExist(SubversionSCM.java:2603)
    16:30:10 at hudson.scm.SubversionSCM.checkout(SubversionSCM.java:914)
    16:30:10 at hudson.scm.SubversionSCM.checkout(SubversionSCM.java:864)
    16:30:10 at hudson.scm.SCM.checkout(SCM.java:504)
    16:30:10 at hudson.model.AbstractProject.checkout(AbstractProject.java:1208)
    16:30:10 at hudson.model.AbstractBuild$AbstractBuildExecution.defaultCheckout(AbstractBuild.java:574)
    16:30:10 at jenkins.scm.SCMCheckoutStrategy.checkout(SCMCheckoutStrategy.java:86)
    16:30:10 at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:499)
    16:30:10 at hudson.model.Run.execute(Run.java:1819)
    16:30:10 at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
    16:30:10 at hudson.model.ResourceController.execute(ResourceController.java:97)
    16:30:10 at hudson.model.Executor.run(Executor.java:429)
    16:30:10 Finished: FAILURE